summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/lxc/files/run-ptest4
-rw-r--r--recipes-containers/lxc/files/runtest.patch32
-rw-r--r--recipes-containers/lxc/lxc_1.0.0.bb17
3 files changed, 51 insertions, 2 deletions
diff --git a/recipes-containers/lxc/files/run-ptest b/recipes-containers/lxc/files/run-ptest
new file mode 100644
index 00000000..23a6256b
--- /dev/null
+++ b/recipes-containers/lxc/files/run-ptest
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3make -C src/tests -k check-TESTS
4
diff --git a/recipes-containers/lxc/files/runtest.patch b/recipes-containers/lxc/files/runtest.patch
new file mode 100644
index 00000000..e4e034b2
--- /dev/null
+++ b/recipes-containers/lxc/files/runtest.patch
@@ -0,0 +1,32 @@
1Add install-ptest rule.
2
3Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
4Upstream-status: Pending
5
6diff -uNr a/src/tests/Makefile.am b/src/tests/Makefile.am
7--- a/src/tests/Makefile.am 2014-04-07 16:25:59.246238815 +0300
8+++ b/src/tests/Makefile.am 2014-04-10 18:09:43.195772467 +0300
9@@ -54,6 +54,23 @@
10
11 endif
12
13+TESTS = lxc-test-containertests lxc-test-locktests \
14+ lxc-test-getkeys lxc-test-lxcpath lxc-test-cgpath lxc-test-console \
15+ lxc-test-snapshot lxc-test-concurrent lxc-test-may-control \
16+ lxc-test-reboot lxc-test-list lxc-test-attach lxc-test-device-add-remove
17+
18+buildtest-TESTS: $(TESTS)
19+
20+install-ptest:
21+ install -d $(TEST_DIR)
22+ install -D ../lxc/liblxc.so $(TEST_DIR)/../lxc/liblxc.so
23+ install -D ../../config/test-driver $(TEST_DIR)/../../config/test-driver
24+ cp Makefile $(TEST_DIR)
25+ @(for file in $(TESTS); do install $$file $(TEST_DIR); done;)
26+ sed -i 's|^Makefile:|_Makefile:|' $(TEST_DIR)/Makefile
27+ sed -i 's|^all-am:|_all-am:|' $(TEST_DIR)/Makefile
28+ sed -i -e 's|^\(.*\.log:\) \(.*EXEEXT.*\)|\1|g' $(TEST_DIR)/Makefile
29+
30 EXTRA_DIST = \
31 cgpath.c \
32 clonetest.c \
diff --git a/recipes-containers/lxc/lxc_1.0.0.bb b/recipes-containers/lxc/lxc_1.0.0.bb
index d5fc680a..5a35177d 100644
--- a/recipes-containers/lxc/lxc_1.0.0.bb
+++ b/recipes-containers/lxc/lxc_1.0.0.bb
@@ -20,12 +20,15 @@ RDEPENDS_${PN} = " \
20 perl-module-overload \ 20 perl-module-overload \
21 perl-module-exporter-heavy \ 21 perl-module-exporter-heavy \
22" 22"
23RDEPENDS_${PN}-ptest += "file make"
23 24
24SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ 25SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
25 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \ 26 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \
26 file://config_network_type-set-macvlan-default-mode-to-priv.patch \ 27 file://config_network_type-set-macvlan-default-mode-to-priv.patch \
27 file://lxc-busybox-follow-symlinks-when-inspecting-busybox-.patch \ 28 file://lxc-busybox-follow-symlinks-when-inspecting-busybox-.patch \
28 file://network.c-Add-missing-LXC_NET_NONE-option-refactor.patch \ 29 file://network.c-Add-missing-LXC_NET_NONE-option-refactor.patch \
30 file://runtest.patch \
31 file://run-ptest \
29 " 32 "
30SRC_URI[md5sum] = "87a9d168a6e55326303cce3b2cb7f82e" 33SRC_URI[md5sum] = "87a9d168a6e55326303cce3b2cb7f82e"
31SRC_URI[sha256sum] = "0992212ddaad01dfe8c048e130566b73dd5f34191585f36bdac07a4f8a91f3bd" 34SRC_URI[sha256sum] = "0992212ddaad01dfe8c048e130566b73dd5f34191585f36bdac07a4f8a91f3bd"
@@ -34,20 +37,23 @@ S = "${WORKDIR}/${BPN}-${PV}"
34 37
35# Let's not configure for the host distro. 38# Let's not configure for the host distro.
36# 39#
37EXTRA_OECONF += "--with-distro=${DISTRO}" 40PTEST_CONF = "${@base_contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}"
41EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}"
38 42
39PACKAGECONFIG ??= "" 43PACKAGECONFIG ??= ""
40PACKAGECONFIG[doc] = "--enable-doc,--disable-doc,," 44PACKAGECONFIG[doc] = "--enable-doc,--disable-doc,,"
41PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," 45PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,,"
42PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" 46PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor"
43 47
44inherit autotools pkgconfig 48inherit autotools pkgconfig ptest
45 49
46FILES_${PN}-doc = "${mandir} ${infodir}" 50FILES_${PN}-doc = "${mandir} ${infodir}"
47# For LXC the docdir only contains example configuration files and should be included in the lxc package 51# For LXC the docdir only contains example configuration files and should be included in the lxc package
48FILES_${PN} += "${docdir}" 52FILES_${PN} += "${docdir}"
49FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" 53FILES_${PN}-dbg += "${libexecdir}/lxc/.debug"
50 54
55PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1"
56
51do_install_append() { 57do_install_append() {
52 # The /var/cache/lxc directory created by the Makefile 58 # The /var/cache/lxc directory created by the Makefile
53 # is wiped out in volatile, we need to create this at boot. 59 # is wiped out in volatile, we need to create this at boot.
@@ -58,8 +64,15 @@ do_install_append() {
58 64
59} 65}
60 66
67EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests"
68
69do_install_ptest() {
70 oe_runmake -C src/tests install-ptest
71}
72
61pkg_postinst_${PN}() { 73pkg_postinst_${PN}() {
62 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then 74 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
63 /etc/init.d/populate-volatile.sh update 75 /etc/init.d/populate-volatile.sh update
64 fi 76 fi
65} 77}
78