6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_5884_test.py

55 lines
1.3 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-26 21:10:46 +01:00
"""
ID: issue-6142
ISSUE: 6142
TITLE: Initial global mapping from srp plugin does not work
DESCRIPTION:
JIRA: CORE-5884
"""
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
user_a = user_factory('db', name='tmp$c5884_1', password='123', plugin='Srp')
user_b = user_factory('db', name='tmp$c5884_2', password='456', plugin='Srp')
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
create or alter mapping lmap using plugin srp from user tmp$c5884_1 to user ltost;
2022-01-26 21:10:46 +01:00
create or alter global mapping gmap using plugin srp from user tmp$c5884_2 to user gtost;
2021-04-26 20:07:00 +02:00
commit;
connect '$(DSN)' user tmp$c5884_1 password '123';
select current_user as whoami from rdb$database;
commit;
connect '$(DSN)' user tmp$c5884_2 password '456';
select current_user as whoami from rdb$database;
commit;
connect '$(DSN)' user sysdba password 'masterkey';
commit;
drop global mapping gmap;
drop mapping lmap;
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
expected_stdout = """
WHOAMI LTOST
WHOAMI GTOST
2021-12-19 22:25:36 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0.4')
2022-01-26 21:10:46 +01:00
def test_1(act: Action, user_a: User, user_b: User):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout