Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
abb23911
Commit
abb23911
authored
3 months ago
by
Egor Ivkov
Committed by
Егор Ивков
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
test: role and user limits
parent
dded2b2b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1509
Check max users on user creation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/int/test_limits.py
+52
-0
52 additions, 0 deletions
test/int/test_limits.py
with
52 additions
and
0 deletions
test/int/test_limits.py
0 → 100644
+
52
−
0
View file @
abb23911
import
pytest
from
conftest
import
Cluster
,
TarantoolError
max_picodata_users
=
26
def
test_user_limit
(
cluster
:
Cluster
):
cluster
.
deploy
(
instance_count
=
2
)
i1
,
i2
=
cluster
.
instances
password
=
"
Passw0rd
"
for
i
in
range
(
max_picodata_users
):
username
=
f
"
USER
{
i
}
"
acl
=
i1
.
sql
(
f
"""
create user
{
username
}
with password
'
{
password
}
'
using md5 option (timeout = 3)
"""
)
assert
acl
[
"
row_count
"
]
==
1
# FIXME: should not panic, should be an error instead
with
pytest
.
raises
(
TarantoolError
,
match
=
"
a limit on the total number of users has been reached: 32
"
,
):
username
=
f
"
USER
{
max_picodata_users
}
"
i1
.
sql
(
f
"""
create user
{
username
}
with password
'
{
password
}
'
using md5
"""
)
def
test_role_limit
(
cluster
:
Cluster
):
cluster
.
deploy
(
instance_count
=
2
)
i1
,
i2
=
cluster
.
instances
for
i
in
range
(
max_picodata_users
):
role
=
f
"
ROLE
{
i
}
"
acl
=
i1
.
sql
(
f
"
create role
{
role
}
"
)
assert
acl
[
"
row_count
"
]
==
1
# FIXME: should not panic, should be an error instead
with
pytest
.
raises
(
TarantoolError
,
match
=
"
a limit on the total number of users has been reached: 32
"
,
):
role
=
f
"
ROLE
{
max_picodata_users
}
"
i1
.
sql
(
f
"
create role
{
role
}
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment