From 85b2c8191b8622a5cfe3c8c6e3811ef5e1eee0eb Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Tue, 8 Mar 2022 13:05:33 +0100 Subject: [PATCH] ipatests: Fix a call to run_command with wildcard The test is calling run_command with a list of arguments: run_command(['rm', '-f', paths.CERTMONGER_REQUESTS_DIR + '/*']) but this format does not support shell expansion. Replace with a str parameter: run_command('rm -fv' + paths.CERTMONGER_REQUESTS_DIR + '/*') to make sure all the files in the directory are actually removed. Fixes: https://pagure.io/freeipa/issue/8506 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Rob Crittenden --- ipatests/test_integration/test_ipa_cert_fix.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipatests/test_integration/test_ipa_cert_fix.py b/ipatests/test_integration/test_ipa_cert_fix.py index bb03d4309..77076e78e 100644 --- a/ipatests/test_integration/test_ipa_cert_fix.py +++ b/ipatests/test_integration/test_ipa_cert_fix.py @@ -122,9 +122,10 @@ def expire_cert_critical(): # errors from certmonger trying to check the status of certs # that don't matter because we are uninstalling. host.run_command(['systemctl', 'stop', 'certmonger']) - host.run_command( - ['rm', '-f', paths.CERTMONGER_REQUESTS_DIR + '/*'] - ) + # Important: run_command with a str argument is able to + # perform shell expansion but run_command with a list of + # arguments is not + host.run_command('rm -fv ' + paths.CERTMONGER_REQUESTS_DIR + '*') tasks.uninstall_master(host) tasks.move_date(host, 'start', '-3Years-1day')