summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-02 18:00:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-06 07:41:42 +0100
commit511d0072481e43109d842a49d62b413f838dae14 (patch)
treec6e9bc129e9a488e6d846d25894b78b2341197bc
parent9a106486ad7900924a87c5869702903204a35b54 (diff)
downloadpoky-511d0072481e43109d842a49d62b413f838dae14.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. (From OE-Core rev: 6f9200cc30d50888b9b63103824880abaf8b5eea) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py8
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):
1359 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) 1359 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image)
1360 image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME']) 1360 image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME'])
1361 1361
1362 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
1363
1362 # Image is created 1364 # Image is created
1363 self.assertTrue(os.path.exists(image_path), "image file %s doesn't exist" % image_path) 1365 self.assertTrue(os.path.exists(image_path), "image file %s doesn't exist" % image_path)
1364 1366
1365 # Check the names of the three partitions 1367 # Check the names of the three partitions
1366 # as listed in test_gpt_partition_name.wks 1368 # as listed in test_gpt_partition_name.wks
1367 result = runCmd("sfdisk --part-label %s 1" % image_path) 1369 result = runCmd("%s/usr/sbin/sfdisk --part-label %s 1" % (sysroot, image_path))
1368 self.assertEqual('boot-A', result.output) 1370 self.assertEqual('boot-A', result.output)
1369 result = runCmd("sfdisk --part-label %s 2" % image_path) 1371 result = runCmd("%s/usr/sbin/sfdisk --part-label %s 2" % (sysroot, image_path))
1370 self.assertEqual('root-A', result.output) 1372 self.assertEqual('root-A', result.output)
1371 # When the --part-name is not defined, the partition name is equal to the --label 1373 # When the --part-name is not defined, the partition name is equal to the --label
1372 result = runCmd("sfdisk --part-label %s 3" % image_path) 1374 result = runCmd("%s/usr/sbin/sfdisk --part-label %s 3" % (sysroot, image_path))
1373 self.assertEqual('ext-space', result.output) 1375 self.assertEqual('ext-space', result.output)
1374 1376
1375class ModifyTests(WicTestCase): 1377class ModifyTests(WicTestCase):