azure-run-tests: handle single unexpanded parameter too

If TESTS_TO_RUN contains a single parameter that cannot be expanded,
bash will not perform brace elimination. Remove braces manually.

For example, TESTS_TO_RUN='test_xmlrpc/test_*.py' will not expand
outside of ipatests and the script would generate

 tests_to_run=-k{test_xmlrpc/test_*.py}

Braces then will prevent actual ipa-run-tests execution from matching
any of XMLRPC tests.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Alexander Bokovoy 2019-05-15 08:13:45 +03:00
parent 58fe6fac61
commit 9cb6817b30
2 changed files with 4 additions and 2 deletions

View File

@ -138,7 +138,8 @@ jobs:
XMLRPC_tests:
TEST_TITLE: 'XMLRPC'
TASK_TO_RUN: run-tests
TESTS_TO_RUN: "test_xmlrpc/test_*.py"
TESTS_TO_RUN: "test_xmlrpc"
steps:
- template: templates/setup-test-environment.yml
parameters:

View File

@ -4,7 +4,8 @@ server_domain=example.test
server_password=Secret123
# Expand list of tests into -k... -k... -k... .. sequence
tests_to_run=$(eval "eval echo -k{$(echo $TESTS_TO_RUN | sed -e 's/[ \t]+*/,/g')}")
# If remaining string still has { or } characters that shell did not expand, remove them
tests_to_run=$(eval "eval echo -k{$(echo $TESTS_TO_RUN | sed -e 's/[ \t]+*/,/g')}" | tr -d '{}')
systemctl --now enable firewalld
ipa-server-install -U --domain ${server_domain} --realm ${server_realm} -p ${server_password} -a ${server_password} --setup-dns --setup-kra --auto-forwarders