From 58c1fdd41681c15f39b59bbb5e39b2e1cf245c6c Mon Sep 17 00:00:00 2001 From: Sudhir Menon Date: Aug 16 2024 06:55:45 +0000 Subject: 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 Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipatests/test_integration/test_hsm.py b/ipatests/test_integration/test_hsm.py index 7f92c6a..374f5c2 100644 --- a/ipatests/test_integration/test_hsm.py +++ b/ipatests/test_integration/test_hsm.py @@ -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,