blob: f6841c66753f63f94283c598ecab63c312b1d40c [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
Patrick Williams92b42cb2022-09-03 06:53:57 -05002# Copyright OpenEmbedded Contributors
3#
Brad Bishopc342db32019-05-15 21:57:59 -04004# SPDX-License-Identifier: MIT
5#
6
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007from oeqa.runtime.case import OERuntimeTestCase
8from oeqa.core.decorator.depends import OETestDepends
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009from oeqa.core.decorator.data import skipIfNotFeature
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080010from oeqa.runtime.decorator.package import OEHasPackage
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011
12class LddTest(OERuntimeTestCase):
13
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014 @OEHasPackage(["ldd"])
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015 @OETestDepends(['ssh.SSHTest.test_ssh'])
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080016 def test_ldd(self):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 status, output = self.target.run('which ldd')
18 msg = 'ldd does not exist in PATH: which ldd: %s' % output
19 self.assertEqual(status, 0, msg=msg)
20
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021 cmd = ('for i in $(which ldd | xargs cat | grep "^RTLDLIST"| '
22 'cut -d\'=\' -f2|tr -d \'"\'); '
23 'do test -f $i && echo $i && break; done')
24 status, output = self.target.run(cmd)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025 self.assertEqual(status, 0, msg="ldd path not correct or RTLDLIST files don't exist.")
26
27 status, output = self.target.run("ldd /bin/true")
28 self.assertEqual(status, 0, msg="ldd failed to execute: %s" % output)