Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | # This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase |
| 6 | # Note that the image under test must have "pam" in DISTRO_FEATURES |
| 7 | |
| 8 | from oeqa.runtime.case import OERuntimeTestCase |
| 9 | from oeqa.core.decorator.depends import OETestDepends |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | from oeqa.core.decorator.data import skipIfNotFeature |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 11 | from oeqa.runtime.decorator.package import OEHasPackage |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 12 | |
| 13 | class PamBasicTest(OERuntimeTestCase): |
| 14 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES') |
| 16 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 17 | @OEHasPackage(['shadow']) |
| 18 | @OEHasPackage(['shadow-base']) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | def test_pam(self): |
| 20 | status, output = self.target.run('login --help') |
| 21 | msg = ('login command does not work as expected. ' |
| 22 | 'Status and output:%s and %s' % (status, output)) |
| 23 | self.assertEqual(status, 1, msg = msg) |
| 24 | |
| 25 | status, output = self.target.run('passwd --help') |
| 26 | msg = ('passwd command does not work as expected. ' |
| 27 | 'Status and output:%s and %s' % (status, output)) |
| 28 | self.assertEqual(status, 0, msg = msg) |
| 29 | |
| 30 | status, output = self.target.run('su --help') |
| 31 | msg = ('su command does not work as expected. ' |
| 32 | 'Status and output:%s and %s' % (status, output)) |
| 33 | self.assertEqual(status, 0, msg = msg) |
| 34 | |
| 35 | status, output = self.target.run('useradd --help') |
| 36 | msg = ('useradd command does not work as expected. ' |
| 37 | 'Status and output:%s and %s' % (status, output)) |
| 38 | self.assertEqual(status, 0, msg = msg) |