diff options
7 files changed, 239 insertions, 66 deletions
diff --git a/recipes-containers/lxc/files/automake-ensure-VPATH-builds-correctly.patch b/recipes-containers/lxc/files/automake-ensure-VPATH-builds-correctly.patch deleted file mode 100644 index 61c0e293..00000000 --- a/recipes-containers/lxc/files/automake-ensure-VPATH-builds-correctly.patch +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | From fe23085d9a40d6d78387d9ce8ddb65785fe8d6e5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
| 3 | Date: Thu, 2 Oct 2014 18:31:50 -0400 | ||
| 4 | Subject: [PATCH] automake: ensure VPATH builds correctly | ||
| 5 | |||
| 6 | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
| 7 | --- | ||
| 8 | src/tests/Makefile.am | 2 +- | ||
| 9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 10 | |||
| 11 | diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am | ||
| 12 | index d74c10d..6225f78 100644 | ||
| 13 | --- a/src/tests/Makefile.am | ||
| 14 | +++ b/src/tests/Makefile.am | ||
| 15 | @@ -66,7 +66,7 @@ buildtest-TESTS: $(TESTS) | ||
| 16 | install-ptest: | ||
| 17 | install -d $(TEST_DIR) | ||
| 18 | install -D ../lxc/.libs/liblxc.so $(TEST_DIR)/../lxc/liblxc.so | ||
| 19 | - install -D ../../config/test-driver $(TEST_DIR)/../../config/test-driver | ||
| 20 | + install -D $(top_srcdir)/config/test-driver $(TEST_DIR)/../../config/test-driver | ||
| 21 | cp Makefile $(TEST_DIR) | ||
| 22 | @(for file in $(TESTS); do install $$file $(TEST_DIR); done;) | ||
| 23 | sed -i 's|^Makefile:|_Makefile:|' $(TEST_DIR)/Makefile | ||
| 24 | -- | ||
| 25 | 1.7.10.4 | ||
| 26 | |||
diff --git a/recipes-containers/lxc/files/run-ptest b/recipes-containers/lxc/files/run-ptest index 23a6256b..e9855449 100644 --- a/recipes-containers/lxc/files/run-ptest +++ b/recipes-containers/lxc/files/run-ptest | |||
| @@ -1,4 +1,57 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | make -C src/tests -k check-TESTS | 3 | # Network interfaces come up and down and can be quite noisy |
| 4 | # and since we are often on the console when running ptests | ||
| 5 | # let's just quiet things some | ||
| 6 | dmesg -n 1 | ||
| 4 | 7 | ||
| 8 | # Blacklisted test will be skipped | ||
| 9 | blacklist="" | ||
| 10 | # Not applicable | ||
| 11 | blacklist="$blacklist lxc-test-apparmor" | ||
| 12 | # These currently hang so skip them until someone fixes them up | ||
| 13 | blacklist="$blacklist lxc-test-shutdowntest" | ||
| 14 | blacklist="$blacklist lxc-test-state-server" | ||
| 15 | |||
| 16 | passed=0 | ||
| 17 | failed=0 | ||
| 18 | skipped=0 | ||
| 19 | |||
| 20 | # Create logs dir and clear old logs if any | ||
| 21 | mkdir logs 2> /dev/null | ||
| 22 | rm -f logs/* | ||
| 23 | |||
| 24 | echo "### Starting LXC ptest ###" | ||
| 25 | |||
| 26 | for test in ./tests/* | ||
| 27 | do | ||
| 28 | if [[ ! $blacklist = *$(basename $test)* ]] | ||
| 29 | then | ||
| 30 | $test >logs/$(basename $test).log 2>&1 | ||
| 31 | else | ||
| 32 | echo "$test SKIPPED" | ||
| 33 | skipped=$((skipped+1)) | ||
| 34 | continue | ||
| 35 | fi | ||
| 36 | |||
| 37 | if [ $? -eq 0 ] | ||
| 38 | then | ||
| 39 | echo "$test PASS" | ||
| 40 | passed=$((passed+1)) | ||
| 41 | else | ||
| 42 | echo "$test FAIL" | ||
| 43 | failed=$((failed+1)) | ||
| 44 | fi | ||
| 45 | done | ||
| 46 | |||
| 47 | echo "" | ||
| 48 | echo "Results:" | ||
| 49 | echo " PASSED = $passed" | ||
| 50 | echo " FAILED = $failed" | ||
| 51 | echo " SKIPPED = $skipped" | ||
| 52 | echo "(for details check individual test log in ./logs directory)" | ||
| 53 | echo "" | ||
| 54 | echo "### LXC ptest complete ###" | ||
| 55 | |||
| 56 | # restore dmesg to console | ||
| 57 | dmesg -n 6 | ||
diff --git a/recipes-containers/lxc/files/runtest.patch b/recipes-containers/lxc/files/runtest.patch deleted file mode 100644 index 6572265f..00000000 --- a/recipes-containers/lxc/files/runtest.patch +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | Add install-ptest rule. | ||
| 2 | |||
| 3 | Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> | ||
| 4 | Upstream-status: Pending | ||
| 5 | |||
| 6 | diff -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/.libs/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/files/template-make-busybox-template-compatible-with-core-.patch b/recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch new file mode 100644 index 00000000..1c6022b7 --- /dev/null +++ b/recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | From 0990db9b9723589606104d42ac2cf865b78e50a1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 3 | Date: Thu, 31 May 2018 11:44:44 -0400 | ||
| 4 | Subject: [PATCH] template: make busybox template compatible with | ||
| 5 | core-image-minimal | ||
| 6 | |||
| 7 | The busybox template makes a lot of assumptions about how the busybox | ||
| 8 | binary found on the host was configured. Building core-image-minimal | ||
| 9 | "out of the box" does not configure busybox's 'passwd' or 'init' | ||
| 10 | applets so we need to work around this. | ||
| 11 | |||
| 12 | Chances are if you attempt to use the busybox template with a host | ||
| 13 | which is note core-image-minimal it will fail but we are making these | ||
| 14 | changes here to at least have the template work with | ||
| 15 | core-image-minimal to be able to demonstrate that it can work as well | ||
| 16 | as to have it available for the ptests. | ||
| 17 | |||
| 18 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 19 | --- | ||
| 20 | templates/lxc-busybox.in | 16 +++++++++++++--- | ||
| 21 | 1 file changed, 13 insertions(+), 3 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in | ||
| 24 | index 7d00bf5..5a99103 100644 | ||
| 25 | --- a/templates/lxc-busybox.in | ||
| 26 | +++ b/templates/lxc-busybox.in | ||
| 27 | @@ -181,6 +181,19 @@ configure_busybox() | ||
| 28 | return 1 | ||
| 29 | fi | ||
| 30 | |||
| 31 | + # copy host passwd | ||
| 32 | + if ! cp "$(which passwd)" "${rootfs}/bin"; then | ||
| 33 | + echo "ERROR: Failed to copy passwd binary" | ||
| 34 | + return 1 | ||
| 35 | + fi | ||
| 36 | + | ||
| 37 | + # copy bash binary as the container init | ||
| 38 | + if ! cp "$(which bash)" "${rootfs}/sbin/init"; then | ||
| 39 | + echo "ERROR: Failed to copy bash binary" | ||
| 40 | + return 1 | ||
| 41 | + fi | ||
| 42 | + | ||
| 43 | + | ||
| 44 | # symlink busybox for the commands it supports | ||
| 45 | # it would be nice to just use "chroot $rootfs busybox --install -s /bin" | ||
| 46 | # but that only works right in a chroot with busybox >= 1.19.0 | ||
| 47 | @@ -191,9 +204,6 @@ configure_busybox() | ||
| 48 | xargs -n1 ln -s busybox | ||
| 49 | ) | ||
| 50 | |||
| 51 | - # relink /sbin/init | ||
| 52 | - ln "${rootfs}/bin/busybox" "${rootfs}/sbin/init" | ||
| 53 | - | ||
| 54 | # /etc/fstab must exist for "mount -a" | ||
| 55 | touch "${rootfs}/etc/fstab" | ||
| 56 | |||
| 57 | -- | ||
| 58 | 2.7.4 | ||
| 59 | |||
diff --git a/recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch b/recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch new file mode 100644 index 00000000..81fd15d6 --- /dev/null +++ b/recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | From 0dad69a3bd306cc701c8bd4df4ea47f0ec5f9150 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 3 | Date: Thu, 31 May 2018 15:14:26 -0400 | ||
| 4 | Subject: [PATCH] tests: add '--no-validate' when using download template | ||
| 5 | |||
| 6 | We are usually running the ptests with core-image-minimal which has no | ||
| 7 | mechanism to validate the downloads. Validation isn't really of | ||
| 8 | interest to this test at any rate so simply add '--no-validate' to | ||
| 9 | avoid failing due to no GPG validation. | ||
| 10 | |||
| 11 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 12 | --- | ||
| 13 | src/tests/lxc-test-apparmor-mount | 2 +- | ||
| 14 | src/tests/lxc-test-autostart | 2 +- | ||
| 15 | src/tests/lxc-test-no-new-privs | 2 +- | ||
| 16 | src/tests/lxc-test-unpriv | 2 +- | ||
| 17 | src/tests/lxc-test-usernic.in | 2 +- | ||
| 18 | 5 files changed, 5 insertions(+), 5 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/src/tests/lxc-test-apparmor-mount b/src/tests/lxc-test-apparmor-mount | ||
| 21 | index ddcee8a..d3d2c49 100755 | ||
| 22 | --- a/src/tests/lxc-test-apparmor-mount | ||
| 23 | +++ b/src/tests/lxc-test-apparmor-mount | ||
| 24 | @@ -157,7 +157,7 @@ if [ -f /etc/lsb-release ]; then | ||
| 25 | done | ||
| 26 | fi | ||
| 27 | |||
| 28 | -run_cmd lxc-create -t download -n $cname -- -d ubuntu -r $release -a $ARCH | ||
| 29 | +run_cmd lxc-create -t download -n $cname -- --no-validate -d ubuntu -r $release -a $ARCH | ||
| 30 | |||
| 31 | echo "test default confined container" | ||
| 32 | run_cmd lxc-start -n $cname -d | ||
| 33 | diff --git a/src/tests/lxc-test-autostart b/src/tests/lxc-test-autostart | ||
| 34 | index e5b651b..d15b79b 100755 | ||
| 35 | --- a/src/tests/lxc-test-autostart | ||
| 36 | +++ b/src/tests/lxc-test-autostart | ||
| 37 | @@ -55,7 +55,7 @@ if [ -f /etc/lsb-release ]; then | ||
| 38 | done | ||
| 39 | fi | ||
| 40 | |||
| 41 | -lxc-create -t download -n $CONTAINER_NAME -B dir -- -d ubuntu -r $release -a $ARCH | ||
| 42 | +lxc-create -t download -n $CONTAINER_NAME -B dir -- --no-validate -d ubuntu -r $release -a $ARCH | ||
| 43 | CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs.path -H) | sed -e 's/dir://') | ||
| 44 | cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak | ||
| 45 | |||
| 46 | diff --git a/src/tests/lxc-test-no-new-privs b/src/tests/lxc-test-no-new-privs | ||
| 47 | index 8642992..e72bdf0 100755 | ||
| 48 | --- a/src/tests/lxc-test-no-new-privs | ||
| 49 | +++ b/src/tests/lxc-test-no-new-privs | ||
| 50 | @@ -47,7 +47,7 @@ if type dpkg >/dev/null 2>&1; then | ||
| 51 | ARCH=$(dpkg --print-architecture) | ||
| 52 | fi | ||
| 53 | |||
| 54 | -lxc-create -t download -n c1 -- -d ubuntu -r xenial -a $ARCH | ||
| 55 | +lxc-create -t download -n c1 -- --no-validate -d ubuntu -r xenial -a $ARCH | ||
| 56 | echo "lxc.no_new_privs = 1" >> /var/lib/lxc/c1/config | ||
| 57 | |||
| 58 | lxc-start -n c1 | ||
| 59 | diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv | ||
| 60 | index 16ff12d..0958d48 100755 | ||
| 61 | --- a/src/tests/lxc-test-unpriv | ||
| 62 | +++ b/src/tests/lxc-test-unpriv | ||
| 63 | @@ -173,7 +173,7 @@ run_cmd mkdir -p $HDIR/.cache/lxc | ||
| 64 | cp -R /var/cache/lxc/download $HDIR/.cache/lxc && \ | ||
| 65 | chown -R $TUSER: $HDIR/.cache/lxc | ||
| 66 | |||
| 67 | -run_cmd lxc-create -t download -n c1 -- -d ubuntu -r $release -a $ARCH | ||
| 68 | +run_cmd lxc-create -t download -n c1 -- --no-validate -d ubuntu -r $release -a $ARCH | ||
| 69 | |||
| 70 | # Make sure we can start it - twice | ||
| 71 | |||
| 72 | diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in | ||
| 73 | index 3e35008..f489286 100755 | ||
| 74 | --- a/src/tests/lxc-test-usernic.in | ||
| 75 | +++ b/src/tests/lxc-test-usernic.in | ||
| 76 | @@ -146,7 +146,7 @@ if [ -f /etc/lsb-release ]; then | ||
| 77 | fi | ||
| 78 | |||
| 79 | # Create three containers | ||
| 80 | -run_cmd "lxc-create -t download -n b1 -- -d ubuntu -r $release -a $ARCH" | ||
| 81 | +run_cmd "lxc-create -t download -n b1 -- --no-validate -d ubuntu -r $release -a $ARCH" | ||
| 82 | run_cmd "lxc-start -n b1 -d" | ||
| 83 | p1=$(run_cmd "lxc-info -n b1 -p -H") | ||
| 84 | |||
| 85 | -- | ||
| 86 | 2.7.4 | ||
| 87 | |||
diff --git a/recipes-containers/lxc/files/tests-our-init-is-not-busybox.patch b/recipes-containers/lxc/files/tests-our-init-is-not-busybox.patch new file mode 100644 index 00000000..4c9bf652 --- /dev/null +++ b/recipes-containers/lxc/files/tests-our-init-is-not-busybox.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From b53169dc4c53f9ef64f8cb06dd9af97182577698 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 3 | Date: Thu, 31 May 2018 15:00:34 -0400 | ||
| 4 | Subject: [PATCH] tests: our init is not busybox | ||
| 5 | |||
| 6 | Since we are using 'bash' as the init (see our updates to the busybox | ||
| 7 | template) we can't compare '/sbin/init' and 'busybox'. Actually we are | ||
| 8 | really only interested in the fact 'cmp' is being run and not the | ||
| 9 | result, so simplify by comparing '/sbin/init' to itself. | ||
| 10 | |||
| 11 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
| 12 | --- | ||
| 13 | src/tests/attach.c | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/src/tests/attach.c b/src/tests/attach.c | ||
| 17 | index 2c77127..1c182d6 100644 | ||
| 18 | --- a/src/tests/attach.c | ||
| 19 | +++ b/src/tests/attach.c | ||
| 20 | @@ -251,7 +251,7 @@ static int test_attach_cmd(struct lxc_container *ct) | ||
| 21 | { | ||
| 22 | int ret; | ||
| 23 | pid_t pid; | ||
| 24 | - char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL}; | ||
| 25 | + char *argv[] = {"cmp", "-s", "/sbin/init", "/sbin/init", NULL}; | ||
| 26 | lxc_attach_command_t command = {"cmp", argv}; | ||
| 27 | lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; | ||
| 28 | |||
| 29 | -- | ||
| 30 | 2.7.4 | ||
| 31 | |||
diff --git a/recipes-containers/lxc/lxc_3.0.0.bb b/recipes-containers/lxc/lxc_3.0.0.bb index 762a3125..4f7526bd 100644 --- a/recipes-containers/lxc/lxc_3.0.0.bb +++ b/recipes-containers/lxc/lxc_3.0.0.bb | |||
| @@ -29,19 +29,20 @@ RDEPENDS_${PN} = " \ | |||
| 29 | 29 | ||
| 30 | RDEPENDS_${PN}_append_libc-glibc = " glibc-utils" | 30 | RDEPENDS_${PN}_append_libc-glibc = " glibc-utils" |
| 31 | 31 | ||
| 32 | RDEPENDS_${PN}-ptest += "file make gmp nettle gnutls bash" | 32 | RDEPENDS_${PN}-ptest += "file make gmp nettle gnutls bash libgcc" |
| 33 | 33 | ||
| 34 | RDEPENDS_${PN}-networking += "iptables" | 34 | RDEPENDS_${PN}-networking += "iptables" |
| 35 | 35 | ||
| 36 | SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ | 36 | SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ |
| 37 | file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \ | 37 | file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \ |
| 38 | file://runtest.patch \ | ||
| 39 | file://run-ptest \ | 38 | file://run-ptest \ |
| 40 | file://automake-ensure-VPATH-builds-correctly.patch \ | ||
| 41 | file://lxc-fix-B-S.patch \ | 39 | file://lxc-fix-B-S.patch \ |
| 42 | file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \ | 40 | file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \ |
| 43 | file://logs-optionally-use-base-filenames-to-report-src-fil.patch \ | 41 | file://logs-optionally-use-base-filenames-to-report-src-fil.patch \ |
| 44 | file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \ | 42 | file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \ |
| 43 | file://template-make-busybox-template-compatible-with-core-.patch \ | ||
| 44 | file://tests-our-init-is-not-busybox.patch \ | ||
| 45 | file://tests-add-no-validate-when-using-download-template.patch \ | ||
| 45 | file://dnsmasq.conf \ | 46 | file://dnsmasq.conf \ |
| 46 | file://lxc-net \ | 47 | file://lxc-net \ |
| 47 | " | 48 | " |
| @@ -116,8 +117,6 @@ FILES_${PN}-networking += " \ | |||
| 116 | ${sysconfdir}/default/lxc-net \ | 117 | ${sysconfdir}/default/lxc-net \ |
| 117 | " | 118 | " |
| 118 | 119 | ||
| 119 | PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" | ||
| 120 | |||
| 121 | CACHED_CONFIGUREVARS += " \ | 120 | CACHED_CONFIGUREVARS += " \ |
| 122 | ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \ | 121 | ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \ |
| 123 | am_cv_python_pyexecdir='${exec_prefix}/${libdir}/python3.5/site-packages' \ | 122 | am_cv_python_pyexecdir='${exec_prefix}/${libdir}/python3.5/site-packages' \ |
| @@ -159,7 +158,9 @@ do_install_append() { | |||
| 159 | EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" | 158 | EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" |
| 160 | 159 | ||
| 161 | do_install_ptest() { | 160 | do_install_ptest() { |
| 162 | oe_runmake -C src/tests install-ptest | 161 | # Move tests to the "ptest directory" |
| 162 | install -d ${D}/${PTEST_PATH}/tests | ||
| 163 | mv ${D}/usr/bin/lxc-test-* ${D}/${PTEST_PATH}/tests/. | ||
| 163 | } | 164 | } |
| 164 | 165 | ||
| 165 | pkg_postinst_${PN}() { | 166 | pkg_postinst_${PN}() { |
