Skip to content

Commit 86ff777

Browse files
OffgridwithJDclaude
andcommitted
ci: perltidy the test suite to satisfy the pgperltidy check
The pgperltidy half of the "Check" CI job was red because 27 test files predated (or were not run through) perltidy. Reformat them with the project profile (src/tools/pgindent/perltidyrc, perltidy v20250105, the version CI uses) so the check passes. Formatting only: every change is whitespace/line-wrapping and the token stream of each file is unchanged. A sample of the reformatted tests still passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c9f7e1b commit 86ff777

27 files changed

Lines changed: 177 additions & 84 deletions

t/CosmianKms.pm

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ sub gen_certs
3333

3434
# CA
3535
system_or_bail(
36-
'openssl', 'req', '-x509', '-newkey',
37-
'rsa:2048', '-nodes', '-days', '1',
38-
'-keyout', "$dir/ca.key", '-out', "$dir/ca.pem",
36+
'openssl', 'req',
37+
'-x509', '-newkey',
38+
'rsa:2048', '-nodes',
39+
'-days', '1',
40+
'-keyout', "$dir/ca.key",
41+
'-out', "$dir/ca.pem",
3942
'-subj', '/CN=open_pg_tde-test-ca');
4043

4144
# Server CSR + signed cert
@@ -65,9 +68,12 @@ sub gen_certs
6568

6669
# Client CSR + signed cert
6770
system_or_bail(
68-
'openssl', 'req', '-newkey', 'rsa:2048',
69-
'-nodes', '-keyout', "$dir/client.key", '-out',
70-
"$dir/client.csr", '-subj', '/CN=open_pg_tde-client');
71+
'openssl', 'req',
72+
'-newkey', 'rsa:2048',
73+
'-nodes', '-keyout',
74+
"$dir/client.key", '-out',
75+
"$dir/client.csr", '-subj',
76+
'/CN=open_pg_tde-client');
7177
system_or_bail(
7278
'openssl', 'x509',
7379
'-req', '-in',

t/basic.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
my $node = PostgreSQL::Test::Cluster->new('main');
1212
$node->init;
13-
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'open_pg_tde'");
13+
$node->append_conf('postgresql.conf',
14+
"shared_preload_libraries = 'open_pg_tde'");
1415
$node->start;
1516

1617
$node->safe_psql('postgres', 'CREATE EXTENSION open_pg_tde;');
@@ -35,7 +36,8 @@
3536
'only whitelisted functions are callable by public');
3637

3738
$stdout = $node->safe_psql('postgres',
38-
"SELECT extname, extversion FROM pg_extension WHERE extname = 'open_pg_tde';");
39+
"SELECT extname, extversion FROM pg_extension WHERE extname = 'open_pg_tde';"
40+
);
3941
is($stdout, 'open_pg_tde|2.2', 'is installed with right version');
4042

