test_local_domain.py revision 7fa4964d84f41bd80a6d971ffaeef87a7c2f19be
#
# SSSD LOCAL domain tests
#
# Copyright (c) 2015 Red Hat, Inc.
# Author: Michal Zidek <mzidek@redhat.com>
#
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
import stat
import pwd
import grp
import time
import config
import signal
import subprocess
import pytest
import ent
def stop_sssd():
while True:
try:
except:
break
"""Generate sssd.conf and add teardown for removing it"""
def create_sssd_fixture(request):
"""Start sssd and add teardown for stopping it and removing state"""
raise Exception("sssd start failed")
def teardown():
try:
except:
pass
def local_domain_only(request):
[sssd]
domains = LOCAL
services = nss
[nss]
memcache_timeout = 0
id_provider = local
min_id = 10000
max_id = 20000
return None
def assert_nonexistent_user(name):
def assert_nonexistent_group(name):
"""
Regression test for ticket
"""
# Change the LC_ALL variable to nonexistent locale
# sss_userdel must remove the user despite wrong LC_ALL
assert_nonexistent_user("foo")
"""
Regression test for tickets
"""
"This should not raise KeyError"
"sss_grupshow should return 0 with existing group name"
assert_nonexistent_group("foo")
"""
Regression test for ticket
"""
"group10009",
"""
Regression test for tickets
"""
["sss_groupmod", "-a", "group_parent", "group_child"])
# User from child_group is member of parent_group, so child_group's
# member must be also parent_group's member
"group_parent",