From 1647fe417a7ec6be3ab834dbb496a3054328bf42 Mon Sep 17 00:00:00 2001 From: Georgy Moshkin <gmoshkin@picodata.io> Date: Thu, 1 Feb 2024 20:08:23 +0300 Subject: [PATCH] test: cleanup test_sql_acl_users_roles --- test/int/test_sql.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/int/test_sql.py b/test/int/test_sql.py index dae65aebf9..8238ccf46a 100644 --- a/test/int/test_sql.py +++ b/test/int/test_sql.py @@ -1389,17 +1389,20 @@ def test_sql_acl_users_roles(cluster: Cluster): # Check altering works. acl = i1.sql(f"create user {username} with password '{password}' using md5") assert acl["row_count"] == 1 - users_auth_was = i1.call("box.space._pico_user.index.name:get", upper_username)[3] + user_def = i1.call("box.space._pico_user.index.name:get", upper_username) + users_auth_was = user_def[3] # * Password and method aren't changed -> update nothing. acl = i1.sql(f"alter user {username} with password '{password}' using md5") assert acl["row_count"] == 0 - users_auth_became = i1.call("box.space._pico_user.index.name:get", upper_username)[3] + user_def = i1.call("box.space._pico_user.index.name:get", upper_username) + users_auth_became = user_def[3] assert users_auth_was == users_auth_became # * Password is changed -> update hash. acl = i1.sql(f"alter user {username} with password '{another_password}' using md5") assert acl["row_count"] == 1 - users_auth_became = i1.call("box.space._pico_user.index.name:get", upper_username)[3] + user_def = i1.call("box.space._pico_user.index.name:get", upper_username) + users_auth_became = user_def[3] assert users_auth_was[0] == users_auth_became[0] assert users_auth_was[1] != users_auth_became[1] @@ -1408,13 +1411,15 @@ def test_sql_acl_users_roles(cluster: Cluster): f"alter user {username} with password '{another_password}' using chap-sha1" ) assert acl["row_count"] == 1 - users_auth_became = i1.call("box.space._pico_user.index.name:get", upper_username)[3] + user_def = i1.call("box.space._pico_user.index.name:get", upper_username) + users_auth_became = user_def[3] assert users_auth_was[0] != users_auth_became[0] assert users_auth_was[1] != users_auth_became[1] # * LDAP should ignore password -> update method and hash. acl = i1.sql(f"alter user {username} with password '{another_password}' using ldap") assert acl["row_count"] == 1 - users_auth_became = i1.call("box.space._pico_user.index.name:get", upper_username)[3] + user_def = i1.call("box.space._pico_user.index.name:get", upper_username) + users_auth_became = user_def[3] assert users_auth_was[0] != users_auth_became[0] assert users_auth_became[1] == "" acl = i1.sql(f"drop user {username}") -- GitLab