From 04e09df17e0b17c62d3f11eb5e5f95315c00fd84 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 25 Jun 2025 19:32:32 +0900 Subject: [PATCH] Test: fix 038.pcp_commands regression test. The result of the test showed local host IP. Although the IP can be either IPv4 or IPv6, the test script hadn't considered it. To fix this, now test.sh converts IPv4 and IPv6 IP to "localhost". --- src/test/regression/tests/038.pcp_commands/expected | 8 ++++---- src/test/regression/tests/038.pcp_commands/test.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/regression/tests/038.pcp_commands/expected b/src/test/regression/tests/038.pcp_commands/expected index 45e459146..861fabb87 100644 --- a/src/test/regression/tests/038.pcp_commands/expected +++ b/src/test/regression/tests/038.pcp_commands/expected @@ -1,10 +1,10 @@ CREATE EXTENSION pgpool_adm; CREATE EXTENSION -SELECT database, status, client_host, statement FROM pcp_proc_info +SELECT database, status, case when client_host = '127.0.0.1' or client_host = '::1' then 'localhost' end, statement FROM pcp_proc_info (host => '', port => 11001, username => 't-ishii', password => 't-ishii') WHERE connected = '1' AND backend_id = '0' AND statement = 'SELECT pg_sleep(1)' - database | status | client_host | statement -----------+-----------------+-------------+-------------------- - test | Execute command | 127.0.0.1 | SELECT pg_sleep(1) + database | status | case | statement +----------+-----------------+-----------+-------------------- + test | Execute command | localhost | SELECT pg_sleep(1) (1 row) diff --git a/src/test/regression/tests/038.pcp_commands/test.sh b/src/test/regression/tests/038.pcp_commands/test.sh index cb75d4a9d..21896e44b 100755 --- a/src/test/regression/tests/038.pcp_commands/test.sh +++ b/src/test/regression/tests/038.pcp_commands/test.sh @@ -60,7 +60,7 @@ wait_for_pgpool_startup $PSQL -a -h localhost -c "SELECT pg_sleep(1)" test & $PSQL -a -h localhost test > result 2>&1 < '', port => $PCP_PORT, username => '$WHOAMI', password => '$WHOAMI') WHERE connected = '1' AND backend_id = '0' AND statement = 'SELECT pg_sleep(1)' EOF -- 2.39.5