diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2015-09-15 22:41:29 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2015-09-15 22:41:29 +0300 |
commit | 21f9b84b4b729fbd7acbd465e7a3f726e4d20f91 (patch) | |
tree | eb2d091d427ca0813b445509d59cc8e27e8ad25f /yocto-poky/meta/lib/oeqa/runtime/multilib.py | |
parent | 101cef31e2bf54c678501155cd2106251acbd076 (diff) | |
parent | c124f4f2e04dca16a428a76c89677328bc7bf908 (diff) | |
download | openbmc-21f9b84b4b729fbd7acbd465e7a3f726e4d20f91.tar.xz |
Merge commit 'c124f4f2e04dca16a428a76c89677328bc7bf908' as 'yocto-poky'
Diffstat (limited to 'yocto-poky/meta/lib/oeqa/runtime/multilib.py')
-rw-r--r-- | yocto-poky/meta/lib/oeqa/runtime/multilib.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/yocto-poky/meta/lib/oeqa/runtime/multilib.py b/yocto-poky/meta/lib/oeqa/runtime/multilib.py new file mode 100644 index 000000000..e1bcc428f --- /dev/null +++ b/yocto-poky/meta/lib/oeqa/runtime/multilib.py @@ -0,0 +1,48 @@ +import unittest +from oeqa.oetest import oeRuntimeTest, skipModule +from oeqa.utils.decorators import * + +def setUpModule(): + multilibs = oeRuntimeTest.tc.d.getVar("MULTILIBS", True) or "" + if "multilib:lib32" not in multilibs: + skipModule("this isn't a multilib:lib32 image") + + +class MultilibTest(oeRuntimeTest): + + def parse(self, s): + """ + Parse the output of readelf -h and return the binary class, or fail. + """ + l = [l.split()[1] for l in s.split('\n') if "Class:" in l] + if l: + return l[0] + else: + self.fail("Cannot parse readelf output\n" + s) + + @skipUnlessPassed('test_ssh') + def test_check_multilib_libc(self): + """ + Check that a multilib image has both 32-bit and 64-bit libc in. + """ + + (status, output) = self.target.run("readelf -h /lib/libc.so.6") + self.assertEqual(status, 0, "Failed to readelf /lib/libc.so.6") + class32 = self.parse(output) + + (status, output) = self.target.run("readelf -h /lib64/libc.so.6") + self.assertEqual(status, 0, "Failed to readelf /lib64/libc.so.6") + class64 = self.parse(output) + + self.assertEqual(class32, "ELF32", msg="/lib/libc.so.6 isn't ELF32 (is %s)" % class32) + self.assertEqual(class64, "ELF64", msg="/lib64/libc.so.6 isn't ELF64 (is %s)" % class64) + + @testcase('279') + @skipUnlessPassed('test_check_multilib_libc') + def test_file_connman(self): + self.assertTrue(oeRuntimeTest.hasPackage('lib32-connman-gnome'), msg="This test assumes lib32-connman-gnome is installed") + + (status, output) = self.target.run("readelf -h /usr/bin/connman-applet") + self.assertEqual(status, 0, "Failed to readelf /usr/bin/connman-applet") + theclass = self.parse(output) + self.assertEqual(theclass, "ELF32", msg="connman-applet isn't ELF32 (is %s)" % theclass) |