All of lore.kernel.org
 help / color / mirror / Atom feed
* meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0
@ 2018-05-31 21:08 Mark Asselstine
  2018-05-31 21:08 ` [PATCH 1/3] " Mark Asselstine
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mark Asselstine @ 2018-05-31 21:08 UTC (permalink / raw)
  To: meta-virtualization


The following brings us up to date with the latest upstream release of
lxc. Actually we get 3 things in this series.
1. an uprev to v3.0.0
2. working 'busybox' template (though I recommend you don't use it,
   it is used for ptest but it is pretty useless otherwise).
3. updated ptest approach

This will break meta-overc so I will follow up with one or more
commits there which should be merged at the same time as this to avoid
breaking OverC builds.

Mark


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] lxc: uprev to v3.0.0
  2018-05-31 21:08 meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Mark Asselstine
@ 2018-05-31 21:08 ` Mark Asselstine
  2018-05-31 21:08 ` [PATCH 2/3] lxc: fixup 'download' template use Mark Asselstine
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Asselstine @ 2018-05-31 21:08 UTC (permalink / raw)
  To: meta-virtualization

Update to the latest lxc release. This requires some minor patch
updates (fuzz and offset, not content) along with dropping a no longer
needed fix for gcc7 (gcc 7.3 is everywhere and is patched).

The ptests were already busted before the uprev so I was not able to
run them but I will follow up with a fix for this. I did run against
our usual usecases 'lxc-create', 'lxc-console', 'lxc-ls',
'lxc-destroy', 'lxc-start', 'lxc-execute', 'lxc-attach'... and there
were no issues (outcomes matched v2.0.8).

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 .../files/cgroups-work-around-issue-in-gcc-7.patch | 34 ----------------------
 ...ally-use-base-filenames-to-report-src-fil.patch |  8 ++---
 ...1.0.0-disable-udhcp-from-busybox-template.patch |  6 ++--
 .../lxc/{lxc_2.0.8.bb => lxc_3.0.0.bb}             |  5 ++--
 4 files changed, 9 insertions(+), 44 deletions(-)
 delete mode 100644 recipes-containers/lxc/files/cgroups-work-around-issue-in-gcc-7.patch
 rename recipes-containers/lxc/{lxc_2.0.8.bb => lxc_3.0.0.bb} (97%)

diff --git a/recipes-containers/lxc/files/cgroups-work-around-issue-in-gcc-7.patch b/recipes-containers/lxc/files/cgroups-work-around-issue-in-gcc-7.patch
deleted file mode 100644
index 90740fb..0000000
--- a/recipes-containers/lxc/files/cgroups-work-around-issue-in-gcc-7.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 58a2d817a82100d287c60c63315d81445cdba3f9 Mon Sep 17 00:00:00 2001
-From: Mark Asselstine <mark.asselstine@windriver.com>
-Date: Thu, 15 Jun 2017 15:12:08 -0400
-Subject: [PATCH] cgroups: work around issue in gcc 7
-
-This works around
-https://bugzilla.yoctoproject.org/show_bug.cgi?id=11672
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78969
-
-By removing a single cgroup entry. For the majority of usecases this
-loss of a single entry should not be an issue and once gcc 7 is fixed
-we can revert this.
-
-Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
----
- src/lxc/cgroups/cgfsng.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
-index ebd548b..c520abd 100644
---- a/src/lxc/cgroups/cgfsng.c
-+++ b/src/lxc/cgroups/cgfsng.c
-@@ -1373,7 +1373,7 @@ static inline bool cgfsng_create(void *hdata)
- 	offset = cgname + len - 5;
- 
- again:
--	if (idx == 1000) {
-+	if (idx == 999) {
- 		ERROR("Too many conflicting cgroup names");
- 		goto out_free;
- 	}
--- 
-2.7.4
-
diff --git a/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch b/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch
index 583b6f1..f430601 100644
--- a/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch
+++ b/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch
@@ -31,9 +31,9 @@ diff --git a/configure.ac b/configure.ac
 index deba90b..c1ed67b 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -357,6 +357,15 @@ AM_COND_IF([ENABLE_PYTHON],
- 	PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])])
- 	AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
+@@ -356,6 +356,15 @@ AM_COND_IF([ENABLE_PYTHON],
+ 	[], [enable_examples=yes])
+ AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
  
 +# Enable basenames in the logs for source files
 +AC_ARG_ENABLE([log-src-basename],
@@ -51,7 +51,7 @@ diff --git a/src/lxc/log.h b/src/lxc/log.h
 index 76bd4df..4365977 100644
 --- a/src/lxc/log.h
 +++ b/src/lxc/log.h
-@@ -74,8 +74,13 @@ struct lxc_log_locinfo {
+@@ -77,8 +77,13 @@ struct lxc_log_locinfo {
  	int		line;
  };
  
diff --git a/recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch b/recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch
index 723be27..07a12ff 100644
--- a/recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch
+++ b/recipes-containers/lxc/files/lxc-1.0.0-disable-udhcp-from-busybox-template.patch
@@ -11,14 +11,14 @@ diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in
 index cb425ec..bb8c951 100644
 --- a/templates/lxc-busybox.in
 +++ b/templates/lxc-busybox.in
-@@ -84,7 +84,6 @@ EOF
+@@ -111,7 +111,6 @@ EOF
  #!/bin/sh
  /bin/syslogd
  /bin/mount -a
 -/bin/udhcpc
  EOF
  
-     # executable
--- 
+   # executable
+---
 1.7.11.7
 
diff --git a/recipes-containers/lxc/lxc_2.0.8.bb b/recipes-containers/lxc/lxc_3.0.0.bb
similarity index 97%
rename from recipes-containers/lxc/lxc_2.0.8.bb
rename to recipes-containers/lxc/lxc_3.0.0.bb
index 46fa9a7..7158d0a 100644
--- a/recipes-containers/lxc/lxc_2.0.8.bb
+++ b/recipes-containers/lxc/lxc_3.0.0.bb
@@ -40,13 +40,12 @@ SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
 	file://lxc-fix-B-S.patch \
 	file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
 	file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
-	file://cgroups-work-around-issue-in-gcc-7.patch \
 	file://dnsmasq.conf \
 	file://lxc-net \
 	"
 
-SRC_URI[md5sum] = "7bfd95280522d7936c0979dfea92cdb5"
-SRC_URI[sha256sum] = "0d8e34b302cfe4c40c6c9ae5097096aa5cc2c1dfceea3f0f22e3e16c4a4e8494"
+SRC_URI[md5sum] = "ca1db4f9dc35df9203a58ab606cdfb7a"
+SRC_URI[sha256sum] = "6230224c27f050201b372b18a9f39cd220ed584899c5f0cf73c6b313dabc8d8a"
 
 S = "${WORKDIR}/${BPN}-${PV}"
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] lxc: fixup 'download' template use
  2018-05-31 21:08 meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Mark Asselstine
  2018-05-31 21:08 ` [PATCH 1/3] " Mark Asselstine
