pkgdata: fix test_find_path to consider multilib
cover pkgdata: fix test_find_path to consider multilib
*** BLURB HERE ***
The following changes since commit 27d60c5a812774f0e5c43161e5b514c4aebdf301:
gstreamer1.0-libav: disable API documentation (2019-06-15 13:46:38 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/oeqa-pkgdata
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/oeqa-pkgdata
Chen Qi (1):
pkgdata: fix test_find_path to consider multilib
meta/lib/oeqa/selftest/cases/pkgdata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/1 pkgdata: fix test_find_path to consider multilib
Fix test_find_path test case to take into consideration of multilib being enabled. After this change, no matter multilib is enabled or not, the test case should pass.
--- meta/lib/oeqa/selftest/cases/pkgdata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
meta/lib/oeqa/selftest/cases/pkgdata.py +4 -3
@@ -47,10 +47,11 @@ class OePkgdataUtilTests(OESelftestTestCase): self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output) def test_find_path(self): - result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1') - self.assertEqual(result.output, 'zlib: /lib/libz.so.1') + base_libdir = get_bb_var('base_libdir') + result = runCmd('oe-pkgdata-util find-path %s/libz.so.1' % base_libdir) + self.assertEqual(result.output, 'zlib: %s/libz.so.1' % base_libdir) result = runCmd('oe-pkgdata-util find-path /usr/bin/m4') - self.assertEqual(result.output, 'm4: /usr/bin/m4') + self.assertTrue('m4: /usr/bin/m4' in result.output) result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True) self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
Signature · 1 line
1.9.1
Quoted 18 lines · Chen Qi
Fix
test_find_pathtest case to take into consideration of multilib being enabled. After this change, no matter multilib is enabled or not, the test case should pass.Signed-off-by Chen Qi <[email protected]>--- meta/lib/oeqa/selftest/cases/pkgdata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)meta/lib/oeqa/selftest/cases/pkgdata.py +0
-1@@ -47,10 +47,11 @@ class OePkgdataUtilTests(OESelftestTestCase): self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output) def test_find_path(self): - result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1')
meta/lib/oeqa/selftest/cases/pkgdata.py class OePkgdataUtilTests(OESelftestTestCase): · line 57
Quoted 10 lines
meta/lib/oeqa/selftest/cases/pkgdata.py +4
-2- self.assertEqual(result.output, 'zlib: /lib/libz.so.1') + base_libdir = get_bb_var('base_libdir') + result = runCmd('oe-pkgdata-util find-path %s/libz.so.1' % base_libdir) + self.assertEqual(result.output, 'zlib: %s/libz.so.1' % base_libdir) result = runCmd('oe-pkgdata-util find-path /usr/bin/m4') - self.assertEqual(result.output, 'm4: /usr/bin/m4') + self.assertTrue('m4: /usr/bin/m4' in result.output) result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True) self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
For selftest we really want a "known" configuration so I'm not sure we want to go down this route as there are a lot of configurations which could confuse the test results.
It would probably be better to have selftest only build a clean config and accept a limited number of variables. The parallel execution code did go a long way to getting us to the point where it would do that.
Cheers,
Richard
Quoted 33 lines · Richard Purdie
Quoted 18 lines · Chen Qi
Fix
test_find_pathtest case to take into consideration of multilib being enabled. After this change, no matter multilib is enabled or not, the test case should pass.Signed-off-by Chen Qi <[email protected]>--- meta/lib/oeqa/selftest/cases/pkgdata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)meta/lib/oeqa/selftest/cases/pkgdata.py +0
-1@@ -47,10 +47,11 @@ class OePkgdataUtilTests(OESelftestTestCase): self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output) def test_find_path(self): - result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1')meta/lib/oeqa/selftest/cases/pkgdata.py class OePkgdataUtilTests(OESelftestTestCase): · line 57
Quoted 10 lines
meta/lib/oeqa/selftest/cases/pkgdata.py +4
-2- self.assertEqual(result.output, 'zlib: /lib/libz.so.1') + base_libdir = get_bb_var('base_libdir') + result = runCmd('oe-pkgdata-util find-path %s/libz.so.1' % base_libdir) + self.assertEqual(result.output, 'zlib: %s/libz.so.1' % base_libdir) result = runCmd('oe-pkgdata-util find-path /usr/bin/m4') - self.assertEqual(result.output, 'm4: /usr/bin/m4') + self.assertTrue('m4: /usr/bin/m4' in result.output) result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True) self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')For selftest we really want a "known" configuration so I'm not sure we want to go down this route as there are a lot of configurations which could confuse the test results.
Quoted 10 lines
It would probably be better to have selftest only build a clean config and accept a limited number of variables. The parallel execution code did go a long way to getting us to the point where it would do that.
Cheers,
Richard
Got it, Thanks.
Best Regards,
Chen Qi