ldd.py 964 B

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