Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | from oeqa.runtime.case import OERuntimeTestCase |
| 6 | from oeqa.core.decorator.depends import OETestDepends |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | from oeqa.core.decorator.data import skipIfNotInDataVar |
| 8 | |
| 9 | class X32libTest(OERuntimeTestCase): |
| 10 | |
| 11 | @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32', |
| 12 | 'DEFAULTTUNE is not set to x86-64-x32') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
| 14 | def test_x32_file(self): |
| 15 | cmd = 'readelf -h /bin/ls | grep Class | grep ELF32' |
| 16 | status1 = self.target.run(cmd)[0] |
| 17 | cmd = 'readelf -h /bin/ls | grep Machine | grep X86-64' |
| 18 | status2 = self.target.run(cmd)[0] |
| 19 | msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % |
| 20 | self.target.run("readelf -h /bin/ls")[1]) |
| 21 | self.assertTrue(status1 == 0 and status2 == 0, msg=msg) |