From 1082f2563f5cdc7d4f019c3a85bd0c717fc6fd16 Mon Sep 17 00:00:00 2001 From: Scott Poore Date: Thu, 5 Oct 2023 11:06:51 -0500 Subject: [PATCH] Tests: add follow-symlinks to sed for nsswitch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The multihost/alltests/test_automount_from_bash.py test module runs a sed against /etc/nsswitch.conf which convers it from a link to a file. This causes issues with authselect in later tests resulting in test errors. This can be fixed by adding the --follow-symlinks option. The restore() from the fixture should return the config to it's original content. Reviewed-by: Jakub Vávra --- src/tests/multihost/alltests/test_automount_from_bash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/multihost/alltests/test_automount_from_bash.py b/src/tests/multihost/alltests/test_automount_from_bash.py index 913b66a1586..fdab6b3b012 100644 --- a/src/tests/multihost/alltests/test_automount_from_bash.py +++ b/src/tests/multihost/alltests/test_automount_from_bash.py @@ -103,7 +103,7 @@ def create_users(multihost, request): client.run_command("authselect select sssd --force") client.run_command("cp -f /etc/nsswitch.conf /etc/nsswitch.conf.backup") client.run_command("cp -f /etc/sysconfig/autofs /etc/sysconfig/autofs_bkp") - client.run_command("sed -i 's/automount: files/automount: sss files/g' /etc/nsswitch.conf") + client.run_command("sed --follow-symlinks -i 's/automount: files/automount: sss files/g' /etc/nsswitch.conf") ldap_uri = f'ldap://{multihost.master[0].sys_hostname}' ldap_inst = LdapOperations(ldap_uri, ds_rootdn, ds_rootpw) ldap_inst.org_unit("mount", ds_suffix)