diff --git a/README.md b/README.md index 82aa5ac3..30686a9a 100644 --- a/README.md +++ b/README.md @@ -96,10 +96,11 @@ Local Testing ``` # run icinga in a container and forward port 80 -> docker run -it -p 80:80 jordan/icinga2 +> docker run -d -p 80:80 jordan/icinga2 -# run the ansible-playbook against the container -> ansible-playbook tests/integration/test.yml -e icinga_url=http://127.0.0.1/icingaweb2 +# run the ansible playbooks against the container +> ansible-playbook tests/integration/targets/icinga/normalmode.yml +> ansible-playbook tests/integration/targets/icinga/checkmode.yml ``` License diff --git a/hacking/update_examples_and_tests.sh b/hacking/update_examples_and_tests.sh index 19ca456e..a92c8e6e 100644 --- a/hacking/update_examples_and_tests.sh +++ b/hacking/update_examples_and_tests.sh @@ -9,19 +9,19 @@ for module in ../plugins/modules/*.py; do sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../examples/${module_name}.yml" # create tests - echo "---" | tee "../tests/integration/targets/icinga/tasks/${module_name}.yml" - sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/tasks/${module_name}.yml" + echo "---" | tee "../tests/integration/targets/icinga/roles/icinga/tasks/${module_name}.yml" + sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/${module_name}.yml" # create create working tests deleting the hosts - echo "---" | tee "../tests/integration/targets/icinga/tasks/absent_${module_name}.yml" - sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/tasks/absent_${module_name}.yml" - sed -i 's/state: present/state: absent/g' "../tests/integration/targets/icinga/tasks/absent_${module_name}.yml" + echo "---" | tee "../tests/integration/targets/icinga/roles/icinga/tasks/absent_${module_name}.yml" + sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/absent_${module_name}.yml" + sed -i 's/state: present/state: absent/g' "../tests/integration/targets/icinga/roles/icinga/tasks/absent_${module_name}.yml" # create failing tests with wrong password - echo "---" | tee "../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml" - sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml" + echo "---" | tee "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml" + sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml" # replace password variable with wrong password - sed -i 's/{{ icinga_pass }}/iamwrong/g' "../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml" + sed -i 's/{{ icinga_pass }}/iamwrong/g' "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml" # add ignore_errors to the creation-task and an assert task that checks for failure echo -n " @@ -32,15 +32,15 @@ for module in ../plugins/modules/*.py; do assert: that: - \"result.failed\" - - \"result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'\" # noqa -" >> "../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml" + - \"result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '\" # noqa +" >> "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml" # create failing tests with wrong host # add test - echo "---" | tee "../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml" - sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml" + echo "---" | tee "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml" + sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}' "${module}" | tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml" # replace url varuable with nonexisting url - sed -i 's/{{ icinga_url }}/http:\/\/nonexistant/g' "../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml" + sed -i 's/{{ icinga_url }}/http:\/\/nonexistant/g' "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml" # add ignore_errors to the creation-task and an assert task that checks for failure echo -n " @@ -51,6 +51,6 @@ for module in ../plugins/modules/*.py; do assert: that: - \"result.failed\" - - \"result.msg == 'bad return code while creating: -1. Error message: Request failed: '\" # noqa -" >> "../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml" + - \"result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '\" # noqa +" >> "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml" done diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command.yml index 56d53479..977b496b 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command.yml @@ -65,4 +65,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command_template.yml index f06a5fbc..7087bcf4 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_command_template.yml @@ -63,4 +63,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host.yml index 56329c13..4869caec 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host.yml @@ -25,4 +25,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host_template.yml index 318e2dcf..f78aed62 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host_template.yml @@ -21,4 +21,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_hostgroup.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_hostgroup.yml index 36d3cca0..023d534f 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_hostgroup.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_hostgroup.yml @@ -16,4 +16,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_notification.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_notification.yml index 8559a7e2..3dcba3d6 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_notification.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_notification.yml @@ -24,4 +24,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_apply.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_apply.yml index 4e0d7fdb..e70a5bd8 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_apply.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_apply.yml @@ -27,4 +27,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_template.yml index 184f67bf..92f10d3c 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_service_template.yml @@ -19,4 +19,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_servicegroup.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_servicegroup.yml index 323cf021..0747a9ae 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_servicegroup.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_servicegroup.yml @@ -16,4 +16,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_timeperiod.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_timeperiod.yml index 8500034e..e977da2b 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_timeperiod.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_timeperiod.yml @@ -22,4 +22,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user.yml index 0de6f35e..c711d883 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user.yml @@ -20,4 +20,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user_template.yml index eee9fc43..c8535c7c 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_user_template.yml @@ -16,4 +16,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command.yml index 64d479d2..02519b0a 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command.yml @@ -65,4 +65,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command_template.yml index 5c9121ae..c6ce4a25 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_command_template.yml @@ -63,4 +63,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host.yml index be08d3e1..f7444cca 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host.yml @@ -25,4 +25,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host_template.yml index fdd29540..bef6a488 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host_template.yml @@ -21,4 +21,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_hostgroup.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_hostgroup.yml index 1c3e6fea..096b7035 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_hostgroup.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_hostgroup.yml @@ -16,4 +16,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_notification.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_notification.yml index c9ed38ed..0a2ba2c0 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_notification.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_notification.yml @@ -24,4 +24,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_apply.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_apply.yml index 9e717b67..c19459be 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_apply.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_apply.yml @@ -27,4 +27,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_template.yml index 2872018e..919dafe6 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_service_template.yml @@ -19,4 +19,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_servicegroup.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_servicegroup.yml index 7fada175..b92f3852 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_servicegroup.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_servicegroup.yml @@ -16,4 +16,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_timeperiod.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_timeperiod.yml index 40a1b839..9304ba57 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_timeperiod.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_timeperiod.yml @@ -22,4 +22,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user.yml index 77a7d810..89446af9 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user.yml @@ -20,4 +20,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user_template.yml b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user_template.yml index 61767aaf..8f560172 100644 --- a/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user_template.yml +++ b/tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_user_template.yml @@ -16,4 +16,4 @@ assert: that: - "result.failed" - - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized'" # noqa + - "result.msg == 'bad return code while creating: 401. Error message: HTTP Error 401: Unauthorized' or result.msg == 'bad return code while creating: -1. Error message: Request failed: ' or result.msg == 'bad return code while creating: -1. Error message: Request failed: '" # noqa diff --git a/tests/integration/test.yml b/tests/integration/test.yml index 80239521..4e68fa1f 100644 --- a/tests/integration/test.yml +++ b/tests/integration/test.yml @@ -3,6 +3,6 @@ gather_facts: false tasks: - include_role: - name: tests/integration/targets/icinga + name: tests/integration/targets/icinga/roles/icinga collections: - t_systems_mms.icinga_director