git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bde2fb7)
postgres_fdw: Fix tests on some Windows variants
2025年3月26日 05:56:52 +0000 (06:56 +0100)
2025年3月26日 06:00:00 +0000 (07:00 +0100)
The tests introduced by commit 76563f88cfb only work when Unix-domain
sockets are available. This is optional on Windows, and buildfarm
member drongo runs without them. To fix, skip the test if Unix-domain
sockets are not enabled.


diff --git a/contrib/postgres_fdw/t/001_auth_scram.pl b/contrib/postgres_fdw/t/001_auth_scram.pl
index 2cce21b0fdb574e40c598336337943e000fc35cc..ba178246eb7a12e34f5f4789079a20789ce34b00 100644 (file)
--- a/contrib/postgres_fdw/t/001_auth_scram.pl
+++ b/contrib/postgres_fdw/t/001_auth_scram.pl
@@ -68,46 +68,51 @@ test_fdw_auth($node1, $db0, "t2", $fdw_server2,
test_auth($node2, $db2, "t2",
"SCRAM auth directly on foreign server should still succeed");
-# Ensure that trust connections fail without superuser opt-in.
-unlink($node1->data_dir . '/pg_hba.conf');
-unlink($node2->data_dir . '/pg_hba.conf');
+SKIP:
+{
+ skip "test requires Unix-domain sockets", 4 if !$use_unix_sockets;
+
+ # Ensure that trust connections fail without superuser opt-in.
+ unlink($node1->data_dir . '/pg_hba.conf');
+ unlink($node2->data_dir . '/pg_hba.conf');
-$node1->append_conf(
- 'pg_hba.conf', qq{
+$node1->append_conf(
+ 'pg_hba.conf', qq{
local db0 all scram-sha-256
local db1 all trust
}
-);
-$node2->append_conf(
- 'pg_hba.conf', qq{
+);
+$node2->append_conf(
+ 'pg_hba.conf', qq{
local all all password
}
-);
-
-$node1->restart;
-$node2->restart;
-
-my ($ret, $stdout, $stderr) = $node1->psql(
- $db0,
- qq'select count(1) from t',
- connstr => $node1->connstr($db0) . " user=$user");
-
-is($ret, 3, 'loopback trust fails on the same cluster');
-like(
- $stderr,
- qr/failed: authentication method requirement "scram-sha-256"/,
- 'expected error from loopback trust (same cluster)');
-
-($ret, $stdout, $stderr) = $node1->psql(
- $db0,
- qq'select count(1) from t2',
- connstr => $node1->connstr($db0) . " user=$user");
-
-is($ret, 3, 'loopback password fails on a different cluster');
-like(
- $stderr,
- qr/failed: authentication method requirement "scram-sha-256"/,
- 'expected error from loopback password (different cluster)');
+ );
+
+ $node1->restart;
+ $node2->restart;
+
+ my ($ret, $stdout, $stderr) = $node1->psql(
+ $db0,
+ qq'select count(1) from t',
+ connstr => $node1->connstr($db0) . " user=$user");
+
+ is($ret, 3, 'loopback trust fails on the same cluster');
+ like(
+ $stderr,
+ qr/failed: authentication method requirement "scram-sha-256"/,
+ 'expected error from loopback trust (same cluster)');
+
+ ($ret, $stdout, $stderr) = $node1->psql(
+ $db0,
+ qq'select count(1) from t2',
+ connstr => $node1->connstr($db0) . " user=$user");
+
+ is($ret, 3, 'loopback password fails on a different cluster');
+ like(
+ $stderr,
+ qr/failed: authentication method requirement "scram-sha-256"/,
+ 'expected error from loopback password (different cluster)');
+}
# Helper functions
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /