Skip to content

Commit 24861ac

Browse files
authored
chore(query): modify rbac test result display (#16686)
1 parent d83bb39 commit 24861ac

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
-- reset users
22
-- prepare user and tables for tests
3-
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.
4-
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.
5-
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.
6-
Error: APIError: RequestError: Query Page failed with status 401 Unauthorized: {"error":{"code":5100,"message":"wrong password"}}
7-
Error: APIError: RequestError: Start Query failed with status 401 Unauthorized: {"error":{"code":5100,"message":"wrong password"}}
3+
1
4+
1
5+
1
6+
1
7+
1
88
testuser1 password is 123
99
testuser2 password not modify
1010
-- reset users

tests/suites/0_stateless/18_rbac/18_0011_alter_own_username.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ echo "DROP USER IF EXISTS 'testuser2'" | $BENDSQL_CLIENT_CONNECT
1414
echo '-- prepare user and tables for tests'
1515
echo "CREATE USER 'testuser1' IDENTIFIED BY '$TEST_USER_PASSWORD'" | $BENDSQL_CLIENT_CONNECT
1616
echo "CREATE USER 'testuser2' IDENTIFIED BY '$TEST_USER_PASSWORD'" | $BENDSQL_CLIENT_CONNECT
17-
echo "alter user 'testuser2' identified by '123'" | $TEST_USER_CONNECT
18-
echo "alter user 'testuser1' identified by '123' with default_role='role1'" | $TEST_USER_CONNECT
19-
echo "alter user 'testuser1' identified by '123' with disabled=true" | $TEST_USER_CONNECT
17+
echo "alter user 'testuser2' identified by '123'" | $TEST_USER_CONNECT 2>&1 | grep 'Permission denied: privilege \[Alter\]' |wc -l
18+
echo "alter user 'testuser1' identified by '123' with default_role='role1'" | $TEST_USER_CONNECT 2>&1 | grep 'Permission denied: privilege \[Alter\]' |wc -l
19+
echo "alter user 'testuser1' identified by '123' with disabled=true" | $TEST_USER_CONNECT 2>&1 | grep 'Permission denied: privilege \[Alter\]' |wc -l
2020

2121
# 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.
2222
# testuser1@localhost:8000/default> alter user 'testuser1' identified by '123';
2323
# error: APIError: RequestError: Query Page failed with status 401 Unauthorized: {"error":{"code":"401","message":"wrong password"}}
24-
echo "alter user 'testuser1' identified by '123'" | $TEST_USER_CONNECT
24+
echo "alter user 'testuser1' identified by '123'" | $TEST_USER_CONNECT 2>&1 | grep 'wrong password' | wc -l
2525

2626
export TEST_USER_MODIFY_CONNECT="bendsql --user=testuser1 --password=123 --host=${QUERY_MYSQL_HANDLER_HOST} --port ${QUERY_HTTP_HANDLER_PORT}"
2727

28-
echo "select 1" | $TEST_USER_CONNECT
28+
echo "select 1" | $TEST_USER_CONNECT 2>&1 | grep 'wrong password' | wc -l
2929
echo "select 'testuser1 password is 123'" | $TEST_USER_MODIFY_CONNECT
3030
echo "select 'testuser2 password not modify'" | $TEST_USER2_CONNECT
3131

0 commit comments

Comments
 (0)