4143
(undef, undef, $stderr) = $node->psql('postgres',

t/change_key_provider.pl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
my $node = PostgreSQL::Test::Cluster->new('main');
1313
$node->init;
14-
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'open_pg_tde'");
14+
$node->append_conf('postgresql.conf',
15+
"shared_preload_libraries = 'open_pg_tde'");
1516
$node->start;
1617

1718
$node->safe_psql(
@@ -37,7 +38,8 @@
3738

3839
$node->safe_psql('postgres', "SELECT open_pg_tde_verify_key();");
3940
$stdout =
40-
$node->safe_psql('postgres', "SELECT open_pg_tde_is_encrypted('test_enc');");
41+
$node->safe_psql('postgres',
42+
"SELECT open_pg_tde_is_encrypted('test_enc');");
4143
is($stdout, 't', 'relation is encrypted');
4244
$stdout = $node->safe_psql('postgres', 'SELECT * FROM test_enc ORDER BY id;');
4345
is($stdout, "1|5\n2|6", 'relation can be read');
@@ -56,7 +58,8 @@
5658

5759
$node->safe_psql('postgres', "SELECT open_pg_tde_verify_key();");
5860
$stdout =
59-
$node->safe_psql('postgres', "SELECT open_pg_tde_is_encrypted('test_enc');");
61+
$node->safe_psql('postgres',
62+
"SELECT open_pg_tde_is_encrypted('test_enc');");
6063
is($stdout, 't', 'relation is still encrypted');
6164
$stdout = $node->safe_psql('postgres', 'SELECT * FROM test_enc ORDER BY id;');
6265
is($stdout, "1|5\n2|6", 'relation can still be read');
@@ -65,7 +68,8 @@
6568

6669
$node->safe_psql('postgres', "SELECT open_pg_tde_verify_key();");
6770
$stdout =
68-
$node->safe_psql('postgres', "SELECT open_pg_tde_is_encrypted('test_enc');");
71+
$node->safe_psql('postgres',
72+
"SELECT open_pg_tde_is_encrypted('test_enc');");
6973
is($stdout, 't', 'relation is encrypted after restart');
7074
$stdout = $node->safe_psql('postgres', 'SELECT * FROM test_enc ORDER BY id;');
7175
is($stdout, "1|5\n2|6", 'relation can be read after restart');
@@ -81,7 +85,8 @@
8185
qr/ERROR: key "test-key" not found in key provider "file-vault"/,
8286
'verificaiton fails after we have moved the key');
8387
$stdout =
84-
$node->safe_psql('postgres', "SELECT open_pg_tde_is_encrypted('test_enc');");
88+
$node->safe_psql('postgres',
89+
"SELECT open_pg_tde_is_encrypted('test_enc');");
8590
is($stdout, 't', 'encryption check does not require a key');
8691
$stderr = ($node->psql('postgres', 'SELECT * FROM test_enc ORDER BY id;'))[2];
8792
like(
@@ -102,7 +107,8 @@
102107

103108
$node->safe_psql('postgres', "SELECT open_pg_tde_verify_key();");
104109
$stdout =
105-
$node->safe_psql('postgres', "SELECT open_pg_tde_is_encrypted('test_enc');");
110+
$node->safe_psql('postgres',
111+
"SELECT open_pg_tde_is_encrypted('test_enc');");
106112
is($stdout, 't', 'relation is encrypted after restoring provider');
107113
$stdout = $node->safe_psql('postgres', 'SELECT * FROM test_enc ORDER BY id;');
108114
is($stdout, "1|5\n2|6", 'relation can be read after restoring provider');

t/checksum_hint_bits.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,18 @@
6464
is($node->safe_psql('postgres', "SELECT s FROM t_xts WHERE id = 4999"),
6565
'xts-4999', 'XTS row content is correct after restart');
6666
is($node->safe_psql('postgres', 'SELECT count(*) FROM t_xts256'),
67-
'5000', 'XTS-256 table reads back after hint bits, checksums, and restart');
67+
'5000',
68+
'XTS-256 table reads back after hint bits, checksums, and restart');
6869
is($node->safe_psql('postgres', "SELECT s FROM t_xts256 WHERE id = 4999"),
6970
'xts256-4999', 'XTS-256 row content is correct after restart');
7071

7172
# A full scan verifies the checksum of every page of each table; if any page
7273
# failed verification the query would error.
7374
is($node->safe_psql('postgres', 'SELECT sum(length(s)) > 0 FROM t_xts'),
7475
't', 'full scan of the XTS table passes page checksum verification');
75-
is($node->safe_psql('postgres', 'SELECT sum(length(s)) > 0 FROM t_xts256'),
76-
't', 'full scan of the XTS-256 table passes page checksum verification');
76+
is( $node->safe_psql('postgres', 'SELECT sum(length(s)) > 0 FROM t_xts256'),
77+
't',
78+
'full scan of the XTS-256 table passes page checksum verification');
7779

7880
# No checksum-verification failures were logged.
7981
my $log = slurp_file($node->logfile);

t/cipher_selection.pl

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
my $node = PostgreSQL::Test::Cluster->new('main');
1414
$node->init;
15-
$node->append_conf('postgresql.conf', q{shared_preload_libraries = 'open_pg_tde'});
15+
$node->append_conf('postgresql.conf',
16+
q{shared_preload_libraries = 'open_pg_tde'});
1617
$node->start;
1718

1819
my $keyring = $node->basedir . '/cipher_selection.per';
@@ -30,12 +31,16 @@
3031
'aes_xts', 'open_pg_tde.data_cipher defaults to aes_xts');
3132

