Test file tweaks for new output.
authorGreg Sabino Mullane <[email protected]>
Thu, 30 Jun 2011 03:02:53 +0000 (23:02 -0400)
committerGreg Sabino Mullane <[email protected]>
Thu, 30 Jun 2011 03:02:53 +0000 (23:02 -0400)
24 files changed:
check_postgres.pl
t/02_autovac_freeze.t
t/02_backends.t
t/02_bloat.t
t/02_checkpoint.t
t/02_connection.t
t/02_custom_query.t
t/02_database_commitratio.t
t/02_database_hitratio.t
t/02_database_size.t
t/02_fsm_pages.t
t/02_fsm_relations.t
t/02_locks.t
t/02_new_version_bc.t
t/02_new_version_box.t
t/02_new_version_cp.t
t/02_new_version_pg.t
t/02_new_version_tnm.t
t/02_prepared_txns.t
t/02_replicate_row.t
t/02_sequence.t
t/02_slony_status.t
t/02_version.t
t/02_wal_files.t

index 4c204b19f03eeb387c9f0de8c588ab57f3889bb3..044f42080cb1619b652de411ea3f7a4b891fe9f5 100755 (executable)
@@ -1394,6 +1394,7 @@ sub add_response {
         $dbhost,
         $dbport;
     $header =~ s/\s+$//;
+    $header =~ s/^ //;
     my $perf = ($opt{showtime} and $db->{totaltime} and $action ne 'bloat') ? "time=$db->{totaltime}s" : '';
     if ($db->{perf}) {
         $db->{perf} =~ s/^ +//;
index 9f692071f596dc5d4d1f7b98e8755add9c5578c9..4fd585d3f74de8142d2b74aa6d001229381a6ab8 100644 (file)
@@ -35,7 +35,7 @@ $t = qq{$S identifies host};
 like ($result, qr{host:$host}, $t);
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid --warning option};
 like ($cp->run('--warning=40'), qr{ERROR:.+must be a percentage}, $t);
index dbc94ef9810fbd4bf30065bb77e57e6cc6a11e50..ed34ecb30f6b9d141a0d1ac175ba7d0e493d6b68 100644 (file)
@@ -55,7 +55,7 @@ SKIP: {
 }
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid warning option};
 like ($cp->run('-w felz'),     qr{^ERROR: Warning}, $t);
index 82014509aca01970ab5bec72f7139c38129ff50d..cbb9c010133ea1f50214856bae3f338b568c4ab4 100644 (file)
@@ -22,7 +22,7 @@ my $label = 'POSTGRES_BLOAT';
 my $tname = 'cp_bloat_test';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
 like ($cp->run('-w=abc'), qr{must be a size or a percentage}, $t);
index 83349000cd6d8f2c1fbca73f6a3b0f125c61097a..724e695b896f47d274413140573381191cdc3703 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'checkpoint'};
 my $label = 'POSTGRES_CHECKPOINT';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called without warning or critical};
 like ($cp->run(''), qr{Must provide a warning and/or critical}, $t);
index 6e1c5115895aa5964ae0f277df333b2f0297b3e2..d6fd219e1d876110bf68781ab3d5cdb79f105ecb 100644 (file)
@@ -35,7 +35,7 @@ $t=qq{$S returned correct version};
 like ($result, qr{ \| time=\d\.\d\ds\s$}, $t);
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid warning option};
 like ($cp->run('-w felz'),     qr{^ERROR: No warning}, $t);
