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

57 lines
1.8 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_2780
# title: Include client library version and protocol version in mon$attachments
# decription:
# tracker_id: CORE-2780
# min_versions: ['3.0']
# versions: 3.0
# qmid:
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 3.0
# resources: None
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """
set list on;
-- See letter from dimitr, 10-apr-2015 09:19
select
-- All platform protovol name: starts with 'TCP'
iif( cast(mon$remote_protocol as varchar(10) character set utf8) collate unicode_ci starting with 'tcp', 1, 0) is_protocol_valid
-- Prefixes for client version:
-- Windows: WI
-- Linux: LI
-- MacOS: UI (intel) or UP (powerpc)
-- Solaris: SI (intel) or SO (spark)
-- HP-UX: HP
-- '-T' = Testing; '-V' = RC or release
-- Sufixes: 'Firebird' followed by space and at least one digit.
,iif( cast(mon$client_version as varchar(255) character set utf8) collate unicode_ci
similar to
'(WI|LI|UI|UP|SI|SO|HU)[-](T|V){0,1}[0-9]+.[0-9]+.[0-9]+((.?[0-9]+)*)[[:WHITESPACE:]]+firebird[[:WHITESPACE:]]+[0-9]+((.?[0-9]+)*)%', 1, 0) is_client_version_valid
from mon$attachments
where mon$attachment_id = current_connection;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
expected_stdout_1 = """
IS_PROTOCOL_VALID 1
IS_CLIENT_VERSION_VALID 1
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2021-04-28 12:42:11 +02:00
def test_1(act_1: Action):
2021-04-26 20:07:00 +02:00
act_1.expected_stdout = expected_stdout_1
act_1.execute()
2021-12-22 20:23:11 +01:00
assert act_1.clean_stdout == act_1.clean_expected_stdout
2021-04-26 20:07:00 +02:00