diff --git a/tests/02a-checkrun.sh b/tests/02a-checkrun.sh index 24025ee4..96c202bb 100755 --- a/tests/02a-checkrun.sh +++ b/tests/02a-checkrun.sh @@ -63,10 +63,10 @@ echo -e " ___ ____ _ _\n / _ \___ \ __ _ check_run_ok "ansible-deployer show --debug" "\[DEBUG\]: load_configuration called" # Check different output options -check_message_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra" "\[ERROR\]:\n TASK \[Run ll\]" -check_message_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra --debug" "\[DEBUG\]:\n TASK \[Run ll\]" -check_message_not_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra --raw-runner-output" "\[ERROR\]:\n TASK \[Run ll\]" -check_message_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra --raw-runner-output --debug" "\[DEBUG\]:\n TASK \[Run ll\]" +check_message_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra" "\[ERROR\]:.*\n.* TASK \[Run ll\]" +check_message_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra --debug" "\[DEBUG\]:.*\n.* TASK \[Run ll\]" +check_message_not_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra --raw-runner-output" "\[ERROR\]:.*\n.* TASK \[Run ll\]" +check_message_in_output "ansible-deployer run --task task_with_ansible_fail --stage testing --infrastructure testInfra --raw-runner-output --debug" "\[DEBUG\]:.*\n.* TASK \[Run ll\]" echo -e " ___ ____ _ _\n / _ \___ \ __ _ ___| |__ ___ ___| | ___ __ _ _ _ __\n | | | |__) / _\` | _____ / __| '_ \ / _ \/ __| |/ / '__| | | | '_ \ \n | |_| / __/ (_| | |_____| | (__| | | | __/ (__| <| | | |_| | | | |\n \___/_____\__,_| \___|_| |_|\___|\___|_|\_\_| \__,_|_| |_|\n \n _ _ _ _ _ _\n | (_)_ __ ___ (_) |_ ___ _ __ | |_(_) ___ _ __\n | | | '_ \` _ \| | __| / _ \| '_ \| __| |/ _ \| '_ \ \n | | | | | | | | | |_ | (_) | |_) | |_| | (_) | | | |\n |_|_|_| |_| |_|_|\__| \___/| .__/ \__|_|\___/|_| |_|\n |_|\n" # Check --limit option diff --git a/tests/02a-checkrun_short.sh b/tests/02a-checkrun_short.sh index 17eead1f..f54c0b42 100755 --- a/tests/02a-checkrun_short.sh +++ b/tests/02a-checkrun_short.sh @@ -62,10 +62,10 @@ echo -e " ___ ____ _ _ check_run_ok "ansible-deployer show -d" "\[DEBUG\]: load_configuration called" # Check different output options -check_message_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra" "\[ERROR\]:\n TASK \[Run ll\]" -check_message_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra -d" "\[DEBUG\]:\n TASK \[Run ll\]" -check_message_not_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra --raw-runner-output" "\[ERROR\]:\n TASK \[Run ll\]" -check_message_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra --raw-runner-output -d" "\[DEBUG\]:\n TASK \[Run ll\]" +check_message_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra" "\[ERROR\]:.*\n.* TASK \[Run ll\]" +check_message_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra -d" "\[DEBUG\]:.*\n.* TASK \[Run ll\]" +check_message_not_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra --raw-runner-output" "\[ERROR\]:.*\n.* TASK \[Run ll\]" +check_message_in_output "ansible-deployer run -t task_with_ansible_fail -s testing -i testInfra --raw-runner-output -d" "\[DEBUG\]:.*\n.* TASK \[Run ll\]" echo -e " ___ ____ _ _ _ _\n / _ \___ \ __ _ ___| |__ ___ ___| | ___ __ _ _ _ __ ___| |__ ___ _ __| |_\n | | | |__) / _\` | _____ / __| '_ \ / _ \/ __| |/ / '__| | | | '_ \ / __| '_ \ / _ \| '__| __|\n | |_| / __/ (_| | |_____| | (__| | | | __/ (__| <| | | |_| | | | | \__ \ | | | (_) | | | |_\n \___/_____\__,_| \___|_| |_|\___|\___|_|\_\_| \__,_|_| |_| |___/_| |_|\___/|_| \__|\n \n _ _ _ _ _ _\n | (_)_ __ ___ (_) |_ ___ _ __ | |_(_) ___ _ __\n | | | '_ \` _ \| | __| / _ \| '_ \| __| |/ _ \| '_ \ \n | | | | | | | | | |_ | (_) | |_) | |_| | (_) | | | |\n |_|_|_| |_| |_|_|\__| \___/| .__/ \__|_|\___/|_| |_|\n |_|\n" # Check --limit option diff --git a/tests/testing_lib.sh b/tests/testing_lib.sh index 2c8a7fe7..4fa7f6b9 100644 --- a/tests/testing_lib.sh +++ b/tests/testing_lib.sh @@ -19,7 +19,7 @@ check_message_in_output() { CMD=$1 EXPTEXT=$2 echo "Check: $CMD" - eval "$CMD |& grep '$EXPTEXT'" + eval "$CMD |& grep -zP '$EXPTEXT'" if [ $? -eq 0 ] then echo "OK: '${CMD}' returned '${EXPTEXT}'" @@ -35,7 +35,7 @@ check_message_not_in_output() { CMD=$1 EXPTEXT=$2 echo "Check: $CMD" - eval "$CMD |& grep '$EXPTEXT'" + eval "$CMD |& grep -zP '$EXPTEXT'" if [ $? -eq 0 ] then echo "FAILED: '${CMD}' returned '${EXPTEXT}'"