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

51 lines
1.5 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-3171
ISSUE: 3171
TITLE: Include client library version and protocol version in mon$attachments
DESCRIPTION:
JIRA: CORE-2780
FBTEST: bugs.core_2780
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
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
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
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')
2022-01-21 18:49:26 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00