You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hacking/update_examples_and_tests.sh
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -9,19 +9,19 @@ for module in ../plugins/modules/*.py; do
9
9
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../examples/${module_name}.yml"
10
10
11
11
# create tests
12
-
echo"---"| tee "../tests/integration/targets/icinga/tasks/${module_name}.yml"
13
-
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/tasks/${module_name}.yml"
12
+
echo"---"| tee "../tests/integration/targets/icinga/roles/icinga/tasks/${module_name}.yml"
13
+
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/${module_name}.yml"
14
14
15
15
# create create working tests deleting the hosts
16
-
echo"---"| tee "../tests/integration/targets/icinga/tasks/absent_${module_name}.yml"
17
-
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/tasks/absent_${module_name}.yml"
18
-
sed -i 's/state: present/state: absent/g'"../tests/integration/targets/icinga/tasks/absent_${module_name}.yml"
16
+
echo"---"| tee "../tests/integration/targets/icinga/roles/icinga/tasks/absent_${module_name}.yml"
17
+
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/absent_${module_name}.yml"
18
+
sed -i 's/state: present/state: absent/g'"../tests/integration/targets/icinga/roles/icinga/tasks/absent_${module_name}.yml"
19
19
20
20
# create failing tests with wrong password
21
-
echo"---"| tee "../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml"
22
-
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml"
21
+
echo"---"| tee "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml"
22
+
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml"
23
23
# replace password variable with wrong password
24
-
sed -i 's/{{ icinga_pass }}/iamwrong/g'"../tests/integration/targets/icinga/tasks/wrong_pass_${module_name}.yml"
24
+
sed -i 's/{{ icinga_pass }}/iamwrong/g'"../tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_${module_name}.yml"
25
25
26
26
# add ignore_errors to the creation-task and an assert task that checks for failure
27
27
echo -n "
@@ -32,15 +32,15 @@ for module in ../plugins/modules/*.py; do
echo"---"| tee "../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml"
41
-
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml"
40
+
echo"---"| tee "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml"
41
+
sed -n '/EXAMPLES/,/"""/{/EXAMPLES/b;/"""/b;p}'"${module}"| tee -a "../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml"
42
42
# replace url varuable with nonexisting url
43
-
sed -i 's/{{ icinga_url }}/http:\/\/nonexistant/g'"../tests/integration/targets/icinga/tasks/wrong_host_${module_name}.yml"
43
+
sed -i 's/{{ icinga_url }}/http:\/\/nonexistant/g'"../tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_${module_name}.yml"
44
44
45
45
# add ignore_errors to the creation-task and an assert task that checks for failure
46
46
echo -n "
@@ -51,6 +51,6 @@ for module in ../plugins/modules/*.py; do
51
51
assert:
52
52
that:
53
53
- \"result.failed\"
54
-
- \"result.msg == 'bad return code while creating: -1. Error message: Request failed: <urlopen error [Errno -3] Temporary failure in name resolution>'\" # noqa
0 commit comments