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

68 lines
2.3 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-24 20:27:02 +01:00
"""
ID: issue-5192
ISSUE: 5192
TITLE: GFIX -online: message "IProvider::attachDatabase failed when loading mapping cache"
appears in Classic (only) if access uses remote protocol
2022-01-24 20:27:02 +01:00
DESCRIPTION:
JIRA: CORE-4899
FBTEST: bugs.core_4899
2022-01-24 20:27:02 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
db = db_factory()
2021-11-26 19:20:43 +01:00
2022-01-24 20:27:02 +01:00
act = python_act('db', substitutions=[('^((?!Attributes).)*$', ''), ('[\t]+', ' ')])
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
expected_stdout = """
2021-12-19 22:25:36 +01:00
Attributes full shutdown
Attributes
Attributes full shutdown
Attributes
2021-11-26 19:20:43 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-24 20:27:02 +01:00
def test_1(act: Action, capsys):
2021-11-26 19:20:43 +01:00
# Trying to move database to OFFLINE:
2022-01-24 20:27:02 +01:00
act.gfix(switches=['-shut', 'full', '-force', '0', str(act.db.db_path)])
print(act.stdout)
act.reset()
act.gstat(switches=['-h', str(act.db.db_path)], connect_db=False)
print(act.stdout)
2021-11-26 19:20:43 +01:00
# Trying to move database online using LOCAL protocol:
2022-01-24 20:27:02 +01:00
act.reset()
act.gfix(switches=['-online', str(act.db.db_path)])
print(act.stdout)
2021-11-26 19:20:43 +01:00
# gfix attachment via local protocol reflects with following lines in trace:
# 2015-08-24T18:30:03.2580 (2516:012417E0) ATTACH_DATABASE
# C:\\MIX\\FIREBIRD\\QA\\FBT-REPO\\TMP\\CORE4899-TMP.FDB (ATT_9, SYSDBA:NONE, NONE, <internal>)
2022-01-24 20:27:02 +01:00
act.reset()
act.gstat(switches=['-h', str(act.db.db_path)], connect_db=False)
print(act.stdout)
2021-11-26 19:20:43 +01:00
# --------------------- II ---------------
2022-01-24 20:27:02 +01:00
act.reset()
act.gfix(switches=['-shut', 'full', '-force', '0', str(act.db.db_path)])
print(act.stdout)
act.reset()
act.gstat(switches=['-h', str(act.db.db_path)], connect_db=False)
print(act.stdout)
2021-11-26 19:20:43 +01:00
# Trying to move database online using REMOTE protocol:
2022-01-24 20:27:02 +01:00
act.reset()
act.gfix(switches=['-online', act.db.dsn])
print(act.stdout)
2021-11-26 19:20:43 +01:00
# Note: gfix attachment via remote protocol refects with following lines in trace:
# 2015-08-24T18:30:03.8520 (3256:01B526A8) ATTACH_DATABASE
# C:\\MIX\\FIREBIRD\\QA\\FBT-REPO\\TMP\\CORE4899-TMP.FDB (ATT_9, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
# C:\\MIX\\firebird\\db30\\gfix.exe:1448
2022-01-24 20:27:02 +01:00
act.reset()
act.gstat(switches=['-h', str(act.db.db_path)], connect_db=False)
print(act.stdout)
2021-11-26 19:20:43 +01:00
# Check
2022-01-24 20:27:02 +01:00
act.reset()
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
assert act.clean_stdout == act.clean_expected_stdout