Fix regression test 023 ssl_connection
authorTakuma Hoshiai <hoshiai@sraoss.co.jp>
Tue, 25 Jun 2019 06:09:37 +0000 (15:09 +0900)
committerTakuma Hoshiai <hoshiai@sraoss.co.jp>
Tue, 25 Jun 2019 06:09:37 +0000 (15:09 +0900)
If TLS1.3 was used by openssl, this test failed.
This mistake is due to #51bc494aaa7fd191e14038204d18effe2efb0ec8 .

src/test/regression/tests/023.ssl_connection/test.sh
src/utils/pool_process_reporting.c

index b947daf4140d893d43d41d0fed1ebfc4e5d2a1ba..1d479c84a4de7a0e29b92f4b20a347043f40fea0 100755 (executable)
@@ -60,11 +60,13 @@ wait_for_pgpool_startup
 
 # first, checking frontend<-->Pgpool-II...
 
-$PSQL -h localhost test <<EOF | grep SSL
+$PSQL -h localhost test <<EOF > result
 \conninfo
 \q
 EOF
 
+grep SSL result
+
 if [ $? != 0 ];then
     echo "Checking SSL connection between frontend and Pgpool-II failed."
     ./shutdownall
@@ -73,18 +75,19 @@ fi
 
 echo "Checking SSL connection between frontend and Pgpool-II was ok."
 
-$PSQL -h localhost test <<EOF | grep SSL | grep ECDH
-\conninfo
-\q
-EOF
+grep SSL result |grep TLSv1.2
 
-if [ $? != 0 ];then
-    echo "Checking SSL connection with ECDH between frontend and Pgpool-II failed."
-    ./shutdownall
-    exit 1
-fi
+# if SSl protocol version TLSv1.2
+if [ $? = 0 ];then
+    grep SSL result |grep ECDH
 
-echo "Checking SSL connection with ECDH between frontend and Pgpool-II was ok."
+    if [ $? != 0 ];then
+        echo "Checking SSL connection with ECDH between frontend and Pgpool-II failed."
+        ./shutdownall
+        exit 1
+    fi
+       echo "Checking SSL connection with ECDH between frontend and Pgpool-II was ok."
+fi
 
 grep "client->server SSL response: S" log/pgpool.log >/dev/null
 if [ $? != 0 ];then
index bebbec03241171a134443a4f666adf86c829a8d1..7be0a474ce127c5b8021984c72abe3d52c1a66fd 100644 (file)
@@ -268,12 +268,12 @@ get_config(int *nrows)
        i++;
 
        StrNCpy(status[i].name, "ssl_ecdh_curve", POOLCONFIG_MAXNAMELEN);
-       snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->ssl_ecdh_curve);
+       snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_ecdh_curve);
        StrNCpy(status[i].desc, "the curve to use in ECDH key exchange", POOLCONFIG_MAXDESCLEN);
        i++;
 
        StrNCpy(status[i].name, "ssl_dh_params_file", POOLCONFIG_MAXNAMELEN);
-       snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->ssl_dh_params_file);
+       snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_dh_params_file);
        StrNCpy(status[i].desc, "path to the Diffie-Hellman parameters contained file", POOLCONFIG_MAXDESCLEN);
        i++;