From: Bo Peng Date: Thu, 15 May 2025 02:28:29 +0000 (+0900) Subject: This commit is a follow-up to commit d92a7e2. X-Git-Tag: V4_7_0_BETA1~121 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d72bb83fe5c109944a40fe368faea7a9af59f7f6;p=pgpool2.git This commit is a follow-up to commit d92a7e2. --- diff --git a/src/test/regression/tests/040.client_auth/test.sh b/src/test/regression/tests/040.client_auth/test.sh index ad5f6934b..964e9293e 100755 --- a/src/test/regression/tests/040.client_auth/test.sh +++ b/src/test/regression/tests/040.client_auth/test.sh @@ -58,22 +58,23 @@ fi # create user # $1: username # $2: "scram", "md5", "password", "pam" or "ldap". +# $3: port # If "password" is specified, encryption method becomes 'scram-sha-256'. function add_user() { - createuser $1 + createuser -p $3 $1 if [ $2 = "scram" ];then - psql -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" + psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ $2 = "md5" ];then - psql -c "SET password_encryption = 'md5'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" + psql -p $3 -c "SET password_encryption = 'md5'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ $2 = "password" ];then - psql -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" + psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ "$DO_PAM_TEST" = "true" -a $2 = "pam" ];then - psql -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" + psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ "$DO_PAM_TEST" != "true" -a $2 = "pam" ];then echo "do nothing because DO_PAM_TEST is not true and auth method is pam" elif [ "$DO_LDAP_TEST" = "true" -a $2 = "ldap" ];then - psql -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" + psql -p $3 -c "SET password_encryption = 'scram-sha-256'; ALTER USER $1 WITH ENCRYPTED PASSWORD '$1'" elif [ "$DO_LDAP_TEST" != "true" -a $2 = "ldap" ];then echo "do nothing because DO_LDAP_TEST is not true and auth method is ldap" else @@ -275,7 +276,13 @@ function do_auth pg_hba=$5 expected=$6 - add_user $username $pg_hba + add_user $username $pg_hba $PGPORT + + # for logical replication and slony, we need to manually + # add PostgreSQL user to node 1. + if [ $mode = 'l' -o $mode = 'y' ];then + add_user $username $pg_hba "11003" + fi add_pool_hba $username $pool_hba $PGPOOL_VERSION_DIGIT add_pool_passwd $username $pool_passwd $PGPOOL_VERSION_DIGIT add_pg_hba $username $pg_hba @@ -433,13 +440,10 @@ chmod 0600 $PGPOOLKEYFILE #---------------------------------------- # Test execution starts here -# pgpool_setup does not create a replication environment for logical -# replication mode and slony mode, which makes the test failed -# horribly because PostgreSQL roles are not replicated. Therefore we -# skip the tests for these modes. - -for mode in s r i n +# Full test (6 clustering modes) takes too long time and it causes +# timeout. For now, we skip logical replication and slony mode. #for mode in s r i n l y +for mode in s r i n do echo "==== testing mode: $mode ===" anyfail=""