Clean up more unused variables in perl code

This is a continuation of 0c1aca461481, with some cleanup in:
- msvc_gendef.pl
- pgindent
- 005_negotiate_encryption.pl, as of an oversight of d39a49c1e459 that
has removed %params in test_matrix(), making also $server_config
useless.

Author: Dagfinn Ilmari Mannsåker
Discussion: https://postgr.es/m/87wmm4dkci.fsf@wibble.ilmari.org
This commit is contained in:
Michael Paquier 2024-07-03 12:43:57 +09:00
parent dec9d4acdb
commit dd569214aa
3 changed files with 7 additions and 22 deletions

View File

@ -215,11 +215,6 @@ my @all_gssencmodes = ('disable', 'prefer', 'require');
my @all_sslmodes = ('disable', 'allow', 'prefer', 'require'); my @all_sslmodes = ('disable', 'allow', 'prefer', 'require');
my @all_sslnegotiations = ('postgres', 'direct'); my @all_sslnegotiations = ('postgres', 'direct');
my $server_config = {
server_ssl => 0,
server_gss => 0,
};
### ###
### Run tests with GSS and SSL disabled in the server ### Run tests with GSS and SSL disabled in the server
### ###
@ -272,7 +267,7 @@ testuser require * * - -> fail
}; };
note("Running tests with SSL and GSS disabled in the server"); note("Running tests with SSL and GSS disabled in the server");
test_matrix($node, $server_config, test_matrix($node,
['testuser'], \@all_gssencmodes, \@all_sslmodes, \@all_sslnegotiations, ['testuser'], \@all_gssencmodes, \@all_sslmodes, \@all_sslnegotiations,
parse_table($test_table)); parse_table($test_table));
@ -311,19 +306,15 @@ nossluser . disable postgres connect, authok
# Enable SSL in the server # Enable SSL in the server
$node->adjust_conf('postgresql.conf', 'ssl', 'on'); $node->adjust_conf('postgresql.conf', 'ssl', 'on');
$node->reload; $node->reload;
$server_config->{server_ssl} = 1;
note("Running tests with SSL enabled in server"); note("Running tests with SSL enabled in server");
test_matrix( test_matrix($node, [ 'testuser', 'ssluser', 'nossluser' ],
$node, $server_config, ['disable'], \@all_sslmodes, \@all_sslnegotiations,
[ 'testuser', 'ssluser', 'nossluser' ], ['disable'],
\@all_sslmodes, \@all_sslnegotiations,
parse_table($test_table)); parse_table($test_table));
# Disable SSL again # Disable SSL again
$node->adjust_conf('postgresql.conf', 'ssl', 'off'); $node->adjust_conf('postgresql.conf', 'ssl', 'off');
$node->reload; $node->reload;
$server_config->{server_ssl} = 0;
} }
### ###
@ -336,7 +327,6 @@ SKIP:
$krb->create_principal('gssuser', $gssuser_password); $krb->create_principal('gssuser', $gssuser_password);
$krb->create_ticket('gssuser', $gssuser_password); $krb->create_ticket('gssuser', $gssuser_password);
$server_config->{server_gss} = 1;
$test_table = q{ $test_table = q{
# USER GSSENCMODE SSLMODE SSLNEGOTIATION EVENTS -> OUTCOME # USER GSSENCMODE SSLMODE SSLNEGOTIATION EVENTS -> OUTCOME
@ -400,7 +390,7 @@ nogssuser disable disable postgres connect, authok
} }
note("Running tests with GSS enabled in server"); note("Running tests with GSS enabled in server");
test_matrix($node, $server_config, [ 'testuser', 'gssuser', 'nogssuser' ], test_matrix($node, [ 'testuser', 'gssuser', 'nogssuser' ],
\@all_gssencmodes, $sslmodes, $sslnegotiations, \@all_gssencmodes, $sslmodes, $sslnegotiations,
parse_table($test_table)); parse_table($test_table));
} }
@ -423,7 +413,6 @@ SKIP:
# Enable SSL # Enable SSL
$node->adjust_conf('postgresql.conf', 'ssl', 'on'); $node->adjust_conf('postgresql.conf', 'ssl', 'on');
$node->reload; $node->reload;
$server_config->{server_ssl} = 1;
$test_table = q{ $test_table = q{
# USER GSSENCMODE SSLMODE SSLNEGOTIATION EVENTS -> OUTCOME # USER GSSENCMODE SSLMODE SSLNEGOTIATION EVENTS -> OUTCOME
@ -510,7 +499,6 @@ nossluser disable disable postgres connect, authok
note("Running tests with both GSS and SSL enabled in server"); note("Running tests with both GSS and SSL enabled in server");
test_matrix( test_matrix(
$node, $node,
$server_config,
[ 'testuser', 'gssuser', 'ssluser', 'nogssuser', 'nossluser' ], [ 'testuser', 'gssuser', 'ssluser', 'nogssuser', 'nossluser' ],
\@all_gssencmodes, \@all_gssencmodes,
\@all_sslmodes, \@all_sslmodes,
@ -546,8 +534,8 @@ sub test_matrix
{ {
local $Test::Builder::Level = $Test::Builder::Level + 1; local $Test::Builder::Level = $Test::Builder::Level + 1;
my ($pg_node, $node_conf, my ($pg_node, $test_users, $gssencmodes, $sslmodes, $sslnegotiations,
$test_users, $gssencmodes, $sslmodes, $sslnegotiations, %expected) %expected)
= @_; = @_;
foreach my $test_user (@{$test_users}) foreach my $test_user (@{$test_users})

View File

@ -6,8 +6,6 @@ use warnings FATAL => 'all';
use List::Util qw(min); use List::Util qw(min);
use Getopt::Long; use Getopt::Long;
my @def;
# #
# Script that generates a .DEF file for all objects in a directory # Script that generates a .DEF file for all objects in a directory
# #

View File

@ -21,8 +21,7 @@ my $indent_opts =
my $devnull = File::Spec->devnull; my $devnull = File::Spec->devnull;
my ($typedefs_file, $typedef_str, @excludes, my ($typedefs_file, $typedef_str, @excludes, $indent, $diff,
$indent, $build, $diff,
$check, $help, @commits,); $check, $help, @commits,);
$help = 0; $help = 0;