@ 2018-05-31 21:08 ` Mark Asselstine
  2018-05-31 21:08 ` [PATCH 3/3] lxc: use compiled tests instead of copying source building on target Mark Asselstine
  2018-06-04  3:27 ` meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Bruce Ashfield
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Asselstine @ 2018-05-31 21:08 UTC (permalink / raw)
  To: meta-virtualization

We have a new dependency on 'mountpoint' which is now called in the
download template script. We also hit an upstream bug due to improper
use of 'mktemp', so we apply a patch to fix this and sent the fix
upstream as well.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 ...s-actually-create-DOWNLOAD_TEMP-directory.patch | 39 ++++++++++++++++++++++
 recipes-containers/lxc/lxc_3.0.0.bb                |  2 ++
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-containers/lxc/files/templates-actually-create-DOWNLOAD_TEMP-directory.patch

diff --git a/recipes-containers/lxc/files/templates-actually-create-DOWNLOAD_TEMP-directory.patch b/recipes-containers/lxc/files/templates-actually-create-DOWNLOAD_TEMP-directory.patch
new file mode 100644
index 0000000..359f662
--- /dev/null
+++ b/recipes-containers/lxc/files/templates-actually-create-DOWNLOAD_TEMP-directory.patch
@@ -0,0 +1,39 @@
+From 1d83b86a9bf017257c068c662ec3bf52ec0cfe90 Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Thu, 31 May 2018 16:21:45 -0400
+Subject: [PATCH] templates: actually create DOWNLOAD_TEMP directory
+
+The way 'mktemp' is currently used you will get a temp directory in
+$TMPDIR or '/tmp' and DOWNLOAD_TEMP will not be pointing to an actual
+directory. This will result in the wget operations failing and the
+container will fail to create:
+
+    ERROR: Failed to download http://....
+
+Instead we want to use the '-p' option for mktemp to set the base path
+and this will ensure that the temp directory is created in the correct
+location and DOWNLOAD_TEMP will be consistent with this location.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ templates/lxc-download.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/templates/lxc-download.in b/templates/lxc-download.in
+index f875183..5f1138c 100644
+--- a/templates/lxc-download.in
++++ b/templates/lxc-download.in
+@@ -320,7 +320,7 @@ fi
+ if ! command -V mktemp >/dev/null 2>&1; then
+   DOWNLOAD_TEMP="${DOWNLOAD_TEMP}/tmp/lxc-download.$$"
+ else
+-  DOWNLOAD_TEMP="${DOWNLOAD_TEMP}$(mktemp -d)"
++  DOWNLOAD_TEMP="$(mktemp -p ${DOWNLOAD_TEMP} -d)"
+ fi
+ 
+ # Simply list images
+-- 
+2.7.4
+
diff --git a/recipes-containers/lxc/lxc_3.0.0.bb b/recipes-containers/lxc/lxc_3.0.0.bb
index 7158d0a..762a312 100644
--- a/recipes-containers/lxc/lxc_3.0.0.bb
+++ b/recipes-containers/lxc/lxc_3.0.0.bb
@@ -24,6 +24,7 @@ RDEPENDS_${PN} = " \
 		libidn \
 		gnutls \
 		nettle \
+		util-linux-mountpoint \
 "
 
 RDEPENDS_${PN}_append_libc-glibc = " glibc-utils"
@@ -40,6 +41,7 @@ SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \
 	file://lxc-fix-B-S.patch \
 	file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
 	file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
+	file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \
 	file://dnsmasq.conf \
 	file://lxc-net \
 	"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] lxc: use compiled tests instead of copying source building on target
  2018-05-31 21:08 meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Mark Asselstine
  2018-05-31 21:08 ` [PATCH 1/3] " Mark Asselstine
  2018-05-31 21:08 ` [PATCH 2/3] lxc: fixup 'download' template use Mark Asselstine
@ 2018-05-31 21:08 ` Mark Asselstine
  2018-06-04  3:27 ` meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Bruce Ashfield
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Asselstine @ 2018-05-31 21:08 UTC (permalink / raw)
  To: meta-virtualization

The tests are already built when we do_compile so we only need to copy
them to the ptest path and create a wrapper script to run them. This
has the added benefit of reducing the size of the lxc package.

We have to manipulate the test sources some to remove gpg validation
and a few other minor changes, none of which actually change what is
being tested (notes are provided in the associated commit logs).

The following are the ptest results currently acheived:

    ### Starting LXC ptest ###
    ./tests/lxc-test-api-reboot FAIL
    ./tests/lxc-test-apparmor SKIPPED
    ./tests/lxc-test-attach PASS
    ./tests/lxc-test-automount PASS
    ./tests/lxc-test-autostart PASS
    ./tests/lxc-test-cgpath PASS
    ./tests/lxc-test-cloneconfig PASS
    ./tests/lxc-test-clonetest PASS
    ./tests/lxc-test-concurrent PASS
    ./tests/lxc-test-config-jump-table PASS
    ./tests/lxc-test-console PASS
    ./tests/lxc-test-console-log PASS
    ./tests/lxc-test-containertests PASS
    ./tests/lxc-test-createconfig PASS
    ./tests/lxc-test-createtest PASS
    ./tests/lxc-test-criu-check-feature PASS
    ./tests/lxc-test-destroytest PASS
    ./tests/lxc-test-device-add-remove PASS
    ./tests/lxc-test-get_item PASS
    ./tests/lxc-test-getkeys PASS
    ./tests/lxc-test-list PASS
    ./tests/lxc-test-locktests PASS
    ./tests/lxc-test-lxcpath PASS
    ./tests/lxc-test-may-control PASS
    ./tests/lxc-test-no-new-privs PASS
    ./tests/lxc-test-parse-config-file PASS
    ./tests/lxc-test-raw-clone PASS
    ./tests/lxc-test-reboot PASS
    ./tests/lxc-test-rootfs PASS
    ./tests/lxc-test-saveconfig PASS
    ./tests/lxc-test-share-ns PASS
    ./tests/lxc-test-shortlived PASS
    ./tests/lxc-test-shutdowntest SKIPPED
    ./tests/lxc-test-snapshot PASS
    ./tests/lxc-test-startone PASS
    ./tests/lxc-test-state-server SKIPPED
    ./tests/lxc-test-utils PASS

    Results:
        PASSED = 33
        FAILED = 1
        SKIPPED = 3
        (for details check individual test log in ./logs directory)

    ### LXC ptest complete ###

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 .../automake-ensure-VPATH-builds-correctly.patch   | 26 -------
 recipes-containers/lxc/files/run-ptest             | 57 +++++++++++++-
 recipes-containers/lxc/files/runtest.patch         | 32 --------
 ...ke-busybox-template-compatible-with-core-.patch | 59 +++++++++++++++
 ...-no-validate-when-using-download-template.patch | 87 ++++++++++++++++++++++
 .../lxc/files/tests-our-init-is-not-busybox.patch  | 31 ++++++++
 recipes-containers/lxc/lxc_3.0.0.bb                | 13 ++--
 7 files changed, 239 insertions(+), 66 deletions(-)
 delete mode 100644 recipes-containers/lxc/files/automake-ensure-VPATH-builds-correctly.patch
 delete mode 100644 recipes-containers/lxc/files/runtest.patch
 create mode 100644 recipes-containers/lxc/files/template-make-busybox-template-compatible-with-core-.patch
 create mode 100644 recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch
 create mode 100644 recipes-containers/lxc/files/tests-our-init-is-not-busybox.patch

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0
  2018-05-31 21:08 meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Mark Asselstine
                   ` (2 preceding siblings ...)
  2018-05-31 21:08 ` [PATCH 3/3] lxc: use compiled tests instead of copying source building on target Mark Asselstine
@ 2018-06-04  3:27 ` Bruce Ashfield
  3 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2018-06-04  3:27 UTC (permalink / raw)
  To: Mark Asselstine; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

merged

Bruce

On Thu, May 31, 2018 at 5:08 PM, Mark Asselstine <
mark.asselstine@windriver.com> wrote:

>
> The following brings us up to date with the latest upstream release of
> lxc. Actually we get 3 things in this series.
> 1. an uprev to v3.0.0
> 2. working 'busybox' template (though I recommend you don't use it,
>    it is used for ptest but it is pretty useless otherwise).
> 3. updated ptest approach
>
> This will break meta-overc so I will follow up with one or more
> commits there which should be merged at the same time as this to avoid
> breaking OverC builds.
>
> Mark
> --
> _______________________________________________
> meta-virtualization mailing list
> meta-virtualization@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-virtualization
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"

[-- Attachment #2: Type: text/html, Size: 1623 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-04  3:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 21:08 meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Mark Asselstine
2018-05-31 21:08 ` [PATCH 1/3] " Mark Asselstine
2018-05-31 21:08 ` [PATCH 2/3] lxc: fixup 'download' template use Mark Asselstine
2018-05-31 21:08 ` [PATCH 3/3] lxc: use compiled tests instead of copying source building on target Mark Asselstine
2018-06-04  3:27 ` meta-virtualization][PATCH 0/3] lxc: uprev to v3.0.0 Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.