2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
2022-01-22 21:59:15 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-3543
|
|
|
|
ISSUE: 3543
|
|
|
|
TITLE: exclude_filter doesn't work for <services></section> section of the Trace facility
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-3168
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_3168
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
import pytest
|
2022-01-22 21:59:15 +01:00
|
|
|
from firebird.qa import *
|
2021-11-16 19:44:53 +01:00
|
|
|
from firebird.driver import SrvStatFlag
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
db = db_factory()
|
2021-11-16 19:44:53 +01:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = python_act('db', substitutions=[('^((?!ERROR|ELEMENT|PROPERTIES|STATS|BACKUP|RESTORE).)*$', '')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
expected_stdout = """
|
2021-11-16 19:44:53 +01:00
|
|
|
EXCLUDE_FILTER = "DATABASE STATS"
|
|
|
|
"DATABASE PROPERTIES"
|
|
|
|
"BACKUP DATABASE"
|
|
|
|
"""
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
trace = ['log_services = true',
|
2021-12-07 20:09:36 +01:00
|
|
|
'exclude_filter = "Database Stats"',
|
|
|
|
]
|
2021-11-16 19:44:53 +01:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
temp_file = temp_file('test-file')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2024-05-15 19:26:01 +02:00
|
|
|
@pytest.mark.trace
|
2021-11-16 19:44:53 +01:00
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-22 21:59:15 +01:00
|
|
|
def test_1(act: Action, temp_file):
|
|
|
|
with act.trace(svc_events=trace), act.connect_server() as srv:
|
|
|
|
srv.database.set_sweep_interval(database=act.db.db_path, interval=1234321)
|
|
|
|
srv.database.get_statistics(database=act.db.db_path, flags=SrvStatFlag.HDR_PAGES)
|
2021-11-16 19:44:53 +01:00
|
|
|
srv.wait()
|
2022-01-22 21:59:15 +01:00
|
|
|
srv.database.backup(database=act.db.db_path, backup=temp_file)
|
2021-11-16 19:44:53 +01:00
|
|
|
srv.wait()
|
2022-01-22 21:59:15 +01:00
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.trace_to_stdout(upper=True)
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|