2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
2022-01-22 21:59:15 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-3904
|
|
|
|
ISSUE: 3904
|
|
|
|
TITLE: GFIX returns an error after correctly shutting down a database
|
|
|
|
DESCRIPTION: Affects only local connections
|
|
|
|
JIRA: CORE-3548
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_3548
|
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-17 19:43:06 +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-17 19:43:06 +01:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = python_act('db', substitutions=[('^((?!Attribute|connection).)*$', '')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
expected_stdout = """
|
2021-12-19 22:25:36 +01:00
|
|
|
Attributes full shutdown
|
2021-11-17 19:43:06 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
def test_1(act: Action):
|
|
|
|
act.gfix(switches=['-user', act.db.user, '-password', act.db.password,
|
|
|
|
'-shut', 'full', '-force', '0', str(act.db.db_path)])
|
|
|
|
with act.connect_server() as srv:
|
|
|
|
srv.database.get_statistics(database=act.db.db_path, flags=SrvStatFlag.HDR_PAGES)
|
2021-11-17 19:43:06 +01:00
|
|
|
stats = srv.readlines()
|
2022-01-22 21:59:15 +01:00
|
|
|
act.gfix(switches=['-user', act.db.user, '-password', act.db.password,
|
|
|
|
'-online', str(act.db.db_path)])
|
|
|
|
act.stdout = '\n'.join(stats)
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|