diff --git a/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.result b/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.result index ae72d2fca975..f2976737c3e9 100644 --- a/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.result +++ b/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.result @@ -1,10 +1,10 @@ -- reset users -- prepare user and tables for tests -Error: APIError: ResponseError with 1063: Permission denied: privilege [Alter] is required on *.* for user 'testuser1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage. -Error: APIError: ResponseError with 1063: Permission denied: privilege [Alter] is required on *.* for user 'testuser1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage. -Error: APIError: ResponseError with 1063: Permission denied: privilege [Alter] is required on *.* for user 'testuser1'@'%' with roles [public]. Note: Please ensure that your current role have the appropriate permissions to create a new Database|Table|UDF|Stage. -Error: APIError: RequestError: Query Page failed with status 401 Unauthorized: {"error":{"code":5100,"message":"wrong password"}} -Error: APIError: RequestError: Start Query failed with status 401 Unauthorized: {"error":{"code":5100,"message":"wrong password"}} +1 +1 +1 +1 +1 testuser1 password is 123 testuser2 password not modify -- reset users diff --git a/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.sh b/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.sh index e12d68cc978b..021918201b01 100755 --- a/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.sh +++ b/tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.sh @@ -14,18 +14,18 @@ echo "DROP USER IF EXISTS 'testuser2'" | $BENDSQL_CLIENT_CONNECT echo '-- prepare user and tables for tests' echo "CREATE USER 'testuser1' IDENTIFIED BY '$TEST_USER_PASSWORD'" | $BENDSQL_CLIENT_CONNECT echo "CREATE USER 'testuser2' IDENTIFIED BY '$TEST_USER_PASSWORD'" | $BENDSQL_CLIENT_CONNECT -echo "alter user 'testuser2' identified by '123'" | $TEST_USER_CONNECT -echo "alter user 'testuser1' identified by '123' with default_role='role1'" | $TEST_USER_CONNECT -echo "alter user 'testuser1' identified by '123' with disabled=true" | $TEST_USER_CONNECT +echo "alter user 'testuser2' identified by '123'" | $TEST_USER_CONNECT 2>&1 | grep 'Permission denied: privilege \[Alter\]' |wc -l +echo "alter user 'testuser1' identified by '123' with default_role='role1'" | $TEST_USER_CONNECT 2>&1 | grep 'Permission denied: privilege \[Alter\]' |wc -l +echo "alter user 'testuser1' identified by '123' with disabled=true" | $TEST_USER_CONNECT 2>&1 | grep 'Permission denied: privilege \[Alter\]' |wc -l # Note: this query in bendsql will return err, because bendsql will call auth in poll, after password modified, in next poll the auth failed, it will return err. # testuser1@localhost:8000/default> alter user 'testuser1' identified by '123'; # error: APIError: RequestError: Query Page failed with status 401 Unauthorized: {"error":{"code":"401","message":"wrong password"}} -echo "alter user 'testuser1' identified by '123'" | $TEST_USER_CONNECT +echo "alter user 'testuser1' identified by '123'" | $TEST_USER_CONNECT 2>&1 | grep 'wrong password' | wc -l export TEST_USER_MODIFY_CONNECT="bendsql --user=testuser1 --password=123 --host=${QUERY_MYSQL_HANDLER_HOST} --port ${QUERY_HTTP_HANDLER_PORT}" -echo "select 1" | $TEST_USER_CONNECT +echo "select 1" | $TEST_USER_CONNECT 2>&1 | grep 'wrong password' | wc -l echo "select 'testuser1 password is 123'" | $TEST_USER_MODIFY_CONNECT echo "select 'testuser2 password not modify'" | $TEST_USER2_CONNECT