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