diff options
| author | Paul Buetow <paul@buetow.org> | 2015-01-02 14:00:56 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2015-01-02 14:00:56 +0100 |
| commit | 4f27f3ea59baa6cfca0ac1df96b1dfedbd83706c (patch) | |
| tree | 79754e3c49216f80cb3ad5579851fca0bf1a31c9 /t/get_interactive.t | |
initial
Diffstat (limited to 't/get_interactive.t')
| -rw-r--r-- | t/get_interactive.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/get_interactive.t b/t/get_interactive.t new file mode 100644 index 0000000..85ae878 --- /dev/null +++ b/t/get_interactive.t @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use v5.10; + +use JSON; +use Test::More; + +chdir '..'; +my $json; + +$json = decode_json `./mon --nocolor insert host set use = generic-host and name = footest.server.lan and host_name = footest.server.lan and address = 127.0.0.1`; +cmp_ok($json->{message}, 'eq', '1 changes successfully commited', 'Testing insert'); + +$json = decode_json `./mon --nocolor get host where name like footest.server.lan`; +cmp_ok($json->[0]{address}, 'eq', '127.0.0.1', 'Testing get'); + +$json = decode_json `./mon --nocolor get host`; +cmp_ok(scalar @$json, '>', '1', 'Testing get'); + +$json = decode_json `./mon --nocolor delete host where name like footest.server.lan`; +cmp_ok($json->{message}, 'eq', '1 changes successfully commited', 'Testing delete'); + +done_testing(); |
