diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2018-05-31 17:08:06 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-06-03 23:26:52 -0400 |
commit | 1a5853f87cfc0b16d992ed222bbb0ff6066b2617 (patch) | |
tree | 69f38ba542fd85dd9fe1e3067510aaadf7da8295 /recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch | |
parent | b6bccf42d1042ee52800d307cffb39191b0f35f3 (diff) | |
download | meta-virtualization-1a5853f87cfc0b16d992ed222bbb0ff6066b2617.tar.gz |
lxc: use compiled tests instead of copying source building on target
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>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch')
-rw-r--r-- | recipes-containers/lxc/files/tests-add-no-validate-when-using-download-template.patch | 87 |
1 files changed, 87 insertions, 0 deletions
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 | |||