3233
is( $node->safe_psql(
33-
'postgres', 'SET open_pg_tde.data_cipher = aes_256_xts; SHOW open_pg_tde.data_cipher'),
34+
'postgres',
35+
'SET open_pg_tde.data_cipher = aes_256_xts; SHOW open_pg_tde.data_cipher'
36+
),
3437
'aes_256_xts',
3538
'open_pg_tde.data_cipher accepts aes_256_xts');
3639

3740
is( $node->safe_psql(
38-
'postgres', 'SET open_pg_tde.data_cipher = aes_xts; SHOW open_pg_tde.data_cipher'),
41+
'postgres',
42+
'SET open_pg_tde.data_cipher = aes_xts; SHOW open_pg_tde.data_cipher'
43+
),
3944
'aes_xts',
4045
'open_pg_tde.data_cipher accepts aes_xts');
4146

@@ -46,7 +51,9 @@
4651
my ($rc, $stdout, $stderr) =
4752
$node->psql('postgres', "SET open_pg_tde.data_cipher = $bad");
4853
isnt($rc, 0, "open_pg_tde.data_cipher rejects $bad");
49-
like($stderr, qr/invalid value for parameter "open_pg_tde.data_cipher"/,
54+
like(
55+
$stderr,
56+
qr/invalid value for parameter "open_pg_tde.data_cipher"/,
5057
"$bad produces the expected error");
5158
}
5259

@@ -60,7 +67,8 @@
6067
'postgres',
6168
'SET open_pg_tde.cipher = aes_256; SET open_pg_tde.data_cipher = inherit; '
6269
. 'CREATE TABLE t_inherit(id int) USING tde_heap; '
63-
. 'INSERT INTO t_inherit VALUES (1); SELECT count(*) FROM t_inherit;'),
70+
. 'INSERT INTO t_inherit VALUES (1); SELECT count(*) FROM t_inherit;'
71+
),
6472
'1',
6573
'inherit creates a working encrypted table (mapped to XTS)');
6674

@@ -90,7 +98,8 @@
9098
for my $case ([ 't256', $canary256 ], [ 't128', $canary128 ])
9199
{
92100
my ($tbl, $canary) = @$case;
93-
my $rel = $node->safe_psql('postgres', "SELECT pg_relation_filepath('$tbl')");
101+
my $rel =
102+
$node->safe_psql('postgres', "SELECT pg_relation_filepath('$tbl')");
94103
my $blob = slurp_file($node->data_dir . '/' . $rel);
95104
unlike($blob, qr/\Q$canary\E/, "$tbl is ciphertext on disk");
96105
}

t/crash_recovery.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117

118118
# Sanity check to see that we are testing somthing useful
119119
$stdout =
120-
$node->safe_psql('postgres', "SELECT open_pg_tde_is_encrypted('seq_unlogged');");
120+
$node->safe_psql('postgres',
121+
"SELECT open_pg_tde_is_encrypted('seq_unlogged');");
121122
is($stdout, 't', 'sequence is encrypted');
122123

123124
$node->kill9;

t/default_principal_key.pl

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
my $node = PostgreSQL::Test::Cluster->new('main');
1212
$node->init;
13-
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'open_pg_tde'");
13+
$node->append_conf('postgresql.conf',
14+
"shared_preload_libraries = 'open_pg_tde'");
1415
$node->start;
1516

1617
$node->safe_psql(
@@ -37,7 +38,8 @@
3738
SELECT open_pg_tde_set_default_key_using_global_key_provider('default-key', 'file-provider');
3839
));
3940

