diff options
Diffstat (limited to 'src/bin/scripts/t/011_clusterdb_all.pl')
-rw-r--r-- | src/bin/scripts/t/011_clusterdb_all.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl index c7e8514fb6c..da10ccf18b2 100644 --- a/src/bin/scripts/t/011_clusterdb_all.pl +++ b/src/bin/scripts/t/011_clusterdb_all.pl @@ -6,7 +6,7 @@ use warnings; use PostgresNode; use TestLib; -use Test::More tests => 2; +use Test::More tests => 4; my $node = get_new_node('main'); $node->init; @@ -20,3 +20,16 @@ $node->issues_sql_like( [ 'clusterdb', '-a' ], qr/statement: CLUSTER.*statement: CLUSTER/s, 'cluster all databases'); + +$node->safe_psql( + 'postgres', q( + CREATE DATABASE regression_invalid; + UPDATE pg_database SET datconnlimit = -2 WHERE datname = 'regression_invalid'; +)); +$node->command_ok([ 'clusterdb', '-a' ], + 'invalid database not targeted by clusterdb -a'); + +# Doesn't quite belong here, but don't want to waste time by creating an +# invalid database in 010_clusterdb.pl as well. +$node->command_fails([ 'clusterdb', '-d', 'regression_invalid'], + 'clusterdb cannot target invalid database'); |