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_1148_test.py

39 lines
1.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-19 17:54:56 +01:00
"""
ID: issue-1570
ISSUE: 1570
TITLE: Every user can view server log using services API
DESCRIPTION:
JIRA: CORE-1148
FBTEST: bugs.core_1148
2022-01-19 17:54:56 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2022-01-19 17:54:56 +01:00
from firebird.qa import *
2021-11-10 19:02:05 +01:00
from firebird.driver import DatabaseError
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
substitutions = [('ENGINE_VERSION .*', 'ENGINE_VERSION'),
('STDERR: UNABLE TO PERFORM OPERATION.*', 'STDERR: UNABLE TO PERFORM OPERATION'),
('STDERR: -YOU MUST HAVE SYSDBA RIGHTS AT THIS SERVER*', '')]
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
act = python_act('db', substitutions=substitutions)
2021-11-10 19:02:05 +01:00
2022-01-19 17:54:56 +01:00
tmp_user = user_factory('db', name='TMP$C1148', password='QweRtyUi')
2021-04-26 20:07:00 +02:00
2021-12-22 20:23:11 +01:00
@pytest.mark.version('>=3.0')
2022-01-19 17:54:56 +01:00
def test_1(act: Action, tmp_user: User):
if act.is_version('<4'):
if act.platform == 'Windows':
2022-01-16 10:03:34 +01:00
pattern = 'Unable to perform operation'
else:
pattern = 'You must be either SYSDBA or owner of the database'
2021-12-22 20:23:11 +01:00
else:
pattern = 'You must have SYSDBA rights at this server'
2022-01-19 17:54:56 +01:00
with act.connect_server(user=tmp_user.name, password=tmp_user.password) as srv:
2021-12-22 20:23:11 +01:00
with pytest.raises(DatabaseError, match=pattern):
2021-11-10 19:02:05 +01:00
srv.info.get_log()