summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2023-03-13 13:15:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-22 13:53:29 +0000
commita2b8fec2891420f83031769de362c47a3cc88280 (patch)
treea3eeeb0b7b6521fba5e0bc3190fa8233e62d4d3d
parente1334b120ebfa74cf95eeb523c5b8ff04a5d8dfe (diff)
downloadpoky-a2b8fec2891420f83031769de362c47a3cc88280.tar.gz
selftest: runqemu: respect IMAGE_LINK_NAME
* don't assume that every built image is named: <recipe>-<machine>.<suffix> [YOCTO #12937] (From OE-Core rev: d3c1c983d062f0731610f4a6984126ec6dab8caf) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index c2c3fbc924..e72ff529c4 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -24,6 +24,7 @@ class RunqemuTests(OESelftestTestCase):
24 super(RunqemuTests, self).setUpLocal() 24 super(RunqemuTests, self).setUpLocal()
25 self.recipe = 'core-image-minimal' 25 self.recipe = 'core-image-minimal'
26 self.machine = self.td['MACHINE'] 26 self.machine = self.td['MACHINE']
27 self.image_link_name = get_bb_var('IMAGE_LINK_NAME', self.recipe)
27 28
28 self.fstypes = "ext4" 29 self.fstypes = "ext4"
29 if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): 30 if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'):
@@ -127,7 +128,7 @@ SYSLINUX_TIMEOUT = "10"
127 128
128 def test_boot_qemu_boot(self): 129 def test_boot_qemu_boot(self):
129 """Test runqemu /path/to/image.qemuboot.conf""" 130 """Test runqemu /path/to/image.qemuboot.conf"""
130 qemuboot_conf = "%s-%s.qemuboot.conf" % (self.recipe, self.machine) 131 qemuboot_conf = "%s.qemuboot.conf" % (self.image_link_name)
131 qemuboot_conf = os.path.join(self.deploy_dir_image, qemuboot_conf) 132 qemuboot_conf = os.path.join(self.deploy_dir_image, qemuboot_conf)
132 if not os.path.exists(qemuboot_conf): 133 if not os.path.exists(qemuboot_conf):
133 self.skipTest("%s not found" % qemuboot_conf) 134 self.skipTest("%s not found" % qemuboot_conf)
@@ -138,7 +139,7 @@ SYSLINUX_TIMEOUT = "10"
138 139
139 def test_boot_rootfs(self): 140 def test_boot_rootfs(self):
140 """Test runqemu /path/to/rootfs.ext4""" 141 """Test runqemu /path/to/rootfs.ext4"""
141 rootfs = "%s-%s.ext4" % (self.recipe, self.machine) 142 rootfs = "%s.ext4" % (self.image_link_name)
142 rootfs = os.path.join(self.deploy_dir_image, rootfs) 143 rootfs = os.path.join(self.deploy_dir_image, rootfs)
143 if not os.path.exists(rootfs): 144 if not os.path.exists(rootfs):
144 self.skipTest("%s not found" % rootfs) 145 self.skipTest("%s not found" % rootfs)
@@ -167,8 +168,9 @@ class QemuTest(OESelftestTestCase):
167 cls.recipe = 'core-image-minimal' 168 cls.recipe = 'core-image-minimal'
168 cls.machine = get_bb_var('MACHINE') 169 cls.machine = get_bb_var('MACHINE')
169 cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') 170 cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
171 cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe)
170 cls.cmd_common = "runqemu nographic" 172 cls.cmd_common = "runqemu nographic"
171 cls.qemuboot_conf = "%s-%s.qemuboot.conf" % (cls.recipe, cls.machine) 173 cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name)
172 cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) 174 cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf)
173 bitbake(cls.recipe) 175 bitbake(cls.recipe)
174 176
@@ -200,7 +202,7 @@ class QemuTest(OESelftestTestCase):
200 self.assertTrue(qemu_shutdown_succeeded, 'Failed: %s does not shutdown within timeout(%s)' % (self.machine, shutdown_timeout)) 202 self.assertTrue(qemu_shutdown_succeeded, 'Failed: %s does not shutdown within timeout(%s)' % (self.machine, shutdown_timeout))
201 203
202 def test_qemu_can_boot_nfs_and_shutdown(self): 204 def test_qemu_can_boot_nfs_and_shutdown(self):
203 rootfs_tar = "%s-%s.tar.bz2" % (self.recipe, self.machine) 205 rootfs_tar = "%s.tar.bz2" % (self.image_link_name)
204 rootfs_tar = os.path.join(self.deploy_dir_image, rootfs_tar) 206 rootfs_tar = os.path.join(self.deploy_dir_image, rootfs_tar)
205 self.assertExists(rootfs_tar) 207 self.assertExists(rootfs_tar)
206 cmd = "%s %s" % (self.cmd_common, rootfs_tar) 208 cmd = "%s %s" % (self.cmd_common, rootfs_tar)