From 52fed67d440011498897511ea22bfb70329f11fa Mon Sep 17 00:00:00 2001 From: Hugel <2712504175@qq.com> Date: Sat, 22 May 2021 18:03:28 +0800 Subject: [PATCH] enabel make test (cherry picked from commit 19a10f67dcb3d0d6c4f828ba7334b01d62975002) --- fix-test-failure-with-secilc.patch | 84 ++++++++++++++++++++++++++++++ libsemanage.spec | 12 ++++- 2 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 fix-test-failure-with-secilc.patch diff --git a/fix-test-failure-with-secilc.patch b/fix-test-failure-with-secilc.patch new file mode 100644 index 0000000..95cb2c2 --- /dev/null +++ b/fix-test-failure-with-secilc.patch @@ -0,0 +1,84 @@ +From b4dff18c54fd666100d10581ce9215c8d5cbde93 Mon Sep 17 00:00:00 2001 +From: gengqihu +Date: Tue, 11 May 2021 04:28:37 -0400 +Subject: [PATCH] fix test failure with secilc + +There's no secilc here. The SELinux CIL Compiler is a compiler that +converts the CIL language as described on the CIL design wiki into a +kernel binary policy file. +This patch deletes the testcode related to secilc. + +--- + tests/Makefile | 12 ++++++------ + tests/libsemanage-tests.c | 16 ---------------- + 2 files changed, 6 insertions(+), 22 deletions(-) + +diff --git a/tests/Makefile b/tests/Makefile +index 69f49a3..c98dae0 100644 +--- a/tests/Makefile ++++ b/tests/Makefile +@@ -1,6 +1,5 @@ + # Add your test source files here: +-SOURCES = $(sort $(wildcard *.c)) +-CILS = $(sort $(wildcard *.cil)) ++SOURCES = $(sort $(wildcard libsemanage-tests.c test_other.c test_semanage_store.c test_utilities.c utilities.c)) + + ########################################################################### + +@@ -10,18 +9,14 @@ override CFLAGS += -I../src -I../include + override LDLIBS += -lcunit -lbz2 -laudit -lselinux -lsepol + + OBJECTS = $(SOURCES:.c=.o) +-POLICIES = $(CILS:.cil=.policy) + +-all: $(EXECUTABLE) $(POLICIES) ++all: $(EXECUTABLE) + + $(EXECUTABLE): $(OBJECTS) ../src/libsemanage.a + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) +- +-%.policy: %.cil +- ../../secilc/secilc $*.cil -o $*.policy -f /dev/null + + clean distclean: +- rm -rf $(OBJECTS) $(POLICIES) $(EXECUTABLE) ++ rm -rf $(OBJECTS) $(EXECUTABLE) + + test: all + ./$(EXECUTABLE) +diff --git a/tests/libsemanage-tests.c b/tests/libsemanage-tests.c +index 2ae4a21..df2d5b2 100644 +--- a/tests/libsemanage-tests.c ++++ b/tests/libsemanage-tests.c +@@ -21,14 +21,6 @@ + + #include "test_semanage_store.h" + #include "test_utilities.h" +-#include "test_handle.h" +-#include "test_bool.h" +-#include "test_fcontext.h" +-#include "test_iface.h" +-#include "test_ibendport.h" +-#include "test_node.h" +-#include "test_port.h" +-#include "test_user.h" + #include "test_other.h" + + #include +@@ -68,14 +60,6 @@ static bool do_tests(int interactive, int verbose) + + DECLARE_SUITE(semanage_store); + DECLARE_SUITE(semanage_utilities); +- DECLARE_SUITE(handle); +- DECLARE_SUITE(bool); +- DECLARE_SUITE(fcontext); +- DECLARE_SUITE(iface); +- DECLARE_SUITE(ibendport); +- DECLARE_SUITE(node); +- DECLARE_SUITE(port); +- DECLARE_SUITE(user); + DECLARE_SUITE(other); + + if (verbose) +-- +2.19.1 diff --git a/libsemanage.spec b/libsemanage.spec index f73509e..3d11131 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -3,16 +3,18 @@ Name: libsemanage Version: 3.1 -Release: 1 +Release: 2 License: LGPLv2+ Summary: SELinux binary policy manipulation library URL: https://github.com/SELinuxProject/selinux/wiki Source0: https://github.com/SELinuxProject/selinux/releases/download/20200710/libsemanage-3.1.tar.gz Source1: semanage.conf +Patch9000: fix-test-failure-with-secilc.patch + BuildRequires: gcc python3-devel python2-devel bison flex bzip2-devel audit-libs-devel BuildRequires: libselinux-devel >= %{libselinux_version} swig libsepol-devel >= %{libsepol_version} -BuildRequires: gdb +BuildRequires: gdb CUnit-devel gdb-headless Requires: bzip2-libs audit-libs Requires: libselinux >= %{libselinux_version} @@ -82,6 +84,9 @@ ln -sf %{_libdir}/libsemanage.so.1 %{buildroot}/%{_libdir}/libsemanage.so %ldconfig_scriptlets +%check +make test + %files %license COPYING %dir %{_sysconfdir}/selinux @@ -115,6 +120,9 @@ ln -sf %{_libdir}/libsemanage.so.1 %{buildroot}/%{_libdir}/libsemanage.so %changelog +* Sat May 22 2021 Hugel - 3.1-2 +- enabel make test + * Fri Aug 28 2020 wangchen - 3.1-1 - update to 3.1 -- Gitee