Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -17,9 +17,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# FIXME: Pylint errors
|
||||
# pylint: disable=no-member
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
@@ -46,10 +43,6 @@ class BaseTestLegacyClient(object):
|
||||
'/etc/nsswitch.conf',
|
||||
paths.SSSD_CONF]
|
||||
|
||||
homedir_template = "/home/{domain}/{username}"
|
||||
required_extra_roles = ()
|
||||
optional_extra_roles = ()
|
||||
|
||||
# Actual test classes need to override these attributes to set the expected
|
||||
# values on the UID and GID results, since this varies with the usage of the
|
||||
# POSIX and non-POSIX ID ranges
|
||||
@@ -62,6 +55,26 @@ class BaseTestLegacyClient(object):
|
||||
# To allow custom validation dependent on the trust type
|
||||
posix_trust = False
|
||||
|
||||
@classmethod
|
||||
def setup_class(cls):
|
||||
super(BaseTestLegacyClient, cls).setup_class()
|
||||
cls.ad = cls.ad_domains[0].ads[0]
|
||||
|
||||
cls.legacy_client = cls.host_by_role(cls.required_extra_roles[0])
|
||||
|
||||
# Determine whether the subdomain AD is available
|
||||
try:
|
||||
child_ad = cls.host_by_role(cls.optional_extra_roles[0])
|
||||
cls.ad_subdomain = '.'.join(
|
||||
child_ad.hostname.split('.')[1:])
|
||||
except LookupError:
|
||||
cls.ad_subdomain = None
|
||||
|
||||
tasks.apply_common_fixes(cls.legacy_client)
|
||||
|
||||
for f in cls.backup_files:
|
||||
tasks.backup_file(cls.legacy_client, f)
|
||||
|
||||
def test_apply_advice(self):
|
||||
# Obtain the advice from the server
|
||||
tasks.kinit_admin(self.master)
|
||||
@@ -327,8 +340,8 @@ class BaseTestLegacyClient(object):
|
||||
assert result.returncode != 0
|
||||
|
||||
@classmethod
|
||||
def install(cls, mh):
|
||||
super(BaseTestLegacyClient, cls).install(mh)
|
||||
def install(cls):
|
||||
super(BaseTestLegacyClient, cls).install()
|
||||
|
||||
tasks.kinit_admin(cls.master)
|
||||
|
||||
@@ -346,25 +359,8 @@ class BaseTestLegacyClient(object):
|
||||
|
||||
cls.master.run_command(['ipa', 'user-disable', 'disabledipauser'])
|
||||
|
||||
cls.ad = cls.ad_domains[0].ads[0]
|
||||
|
||||
cls.legacy_client = cls.host_by_role(cls.required_extra_roles[0])
|
||||
|
||||
# Determine whether the subdomain AD is available
|
||||
try:
|
||||
child_ad = cls.host_by_role(cls.optional_extra_roles[0])
|
||||
cls.ad_subdomain = '.'.join(
|
||||
child_ad.hostname.split('.')[1:])
|
||||
except LookupError:
|
||||
cls.ad_subdomain = None
|
||||
|
||||
tasks.apply_common_fixes(cls.legacy_client)
|
||||
|
||||
for f in cls.backup_files:
|
||||
tasks.backup_file(cls.legacy_client, f)
|
||||
|
||||
@classmethod
|
||||
def uninstall(cls, mh):
|
||||
def uninstall(cls):
|
||||
cls.master.run_command(['ipa', 'user-del', 'disabledipauser'],
|
||||
raiseonerr=False)
|
||||
|
||||
@@ -372,7 +368,7 @@ class BaseTestLegacyClient(object):
|
||||
if hasattr(cls, 'legacy_client'):
|
||||
tasks.unapply_fixes(cls.legacy_client)
|
||||
|
||||
super(BaseTestLegacyClient, cls).uninstall(mh)
|
||||
super(BaseTestLegacyClient, cls).uninstall()
|
||||
|
||||
|
||||
# Base classes with attributes that are specific for each legacy client test
|
||||
@@ -414,6 +410,7 @@ class BaseTestLegacyClientPosix(BaseTestLegacyClient,
|
||||
testuser_gid_regex = '10047'
|
||||
subdomain_testuser_uid_regex = '10142'
|
||||
subdomain_testuser_gid_regex = '10147'
|
||||
homedir_template = "/home/{domain}/{username}"
|
||||
posix_trust = True
|
||||
|
||||
def test_remove_trust_with_posix_attributes(self):
|
||||
@@ -427,6 +424,7 @@ class BaseTestLegacyClientNonPosix(BaseTestLegacyClient,
|
||||
testuser_gid_regex = '(?!10047)(\d+)'
|
||||
subdomain_testuser_uid_regex = '(?!10142)(\d+)'
|
||||
subdomain_testuser_gid_regex = '(?!10147)(\d+)'
|
||||
homedir_template = '/home/{domain}/{username}'
|
||||
|
||||
def test_remove_nonposix_trust(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user