Skip to contentSkip to conversation

libseccomp: add latest stable version, add ptest

PATCH New Joe MacDonald 1 participant 1 message Nov 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libseccomp: add latest stable version, add ptest

A new stable version of libseccomp is available, so update the recipe. At the same time, integrate the ptest support that's currently being discussed on the libseccomp list.

---
 .../0001-tests-create-install-tests-target.patch   |  203 ++++++++++++++++++++
 ...tests-install-python-tests-if-appropriate.patch |   61 ++++++
 ...ts-introduce-alternate-test-report-format.patch |  124 ++++++++++++
 .../{libseccomp_2.1.0.bb => libseccomp_2.1.1.bb}   |   10 +-
 4 files changed, 395 insertions(+), 3 deletions(-)
 create mode 100644 recipes-security/libseccomp/files/0001-tests-create-install-tests-target.patch
 create mode 100644 recipes-security/libseccomp/files/0002-tests-install-python-tests-if-appropriate.patch
 create mode 100644 recipes-security/libseccomp/files/0003-tests-introduce-alternate-test-report-format.patch
 rename recipes-security/libseccomp/{libseccomp_2.1.0.bb => libseccomp_2.1.1.bb} (58%)
recipes-security/libseccomp/files/0001-tests-create-install-tests-target.patch new file +203 -0
new file mode 100644
index 0000000..55eaf81
@@ -0,0 +1,203 @@
+From e8e166cdc1fc31e02d568424e17b9f9fc1e95256 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <[email protected]>
+Date: Mon, 28 Oct 2013 15:40:14 -0400
+Subject: [PATCH 1/3] tests: create install-tests target
+
+It can be useful, in particular on a cross-build setup, to install the
+tests and regression suite in addition to the library itself.  Since most
+people probably don't want that by default, though, create an
+install-tests target that will place tests and regression script in
+$(INSTALL_LIB_DIR)/libseccomp/tests and install the necessary tools in
+$(INSTALL_BIN_DIR)/bin.
+
+Upstream-Status: Submitted [http://www.mail-archive.com/[email protected]/msg00470.html]
+
+Signed-off-by: Joe MacDonald <[email protected]>
+---
+ Makefile         |    9 +++++++++
+ README           |    8 ++++++++
+ install.mk       |    1 +
+ macros.mk        |   18 ++++++++++++++++++
+ tests/Makefile   |    7 ++++++-
+ tests/regression |   19 ++++++++++++++++---
+ tools/Makefile   |    3 +++
+ 7 files changed, 61 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 1f61f20..8cb0a16 100644
+--- a/Makefile
++++ b/Makefile
+@@ -40,6 +40,7 @@ include install.mk
+ CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc
+ SUBDIRS_BUILD = include src tests tools
+ SUBDIRS_INSTALL = include src tools doc
++SUBDIRS_INSTALL_TEST = tools tests
+ 
+ .PHONY: tarball install check check-syntax ctags cstags clean dist-clean \
+ 	$(SUBDIRS_BUILD)
+@@ -106,6 +107,14 @@ check: tools tests
+ check-syntax:
+ 	@./tools/check-syntax
+ 
++install-tests: $(SUBDIRS_INSTALL_TEST)
++	@$(ECHO_INFO) "installing tests in $(INSTALL_PREFIX) ..."
++	$(ECHO_INFO) "installing from $$dir/"
++	@for dir in $(SUBDIRS_INSTALL_TEST); do \
++		$(ECHO_INFO) "installing from $$dir/"; \
++		$(MAKE) -C $$dir install-tests; \
++	done
++
+ ctags:
+ 	@$(ECHO_INFO) "generating ctags for the project ..."
+ 	@ctags -R *
+diff --git a/README b/README
+index 37b9709..14ae254 100644
+--- a/README
++++ b/README
+@@ -41,6 +41,14 @@ to run all of the tests you can simply run the script:
+ However, the script takes a number of options to customize its execution; the
+ options can be displayed by running "./regression -h".
+ 
++It is also possible to install the tests and regression script to the system by
++issuing:
++
++   # make install-tests
++
++When complete, installed tests and regression script may be found in
++$LIBDIR/lib/libseccomp/test
++
+ * Other Useful Tools
+ 
+ The "tools/" directory includes a number of tools which may be helpful in the
+diff --git a/install.mk b/install.mk
+index 123af33..f6aa311 100644
+--- a/install.mk
++++ b/install.mk
+@@ -24,6 +24,7 @@ INSTALL_PREFIX ?= $(CONF_INSTALL_PREFIX)
+ INSTALL_SBIN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/sbin
+ INSTALL_BIN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/bin
+ INSTALL_LIB_DIR ?= $(DESTDIR)/$(CONF_INSTALL_LIBDIR)
++INSTALL_TEST_DIR ?= $(DESTDIR)/$(CONF_INSTALL_LIBDIR)/libseccomp/tests
+ INSTALL_INC_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/include
+ INSTALL_MAN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/share/man
+ 
+diff --git a/macros.mk b/macros.mk
+index 6df5b3a..e7c196d 100644
+--- a/macros.mk
++++ b/macros.mk
+@@ -206,6 +206,24 @@ INSTALL_INC_MACRO += \
+ 			$^ "$(INSTALL_INC_DIR)";
+ 
+ ifeq ($(V),0)
++	INSTALL_TEST_MACRO = @echo " INSTALL $^ ($(INSTALL_TEST_DIR))";
++endif
++INSTALL_TEST_MACRO += \
++		$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
++			-d "$(INSTALL_TEST_DIR)"; \
++		$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \
++			$^ "$(INSTALL_TEST_DIR)";
++
++ifeq ($(V),0)
++	INSTALL_REGRESSION_TEST_MACRO = @echo " INSTALL regression ($(INSTALL_TEST_DIR))";
++endif
++INSTALL_REGRESSION_TEST_MACRO += \
++		$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
++			-d "$(INSTALL_TEST_DIR)"; \
++		$(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \
++			regression "$(INSTALL_TEST_DIR)";
++
++ifeq ($(V),0)
+ 	INSTALL_MAN1_MACRO = \
+ 		@echo " INSTALL manpages ($(INSTALL_MAN_DIR)/man1)";
+ endif
+diff --git a/tests/Makefile b/tests/Makefile
+index 5fdbca7..135551c 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -31,6 +31,7 @@ include ../macros.mk
+ 
+ include $(TOPDIR)/version_info.mk
+ include $(TOPDIR)/configure.mk
++include $(TOPDIR)/install.mk
+ 
+ OBJS = util.o
+ 
+@@ -71,7 +72,7 @@ DEPS_TESTS = $(TESTS:%=%.d)
+ # targets
+ #
+ 
+-.PHONY: check clean
++.PHONY: check clean install-tests
+ 
+ all: $(TESTS) $(OBJS)
+ 
+@@ -91,5 +92,9 @@ $(TEST_PRIVATE): 00-test.c $(OBJS) ../src/libseccomp.a
+ check: $(TESTS)
+ 	./regression
+ 
++install-tests: $(TESTS) $(TESTS:%=%.tests)
++	$(INSTALL_TEST_MACRO)
++	$(INSTALL_REGRESSION_TEST_MACRO)
++
+ clean:
+ 	$(RM) $(DEPS_TESTS) $(DEPS_OBJS) $(TESTS) $(TEST_PRIVATE) $(OBJS) *.pyc
+diff --git a/tests/regression b/tests/regression
+index 790d5e1..3c293a4 100755
+--- a/tests/regression
++++ b/tests/regression
+@@ -23,9 +23,18 @@
+ 
+ GLBL_ARCH_SUPPORT="x86 x86_64 x32 arm"
+ 
+-GLBL_SYS_ARCH="../tools/scmp_arch_detect"
+-GLBL_SYS_RESOLVER="../tools/scmp_sys_resolver"
+-GLBL_SYS_SIM="../tools/scmp_bpf_sim"
++GLBL_SYS_PATH=$(dirname $(readlink -m $0))
++if [ -d $GLBL_SYS_PATH/../tools/ ]; then
++	# prepend ../tools to $PATH so we can use verify_deps to check for
++	# scmp_* support binaries if regression is running out of the build
++	# tree.
++	PATH=$GLBL_SYS_PATH/../tools/:$PATH
++	export PATH
++fi
++
++GLBL_SYS_ARCH=$(which scmp_arch_detect)
++GLBL_SYS_RESOLVER=$(which scmp_sys_resolver)
++GLBL_SYS_SIM=$(which scmp_bpf_sim)
+ 
+ ####
+ # functions
+@@ -761,6 +770,9 @@ verify_deps head
+ verify_deps sed
+ verify_deps seq
+ verify_deps tr
++verify_deps scmp_arch_detect
++verify_deps scmp_sys_resolver
++verify_deps scmp_bpf_sim
+ 
+ # global variables
+ declare -a batch_list
+@@ -865,6 +877,7 @@ arch=$($GLBL_SYS_ARCH)
+ # display the test output and run the requested tests
+ echo "=============== $(date) ===============" >&$logfd
+ echo "Regression Test Report (\"regression $*\")" >&$logfd
++cd $(dirname $0)
+ for mode in $mode_list; do
+ 	run_tests
+ done
+diff --git a/tools/Makefile b/tools/Makefile
+index 79c7d25..9f4ffea 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -62,5 +62,8 @@ $(TOOLS):
+ install: $(TOOLS_INSTALL)
+ 	$(INSTALL_BIN_MACRO)
+ 
++install-tests: $(TOOLS)
++	$(INSTALL_BIN_MACRO)
++
+ clean:
+ 	$(RM) $(DEPS) $(TOOLS)
+-- 
+1.7.10.4
+
recipes-security/libseccomp/files/0002-tests-install-python-tests-if-appropriate.patch new file +61 -0

61 lines not on this page · raw message

recipes-security/libseccomp/files/0003-tests-introduce-alternate-test-report-format.patch new file +124 -0

124 lines not on this page · raw message

recipes-security/libseccomp/libseccomp_2.1.1.bb renamed from recipes-security/libseccomp/libseccomp_2.1.0.bb +7 -3
similarity index 58%
rename from recipes-security/libseccomp/libseccomp_2.1.0.bb
rename to recipes-security/libseccomp/libseccomp_2.1.1.bb
index f909c62..27fa259 100644
@@ -5,10 +5,14 @@ LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
 SRC_URI = "http://sourceforge.net/projects/libseccomp/files/${PN}-${PV}.tar.gz \
-           file://compiler.patch"
+           file://compiler.patch \
+           file://0001-tests-create-install-tests-target.patch \
+           file://0002-tests-install-python-tests-if-appropriate.patch \
+           file://0003-tests-introduce-alternate-test-report-format.patch \
+"
 
-SRC_URI[md5sum] = "3961103c1234c13a810f6a12e60c797f"
-SRC_URI[sha256sum] = "b0d6e4f0984e6632a04f0cf33c6babdb011674ba15ff208e196f037e0e09905e"
+SRC_URI[md5sum] = "1f41207b29e66a7e5e375dd48a64de85"
+SRC_URI[sha256sum] = "8812c11e407c383f5ad6afb84a88e5a0224477bcfe8ff03f0c548e5abaac841c"
 
 do_configure() {
    ${S}/configure --prefix=${prefix} --libdir=${libdir}
Signature · 1 line
1.7.10.4