diff options
author | Ross Burton <ross.burton@intel.com> | 2015-08-29 00:43:13 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-29 13:38:05 +0100 |
commit | 013f762327bd1477ad4550f4728683f90a340844 (patch) | |
tree | 21645fb603a8040231e359c05ae86587746022b1 /meta/lib | |
parent | f44e043c752470b1ed4d22f3732dc0b362f83fd9 (diff) | |
download | poky-013f762327bd1477ad4550f4728683f90a340844.tar.gz |
oeqa/runtime/multilib: fix and improve multilib test
Replace the previous shell magic with a Python function to parse the readelf
output, and fix the package names to include the lib32- prefix.
[ YOCTO #8219 ]
(From OE-Core rev: c51d24710b48eb3930edb8c661100705c6203e78)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/runtime/multilib.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/multilib.py b/meta/lib/oeqa/runtime/multilib.py index ab0a6ccd69..1c1729b84d 100644 --- a/meta/lib/oeqa/runtime/multilib.py +++ b/meta/lib/oeqa/runtime/multilib.py | |||
@@ -10,9 +10,22 @@ def setUpModule(): | |||
10 | 10 | ||
11 | class MultilibTest(oeRuntimeTest): | 11 | class MultilibTest(oeRuntimeTest): |
12 | 12 | ||
13 | def parse(self, s): | ||
14 | """ | ||
15 | Parse the output of readelf -h and return the binary class, or fail. | ||
16 | """ | ||
17 | l = [l.split()[1] for l in s.split('\n') if "Class:" in l] | ||
18 | if l: | ||
19 | return l[0] | ||
20 | else: | ||
21 | self.fail("Cannot parse readelf output\n" + s) | ||
22 | |||
13 | @testcase('279') | 23 | @testcase('279') |
14 | @skipUnlessPassed('test_ssh') | 24 | @skipUnlessPassed('test_ssh') |
15 | def test_file_connman(self): | 25 | def test_file_connman(self): |
16 | self.assertTrue(oeRuntimeTest.hasPackage('connman-gnome'), msg="This test assumes connman-gnome is installed") | 26 | self.assertTrue(oeRuntimeTest.hasPackage('lib32-connman-gnome'), msg="This test assumes lib32-connman-gnome is installed") |
17 | (status, output) = self.target.run("readelf -h /usr/bin/connman-applet | sed -n '3p' | awk '{print $2}'") | 27 | |
18 | self.assertEqual(output, "ELF32", msg="connman-applet isn't an ELF32 binary. readelf says: %s" % self.target.run("readelf -h /usr/bin/connman-applet")[1]) | 28 | (status, output) = self.target.run("readelf -h /usr/bin/connman-applet") |
29 | self.assertEqual(status, 0, "Failed to readelf /usr/bin/connman-applet") | ||
30 | theclass = self.parse(output) | ||
31 | self.assertEqual(theclass, "ELF32", msg="connman-applet isn't ELF32 (is %s)" % theclass) | ||