diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-02 18:00:46 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-06 07:41:03 +0100 |
commit | 6f9200cc30d50888b9b63103824880abaf8b5eea (patch) | |
tree | 65a5ebe7602178fc6b7df613c5662f76c943006f | |
parent | c2dd2c13ff26c3f046e35a2f6b8afeb099ef422a (diff) | |
download | openembedded-core-contrib-6f9200cc30d50888b9b63103824880abaf8b5eea.tar.gz |
oeqa/selftest/wic: Fix host contamination issue
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>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index d479343773..a3c6deb5aa 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -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): |