Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | from oeqa.runtime.case import OERuntimeTestCase |
| 8 | from oeqa.core.decorator.depends import OETestDepends |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | from oeqa.core.decorator.data import skipIfNotFeature |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | from oeqa.runtime.decorator.package import OEHasPackage |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | |
| 12 | class LddTest(OERuntimeTestCase): |
| 13 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 14 | @OEHasPackage(["ldd"]) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 16 | def test_ldd(self): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 17 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 21 | 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 25 | 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) |