6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\core_5771_test.py: Removed check of message gbak:opened file [fbk_file] in STDOUT. See notes.

This commit is contained in:
pavel-zotov 2023-10-31 13:07:29 +03:00
parent bc3b92ee1a
commit f2a5849dc7

View File

@ -2,11 +2,17 @@
""" """
ID: issue-6034 ID: issue-6034
ISSUE: 6034 ISSUE: https://github.com/FirebirdSQL/firebird/issues/6034
TITLE: Restore (without replace) when database already exists crashes gbak or Firebird (when run through service manager) TITLE: Restore (without replace) when database already exists crashes gbak or Firebird (when run through service manager)
DESCRIPTION: DESCRIPTION:
JIRA: CORE-5771 JIRA: CORE-5771
FBTEST: bugs.core_5771 FBTEST: bugs.core_5771
NOTES:
[31.10.2023]
Removed check of message "gbak:opened file <fbk_file>" in STDOUT.
This message does not appear since 6.0.0.100 (29.10.2023).
Absense of this message (when using 'verbose') should NOT be considered as an error.
Discussed with Alex, letters since 30.10.2023.
""" """
import pytest import pytest
@ -14,21 +20,15 @@ from difflib import unified_diff
from pathlib import Path from pathlib import Path
from firebird.qa import * from firebird.qa import *
substitutions = [('database .*tmp_core_5771.fdb already exists.', substitutions = [ ('database .*tmp_core_5771.fdb already exists.', 'database tmp_core_5771.fdb already exists.'), ]
'database tmp_core_5771.fdb already exists.'),
('opened file .*tmp_core_5771.fbk', 'opened file tmp_core_5771.fbk')]
db = db_factory() db = db_factory()
act = python_act('db', substitutions=substitutions) act = python_act('db', substitutions=substitutions)
expected_stdout = """
gbak:opened file tmp_core_5771.fbk
"""
expected_stderr = """ expected_stderr = """
database tmp_core_5771.fdb already exists. To replace it, use the -REP switch database tmp_core_5771.fdb already exists. To replace it, use the -REP switch
-Exiting before completion due to errors -Exiting before completion due to errors
""" """
fbk_file = temp_file('tmp_core_5771.fbk') fbk_file = temp_file('tmp_core_5771.fbk')
@ -38,16 +38,12 @@ fdb_file = temp_file('tmp_core_5771.fdb')
def test_1(act: Action, fbk_file: Path, fdb_file: Path): def test_1(act: Action, fbk_file: Path, fdb_file: Path):
act.gbak(switches=['-b', act.db.dsn, str(fbk_file)]) act.gbak(switches=['-b', act.db.dsn, str(fbk_file)])
act.gbak(switches=['-rep', str(fbk_file), act.get_dsn(fdb_file)]) act.gbak(switches=['-rep', str(fbk_file), act.get_dsn(fdb_file)])
#
log_before = act.get_firebird_log() log_before = act.get_firebird_log()
#
act.reset() act.reset()
act.expected_stdout = expected_stdout
act.expected_stderr = expected_stderr act.expected_stderr = expected_stderr
act.svcmgr(switches=['action_restore', 'bkp_file', str(fbk_file), act.svcmgr(switches=['action_restore', 'bkp_file', str(fbk_file), 'dbname', str(fdb_file), 'verbose'])
'dbname', str(fdb_file), 'verbose'])
#
log_after = act.get_firebird_log() log_after = act.get_firebird_log()
assert list(unified_diff(log_before, log_after)) == [] assert list(unified_diff(log_before, log_after)) == []
assert (act.clean_stderr == act.clean_expected_stderr and
act.clean_stdout == act.clean_expected_stdout) assert act.clean_stderr == act.clean_expected_stderr