6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_6236_test.py

44 lines
1.4 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID: issue-6480
ISSUE: 6480
TITLE: RDB$TIME_ZONE_UTIL package has wrong privilege for PUBLIC
DESCRIPTION:
Thanks Adriano for suggestion about this test implementation.
We create non-privileged user ('tmp$c6236') and do connect of him
with trying to use package function rdb$time_zone_util.database_version().
It must pass without any errors (result of call no matter).
Confirmed exception on 4.0.0.1714: no permission for EXECUTE access to PACKAGE RDB$TIME_ZONE_UTIL
Checked on 4.0.0.1740 SS: 1.400s - works fine.
::: NB :::
Command 'SHOW GRANTS' does not display privileges on system objects thus we do not use it here.
JIRA: CORE-6236
FBTEST: bugs.core_6236
2022-01-27 20:08:36 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
test_user = user_factory('db', name='tmp$c6236', password='123')
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
2022-01-27 20:08:36 +01:00
expected_stdout = """
2021-12-14 20:56:34 +01:00
DB_VERS_DEFINED True
"""
2021-04-26 20:07:00 +02:00
2021-12-14 20:56:34 +01:00
@pytest.mark.version('>=4.0')
2022-01-27 20:08:36 +01:00
def test_1(act: Action, test_user: User, capsys):
with act.db.connect(user=test_user.name, password=test_user.password) as con:
2021-12-14 20:56:34 +01:00
c = con.cursor()
c.execute('select rdb$time_zone_util.database_version() is not null as db_vers_defined from rdb$database')
2022-01-27 20:08:36 +01:00
act.print_data_list(c)
2021-12-14 20:56:34 +01:00
# Check
2022-01-27 20:08:36 +01:00
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
assert act.clean_stdout == act.clean_expected_stdout