Files
poky/meta/lib/oeqa/runtime/pam.py
Lucian Musat 984f03457a oeqa/runtime: Added skipModule import for test modules that use it.
The modules that use skipModule should import it themselves and not rely on somebody else to import it.

(From OE-Core rev: 6a14db407d471e717f41342ac0700e6a383c32c3)

Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 15:34:00 +01:00

25 lines
1.2 KiB
Python

# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase
# Note that the image under test must have "pam" in DISTRO_FEATURES
import unittest
from oeqa.oetest import oeRuntimeTest, skipModule
from oeqa.utils.decorators import *
def setUpModule():
if not oeRuntimeTest.hasFeature("pam"):
skipModule("target doesn't have 'pam' in DISTRO_FEATURES")
class PamBasicTest(oeRuntimeTest):
@skipUnlessPassed('test_ssh')
def test_pam(self):
(status, output) = self.target.run('login --help')
self.assertEqual(status, 1, msg = "login command does not work as expected. Status and output:%s and %s" %(status, output))
(status, output) = self.target.run('passwd --help')
self.assertEqual(status, 6, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
(status, output) = self.target.run('su --help')
self.assertEqual(status, 2, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
(status, output) = self.target.run('useradd --help')
self.assertEqual(status, 2, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))