summaryrefslogtreecommitdiffstats
path: root/plugins/t/check_ntpd.t
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2007-11-10 22:55:46 +0000
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2007-11-10 22:55:46 +0000
commitcbae6033d1499fdf779fadf13217a5ae6770a850 (patch)
treede84949b475c5e019296e1213c9d1f26f4ed0b3e /plugins/t/check_ntpd.t
parent05f9bbfdc28ba8200fbc620e28f06fe58e2d6d2e (diff)
downloadmonitoring-plugins-cbae6033d1499fdf779fadf13217a5ae6770a850.tar.gz
New tests!! + single file to test all three plugins (Can be split again if ppl prefer that).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/dermoth_ntp_rework@1826 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t/check_ntpd.t')
-rw-r--r--plugins/t/check_ntpd.t57
1 files changed, 0 insertions, 57 deletions
diff --git a/plugins/t/check_ntpd.t b/plugins/t/check_ntpd.t
deleted file mode 100644
index 3c5fe2ed..00000000
--- a/plugins/t/check_ntpd.t
+++ /dev/null
@@ -1,57 +0,0 @@
1#! /usr/bin/perl -w -I ..
2#
3# Testing NTP
4#
5# $Id: check_ntp.t 1468 2006-08-14 08:42:23Z tonvoon $
6#
7
8use strict;
9use Test::More;
10use NPTest;
11
12plan tests => 4;
13
14my $res;
15
16my $ntp_service = getTestParameter( "NP_GOOD_NTP_SERVICE",
17 "A host providing NTP service",
18 "pool.ntp.org");
19
20my $no_ntp_service = getTestParameter( "NP_NO_NTP_SERVICE",
21 "A host NOT providing the NTP service",
22 "localhost" );
23
24my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
25 "The hostname of system not responsive to network requests",
26 "10.0.0.1" );
27
28my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
29 "An invalid (not known to DNS) hostname",
30 "nosuchhost");
31
32SKIP: {
33 skip "No NTP server defined", 1 unless $ntp_service;
34 $res = NPTest->testCmd(
35 "./check_ntp -H $ntp_service"
36 );
37 cmp_ok( $res->return_code, '==', 0, "Got good NTP result");
38}
39
40SKIP: {
41 skip "No bad NTP server defined", 1 unless $no_ntp_service;
42 $res = NPTest->testCmd(
43 "./check_ntp -H $no_ntp_service"
44 );
45 cmp_ok( $res->return_code, '==', 2, "Got bad NTP result");
46}
47
48$res = NPTest->testCmd(
49 "./check_ntp -H $host_nonresponsive"
50 );
51cmp_ok( $res->return_code, '==', 2, "Got critical if server not responding");
52
53$res = NPTest->testCmd(
54 "./check_ntp -H $hostname_invalid"
55 );
56cmp_ok( $res->return_code, '==', 3, "Got critical if server hostname invalid");
57