index 791a0dee35d5db747c199b1a89524fc2b8bd3c26..276f62dadf208355a82955c6f9dff48f8cd5a8f5 100644 (file)
@@ -33,7 +33,7 @@ $t = qq{$S identifies host};
 like ($result, qr{host:$host}, $t);
 
 $t = qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t = qq{$S handles 'string' type for non-match};
 like ($cp->run(qq{--query="$good_query" --valtype=string --warning=abc}),
index cb7f35475aabfa4d512a1fab1544295101687456..6daad1e5e5694671a09f45181fe11c69046116d3 100644 (file)
@@ -34,7 +34,7 @@ $t=qq{$S returned expected text when warning level and critical level are specif
 like ($cp->run('-w 0% -c 0%'), qr{^$label OK:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid warning option};
 like ($cp->run('-w felz'),     qr{^ERROR: Invalid 'warning' option: must be a percentage}, $t);
index 5fcd986990e382ad5896152fc31a05dc3eecd8da..8564de1e020607361fd42c98ed47628cfece31f4 100644 (file)
@@ -34,7 +34,7 @@ $t=qq{$S returned expected text when warning level and critical level are specif
 like ($cp->run('-w 0% -c 0%'), qr{^$label OK:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid warning option};
 like ($cp->run('-w felz'),     qr{^ERROR: Invalid 'warning' option: must be a percentage}, $t);
index 0aa6d9d49fb7f77b0e38f7dd51ce419e5e909c6b..87ed11ce9cb43912459133dcba15ee31796c7a98 100644 (file)
@@ -53,7 +53,7 @@ $t=qq{$S returned expected text when warning level and critical level are specif
 like ($cp->run('-w 10GB -c 20GB'), qr{^$label OK:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid warning option};
 like ($cp->run('-w felz'),     qr{^ERROR: Invalid size}, $t);
index b67331171a22cf866477176227b3e94ba988508d..bbe5a97e5ec5036b48247ddfc0c51d65a5bd3bee 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'fsm_pages'};
 my $label = 'POSTGRES_FSM_PAGES';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
 like ($cp->run('--warning=40'), qr{ERROR:.+must be a percentage}, $t);
index a4218c1909a44bc4044226d0448ce251f322cd49..ebb21c253765d07a7d5c8ca29505f4d98d1d2a88 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'fsm_relations'};
 my $label = 'POSTGRES_FSM_RELATIONS';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
 like ($cp->run('--warning=40'), qr{ERROR:.+must be a percentage}, $t);
index ddf077d0bb248cfd5632bf5886e56205d5ba6fb0..0f497c1b9f12e3edf0aebd9dc72c9428433619e1 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'locks'};
 my $label = 'POSTGRES_LOCKS';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when invalid database used};
 like ($cp->run('--dbname=foo'), qr{database "foo" does not exist}, $t);
index f6aff082a6fc939c6b045e026e8b0f812751ec82..7e802db7cf0311073d66ff6949f90c953013b228 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'new_version_bc'};
 my $label = 'POSTGRES_NEW_VERSION_BC';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 ## No other tests for now
 
index c6920d52d04ae250f4ff0c9bc2b8e177f6352ca8..b41539b8e7fa433c1890fd040f60d7889711a68f 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'new_version_box'};
 my $label = 'POSTGRES_NEW_VERSION_BOX';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 ## No other tests for now
 
index 3a2c100b2c4d204c3824a22107ec6c05347c3cb4..dc47b01962e6535b655d508e16d83a1f093eb67a 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'new_version_cp'};
 my $label = 'POSTGRES_NEW_VERSION_CP';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S returns warning for mismatched major version};
 $cp->fake_self_version('1.2.3');
index 49683309441987a01da857997f938c3bcbe3ccda..2829f86f651d6002aece482abf4b9c149b1740da 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'new_version_pg'};
 my $label = 'POSTGRES_NEW_VERSION_PG';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S returns unknown for bizarre Postgres version};
 $cp->fake_version('7.8.12');
index a03c0b2695180a06afb5a5247a1e068998c87963..5d1b253d848d06b2ea7a81dda6c095e408d2886e 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'new_version_tnm'};
 my $label = 'POSTGRES_NEW_VERSION_TNM';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 ## No other tests for now
 
index 8cf8357830d92918538a54fd87103e9ab9297920..d588a28ca47923a85d8779d21913c056f60b64c1 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'prepare_txns'};
 my $label = 'POSTGRES_PREPARED_TXNS';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 my $ver = $dbh->{pg_server_version};
 if ($ver < 80100) {
index 0fec72f7c80d2058d269eb3701461c722b643031..8aee019be60f203e25eafd8b2180ed22d411bc38 100644 (file)
@@ -41,7 +41,7 @@ $dbh->commit();
 $dbh2->commit();
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called without warning or critical};
 like ($cp->run(''), qr{Must provide a warning and/or critical}, $t);
index fcbea4e1f8183aa308681fa7661a238e796272ca..84333005df61d441b8af1f027e168428b1d818ed 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'sequence'};
 my $label = 'POSTGRES_SEQUENCE';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
 like ($cp->run('--warning=80'), qr{ERROR:.+must be a percentage}, $t);
index 325bec716fdb6815c32d4fe1e325d204cdfcbec1..eb9c2d137341f23012cf05c830d53cbbff0d2873 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'slony_status'};
 my $label = 'POSTGRES_SLONY_STATUS';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with invalid warning};
 like ($cp->run('-w foo'), qr{ERROR:.+'warning' must be a valid time}, $t);
index fe5c54a0ce402b537a15ac213a0bd30ff638df6a..77703ac95b8d027677faab9e894335d9c7ea31b2 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'version'};
 my $label = 'POSTGRES_VERSION';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with MRTG but no option};
 like ($cp->run('--output=mrtg'), qr{ERROR: Invalid mrtg}, $t);
index f1d14c58bed9a3b4d1bee510e85350c5b3415ba7..7241825e020294b225d6b4e46495c1cf0cfa0d8d 100644 (file)
@@ -20,7 +20,7 @@ my $S = q{Action 'wal_files'};
 my $label = 'POSTGRES_WAL_FILES';
 
 $t=qq{$S fails when called with an invalid option};
-like ($cp->run('foobar=12'), qr{^\s*Usage:}, $t);
+like ($cp->run('foobar=12'), qr{Usage:}, $t);
 
 $t=qq{$S fails when called with an invalid option};
 like ($cp->run('--warning=30%'), qr{ERROR:.+must be a positive integer}, $t);