Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | from oeqa.runtime.case import OERuntimeTestCase |
| 2 | from oeqa.core.decorator.depends import OETestDepends |
| 3 | from oeqa.core.decorator.oeid import OETestID |
| 4 | from oeqa.core.decorator.data import skipIfNotFeature |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | from oeqa.runtime.decorator.package import OEHasPackage |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 6 | |
| 7 | class LddTest(OERuntimeTestCase): |
| 8 | |
| 9 | @OETestID(962) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | @OEHasPackage(["ldd"]) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 12 | def test_ldd(self): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 17 | 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 21 | 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) |