test_local_domain.py revision 586f512ab8b6e5a03349598846141f43c1d505b8
#
# 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 time
import config
import signal
import subprocess
import pytest
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
# FIXME: Uncomment this when ticket #2726 is solved
# for path in os.listdir(config.MCACHE_PATH):
# os.unlink(config.MCACHE_PATH + "/" + path)
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):
"""
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")