Skip to content

Commit a63f1b9

Browse files
committed
test: move reschedule helper to support folder
it is useful for other tests as well
1 parent b16db31 commit a63f1b9

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

MANIFEST

+1-1
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,7 @@ support/menu_local.conf
19061906
support/naglint.conf.example
19071907
support/panorama2img
19081908
support/panorama2img.js
1909+
support/reschedule_all_checks.sh
19091910
support/standard_script_header
19101911
support/thruk.init
19111912
support/thruk.logrotate
@@ -2359,7 +2360,6 @@ t/scenarios/cli_api/omd/1.tbp
23592360
t/scenarios/cli_api/omd/1.tsk
23602361
t/scenarios/cli_api/omd/Dockerfile
23612362
t/scenarios/cli_api/omd/playbook.yml
2362-
t/scenarios/cli_api/t/reschedule_all.sh
23632363
t/scenarios/cli_api/t/test.sh
23642364
t/scenarios/cli_api/t/test_root.sh
23652365
t/scenarios/cli_api/t/thruk.troot

support/reschedule_all_checks.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
USERNAME="${1:-omdadmin}"
4+
thruk host list | \
5+
while read host; do
6+
echo $host
7+
thruk -A $USERNAME url 'cmd.cgi?cmd_mod=2&cmd_typ=96&host='"$host"'&start_time=now&force_check=1&wait=0' 2>&1
8+
URLS=""
9+
while read svc; do
10+
svc="${svc// /%20}" # escape spaces
11+
URLS="$URLS cmd.cgi?cmd_mod=2&cmd_typ=7&host="$host"&service="$svc"&start_time=now&force_check=1&wait=0"
12+
done < <(thruk services "$host")
13+
thruk -A $USERNAME url $URLS 2>&1
14+
done
15+
16+
echo "OK"

t/scenarios/cli_api/t/reschedule_all.sh

-13
This file was deleted.

t/scenarios/cli_api/t/thruk_cmd_cli.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ TestUtils::test_command({
6868
###########################################################
6969
# some tests require non-pending services
7070
TestUtils::test_command({
71-
cmd => '/test/t/reschedule_all.sh',
71+
cmd => '/thruk/support/reschedule_all_checks.sh',
7272
like => ['/OK/', '/cmd: COMMAND/', '/SCHEDULE_FORCED_HOST_CHECK/', '/SCHEDULE_FORCED_SVC_CHECK/'],
7373
});
7474
TestUtils::test_command({

0 commit comments

Comments
 (0)