[OE-core] [PATCH 1/1] pkgdata: fix test_find_path to consider multilib

ChenQi Qi.Chen at windriver.com
Tue Jun 18 02:19:21 UTC 2019


On 06/17/2019 11:51 PM, Richard Purdie wrote:
> On Mon, 2019-06-17 at 16:32 +0800, Chen Qi wrote:
>> 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.
>>
>> Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
>> ---
>>   meta/lib/oeqa/selftest/cases/pkgdata.py | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/meta/lib/oeqa/selftest/cases/pkgdata.py b/meta/lib/oeqa/selftest/cases/pkgdata.py
>> index 833a180..2bd15eb 100644
>> --- a/meta/lib/oeqa/selftest/cases/pkgdata.py
>> +++ b/meta/lib/oeqa/selftest/cases/pkgdata.py
>> @@ -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')
> 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
>
>
>

Got it, Thanks.

Best Regards,
Chen Qi


More information about the Openembedded-core mailing list