diff options
| author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-03-10 11:33:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-10 11:33:25 +0100 |
| commit | 5077120a251980b4fafed61b4aa8fa5730a85443 (patch) | |
| tree | 8500b8f5dbe774b399cfdc79f5665ba88ef7f255 /plugins/t/check_dns.t | |
| parent | a3de84594104ac87a91e200d569fb57edacca928 (diff) | |
| parent | 269718094177fb8a7e3d3005d1310495009fe8c4 (diff) | |
| download | monitoring-plugins-5077120.tar.gz | |
Merge branch 'master' into master
Diffstat (limited to 'plugins/t/check_dns.t')
| -rw-r--r-- | plugins/t/check_dns.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/t/check_dns.t b/plugins/t/check_dns.t index cdfbe60d..afb2062d 100644 --- a/plugins/t/check_dns.t +++ b/plugins/t/check_dns.t | |||
| @@ -10,7 +10,7 @@ use NPTest; | |||
| 10 | 10 | ||
| 11 | plan skip_all => "check_dns not compiled" unless (-x "check_dns"); | 11 | plan skip_all => "check_dns not compiled" unless (-x "check_dns"); |
| 12 | 12 | ||
| 13 | plan tests => 19; | 13 | plan tests => 23; |
| 14 | 14 | ||
| 15 | my $successOutput = '/DNS OK: [\.0-9]+ seconds? response time/'; | 15 | my $successOutput = '/DNS OK: [\.0-9]+ seconds? response time/'; |
| 16 | 16 | ||
| @@ -105,3 +105,11 @@ cmp_ok( $res->return_code, '==', 0, "Got expected address"); | |||
| 105 | $res = NPTest->testCmd("./check_dns -H $hostname_valid -a $hostname_invalid_cidr -t 5"); | 105 | $res = NPTest->testCmd("./check_dns -H $hostname_valid -a $hostname_invalid_cidr -t 5"); |
| 106 | cmp_ok( $res->return_code, '==', 2, "Got wrong address"); | 106 | cmp_ok( $res->return_code, '==', 2, "Got wrong address"); |
| 107 | like ( $res->output, "/^DNS CRITICAL.*expected '$hostname_invalid_cidr' but got '$hostname_valid_ip'".'$/', "Output OK"); | 107 | like ( $res->output, "/^DNS CRITICAL.*expected '$hostname_invalid_cidr' but got '$hostname_valid_ip'".'$/', "Output OK"); |
| 108 | |||
| 109 | $res = NPTest->testCmd("./check_dns -H $hostname_valid -n"); | ||
| 110 | cmp_ok( $res->return_code, '==', 2, "Found $hostname_valid"); | ||
| 111 | like ( $res->output, "/^DNS CRITICAL.*Domain '$hostname_valid' was found by the server:/", "Output OK"); | ||
| 112 | |||
| 113 | $res = NPTest->testCmd("./check_dns -H $hostname_invalid -n"); | ||
| 114 | cmp_ok( $res->return_code, '==', 0, "Did not find $hostname_invalid"); | ||
| 115 | like ( $res->output, $successOutput, "Output OK" ); | ||
