From 991c19c84d83db3dabd63268548c08bea6691675 Mon Sep 17 00:00:00 2001 From: shylock <33566796+Shylock-Hg@users.noreply.github.com> Date: Mon, 9 Jan 2023 11:14:33 +0800 Subject: [PATCH] Add lack tests of no role user. (#5196) Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> --- tests/admin/test_permission.py | 14 ++++++++++++++ tests/common/utils.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/admin/test_permission.py b/tests/admin/test_permission.py index a1cf31fc54f..dda32fac188 100644 --- a/tests/admin/test_permission.py +++ b/tests/admin/test_permission.py @@ -891,6 +891,8 @@ def test_show_test(self): assert ret ret, self.guestClient = self.spawn_nebula_client_and_auth('guest', 'guest') assert ret + ret, self.nopClient = self.spawn_nebula_client_and_auth('nop', 'nop') + assert ret query = 'CREATE SPACE space4(partition_num=1, replica_factor=1, vid_type=FIXED_STRING(8))' resp = self.execute(query) @@ -930,6 +932,12 @@ def test_show_test(self): self.check_column_names(resp, expected_column_names) self.check_out_of_order_result(resp, expected_result) + resp = self.nopClient.execute(query) + self.check_resp_succeeded(resp) + expected_result = [] + self.check_column_names(resp, expected_column_names) + self.check_out_of_order_result(resp, expected_result) + query = 'SHOW ROLES IN space1' resp = self.guestClient.execute(query) self.check_resp_failed(resp, ttypes.ErrorCode.E_BAD_PERMISSION) @@ -987,6 +995,8 @@ def test_show_roles(self): assert ret ret, self.guestClient = self.spawn_nebula_client_and_auth('guest', 'guest') assert ret + ret, self.nopClient = self.spawn_nebula_client_and_auth('nop', 'nop') + assert ret query = 'SHOW ROLES IN space5' expected_result = [] @@ -1021,6 +1031,10 @@ def test_show_roles(self): self.check_resp_succeeded(resp) self.check_out_of_order_result(resp, expected_result) + expected_result = [] + resp = self.nopClient.execute(query) + self.check_resp_failed(resp, ttypes.ErrorCode.E_BAD_PERMISSION) + # clean up query = 'DROP SPACE IF EXISTS space5' resp = self.execute(query) diff --git a/tests/common/utils.py b/tests/common/utils.py index 760b638d146..77e7a34df07 100644 --- a/tests/common/utils.py +++ b/tests/common/utils.py @@ -442,7 +442,7 @@ def load_csv_data( def get_conn_pool(host: str, port: int, ssl_config: SSL_config): config = Config() - config.max_connection_pool_size = 20 + config.max_connection_pool_size = 30 config.timeout = 180000 # init connection pool pool = ConnectionPool()