Import Upstream version 4.12.4
This commit is contained in:
@@ -73,11 +73,11 @@ class TestNFS(IntegrationTest):
|
||||
"euripides": "s"
|
||||
}
|
||||
temp_pass = 'temppass'
|
||||
for user in users:
|
||||
for user, last in users.items():
|
||||
self.master.run_command([
|
||||
"ipa", "user-add",
|
||||
"%s" % user, "--first", "%s" % user,
|
||||
"--last", "%s" % users[user],
|
||||
user, "--first", user,
|
||||
"--last", last,
|
||||
'--password'], stdin_text="%s\n%s\n" % (temp_pass, temp_pass)
|
||||
)
|
||||
self.master.run_command(["kdestroy", "-A"])
|
||||
@@ -111,12 +111,12 @@ class TestNFS(IntegrationTest):
|
||||
"stdnfs": "*(ro)",
|
||||
"home": "*(sec=krb5p,rw)"
|
||||
}
|
||||
for export in exports:
|
||||
for export, options in exports.items():
|
||||
exportpath = os.sep.join(('', basedir, export))
|
||||
exportfile = os.sep.join((
|
||||
'', 'etc', 'exports.d', "%s.exports" % export
|
||||
))
|
||||
exportline = " ".join((exportpath, exports[export]))
|
||||
exportline = " ".join((exportpath, options))
|
||||
nfssrv.run_command(["mkdir", "-p", exportpath])
|
||||
nfssrv.run_command(["chmod", "770", exportpath])
|
||||
nfssrv.put_file_contents(exportfile, exportline)
|
||||
@@ -130,7 +130,7 @@ class TestNFS(IntegrationTest):
|
||||
nfsclt = self.clients[1]
|
||||
|
||||
# for journalctl --since
|
||||
since = time.strftime('%H:%M:%S')
|
||||
since = time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
nfsclt.run_command(["systemctl", "restart", "rpc-gssd"])
|
||||
time.sleep(WAIT_AFTER_INSTALL)
|
||||
mountpoints = ("/mnt/krb", "/mnt/std", "/home")
|
||||
@@ -288,13 +288,10 @@ class TestIpaClientAutomountFileRestore(IntegrationTest):
|
||||
tasks.uninstall_client(self.clients[0])
|
||||
request.addfinalizer(fin)
|
||||
|
||||
def nsswitch_backup_restore(
|
||||
self,
|
||||
no_sssd=False,
|
||||
):
|
||||
def nsswitch_backup_restore(self):
|
||||
|
||||
# In order to get a more pure sum, one that ignores the Generated
|
||||
# header and any white space we have to do a bit of work...
|
||||
# header and any whitespace we have to do a bit of work...
|
||||
sha256nsswitch_cmd = \
|
||||
'egrep -v "Generated|^$" /etc/nsswitch.conf | sed "s/\\s//g" ' \
|
||||
'| sort | sha256sum'
|
||||
@@ -309,21 +306,15 @@ class TestIpaClientAutomountFileRestore(IntegrationTest):
|
||||
cmd = self.clients[0].run_command(grep_automount_command)
|
||||
after_ipa_client_install = cmd.stdout_text.split()
|
||||
|
||||
if no_sssd:
|
||||
ipa_client_automount_command = [
|
||||
"ipa-client-automount", "--no-sssd", "-U"
|
||||
]
|
||||
else:
|
||||
ipa_client_automount_command = [
|
||||
"ipa-client-automount", "-U"
|
||||
]
|
||||
ipa_client_automount_command = [
|
||||
"ipa-client-automount", "-U"
|
||||
]
|
||||
self.clients[0].run_command(ipa_client_automount_command)
|
||||
cmd = self.clients[0].run_command(grep_automount_command)
|
||||
after_ipa_client_automount = cmd.stdout_text.split()
|
||||
if no_sssd:
|
||||
assert after_ipa_client_automount == ['files', 'ldap']
|
||||
else:
|
||||
assert after_ipa_client_automount == ['sss', 'files']
|
||||
# The default order depends on the authselect version
|
||||
# but we only care about the list of sources, not their order
|
||||
assert sorted(after_ipa_client_automount) == ['files', 'sss']
|
||||
|
||||
cmd = self.clients[0].run_command(grep_automount_command)
|
||||
assert cmd.stdout_text.split() == after_ipa_client_automount
|
||||
@@ -332,19 +323,18 @@ class TestIpaClientAutomountFileRestore(IntegrationTest):
|
||||
"ipa-client-automount", "--uninstall", "-U"
|
||||
])
|
||||
|
||||
if not no_sssd:
|
||||
# https://pagure.io/freeipa/issue/8190
|
||||
# check that no ipa_automount_location is left in sssd.conf
|
||||
# also check for autofs_provider for good measure
|
||||
grep_automount_in_sssdconf_cmd = \
|
||||
"egrep ipa_automount_location\\|autofs_provider " \
|
||||
"/etc/sssd/sssd.conf"
|
||||
cmd = self.clients[0].run_command(
|
||||
grep_automount_in_sssdconf_cmd, raiseonerr=False
|
||||
)
|
||||
assert cmd.returncode == 1, \
|
||||
"PG8190 regression found: ipa_automount_location still " \
|
||||
"present in sssd.conf"
|
||||
# https://pagure.io/freeipa/issue/8190
|
||||
# check that no ipa_automount_location is left in sssd.conf
|
||||
# also check for autofs_provider for good measure
|
||||
grep_automount_in_sssdconf_cmd = \
|
||||
"egrep ipa_automount_location\\|autofs_provider " \
|
||||
"/etc/sssd/sssd.conf"
|
||||
cmd = self.clients[0].run_command(
|
||||
grep_automount_in_sssdconf_cmd, raiseonerr=False
|
||||
)
|
||||
assert cmd.returncode == 1, \
|
||||
"PG8190 regression found: ipa_automount_location still " \
|
||||
"present in sssd.conf"
|
||||
|
||||
cmd = self.clients[0].run_command(grep_automount_command)
|
||||
assert cmd.stdout_text.split() == after_ipa_client_install
|
||||
@@ -365,6 +355,3 @@ class TestIpaClientAutomountFileRestore(IntegrationTest):
|
||||
|
||||
def test_nsswitch_backup_restore_sssd(self):
|
||||
self.nsswitch_backup_restore()
|
||||
|
||||
def test_nsswitch_backup_restore_no_sssd(self):
|
||||
self.nsswitch_backup_restore(no_sssd=True)
|
||||
|
||||
Reference in New Issue
Block a user