Fix TAP installcheck tests when current directory name contains spaces

This fixes the installcheck part.  The check part has additional
problems that will be addressed in a separate commit.
This commit is contained in:
Peter Eisentraut 2014-07-23 21:41:59 -04:00
parent 4fd9e6ffdd
commit 455044d55a
4 changed files with 9 additions and 9 deletions

View File

@ -18,27 +18,27 @@ command_fails([ 'initdb', '-S', "$tempdir/data3" ],
mkdir "$tempdir/data4" or BAIL_OUT($!);
command_ok([ 'initdb', "$tempdir/data4" ], 'existing empty data directory');
system_or_bail "rm -rf $tempdir/*";
system_or_bail "rm -rf '$tempdir'/*";
command_ok([ 'initdb', "$tempdir/data", '-X', "$tempdir/pgxlog" ],
'separate xlog directory');
system_or_bail "rm -rf $tempdir/*";
system_or_bail "rm -rf '$tempdir'/*";
command_fails(
[ 'initdb', "$tempdir/data", '-X', 'pgxlog' ],
'relative xlog directory not allowed');
system_or_bail "rm -rf $tempdir/*";
system_or_bail "rm -rf '$tempdir'/*";
mkdir "$tempdir/pgxlog";
command_ok([ 'initdb', "$tempdir/data", '-X', "$tempdir/pgxlog" ],
'existing empty xlog directory');
system_or_bail "rm -rf $tempdir/*";
system_or_bail "rm -rf '$tempdir'/*";
mkdir "$tempdir/pgxlog";
mkdir "$tempdir/pgxlog/lost+found";
command_fails([ 'initdb', "$tempdir/data", '-X', "$tempdir/pgxlog" ],
'existing nonempty xlog directory');
system_or_bail "rm -rf $tempdir/*";
system_or_bail "rm -rf '$tempdir'/*";
command_ok([ 'initdb', "$tempdir/data", '-T', 'german' ],
'select default dictionary');

View File

@ -11,6 +11,6 @@ program_options_handling_ok('pg_controldata');
command_fails(['pg_controldata'], 'pg_controldata without arguments fails');
command_fails([ 'pg_controldata', 'nonexistent' ],
'pg_controldata with nonexistent directory fails');
system_or_bail "initdb -D $tempdir/data -A trust >/dev/null";
system_or_bail "initdb -D '$tempdir'/data -A trust >/dev/null";
command_like([ 'pg_controldata', "$tempdir/data" ],
qr/checkpoint/, 'pg_controldata produces output');

View File

@ -6,7 +6,7 @@ use Test::More tests => 2;
my $tempdir = TestLib::tempdir;
my $tempdir_short = TestLib::tempdir_short;
system_or_bail "initdb -D $tempdir/data -A trust >/dev/null";
system_or_bail "initdb -D '$tempdir'/data -A trust >/dev/null";
open CONF, ">>$tempdir/data/postgresql.conf";
print CONF "listen_addresses = ''\n";
print CONF "unix_socket_directories = '$tempdir_short'\n";

View File

@ -88,7 +88,7 @@ sub start_test_server
my $tempdir_short = tempdir_short;
system "initdb -D $tempdir/pgdata -A trust -N >/dev/null";
system "initdb -D '$tempdir'/pgdata -A trust -N >/dev/null";
$ret = system 'pg_ctl', '-D', "$tempdir/pgdata", '-s', '-w', '-l',
"$tempdir/logfile", '-o',
"--fsync=off -k $tempdir_short --listen-addresses='' --log-statement=all",
@ -223,7 +223,7 @@ sub issues_sql_like
truncate $test_server_logfile, 0;
my $result = run $cmd, '>', \$stdout, '2>', \$stderr;
ok($result, "@$cmd exit code 0");
my $log = `cat $test_server_logfile`;
my $log = `cat '$test_server_logfile'`;
like($log, $expected_sql, "$test_name: SQL found in server log");
};
}