Skip to content

Commit

Permalink
Tests: add follow-symlinks to sed for nsswitch
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
spoore1 authored and alexey-tikhonov committed Oct 10, 2023
1 parent a997ee7 commit 1082f25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tests/multihost/alltests/test_automount_from_bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1082f25

Please sign in to comment.