#
# 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"""
"""Start sssd and add teardown for stopping it and removing state"""
raise Exception("sssd start failed")
def teardown():
try:
except:
pass
[sssd]
domains = LOCAL
services = nss
[nss]
memcache_timeout = 0
id_provider = local
min_id = 10000
max_id = 20000
return None
[sssd]
domains = LOCAL
services = nss
[nss]
memcache_timeout = 0
id_provider = local
min_id = 10000
max_id = 20000
use_fully_qualified_names = True
return None
"""
Regression test for ticket
"""
# The user's mpg has to be found (should return 0)
"""
Regression test for ticket (fq variant)
"""
# The user's mpg has to be found (should return 0)
"""
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",
"""
Regression test for tickets
"""
"This should not raise KeyError"
"sss_grupshow should return 0 with existing group name"
assert_nonexistent_group("foo@LOCAL")
"""
Regression test for ticket
"""
["sss_groupadd", "-g", "10009", "group10009@LOCAL"])
["sss_useradd", "-u", "10009", "-M", "user10009@LOCAL"])
["sss_usermod", "-a", "group10009@LOCAL", "user10009@LOCAL"])
"group10009@LOCAL",
"""
Regression test for tickets
"""
["sss_groupadd", "-g", "10009", "group_child@LOCAL"])
["sss_useradd", "-u", "10009", "-M", "user_child@LOCAL"])
["sss_usermod", "-a", "group_child@LOCAL", "user_child@LOCAL"])
["sss_groupadd", "-g", "10008", "group_parent@LOCAL"])
["sss_groupmod", "-a", "group_parent@LOCAL", "group_child@LOCAL"])
# User from child_group is member of parent_group, so child_group's
# member must be also parent_group's member
"group_parent@LOCAL",