diff --git a/src/bin/pg_basebackup/t/030_pg_recvlogical.pl b/src/bin/pg_basebackup/t/030_pg_recvlogical.pl index 063ad96b9be..757e66193fb 100644 --- a/src/bin/pg_basebackup/t/030_pg_recvlogical.pl +++ b/src/bin/pg_basebackup/t/030_pg_recvlogical.pl @@ -15,7 +15,7 @@ program_options_handling_ok('pg_recvlogical'); my $node = PostgreSQL::Test::Cluster->new('main'); # Initialize node without replication settings -$node->init(allows_streaming => 1, has_archiving => 1); +$node->init(allows_streaming => 1, has_archiving => 1, extra => [ '--allow-group-access' ]); $node->append_conf( 'postgresql.conf', q{ wal_level = 'logical' @@ -236,6 +236,18 @@ my $count = (() = $outfiledata =~ /INSERT/g); cmp_ok($count, '==', 2, 'pg_recvlogical has received and written two INSERTs'); +# Check that the output file respects the cluster's group access permissions +SKIP: +{ + skip "unix-style permissions not supported on Windows", 1 + if ($Config{osname} eq 'MSWin32' || $Config{osname} eq 'cygwin'); + + # The cluster was initialized with --allow-group-access, so the output + # file created by pg_recvlogical should be 0640 (-rw-r-----). + my $mode = sprintf('%04o', (stat($outfile))[2] & 07777); + is($mode, '0640', 'pg_recvlogical output file respects group permissions (0640)'); +} + $node->command_ok( [ 'pg_recvlogical',