1# 2# SPDX-License-Identifier: MIT 3# 4 5from oeqa.runtime.case import OERuntimeTestCase 6from oeqa.core.decorator.depends import OETestDepends 7from oeqa.core.decorator.data import skipIfNotInDataVar 8 9class X32libTest(OERuntimeTestCase): 10 11 @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32', 12 'DEFAULTTUNE is not set to x86-64-x32') 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) 22