From f2a5849dc77a3d9995c0434bcdbc3453f55fe8fe Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Tue, 31 Oct 2023 13:07:29 +0300 Subject: [PATCH] Added/Updated tests\bugs\core_5771_test.py: Removed check of message `gbak:opened file [fbk_file]` in STDOUT. See notes. --- tests/bugs/core_5771_test.py | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/tests/bugs/core_5771_test.py b/tests/bugs/core_5771_test.py index 076ad048..c2adb16d 100644 --- a/tests/bugs/core_5771_test.py +++ b/tests/bugs/core_5771_test.py @@ -2,11 +2,17 @@ """ 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) DESCRIPTION: JIRA: CORE-5771 FBTEST: bugs.core_5771 +NOTES: + [31.10.2023] + Removed check of message "gbak:opened 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 @@ -14,21 +20,15 @@ from difflib import unified_diff from pathlib import Path from firebird.qa import * -substitutions = [('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')] +substitutions = [ ('database .*tmp_core_5771.fdb already exists.', 'database tmp_core_5771.fdb already exists.'), ] db = db_factory() act = python_act('db', substitutions=substitutions) -expected_stdout = """ - gbak:opened file tmp_core_5771.fbk -""" - expected_stderr = """ -database tmp_core_5771.fdb already exists. To replace it, use the -REP switch --Exiting before completion due to errors + database tmp_core_5771.fdb already exists. To replace it, use the -REP switch + -Exiting before completion due to errors """ 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): act.gbak(switches=['-b', act.db.dsn, str(fbk_file)]) act.gbak(switches=['-rep', str(fbk_file), act.get_dsn(fdb_file)]) - # log_before = act.get_firebird_log() - # act.reset() - act.expected_stdout = expected_stdout + act.expected_stderr = expected_stderr - act.svcmgr(switches=['action_restore', 'bkp_file', str(fbk_file), - 'dbname', str(fdb_file), 'verbose']) - # + act.svcmgr(switches=['action_restore', 'bkp_file', str(fbk_file), 'dbname', str(fdb_file), 'verbose']) log_after = act.get_firebird_log() 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