From 80161c1e1c836ebed4117a12ded79c28e076ff5e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 23 Nov 2010 19:13:56 +0100 Subject: Tests for -v --- t/50-icli.t | 12 +++++++++++- t/out/list_hosts_v | 4 ++++ t/out/list_services_v | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 t/out/list_hosts_v create mode 100644 t/out/list_services_v diff --git a/t/50-icli.t b/t/50-icli.t index 9fd7983..a5fc8a6 100644 --- a/t/50-icli.t +++ b/t/50-icli.t @@ -6,7 +6,7 @@ use 5.010; # We need commas in our qw list, they're not accidental no warnings 'qw'; -use Test::Command tests => (36*3); +use Test::Command tests => (38*3); my $icli = 'bin/icli -f t/in/status.dat -c t/in/objects.cache'; @@ -91,6 +91,16 @@ $cmd->exit_is_num(0); $cmd->stdout_is_file('t/out/list_services_single'); $cmd->stderr_is_eq($EMPTY); +$cmd = Test::Command->new(cmd => "$icli -lh -v"); +$cmd->exit_is_num(0); +$cmd->stdout_is_file('t/out/list_hosts_v'); +$cmd->stderr_is_eq($EMPTY); + +$cmd = Test::Command->new(cmd => "$icli -ls -v"); +$cmd->exit_is_num(0); +$cmd->stdout_is_file('t/out/list_services_v'); +$cmd->stderr_is_eq($EMPTY); + $cmd = Test::Command->new(cmd => "$icli -lq"); $cmd->exit_is_num(0); $cmd->stdout_is_file('t/out/list_queue'); diff --git a/t/out/list_hosts_v b/t/out/list_hosts_v new file mode 100644 index 0000000..e91e60f --- /dev/null +++ b/t/out/list_hosts_v @@ -0,0 +1,4 @@ +alpha  DOWN  1/10 PING OK - Packet loss = 0%, RTA = 0.73 ms +aneurysm UNREACHABLE 1/10 PING OK - Packet loss = 0%, RTA = 0.10 ms +steel-vpn PENDING 1/10 PING OK - Packet loss = 0%, RTA = 18.01 ms +steel.derf0.net  OK  1/10 PING OK - Packet loss = 0%, RTA = 16.75 ms diff --git a/t/out/list_services_v b/t/out/list_services_v new file mode 100644 index 0000000..5738b6d --- /dev/null +++ b/t/out/list_services_v @@ -0,0 +1,35 @@ + +alpha DOWN + HTTP    OK  1/4 HTTP OK: HTTP/1.0 200 OK - 2333 bytes in 0.019 second response time + +aneurysm UNREACHABLE + Disk: /    OK  1/4 DISK OK - free space: / 4846 MB (75% inode=90%): + Disk: /boot    OK  1/4 DISK OK - free space: /boot 119 MB (53% inode=99%): + Disk: /data    OK  1/4 DISK OK - free space: /data 60091 MB (48% inode=99%): + Disk: /home    OK  1/4 DISK OK - free space: /home 58378 MB (59% inode=98%): + HTTP    OK  1/4 HTTP OK: HTTP/1.1 200 OK - 7467 bytes in 0.001 second response time + HTTPS    OK  1/4 HTTP OK: HTTP/1.1 200 OK - 7467 bytes in 0.018 second response time + Load   CRITICAL 1/4 OK - load average: 0.17, 0.13, 0.09 + Processes    UNKNOWN 1/4 PROCS OK: 118 processes + SMTP    OK  1/4 SMTP OK - 0.038 sec. response time + SSH    OK  1/4 SSH OK - OpenSSH_5.5p1 Debian-4 (protocol 2.0) + SSH password login d    OK  1/4 Password login disabled (server accepts publickey) + System Backup P  PENDING 1/1 /dev/mapper/misc-backup 109G 40G 69G 37% /backup + +steel-vpn + SMTP    OK  1/4 SMTP OK - 0.080 sec. response time + +steel.derf0.net + Disk: lv-home    OK  1/4 DISK OK - free space: /home 20207 MB (95% inode=99%): + Disk: lv-root    OK  1/4 DISK OK - free space: / 5330 MB (85% inode=90%): + Disk: vda1    OK  1/4 DISK OK - free space: /boot 190 MB (88% inode=99%): + HTTP    OK  1/4 HTTP OK: HTTP/1.1 200 OK - 668 bytes in 0.040 second response time + Load    OK  1/4 OK - load average: 0.00, 0.00, 0.00 + Mail Queue    OK  1/4 OK: mailq reports queue is empty + No open relay    OK  1/4 NORELAY OK: <** 554 5.7.1 : Relay access denied + Not Blacklisted    OK  1/4 CHECK_RBL OK - steel.derf0.net BLACKLISTED on 0 servers of 43 + Processes    OK  1/4 PROCS OK: 82 processes + SMTP    OK  1/4 SMTP OK - 0.122 sec. response time + SSH    OK  1/4 SSH OK - OpenSSH_5.5p1 Debian-4 (protocol 2.0) + SSH password login d    OK  1/4 Password login disabled (server accepts publickey) + Users    WARNING 1/4 USERS OK - 0 users currently logged in -- cgit v1.2.3