]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest/wic: Fix host contamination issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 2 Jun 2023 17:00:46 +0000 (18:00 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Jun 2023 06:41:03 +0000 (07:41 +0100)
If wic.Wic2.test_gpt_partition_name is run on a system without sfdisk, the test
will currently fail. As done in another test, it needs to use sfdisk from the
wic-tools sysroot. This patch fixes that host contamination issue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/wic.py

index d4793437735d90ebba694de75f3b21847cd9f13d..a3c6deb5aa32e0e4ef235cbe29a4a7883f5110cf 100644 (file)
@@ -1359,17 +1359,19 @@ class Wic2(WicTestCase):
         bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image)
         image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME'])
 
+        sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
         # Image is created
         self.assertTrue(os.path.exists(image_path), "image file %s doesn't exist" % image_path)
 
         # Check the names of the three partitions
         # as listed in test_gpt_partition_name.wks
-        result = runCmd("sfdisk --part-label %s 1" % image_path)
+        result = runCmd("%s/usr/sbin/sfdisk --part-label %s 1" % (sysroot, image_path))
         self.assertEqual('boot-A', result.output)
-        result = runCmd("sfdisk --part-label %s 2" % image_path)
+        result = runCmd("%s/usr/sbin/sfdisk --part-label %s 2" % (sysroot, image_path))
         self.assertEqual('root-A', result.output)
         # When the --part-name is not defined, the partition name is equal to the --label
-        result = runCmd("sfdisk --part-label %s 3" % image_path)
+        result = runCmd("%s/usr/sbin/sfdisk --part-label %s 3" % (sysroot, image_path))
         self.assertEqual('ext-space', result.output)
 
 class ModifyTests(WicTestCase):