Skip to content
Snippets Groups Projects
Commit 1647fe41 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

test: cleanup test_sql_acl_users_roles

parent 0677534e
No related branches found
No related tags found
1 merge request!855Gmoshkin/service auth
...@@ -1389,17 +1389,20 @@ def test_sql_acl_users_roles(cluster: Cluster): ...@@ -1389,17 +1389,20 @@ def test_sql_acl_users_roles(cluster: Cluster):
# Check altering works. # Check altering works.
acl = i1.sql(f"create user {username} with password '{password}' using md5") acl = i1.sql(f"create user {username} with password '{password}' using md5")
assert acl["row_count"] == 1 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. # * Password and method aren't changed -> update nothing.
acl = i1.sql(f"alter user {username} with password '{password}' using md5") acl = i1.sql(f"alter user {username} with password '{password}' using md5")
assert acl["row_count"] == 0 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 assert users_auth_was == users_auth_became
# * Password is changed -> update hash. # * Password is changed -> update hash.
acl = i1.sql(f"alter user {username} with password '{another_password}' using md5") acl = i1.sql(f"alter user {username} with password '{another_password}' using md5")
assert acl["row_count"] == 1 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[0] == users_auth_became[0]
assert users_auth_was[1] != users_auth_became[1] assert users_auth_was[1] != users_auth_became[1]
...@@ -1408,13 +1411,15 @@ def test_sql_acl_users_roles(cluster: Cluster): ...@@ -1408,13 +1411,15 @@ def test_sql_acl_users_roles(cluster: Cluster):
f"alter user {username} with password '{another_password}' using chap-sha1" f"alter user {username} with password '{another_password}' using chap-sha1"
) )
assert acl["row_count"] == 1 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[0] != users_auth_became[0]
assert users_auth_was[1] != users_auth_became[1] assert users_auth_was[1] != users_auth_became[1]
# * LDAP should ignore password -> update method and hash. # * LDAP should ignore password -> update method and hash.
acl = i1.sql(f"alter user {username} with password '{another_password}' using ldap") acl = i1.sql(f"alter user {username} with password '{another_password}' using ldap")
assert acl["row_count"] == 1 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[0] != users_auth_became[0]
assert users_auth_became[1] == "" assert users_auth_became[1] == ""
acl = i1.sql(f"drop user {username}") acl = i1.sql(f"drop user {username}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment