From 7b3fb760fafb1584782e588b8c3ecc7d1fce0aee Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Thu, 16 Sep 2021 17:39:26 +0300 Subject: [PATCH] [test_runner] psql should be oblivious to user's preferences This makes psql ignore $HOME/.psqlrc --- test_runner/fixtures/zenith_fixtures.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test_runner/fixtures/zenith_fixtures.py b/test_runner/fixtures/zenith_fixtures.py index 1c97e886fc..903d097ce2 100644 --- a/test_runner/fixtures/zenith_fixtures.py +++ b/test_runner/fixtures/zenith_fixtures.py @@ -1031,12 +1031,18 @@ def check_restored_datadir_content(zenith_cli: ZenithCli, test_output_dir: str, pg.stop() # Take a basebackup from pageserver - restored_dir_path = os.path.join(test_output_dir, "{}_restored_datadir".format(pg.branch)) + restored_dir_path = os.path.join(test_output_dir, f"{pg.branch}_restored_datadir") mkdir_if_needed(restored_dir_path) - cmd = f"psql -h localhost -p {pageserver_pg_port} -c 'basebackup {pg.tenant_id} {timeline}' | tar -x -C {restored_dir_path}" + psql_path = os.path.join(pg.pg_bin.pg_bin_path, 'psql') - cmd = os.path.join(pg.pg_bin.pg_bin_path, cmd) + cmd = rf""" + {psql_path} \ + --no-psqlrc \ + postgres://localhost:{pageserver_pg_port} \ + -c 'basebackup {pg.tenant_id} {timeline}' \ + | tar -x -C {restored_dir_path} + """ subprocess.check_call(cmd, shell=True)