blob: 1dfdb949bf9eb3afd6175e1f4c2327a6dcf4a9d8 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001# Copyright (C) 2019 Armin Kuster <akuster808@gmail.com>
2#
3import re
4
5from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
7from oeqa.runtime.decorator.package import OEHasPackage
8
9
10class 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):
Andrew Geissler615f2f12022-07-15 14:00:58 -050031 status, output = self.target.run('sssctl domain-list')
Brad Bishop19323692019-04-05 15:28:33 -040032 match = re.search('No domains configured, fatal error!', output)
33 if match:
Andrew Geissler615f2f12022-07-15 14:00:58 -050034 msg = ('sssctl domain-list failed, sssd.conf not setup correctly. '
Brad Bishop19323692019-04-05 15:28:33 -040035 'Status and output:%s and %s' % (status, output))
36 self.assertEqual(status, 0, msg = msg)
37