2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-24 20:27:02 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5128
|
|
|
|
ISSUE: 5128
|
|
|
|
TITLE: Revoke all on all from role <R> -- failed with "SQL role <R> does not exist in security database"
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4831
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4831
|
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
|
|
|
role = role_factory('db', name='r_20150608_20h03m')
|
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 wng off;
|
2021-12-19 22:25:36 +01:00
|
|
|
-- create role r_20150608_20h03m;
|
|
|
|
-- commit;
|
2021-04-26 20:07:00 +02:00
|
|
|
revoke all on all from role r_20150608_20h03m; -- this was failed, possibly due to: http://sourceforge.net/p/firebird/code/61729
|
|
|
|
commit;
|
|
|
|
show grants;
|
2021-12-19 22:25:36 +01:00
|
|
|
-- commit;
|
|
|
|
-- drop role r_20150608_20h03m;
|
|
|
|
--commit;
|
2021-12-22 20:23:11 +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-12-19 22:25:36 +01:00
|
|
|
|
2022-01-24 20:27:02 +01:00
|
|
|
expected_stderr = """
|
2021-12-19 22:25:36 +01:00
|
|
|
There is no privilege granted in this database
|
2021-10-21 19:29:23 +02: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, role: Role):
|
|
|
|
act.expected_stderr = expected_stderr
|
|
|
|
act.execute()
|
|
|
|
assert (act.clean_stdout == act.clean_expected_stdout and
|
|
|
|
act.clean_stderr == act.clean_expected_stderr)
|