diff options
| author | Armin Kuster <akuster808@gmail.com> | 2019-03-28 16:49:23 -0700 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2019-03-29 08:28:49 -0700 |
| commit | fe0e799624604c5a9c6408aeb0a492d76d58e674 (patch) | |
| tree | 911328ec42009213e66e9ce8d5eee792e05a9e44 | |
| parent | f11dbe0d6deed88e9a041bf4974431ba008eca82 (diff) | |
| download | meta-security-fe0e799624604c5a9c6408aeb0a492d76d58e674.tar.gz | |
sssd: Add basic runtime test
This does some basic testing and checks.
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | lib/oeqa/runtime/cases/sssd.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/oeqa/runtime/cases/sssd.py b/lib/oeqa/runtime/cases/sssd.py new file mode 100644 index 0000000..4644836 --- /dev/null +++ b/lib/oeqa/runtime/cases/sssd.py | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | # Copyright (C) 2019 Armin Kuster <akuster808@gmail.com> | ||
| 2 | # | ||
| 3 | import re | ||
| 4 | |||
| 5 | from oeqa.runtime.case import OERuntimeTestCase | ||
| 6 | from oeqa.core.decorator.depends import OETestDepends | ||
| 7 | from oeqa.runtime.decorator.package import OEHasPackage | ||
| 8 | |||
| 9 | |||
| 10 | class SSSDTest(OERuntimeTestCase): | ||
| 11 | |||
| 12 | @OEHasPackage(['sssd']) | ||
| 13 | @OETestDepends(['ssh.SSHTest.test_ssh']) | ||
| 14 | def test_sssd_help(self): | ||
| 15 | status, output = self.target.run('sssctl --help') | ||
| 16 | msg = ('sssctl command does not work as expected. ' | ||
| 17 | 'Status and output:%s and %s' % (status, output)) | ||
| 18 | self.assertEqual(status, 1, msg = msg) | ||
| 19 | |||
| 20 | @OETestDepends(['sssd.SSSDTest.test_sssd_help']) | ||
| 21 | def test_sssd_sssctl_conf_perms_chk(self): | ||
| 22 | status, output = self.target.run('sssctl domain-status') | ||
| 23 | match = re.search('ConfDB initialization has failed', output) | ||
| 24 | if match: | ||
| 25 | msg = ('sssctl domain-status failed, check sssd.conf perms. ' | ||
| 26 | 'Status and output:%s and %s' % (status, output)) | ||
| 27 | self.assertEqual(status, 0, msg = msg) | ||
| 28 | |||
| 29 | @OETestDepends(['sssd.SSSDTest.test_sssd_sssctl_conf_perms_chk']) | ||
| 30 | def test_sssd_sssctl_deamon(self): | ||
| 31 | status, output = self.target.run('sssctl domain-status') | ||
| 32 | match = re.search('No domains configured, fatal error!', output) | ||
| 33 | if match: | ||
| 34 | msg = ('sssctl domain-status failed, sssd.conf not setup correctly. ' | ||
| 35 | 'Status and output:%s and %s' % (status, output)) | ||
| 36 | self.assertEqual(status, 0, msg = msg) | ||
| 37 | |||
