b4633e73067d7bf3b0dbaf212569c123de88f306 |
|
10-Aug-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
intg: Allow to test netgroups
sh-4.2# getent netgroup -s sss QAUsers
QAUsers ( ,qa1,example.com) ( ,qa2,example.com) ( ,qa3,example.com)
sh-4.2# getent netgroup -s sss QASystems
QASystems (qahost1.example.com,,) (qahost2.lab.eng.pnq.redhat.com,,)
sh-4.2# getent netgroup -s sss test
sh-4.2# echo $?
2
sh-4.2# python
Python 2.7.5 (default, Aug 2 2016, 04:20:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sssd_netgroup
>>> sssd_netgroup.get_sssd_netgroups('QAUsers')
(1, 0, [(None, 'qa1', 'example.com'), (None, 'qa2', 'example.com'), (None, 'qa3', 'example.com')])
>>> sssd_netgroup.get_sssd_netgroups('QASystems')
(1, 0, [('qahost1.example.com', None, None), ('qahost2.lab.eng.pnq.redhat.com', None, None)])
>>> sssd_netgroup.get_sssd_netgroups('test')
(0, 0, [])
>>>
Reviewed-by: Petr Čech <pcech@redhat.com> |