blob: 9c2caa8f65e079fcc8e15f21874babdebdf21b31 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007from oeqa.core.decorator.data import skipIfNotFeature
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009
10class LddTest(OERuntimeTestCase):
11
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012 @OEHasPackage(["ldd"])
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014 def test_ldd(self):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015 status, output = self.target.run('which ldd')
16 msg = 'ldd does not exist in PATH: which ldd: %s' % output
17 self.assertEqual(status, 0, msg=msg)
18
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 cmd = ('for i in $(which ldd | xargs cat | grep "^RTLDLIST"| '
20 'cut -d\'=\' -f2|tr -d \'"\'); '
21 'do test -f $i && echo $i && break; done')
22 status, output = self.target.run(cmd)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023 self.assertEqual(status, 0, msg="ldd path not correct or RTLDLIST files don't exist.")
24
25 status, output = self.target.run("ldd /bin/true")
26 self.assertEqual(status, 0, msg="ldd failed to execute: %s" % output)