blob: 271a1943e301e04331a9900d03d54544a1e1162d [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005# 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
8from oeqa.runtime.case import OERuntimeTestCase
9from oeqa.core.decorator.depends import OETestDepends
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010from oeqa.core.decorator.data import skipIfNotFeature
11
12class PamBasicTest(OERuntimeTestCase):
13
Brad Bishop6e60e8b2018-02-01 10:27:11 -050014 @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES')
15 @OETestDepends(['ssh.SSHTest.test_ssh'])
16 def test_pam(self):
17 status, output = self.target.run('login --help')
18 msg = ('login command does not work as expected. '
19 'Status and output:%s and %s' % (status, output))
20 self.assertEqual(status, 1, msg = msg)
21
22 status, output = self.target.run('passwd --help')
23 msg = ('passwd command does not work as expected. '
24 'Status and output:%s and %s' % (status, output))
25 self.assertEqual(status, 0, msg = msg)
26
27 status, output = self.target.run('su --help')
28 msg = ('su 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('useradd --help')
33 msg = ('useradd command does not work as expected. '
34 'Status and output:%s and %s' % (status, output))
35 self.assertEqual(status, 0, msg = msg)