Test: adapt 023.ssl_connection to PostgreSQL 18.
authorTatsuo Ishii <ishii@postgresql.org>
Tue, 30 Sep 2025 09:04:06 +0000 (18:04 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Tue, 30 Sep 2025 09:04:06 +0000 (18:04 +0900)
PostgreSQL 18 heavily changed psql's \conninfo output format, which
made the test fail because the test relies on \conninfo. This commit
makes the test script aware the PostgreSQL version to fix the issue.

Backpatch-through: v4.2

src/test/regression/tests/023.ssl_connection/test.sh

index 6b1dbb8af2260d3459e68838a3b3848099dc3cd4..2b5f3b6930e8d87b5c1cf282194d40b112ef3136 100755 (executable)
@@ -65,7 +65,13 @@ $PSQL -h localhost test <<EOF > result
 \q
 EOF
 
-grep SSL result
+# PostgreSQL 18 or later prints tablular output for \conninfo.
+# For SSL, "SSL Connection | true (or false)"
+if [ $PGVERSION -ge 18 ];then
+    grep "SSL Connection" result|grep true
+else
+    grep SSL result
+fi
 
 if [ $? != 0 ];then
     echo "Checking SSL connection between frontend and Pgpool-II failed."
@@ -75,7 +81,11 @@ fi
 
 echo "Checking SSL connection between frontend and Pgpool-II was ok."
 
-grep SSL result |grep TLSv1.2
+if [ $PGVERSION -ge 18 ];then
+    grep "SSL Protocol" result|grep TLSv1.2
+else
+    grep SSL result |grep TLSv1.2
+fi
 
 # if SSl protocol version TLSv1.2
 if [ $? = 0 ];then
@@ -111,7 +121,11 @@ $PSQL -h localhost test <<EOF > result
 \q
 EOF
 
-grep SSL result
+if [ $PGVERSION -ge 18 ];then
+    grep "SSL Connection" result|grep true
+else
+    grep SSL result
+fi
 
 if [ $? = 0 ];then
     echo "Checking SSL connection between frontend and Pgpool-II succeeded despite bad ssl_ecdh_curve."