40-
$stdout = $node->safe_psql('postgres', 'SELECT open_pg_tde_verify_default_key();');
41+
$stdout =
42+
$node->safe_psql('postgres', 'SELECT open_pg_tde_verify_default_key();');
4143
is($stdout, '', 'verification succeeds now that we have a key');
4244

4345
$stdout = $node->safe_psql('postgres',
@@ -66,30 +68,34 @@
6668

6769
# Database: postgres
6870
$stdout = $node->safe_psql('postgres',
69-
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();');
71+
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();'
72+
);
7073
is($stdout, '||', 'default key has not been localized yet in postgres');
7174
$node->safe_psql(
7275
'postgres', qq(
7376
CREATE TABLE test_enc (x int PRIMARY KEY) USING tde_heap;
7477
INSERT INTO test_enc (x) VALUES (1), (2);
7578
));
7679
$stdout = $node->safe_psql('postgres',
77-
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();');
80+
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();'
81+
);
7882
is( $stdout,
7983
'-1|file-provider|default-key',
8084
'default key is now localized in postgres');
8185

8286
# Database: other
8387
$stdout = $node->safe_psql('other',
84-
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();');
88+
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();'
89+
);
8590
is($stdout, '||', 'default key has not been localized yet in other');
8691
$node->safe_psql(
8792
'other', qq(
8893
CREATE TABLE test_enc (x int PRIMARY KEY) USING tde_heap;
8994
INSERT INTO test_enc (x) VALUES (1), (2);
9095
));
9196
$stdout = $node->safe_psql('other',
92-
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();');
97+
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();'
98+
);
9399
is( $stdout,
94100
'-1|file-provider|default-key',
95101
'default key is now localized in other');
@@ -103,12 +109,14 @@
103109
));
104110

105111
$stdout = $node->safe_psql('postgres',
106-
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();');
112+
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();'
113+
);
107114
is( $stdout,
108115
'-1|file-provider|new-default-key',
109116
'default key is now localized in postgres');
110117
$stdout = $node->safe_psql('other',
111-
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();');
118+
'SELECT provider_id, provider_name, key_name FROM open_pg_tde_key_info();'
119+
);
112120
is( $stdout,
113121
'-1|file-provider|new-default-key',
114122
'default key is now localized in other');
@@ -133,7 +141,8 @@
133141

134142
$node->safe_psql('postgres', 'DROP TABLE test_enc;');
135143

136-
$stdout = $node->safe_psql('other', 'SELECT open_pg_tde_delete_default_key();');
144+
$stdout =
145+
$node->safe_psql('other', 'SELECT open_pg_tde_delete_default_key();');
137146
is($stdout, '', 'can delete default key when nobody uses it');
138147

139148
$stdout = $node->safe_psql('postgres',

t/key_map_auth.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
my $node = PostgreSQL::Test::Cluster->new('main');
1515
$node->init;
16-
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'open_pg_tde'");
16+
$node->append_conf('postgresql.conf',
17+
"shared_preload_libraries = 'open_pg_tde'");
1718
$node->start;
1819

1920
my $keydir = PostgreSQL::Test::Utils::tempdir;

t/key_rotate_tablespace.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
my $node = PostgreSQL::Test::Cluster->new('main');
1212
$node->init;
13-
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'open_pg_tde'");
13+
$node->append_conf('postgresql.conf',
14+
"shared_preload_libraries = 'open_pg_tde'");
1415
$node->start;
1516

1617
$node->safe_psql(

t/key_validation.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
my $node = PostgreSQL::Test::Cluster->new('main');
1313
$node->init;
14-
$node->append_conf('postgresql.conf', "shared_preload_libraries = 'open_pg_tde'");
14+
$node->append_conf('postgresql.conf',
15+
"shared_preload_libraries = 'open_pg_tde'");
1516
$node->start;
1617

1718
$node->safe_psql(

0 commit comments

Comments
 (0)