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

70 lines
1.9 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-26 21:10:46 +01:00
"""
ID: issue-5972
ISSUE: 5972
TITLE: Trace config with misplaced "{" lead firebird to crash
DESCRIPTION:
We create trace config with following INVALID content:
database = (%[\\/](security[[:digit:]]).fdb|(security.db))
enabled = false
{
}
database =
{
enabled = true
log_connections = true
}
Then we run new process with ISQL with connect to test DB.
This immediately should cause raise error in the 1st (trace) process:
1 Trace session ID 1 started
2 Error creating trace session for database "C:\\MIX\\FIREBIRD\\FB30\\SECURITY3.FDB":
3 error while parsing trace configuration
4 Trace parameters are not present
It was encountered that in FB 3.0.3 Classic lines 2..4 appear TWICE. See note in the ticket, 16/Jan/18 05:08 PM
JIRA: CORE-5706
FBTEST: bugs.core_5706
2022-10-31 14:22:24 +01:00
NOTES:
[15.09.2022] pzotov
Full trace config must be passed to act.trace() rather than only trace items.
Checked on Linux and Windows: 3.0.8.33535, 4.0.1.2692
2022-01-26 21:10:46 +01:00
"""
2022-10-31 14:22:24 +01:00
import locale
from difflib import unified_diff
2021-04-26 20:07:00 +02:00
import pytest
2022-01-26 21:10:46 +01:00
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-26 21:10:46 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
trace_conf = """
# ::: NOTE :::
# First 'database' section here INTENTIONALLY was written WRONG!
database = (%[\\\\/](security[[:digit:]]).fdb|(security.db))
enabled = false
{
}
2021-04-26 20:07:00 +02:00
database =
{
enabled = true
log_connections = true
}
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.trace
@pytest.mark.version('>=3.0.3')
2022-01-26 21:10:46 +01:00
def test_1(act: Action):
log_before = act.get_firebird_log()
with act.trace(config=trace_conf, keep_log=False):
# We run here ISQL only in order to "wake up" trace session and force it to raise error in its log.
# NO message like 'Statement failed, SQLSTATE = 08004/connection rejected by remote interface' should appear now!
2022-01-26 21:10:46 +01:00
act.isql(switches=['-n', '-q'], input='quit;')
log_after = act.get_firebird_log()
assert list(unified_diff(log_before, log_after)) == []