Skip to content

Commit

Permalink
Add lack tests of no role user. (#5196)
Browse files Browse the repository at this point in the history
Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
  • Loading branch information
2 people authored and Sophie-Xie committed Jan 28, 2023
1 parent a068062 commit fdbad53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tests/admin/test_permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fdbad53

Please sign in to comment.