diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/x32lib.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/meta/lib/oeqa/runtime/cases/x32lib.py b/meta/lib/oeqa/runtime/cases/x32lib.py index ddf220140e..f419c8f181 100644 --- a/meta/lib/oeqa/runtime/cases/x32lib.py +++ b/meta/lib/oeqa/runtime/cases/x32lib.py | |||
@@ -6,16 +6,21 @@ from oeqa.runtime.case import OERuntimeTestCase | |||
6 | from oeqa.core.decorator.depends import OETestDepends | 6 | from oeqa.core.decorator.depends import OETestDepends |
7 | from oeqa.core.decorator.data import skipIfNotInDataVar | 7 | from oeqa.core.decorator.data import skipIfNotInDataVar |
8 | 8 | ||
9 | import subprocess | ||
10 | |||
9 | class X32libTest(OERuntimeTestCase): | 11 | class X32libTest(OERuntimeTestCase): |
10 | 12 | ||
11 | @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32', | 13 | @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32', |
12 | 'DEFAULTTUNE is not set to x86-64-x32') | 14 | 'DEFAULTTUNE is not set to x86-64-x32') |
13 | @OETestDepends(['ssh.SSHTest.test_ssh']) | 15 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
14 | def test_x32_file(self): | 16 | def test_x32_file(self): |
15 | cmd = 'readelf -h /bin/ls | grep Class | grep ELF32' | 17 | dest = self.td.get('T', '') + "/ls.x32test" |
16 | status1 = self.target.run(cmd)[0] | 18 | self.target.copyFrom("/bin/ls", dest) |
17 | cmd = 'readelf -h /bin/ls | grep Machine | grep X86-64' | 19 | cmd = 'readelf -h {} | grep Class | grep ELF32'.format(dest) |
18 | status2 = self.target.run(cmd)[0] | 20 | status1 = subprocess.call(cmd, shell=True) |
19 | msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % | 21 | cmd = 'readelf -h {} | grep Machine | grep X86-64'.format(dest) |
20 | self.target.run("readelf -h /bin/ls")[1]) | 22 | status2 = subprocess.call(cmd, shell=True) |
23 | msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says:\n{}".format( | ||
24 | subprocess.check_output("readelf -h {}".format(dest), shell=True).decode())) | ||
25 | os.remove(dest) | ||
21 | self.assertTrue(status1 == 0 and status2 == 0, msg=msg) | 26 | self.assertTrue(status1 == 0 and status2 == 0, msg=msg) |