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