Commit 839acf94 authored by Peter Eisentraut's avatar Peter Eisentraut

pg_ctl: Add tests for behavior with nonexistent data directory

This behavior was made more precise in commit
11d205e2.
parent 95c38a98
use strict;
use warnings;
use TestLib;
use Test::More tests => 10;
use Test::More tests => 11;
my $tempdir = TestLib::tempdir;
my $tempdir_short = TestLib::tempdir_short;
......@@ -10,6 +10,9 @@ program_help_ok('pg_ctl');
program_version_ok('pg_ctl');
program_options_handling_ok('pg_ctl');
command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ],
1, 'pg_ctl start with nonexistent directory');
command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data" ], 'pg_ctl initdb');
open CONF, ">>$tempdir/data/postgresql.conf";
print CONF "listen_addresses = ''\n";
......
use strict;
use warnings;
use TestLib;
use Test::More tests => 2;
use Test::More tests => 3;
my $tempdir = TestLib::tempdir;
my $tempdir_short = TestLib::tempdir_short;
command_exit_is([ 'pg_ctl', 'status', '-D', "$tempdir/nonexistent" ],
4, 'pg_ctl status with nonexistent directory');
system_or_bail "initdb -D '$tempdir'/data -A trust >/dev/null";
open CONF, ">>$tempdir/data/postgresql.conf";
print CONF "listen_addresses = ''\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment