From 61254a1002fbae4838b2a206346dda14bbe7a34a Mon Sep 17 00:00:00 2001 From: leiziwei Date: Tue, 1 Aug 2023 11:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A5=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E4=BF=AE=E6=94=B9pg=5Fhba=E5=BC=95=E8=B5=B7?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E5=88=AB=E7=9A=84=E7=94=A8=E4=BE=8B=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=EF=BC=8C=E5=BA=94=E5=BD=93=E8=BF=98=E5=8E=9Fpg=5Fhba.?= =?UTF-8?q?conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/regress/input/user_host_test.source | 4 ++++ src/test/regress/output/user_host_test.source | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/regress/input/user_host_test.source b/src/test/regress/input/user_host_test.source index 481bffd4e..0b85c2bc5 100644 --- a/src/test/regress/input/user_host_test.source +++ b/src/test/regress/input/user_host_test.source @@ -54,6 +54,7 @@ grant select on test2 to 'test_user_host'@'127.0.%'; grant insert on test2 to 'test_user_host'@'127.0.%'; revoke insert on test2 from 'test_user_host'@'127.0.%'; \! echo 'b_compatibility_user_host_auth = on' >> @abs_srcdir@/tmp_check/datanode1/postgresql.conf +\! /usr/bin/cp @abs_srcdir@/tmp_check/datanode1/pg_hba.conf @abs_srcdir@/tmp_check/datanode1/pg_hba_bk.conf \! sed -i 's#host.*all.*all.*127.0.0.1/32.*#host all all all sha256#g' @abs_srcdir@/tmp_check/datanode1/pg_hba.conf \! @abs_bindir@/gs_ctl restart -D @abs_srcdir@/tmp_check/datanode1 > /dev/null \! sleep 2 @@ -65,3 +66,6 @@ revoke insert on test2 from 'test_user_host'@'127.0.%'; \! @abs_bindir@/gsql -p @portstring@ -h 127.0.0.1 -d user_host_db -r -U test_user_host -W 'test123@' -c "select current_user"; \! @abs_bindir@/gsql -p @portstring@ -h 127.0.0.1 -d user_host_db -r -U test_user_host -W 'test123@' -c "select * from test2"; \! @abs_bindir@/gsql -p @portstring@ -h 127.0.0.1 -d user_host_db -r -U test_user_host2 -W 'test123@' -c "select current_user"; +\! /usr/bin/mv -f @abs_srcdir@/tmp_check/datanode1/pg_hba_bk.conf @abs_srcdir@/tmp_check/datanode1/pg_hba.conf +\! @abs_bindir@/gs_ctl restart -D @abs_srcdir@/tmp_check/datanode1 > /dev/null +\! sleep 5 \ No newline at end of file diff --git a/src/test/regress/output/user_host_test.source b/src/test/regress/output/user_host_test.source index 15241eefe..a86ff100b 100644 --- a/src/test/regress/output/user_host_test.source +++ b/src/test/regress/output/user_host_test.source @@ -111,6 +111,7 @@ revoke insert on test2 from 'test_user_host'@'127.0.%'; --?.* --?.* --?.* +--?.* \! sleep 2 --?.* gsql: FATAL: Invalid username/password,login denied. @@ -147,4 +148,7 @@ DROP ROLE --------------------------- test_user_host2@localhost (1 row) - +--?.* +--?.* +--?.* +\! sleep 5 \ No newline at end of file