6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/bugs/core_3548_test.py

51 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_3548
# title: GFIX returns an error after correctly shutting down a database
# decription: Affected only local connections
# tracker_id: CORE-3548
# min_versions: ['2.5.5']
# versions: 2.5.5
# qmid: None
import pytest
2021-11-17 19:43:06 +01:00
from firebird.qa import db_factory, python_act, Action
from firebird.driver import SrvStatFlag
2021-04-26 20:07:00 +02:00
# version: 2.5.5
# resources: None
substitutions_1 = [('^((?!Attribute|connection).)*$', '')]
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# test_script_1
#---
# db_conn.close()
# runProgram('gfix',['$(DATABASE_LOCATION)bugs.core_3548.fdb','-shut','full','-force','0','-user',user_name,'-password',user_password])
# runProgram('gstat',['$(DATABASE_LOCATION)bugs.core_3548.fdb','-h','-user',user_name,'-password',user_password])
# runProgram('gfix',['$(DATABASE_LOCATION)bugs.core_3548.fdb','-online','-user',user_name,'-password',user_password])
#---
2021-11-17 19:43:06 +01:00
act_1 = python_act('db_1', substitutions=substitutions_1)
2021-04-26 20:07:00 +02:00
expected_stdout_1 = """
Attributes force write, full shutdown
2021-11-17 19:43:06 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=2.5.5')
2021-11-17 19:43:06 +01:00
def test_1(act_1: Action):
act_1.gfix(switches=['-user', act_1.db.user, '-password', act_1.db.password,
'-shut', 'full', '-force', '0', str(act_1.db.db_path)])
with act_1.connect_server() as srv:
srv.database.get_statistics(database=str(act_1.db.db_path), flags=SrvStatFlag.HDR_PAGES)
stats = srv.readlines()
act_1.gfix(switches=['-user', act_1.db.user, '-password', act_1.db.password,
'-online', str(act_1.db.db_path)])
act_1.stdout = '\n'.join(stats)
act_1.expected_stdout = expected_stdout_1
assert act_1.clean_stdout == act_1.clean_expected_stdout
2021-04-26 20:07:00 +02:00