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

60 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-25 22:55:48 +01:00
"""
ID: issue-5765
ISSUE: 5765
TITLE: Creating SRP SYSDBA with explicit admin (-admin yes in gsec or grant admin
role in create user) creates two SYSDBA accounts
2022-01-25 22:55:48 +01:00
DESCRIPTION:
Test script should display only ONE record.
NOTES:
[8.12.2021] [pcisar]
On Linux it fails with:
Statement failed, SQLSTATE = 28000
no permission for remote access to database security.db
JIRA: CORE-5496
FBTEST: bugs.core_5496
2022-01-25 22:55:48 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
db = db_factory()
2022-01-25 22:55:48 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
SEC$USER_NAME SYSDBA
SEC$PLUGIN Srp
Records affected: 1
"""
2022-01-25 22:55:48 +01:00
test_script = """
connect 'localhost:security.db';
create or alter user foo password '123' grant admin role using plugin Srp;
create or alter user rio password '123' grant admin role using plugin Srp;
create or alter user bar password '123' grant admin role using plugin Srp;
commit;
grant rdb$admin to sysdba granted by foo;
grant rdb$admin to sysdba granted by rio;
grant rdb$admin to sysdba granted by bar;
commit;
set list on;
set count on;
select sec$user_name, sec$plugin from sec$users where upper(sec$user_name) = upper('sysdba') and upper(sec$plugin) = upper('srp');
commit;
drop user foo using plugin Srp;
drop user rio using plugin Srp;
drop user bar using plugin Srp;
commit;
quit;
"""
2021-04-26 20:07:00 +02:00
2022-01-25 22:55:48 +01:00
@pytest.mark.skip('FIXME: remote access to security.db')
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0.2')
2022-01-25 22:55:48 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.isql(switches=['-q', '-b'], input=test_script)
assert act.clean_stdout == act.clean_expected_stdout