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 skipIfNotFeature |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | from oeqa.runtime.decorator.package import OEHasPackage |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | |
| 10 | class LddTest(OERuntimeTestCase): |
| 11 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 12 | @OEHasPackage(["ldd"]) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 14 | def test_ldd(self): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 23 | 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) |