mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 03:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
5c30cd0869
commit
a7c025cc11
@@ -939,7 +939,8 @@ class Wic2(WicTestCase):
|
||||
bitbake('wic-image-minimal')
|
||||
self.remove_config(config)
|
||||
|
||||
with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
|
||||
runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'wic-image-minimal') or ""
|
||||
with runqemu('wic-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu:
|
||||
cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e '/dev/sda1 /boot' " \
|
||||
"-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e '/dev/sda4 /mnt'"
|
||||
status, output = qemu.run_serial(cmd)
|
||||
@@ -959,8 +960,9 @@ class Wic2(WicTestCase):
|
||||
bitbake('core-image-minimal ovmf')
|
||||
self.remove_config(config)
|
||||
|
||||
runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or ""
|
||||
with runqemu('core-image-minimal', ssh=False,
|
||||
runqemuparams='nographic ovmf', image_fstype='wic') as qemu:
|
||||
runqemuparams='%s nographic ovmf' % (runqemu_params), image_fstype='wic') as qemu:
|
||||
cmd = "grep sda. /proc/partitions |wc -l"
|
||||
status, output = qemu.run_serial(cmd)
|
||||
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
|
||||
@@ -1154,8 +1156,9 @@ class Wic2(WicTestCase):
|
||||
bitbake('core-image-minimal-mtdutils')
|
||||
self.remove_config(config)
|
||||
|
||||
runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal-mtdutils') or ""
|
||||
with runqemu('core-image-minimal-mtdutils', ssh=False,
|
||||
runqemuparams='nographic', image_fstype='wic') as qemu:
|
||||
runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu:
|
||||
cmd = "grep sda. /proc/partitions |wc -l"
|
||||
status, output = qemu.run_serial(cmd)
|
||||
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
|
||||
@@ -1214,8 +1217,9 @@ class Wic2(WicTestCase):
|
||||
bitbake('core-image-minimal')
|
||||
self.remove_config(config)
|
||||
|
||||
runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or ""
|
||||
with runqemu('core-image-minimal', ssh=False,
|
||||
runqemuparams='nographic', image_fstype='wic') as qemu:
|
||||
runqemuparams='%s nographic' % (runqemu_params), image_fstype='wic') as qemu:
|
||||
# Check that we have ONLY two /dev/sda* partitions (/boot and /)
|
||||
cmd = "grep sda. /proc/partitions | wc -l"
|
||||
status, output = qemu.run_serial(cmd)
|
||||
@@ -1446,8 +1450,8 @@ class Wic2(WicTestCase):
|
||||
os.rename(image_path, image_path + '.bak')
|
||||
os.rename(new_image_path, image_path)
|
||||
|
||||
# Check if it boots in qemu
|
||||
with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
|
||||
runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', 'core-image-minimal') or ""
|
||||
with runqemu('core-image-minimal', ssh=False, runqemuparams='%s nographic' % (runqemu_params)) as qemu:
|
||||
cmd = "ls /etc/"
|
||||
status, output = qemu.run_serial('true')
|
||||
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
|
||||
|
||||
Reference in New Issue
Block a user