summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2010-04-07 20:53:50 +0000
committerGreg Sabino Mullane2010-04-07 20:53:50 +0000
commite1a07ec2cc65eeac7c5f976013b149aa58f65e13 (patch)
tree7b3365c60883cb938c2f6c4790f7b40a4a82a1d9
parentc5aacbe6c004082d96efcec34e9c6666c206e2ce (diff)
Stub for new action tests.
-rw-r--r--t/02_pgbouncer_checksum.t31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/02_pgbouncer_checksum.t b/t/02_pgbouncer_checksum.t
new file mode 100644
index 000000000..030ca94ec
--- /dev/null
+++ b/t/02_pgbouncer_checksum.t
@@ -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;