26 lines
1.1 KiB
Perl
26 lines
1.1 KiB
Perl
use strict;
|
|
use warnings;
|
|
use TestLib;
|
|
use Test::More tests => 10;
|
|
|
|
my $tempdir = TestLib::tempdir;
|
|
|
|
program_help_ok('pg_ctl');
|
|
program_version_ok('pg_ctl');
|
|
program_options_handling_ok('pg_ctl');
|
|
|
|
command_ok(['pg_ctl', 'initdb', '-D', "$tempdir/data"], 'pg_ctl initdb');
|
|
open CONF, ">>$tempdir/data/postgresql.conf";
|
|
print CONF "listen_addresses = ''\n";
|
|
print CONF "unix_socket_directories = '$tempdir'\n";
|
|
close CONF;
|
|
command_ok(['pg_ctl', 'start', '-D', "$tempdir/data", '-w'], 'pg_ctl start -w');
|
|
command_ok(['pg_ctl', 'start', '-D', "$tempdir/data", '-w'], 'second pg_ctl start succeeds');
|
|
command_ok(['pg_ctl', 'stop', '-D', "$tempdir/data", '-w', '-m', 'fast'], 'pg_ctl stop -w');
|
|
command_fails(['pg_ctl', 'stop', '-D', "$tempdir/data", '-w', '-m', 'fast'], 'second pg_ctl stop fails');
|
|
|
|
command_ok(['pg_ctl', 'restart', '-D', "$tempdir/data", '-w', '-m', 'fast'], 'pg_ctl restart with server not running');
|
|
command_ok(['pg_ctl', 'restart', '-D', "$tempdir/data", '-w', '-m', 'fast'], 'pg_ctl restart with server running');
|
|
|
|
system_or_bail 'pg_ctl', '-s', 'stop', '-D', "$tempdir/data", '-m', 'fast';
|