6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/bugs/core_4607_test.py

63 lines
1.6 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-24 20:27:02 +01:00
"""
ID: issue-4922
ISSUE: 4922
TITLE: Add support for having more than one UserManager in firebird.conf and use them from SQL
DESCRIPTION:
NOTES:
[21.10.2021]
This test requires Legacy_UserManager to be listed in firebird.conf UserManager option,
which is NOT by default. Otherwise it will FAIL with "Missing requested management plugin"
Also, it does not use user_factory fixtures as it's the point to create/drop users in test script.
JIRA: CORE-4607
FBTEST: bugs.core_4607
2022-01-24 20:27:02 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
set count on;
create view v_test as
select sec$user_name, sec$plugin
2021-10-21 19:29:23 +02:00
from sec$users
2021-04-26 20:07:00 +02:00
where upper(sec$user_name) starting with upper('tmp$c4607')
order by 1,2
;
commit;
create or alter user tmp$c4607_leg password '123' using plugin Legacy_UserManager;
create or alter user tmp$c4607_srp password '456' using plugin Srp;
commit;
select * from v_test;
commit;
drop user tmp$c4607_leg using plugin Legacy_UserManager;
drop user tmp$c4607_srp using plugin Srp;
commit;
select * from v_test;
2021-12-19 22:25:36 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
SEC$USER_NAME TMP$C4607_LEG
SEC$PLUGIN Legacy_UserManager
SEC$USER_NAME TMP$C4607_SRP
SEC$PLUGIN Srp
Records affected: 2
Records affected: 0
2021-12-19 22:25:36 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-24 20:27:02 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00