diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2019-03-04 15:50:23 -0500 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2019-03-04 15:54:02 -0500 |
commit | 4eff1e9f0bf7835bee61aaaa9d6de23422a724a0 (patch) | |
tree | 20fe1e734f8a109c7996117f70fd1a7acfc45d5f /src | |
parent | 72c7c4e38610297b200721a7d5201f79e7ceef7c (diff) | |
download | postgresql-4eff1e9f0bf7835bee61aaaa9d6de23422a724a0.tar.gz postgresql-4eff1e9f0bf7835bee61aaaa9d6de23422a724a0.zip |
Allow recovery tests to run on Windows as an admin user
This is the only test that fails when run as an admin user. The reason
is that when Postgres is started via pg_ctl its admin privileges are
lowered. However, this test called 'postgres -D datadir' directly,
resulting in a failure. Replace that by calling pg_ctl and then checking
the result for the expected failure, and the logfile for the expected
error message.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/recovery/t/003_recovery_targets.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl index b46b318f5a3..61482fb4000 100644 --- a/src/test/recovery/t/003_recovery_targets.pl +++ b/src/test/recovery/t/003_recovery_targets.pl @@ -132,6 +132,11 @@ my $node_standby = get_new_node('standby_7'); $node_standby->init_from_backup($node_master, 'my_backup', has_restoring => 1); $node_standby->append_conf('postgresql.conf', "recovery_target_name = '$recovery_name' recovery_target_time = '$recovery_time'"); -command_fails_like(['postgres', '-D', $node_standby->data_dir], - qr/multiple recovery targets specified/, - 'multiple conflicting settings'); + +my $res = run_log(['pg_ctl', '-D', $node_standby->data_dir, + '-l', $node_standby->logfile, 'start']); +ok(! $res, 'invalid recovery startup fails'); + +my $logfile = slurp_file($node_standby->logfile()); +ok ($logfile =~ qr/multiple recovery targets specified/, + 'multiple conflicting settings'); |