Stub for new action tests.
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 7 Apr 2010 20:53:50 +0000 (16:53 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 7 Apr 2010 20:53:50 +0000 (16:53 -0400)
t/02_pgbouncer_checksum.t [new file with mode: 0644]

diff --git a/t/02_pgbouncer_checksum.t b/t/02_pgbouncer_checksum.t
new file mode 100644 (file)
index 0000000..030ca94
--- /dev/null
@@ -0,0 +1,31 @@
+#!perl
+
+## Test the "pgbouncer_checksum" action
+
+use 5.006;
+use strict;
+use warnings;
+use Data::Dumper;
+use Test::More tests => 2;
+use lib 't','.';
+use CP_Testing;
+
+use vars qw/$dbh $result $t $host $dbname $testtbl $testtrig_prefix/;
+
+my $cp = CP_Testing->new( {default_action => 'pgbouncer_checksum'} );
+
+$dbh = $cp->test_database_handle();
+$dbname = $cp->get_dbname;
+$host = $cp->get_host();
+
+my $S = q{Action 'pgbouncer_checksum'};
+my $label = 'POSTGRES_PGBOUNCER_CHECKSUM';
+
+$t = qq{$S reports missing flag};
+is ($cp->run(), qq{ERROR: Must provide a 'warning' or 'critical' option\n}, $t);
+
+$t = qq{$S rejects -w and -c together};
+is ($cp->run('-w abcdabcdabcdabcdabcdabcdabcdabcd -c abcdabcdabcdabcdabcdabcdabcdabcd'),
+    qq{ERROR: Can only provide 'warning' OR 'critical' option\n}, $t);
+
+exit;