Tom Lane <tgl@sss.pgh.pa.us> writes:
> I wrote:
>> The Windows animals don't like this:
>> pg_basebackup: error: connection to server at "127.0.0.1", port 59539
>> failed: FATAL: SSPI authentication failed for user "backupuser"
>
>> Not sure whether we have a standard method to get around that.
>
> Ah, right, we do. Looks like adding something like
>
> auth_extra => [ '--create-role', 'backupuser' ]
>
> to the $node->init call would do it, or you could mess with
> invoking pg_regress --config-auth directly.
This was enough incentive for me to set up Cirrus-CI for my fork on
GitHub, and the auth_extra approach in the attached patch fixed the
test:
https://cirrus-ci.com/task/6578617030279168?logs=test_bin#L21
- ilmari
From fec0e29ac0f57d1449229849b837438dfb0b9a07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Thu, 3 Feb 2022 15:45:50 +0000
Subject: [PATCH] Fix non-superuser server-side basebackup test on Windows
Windows doesn't do trust auth for local users by default, but needs
explicitly allowing the OS user to authenticate as the extra user.
---
src/bin/pg_basebackup/t/010_pg_basebackup.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index 2283a8c42d..f996c6e9b9 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -31,7 +31,7 @@
umask(0077);
# Initialize node without replication settings
-$node->init(extra => ['--data-checksums']);
+$node->init(extra => ['--data-checksums'], auth_extra => ['--create-role', 'backupuser']);
$node->start;
my $pgdata = $node->data_dir;
--
2.30.2