diff options
author | Mikko Rapeli <mikko.rapeli@linaro.org> | 2024-10-23 15:08:37 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-25 15:12:22 +0100 |
commit | a7c025cc11731e08bb23a700eabe9faf0c513c30 (patch) | |
tree | d8028f0b154d084ec6c7b2d375ec0f941dfebec1 | |
parent | 5c30cd0869a710de69e2822729684108d812bfa2 (diff) | |
download | poky-a7c025cc11731e08bb23a700eabe9faf0c513c30.tar.gz |
oeqa selftest wic.py: add TEST_RUNQEMUPARAMS to runqemu
To support "slirp" networking on shared build machines instead
of tun/tap devices. Users can set
TEST_RUNQEMUPARAMS = "slirp"
in their build/conf/local.conf to run selftests using "slirp"
networking. The same works for testimage.bbclass and oeqa runtime
tests.
(From OE-Core rev: 4974ec71367492ce314da63c359ccf99acfca882)
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b616759209..f2a46c965b 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -939,7 +939,8 @@ class Wic2(WicTestCase): | |||
939 | bitbake('wic-image-minimal') | 939 | bitbake('wic-image-minimal') |
940 | self.remove_config(config) | 940 | self.remove_config(config) |
941 | 941 | ||
942 | with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu: | 942 | runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'wic-image-minimal') or "" |
943 | with runqemu('wic-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu: | ||
943 | cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e '/dev/sda1 /boot' " \ | 944 | cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e '/dev/sda1 /boot' " \ |
944 | "-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e '/dev/sda4 /mnt'" | 945 | "-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e '/dev/sda4 /mnt'" |
945 | status, output = qemu.run_serial(cmd) | 946 | status, output = qemu.run_serial(cmd) |
@@ -959,8 +960,9 @@ class Wic2(WicTestCase): | |||
959 | bitbake('core-image-minimal ovmf') | 960 | bitbake('core-image-minimal ovmf') |
960 | self.remove_config(config) | 961 | self.remove_config(config) |
961 | 962 | ||
963 | runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or "" | ||
962 | with runqemu('core-image-minimal', ssh=False, | 964 | with runqemu('core-image-minimal', ssh=False, |
963 | runqemuparams='nographic ovmf', image_fstype='wic') as qemu: | 965 | runqemuparams='%s nographic ovmf' % (runqemu_params), image_fstype='wic') as qemu: |
964 | cmd = "grep sda. /proc/partitions |wc -l" | 966 | cmd = "grep sda. /proc/partitions |wc -l" |
965 | status, output = qemu.run_serial(cmd) | 967 | status, output = qemu.run_serial(cmd) |
966 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 968 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |
@@ -1154,8 +1156,9 @@ class Wic2(WicTestCase): | |||
1154 | bitbake('core-image-minimal-mtdutils') | 1156 | bitbake('core-image-minimal-mtdutils') |
1155 | self.remove_config(config) | 1157 | self.remove_config(config) |
1156 | 1158 | ||
1159 | runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal-mtdutils') or "" | ||
1157 | with runqemu('core-image-minimal-mtdutils', ssh=False, | 1160 | with runqemu('core-image-minimal-mtdutils', ssh=False, |
1158 | runqemuparams='nographic', image_fstype='wic') as qemu: | 1161 | runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu: |
1159 | cmd = "grep sda. /proc/partitions |wc -l" | 1162 | cmd = "grep sda. /proc/partitions |wc -l" |
1160 | status, output = qemu.run_serial(cmd) | 1163 | status, output = qemu.run_serial(cmd) |
1161 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 1164 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |
@@ -1214,8 +1217,9 @@ class Wic2(WicTestCase): | |||
1214 | bitbake('core-image-minimal') | 1217 | bitbake('core-image-minimal') |
1215 | self.remove_config(config) | 1218 | self.remove_config(config) |
1216 | 1219 | ||
1220 | runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or "" | ||
1217 | with runqemu('core-image-minimal', ssh=False, | 1221 | with runqemu('core-image-minimal', ssh=False, |
1218 | runqemuparams='nographic', image_fstype='wic') as qemu: | 1222 | runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu: |
1219 | # Check that we have ONLY two /dev/sda* partitions (/boot and /) | 1223 | # Check that we have ONLY two /dev/sda* partitions (/boot and /) |
1220 | cmd = "grep sda. /proc/partitions | wc -l" | 1224 | cmd = "grep sda. /proc/partitions | wc -l" |
1221 | status, output = qemu.run_serial(cmd) | 1225 | status, output = qemu.run_serial(cmd) |
@@ -1446,8 +1450,8 @@ class Wic2(WicTestCase): | |||
1446 | os.rename(image_path, image_path + '.bak') | 1450 | os.rename(image_path, image_path + '.bak') |
1447 | os.rename(new_image_path, image_path) | 1451 | os.rename(new_image_path, image_path) |
1448 | 1452 | ||
1449 | # Check if it boots in qemu | 1453 | runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or "" |
1450 | with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu: | 1454 | with runqemu('core-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu: |
1451 | cmd = "ls /etc/" | 1455 | cmd = "ls /etc/" |
1452 | status, output = qemu.run_serial('true') | 1456 | status, output = qemu.run_serial('true') |
1453 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 1457 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |