blob: 5bde1845d9c6bc7d5bc6dddf3ddca39b744d9114 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001from oeqa.runtime.case import OERuntimeTestCase
2from oeqa.core.decorator.depends import OETestDepends
3from oeqa.core.decorator.oeid import OETestID
4from oeqa.core.decorator.data import skipIfNotFeature
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006
7class LddTest(OERuntimeTestCase):
8
9 @OETestID(962)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010 @OEHasPackage(["ldd"])
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012 def test_ldd(self):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 status, output = self.target.run('which ldd')
14 msg = 'ldd does not exist in PATH: which ldd: %s' % output
15 self.assertEqual(status, 0, msg=msg)
16
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 cmd = ('for i in $(which ldd | xargs cat | grep "^RTLDLIST"| '
18 'cut -d\'=\' -f2|tr -d \'"\'); '
19 'do test -f $i && echo $i && break; done')
20 status, output = self.target.run(cmd)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021 self.assertEqual(status, 0, msg="ldd path not correct or RTLDLIST files don't exist.")
22
23 status, output = self.target.run("ldd /bin/true")
24 self.assertEqual(status, 0, msg="ldd failed to execute: %s" % output)