pam.py 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. # This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase
  2. # Note that the image under test must have "pam" in DISTRO_FEATURES
  3. from oeqa.runtime.case import OERuntimeTestCase
  4. from oeqa.core.decorator.depends import OETestDepends
  5. from oeqa.core.decorator.data import skipIfNotFeature
  6. class PamBasicTest(OERuntimeTestCase):
  7. @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES')
  8. @OETestDepends(['ssh.SSHTest.test_ssh'])
  9. def test_pam(self):
  10. status, output = self.target.run('login --help')
  11. msg = ('login command does not work as expected. '
  12. 'Status and output:%s and %s' % (status, output))
  13. self.assertEqual(status, 1, msg = msg)
  14. status, output = self.target.run('passwd --help')
  15. msg = ('passwd command does not work as expected. '
  16. 'Status and output:%s and %s' % (status, output))
  17. self.assertEqual(status, 0, msg = msg)
  18. status, output = self.target.run('su --help')
  19. msg = ('su command does not work as expected. '
  20. 'Status and output:%s and %s' % (status, output))
  21. self.assertEqual(status, 0, msg = msg)
  22. status, output = self.target.run('useradd --help')
  23. msg = ('useradd command does not work as expected. '
  24. 'Status and output:%s and %s' % (status, output))
  25. self.assertEqual(status, 0, msg = msg)