Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita09009e

Browse files
committed
Update the SSL test suite for recent changes to TAP testing framework.
listen_addresses needs to be handled differently now, and so doeslogging.Michael Paquier
1 parent30bb26b commita09009e

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

‎src/test/ssl/ServerSetup.pm

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ sub copy_files
4545

4646
subconfigure_test_server_for_ssl
4747
{
48-
my$tempdir =$_[0];
48+
my$tempdir =$_[0];
49+
my$serverhost =$_[1];
4950

5051
# Create test users and databases
5152
psql'postgres',"CREATE USER ssltestuser";
@@ -58,6 +59,7 @@ sub configure_test_server_for_ssl
5859
print CONF"fsync=off\n";
5960
print CONF"log_connections=on\n";
6061
print CONF"log_hostname=on\n";
62+
print CONF"listen_addresses='$serverhost'\n";
6163
print CONF"log_statement=all\n";
6264

6365
# enable SSL and set up server key
@@ -80,11 +82,11 @@ sub configure_test_server_for_ssl
8082
print HBA
8183
"# TYPE DATABASE USER ADDRESS METHOD\n";
8284
print HBA
83-
"hostssl trustdb ssltestuser127.0.0.1/32 trust\n";
85+
"hostssl trustdb ssltestuser$serverhost/32 trust\n";
8486
print HBA
8587
"hostssl trustdb ssltestuser ::1/128 trust\n";
8688
print HBA
87-
"hostssl certdb ssltestuser127.0.0.1/32 cert\n";
89+
"hostssl certdb ssltestuser$serverhost/32 cert\n";
8890
print HBA
8991
"hostssl certdb ssltestuser ::1/128 cert\n";
9092
close HBA;
@@ -107,10 +109,6 @@ sub switch_server_cert
107109
print SSLCONF"ssl_crl_file='root+client.crl'\n";
108110
close SSLCONF;
109111

110-
# Stop and restart server to reload the new config. We cannot use
111-
# restart_test_server() because that overrides listen_addresses to only all
112-
# Unix domain socket connections.
113-
114-
system_or_bail'pg_ctl','stop','-D',"$tempdir/pgdata";
115-
system_or_bail'pg_ctl','start','-D',"$tempdir/pgdata",'-w';
112+
# Stop and restart server to reload the new config.
113+
restart_test_server();
116114
}

‎src/test/ssl/t/001_ssltests.pl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ BEGIN
2727

2828
my$tempdir = TestLib::tempdir;
2929

30-
#my $tempdir = "tmp_check";
31-
32-
3330
# Define a couple of helper functions to test connecting to the server.
3431

3532
my$common_connstr;
@@ -43,12 +40,7 @@ sub run_test_psql
4340
'psql','-A','-t','-c',"SELECT 'connected with$connstr'",
4441
'-d',"$connstr" ];
4542

46-
open CLIENTLOG,">>$tempdir/client-log"
47-
ordie"Could not open client-log file";
48-
print CLIENTLOG"\n# Running test:$connstr$logstring\n";
49-
close CLIENTLOG;
50-
51-
my$result = run$cmd,'>>',"$tempdir/client-log",'2>&1';
43+
my$result = run_log($cmd);
5244
return$result;
5345
}
5446

@@ -84,7 +76,7 @@ sub test_connect_fails
8476

8577
diag"setting up data directory in\"$tempdir\"...";
8678
start_test_server($tempdir);
87-
configure_test_server_for_ssl($tempdir);
79+
configure_test_server_for_ssl($tempdir,$SERVERHOSTADDR);
8880
switch_server_cert($tempdir,'server-cn-only');
8981

9082
### Part 1. Run client-side tests.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp