Skip to content

Commit 839acf9

Browse files
committed
pg_ctl: Add tests for behavior with nonexistent data directory
This behavior was made more precise in commit 11d205e.
1 parent 95c38a9 commit 839acf9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/bin/pg_ctl/t/001_start_stop.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use strict;
22
use warnings;
33
use TestLib;
4-
use Test::More tests => 10;
4+
use Test::More tests => 11;
55

66
my $tempdir = TestLib::tempdir;
77
my $tempdir_short = TestLib::tempdir_short;
@@ -10,6 +10,9 @@
1010
program_version_ok('pg_ctl');
1111
program_options_handling_ok('pg_ctl');
1212

13+
command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ],
14+
1, 'pg_ctl start with nonexistent directory');
15+
1316
command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data" ], 'pg_ctl initdb');
1417
open CONF, ">>$tempdir/data/postgresql.conf";
1518
print CONF "listen_addresses = ''\n";

src/bin/pg_ctl/t/002_status.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
use strict;
22
use warnings;
33
use TestLib;
4-
use Test::More tests => 2;
4+
use Test::More tests => 3;
55

66
my $tempdir = TestLib::tempdir;
77
my $tempdir_short = TestLib::tempdir_short;
88

9+
command_exit_is([ 'pg_ctl', 'status', '-D', "$tempdir/nonexistent" ],
10+
4, 'pg_ctl status with nonexistent directory');
11+
912
system_or_bail "initdb -D '$tempdir'/data -A trust >/dev/null";
1013
open CONF, ">>$tempdir/data/postgresql.conf";
1114
print CONF "listen_addresses = ''\n";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy