ipatests: Replace 'usermod -r' command with 'gpasswd -d' in test_hsm.py

Test 'test_hsm_negative_bad_token_dir_permissions'
was failing in RHEL because of the below error.

"ipa: ERROR: stderr: usermod: invalid option -- 'r'"

Hence replaced the usermod with gpasswd command which does the same and
works on both RHEL and Fedora.

Ref: https://pagure.io/freeipa/issue/9626

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Sudhir Menon 2024-08-14 13:05:53 +05:30 committed by Florence Blanc-Renaud
parent 21c6ccc982
commit ed813fe6f0

View File

@ -898,7 +898,7 @@ class TestHSMNegative(IntegrationTest):
'--label', token_name]
)
self.master.run_command(
['usermod', 'pkiuser', '-r', '-G', 'ods']
['gpasswd', '-d', 'pkiuser', 'ods']
)
result = tasks.install_master(
self.master, raiseonerr=False,