ldd.py 1000 B

1234567891011121314151617181920212223242526
  1. #
  2. # SPDX-License-Identifier: MIT
  3. #
  4. from oeqa.runtime.case import OERuntimeTestCase
  5. from oeqa.core.decorator.depends import OETestDepends
  6. from oeqa.core.decorator.data import skipIfNotFeature
  7. from oeqa.runtime.decorator.package import OEHasPackage
  8. class LddTest(OERuntimeTestCase):
  9. @OEHasPackage(["ldd"])
  10. @OETestDepends(['ssh.SSHTest.test_ssh'])
  11. def test_ldd(self):
  12. status, output = self.target.run('which ldd')
  13. msg = 'ldd does not exist in PATH: which ldd: %s' % output
  14. self.assertEqual(status, 0, msg=msg)
  15. cmd = ('for i in $(which ldd | xargs cat | grep "^RTLDLIST"| '
  16. 'cut -d\'=\' -f2|tr -d \'"\'); '
  17. 'do test -f $i && echo $i && break; done')
  18. status, output = self.target.run(cmd)
  19. self.assertEqual(status, 0, msg="ldd path not correct or RTLDLIST files don't exist.")
  20. status, output = self.target.run("ldd /bin/true")
  21. self.assertEqual(status, 0, msg="ldd failed to execute: %s" % output)