70 |
die(); |
die(); |
71 |
} |
} |
72 |
|
|
73 |
|
my @test_db; |
74 |
|
|
75 |
|
foreach (@ARGV) { |
76 |
|
if (m/^([^:]+):([^\@]+)\@(.+)/) { |
77 |
|
push |
78 |
|
%test[host] = $1; |
79 |
|
%test[user] = $2; |
80 |
|
%test |
81 |
|
my ($host,$user,$database) = ($1,$2,$3); |
82 |
|
} else { |
83 |
|
push @failures, "Can't parse configuration: host '$_' not in host:user\@database format!"; |
84 |
|
} |
85 |
|
} |
86 |
|
|
87 |
my( $dbh ) = DBI->connect( "DBI:$mode:dbname=$options{database};$options{host};$options{port}", $options{username}, $options{password} ); |
my( $dbh ) = DBI->connect( "DBI:$mode:dbname=$options{database};$options{host};$options{port}", $options{username}, $options{password} ); |
88 |
if( ! $dbh ) { |
if( ! $dbh ) { |
89 |
push( @failures, "Could not connect to $mode server $host: " . $DBI::errstr ); |
push( @failures, "Could not connect to $mode server $host: " . $DBI::errstr ); |
90 |
|
} else { |
91 |
|
my $sth = $dbh -> prepare("select count(*) from pg_tables"); |
92 |
} |
} |
93 |
|
|
94 |
|
|
95 |
|
|
96 |
if (@failures) { |
if (@failures) { |
97 |
print join (", ", @failures), "\n"; |
print join (", ", @failures), "\n"; |
98 |
exit 1; |
exit 1; |