pam.py 1.4 KB

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