diff options
author | Sven Nierlein <sven@nierlein.de> | 2013-01-23 19:23:00 (GMT) |
---|---|---|
committer | Sven Nierlein <sven@nierlein.de> | 2013-01-23 19:26:41 (GMT) |
commit | 596af9df576b0ecf7a7dcc9a2c19ae771f23bf1d (patch) | |
tree | ebbdf1c585b9de20caef090a1ed9a8dbadd388db | |
parent | 261ad186706422af00ec7e67dc128a99c4603b8c (diff) | |
download | monitoring-plugins-596af9df576b0ecf7a7dcc9a2c19ae771f23bf1d.tar.gz |
updated check dig tests
nagios.com seems to have changed their ip address. Also added tests
about -4/-6 option.
-rw-r--r-- | plugins/t/check_dig.t | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/plugins/t/check_dig.t b/plugins/t/check_dig.t index 323859e..1ab4b42 100644 --- a/plugins/t/check_dig.t +++ b/plugins/t/check_dig.t | |||
@@ -10,30 +10,30 @@ use NPTest; | |||
10 | 10 | ||
11 | plan skip_all => "check_dig not compiled" unless (-x "check_dig"); | 11 | plan skip_all => "check_dig not compiled" unless (-x "check_dig"); |
12 | 12 | ||
13 | plan tests => 12; | 13 | plan tests => 16; |
14 | 14 | ||
15 | my $successOutput = '/DNS OK - [\.0-9]+ seconds? response time/'; | 15 | my $successOutput = '/DNS OK - [\.0-9]+ seconds? response time/'; |
16 | 16 | ||
17 | my $hostname_valid = getTestParameter( | 17 | my $hostname_valid = getTestParameter( |
18 | "NP_HOSTNAME_VALID", | 18 | "NP_HOSTNAME_VALID", |
19 | "A valid (known to DNS) hostname", | 19 | "A valid (known to DNS) hostname", |
20 | "nagios.com" | 20 | "nagiosplugins.org" |
21 | ); | 21 | ); |
22 | 22 | ||
23 | my $hostname_valid_ip = getTestParameter( | 23 | my $hostname_valid_ip = getTestParameter( |
24 | "NP_HOSTNAME_VALID_IP", | 24 | "NP_HOSTNAME_VALID_IP", |
25 | "The IP address of the valid hostname $hostname_valid", | 25 | "The IP address of the valid hostname $hostname_valid", |
26 | "66.118.156.50", | 26 | "67.207.143.200", |
27 | ); | 27 | ); |
28 | 28 | ||
29 | my $hostname_valid_reverse = getTestParameter( | 29 | my $hostname_valid_reverse = getTestParameter( |
30 | "NP_HOSTNAME_VALID_REVERSE", | 30 | "NP_HOSTNAME_VALID_REVERSE", |
31 | "The hostname of $hostname_valid_ip", | 31 | "The hostname of $hostname_valid_ip", |
32 | "66-118-156-50.static.sagonet.net.", | 32 | "nagiosplugins.org.", |
33 | ); | 33 | ); |
34 | 34 | ||
35 | my $hostname_invalid = getTestParameter( | 35 | my $hostname_invalid = getTestParameter( |
36 | "NP_HOSTNAME_INVALID", | 36 | "NP_HOSTNAME_INVALID", |
37 | "An invalid (not known to DNS) hostname", | 37 | "An invalid (not known to DNS) hostname", |
38 | "nosuchhost.altinity.com", | 38 | "nosuchhost.altinity.com", |
39 | ); | 39 | ); |
@@ -69,6 +69,14 @@ SKIP: { | |||
69 | cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server"); | 69 | cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server"); |
70 | like ( $res->output, $successOutput, "Output OK" ); | 70 | like ( $res->output, $successOutput, "Output OK" ); |
71 | 71 | ||
72 | $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5 -4"); | ||
73 | cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server"); | ||
74 | like ( $res->output, $successOutput, "Output OK for IPv4" ); | ||
75 | |||
76 | $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5 -6"); | ||
77 | cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server"); | ||
78 | like ( $res->output, $successOutput, "Output OK for IPv6" ); | ||
79 | |||
72 | $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -a $hostname_valid_ip -t 5"); | 80 | $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -a $hostname_valid_ip -t 5"); |
73 | cmp_ok( $res->return_code, '==', 0, "Got expected address"); | 81 | cmp_ok( $res->return_code, '==', 0, "Got expected address"); |
74 | 82 | ||