From eb019319e555ef1daefd3b5e314705a5c73db555 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Mon, 30 Dec 2024 12:02:31 +0300 Subject: [PATCH] Added/Updated tests\bugs\core_5630_test.py: splitted expected output for 6.x since some columns in rdb$files now have NULLS instead of zeroes - see notes. --- tests/bugs/core_5630_test.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/bugs/core_5630_test.py b/tests/bugs/core_5630_test.py index d89cf2b7..cfba5cd2 100644 --- a/tests/bugs/core_5630_test.py +++ b/tests/bugs/core_5630_test.py @@ -4,10 +4,15 @@ ID: issue-5896 ISSUE: 5896 TITLE: Can't create the shadow file -DESCRIPTION: - Shadow file is can not be created during restore when -use_all_space option is used +DESCRIPTION: Shadow file can not be created during restore when '-use_all_space' option is used JIRA: CORE-5630 -FBTEST: bugs.core_5630 +NOTES: + [30.12.2024] pzotov + Splitted expected out for FB 6.x because columns rdb$file_sequence, rdb$file_start and rdb$file_length + have NULLs instead of zeroes, see: + https://github.com/FirebirdSQL/firebird/commit/f0740d2a3282ed92a87b8e0547139ba8efe61173 + ("Wipe out multi-file database support (#8047)") + Checked on 6.0.0.565 """ import locale @@ -17,24 +22,24 @@ from firebird.qa import * db = db_factory() -act = python_act('db', substitutions=[('Commit current transaction \\(y/n\\)\\?', '')]) +act = python_act('db', substitutions=[('[ \t]+', ' ')]) -expected_stdout_a = """ +expected_stdout_5x = """ RDB$FILE_SEQUENCE 0 RDB$FILE_START 0 RDB$FILE_LENGTH 0 RDB$FILE_FLAGS 1 RDB$SHADOW_NUMBER 1 - S_HASH_BEFORE 1499836372373901520 + S_HASH 1499836372373901520 """ -expected_stdout_b = """ - RDB$FILE_SEQUENCE 0 - RDB$FILE_START 0 - RDB$FILE_LENGTH 0 +expected_stdout_6x = """ + RDB$FILE_SEQUENCE + RDB$FILE_START + RDB$FILE_LENGTH RDB$FILE_FLAGS 1 RDB$SHADOW_NUMBER 1 - S_HASH_AFTER 1499836372373901520 + S_HASH 1499836372373901520 """ fdb_file = temp_file('core_5630.fdb') @@ -70,11 +75,11 @@ def test_1(act: Action, fdb_file: Path, fbk_file: Path, shd_file: Path): commit; set list on; select * from v_shadow_info; - select hash( list(s) ) as s_hash_before from test; + select hash( list(s) ) as s_hash from test; quit; """ - act.expected_stdout = expected_stdout_a + act.expected_stdout = expected_stdout_5x if act.is_version('<6') else expected_stdout_6x act.isql(switches=['-q'], input = init_ddl, connect_db=False, combine_output = True, io_enc = locale.getpreferredencoding()) assert act.clean_stdout == act.clean_expected_stdout # @@ -94,12 +99,12 @@ def test_1(act: Action, fdb_file: Path, fbk_file: Path, shd_file: Path): sql_text = """ set list on; select * from v_shadow_info; - select hash( list(s) ) as s_hash_after from test; + select hash( list(s) ) as s_hash from test; """ act.reset() #----------------------------------------------------------------------------------- - act.expected_stdout = expected_stdout_b + act.expected_stdout = expected_stdout_5x if act.is_version('<6') else expected_stdout_6x act.isql(switches=['-q', act.get_dsn(fdb_file)], input=sql_text, connect_db=False, combine_output = True, io_enc = locale.getpreferredencoding()) assert act.clean_stdout == act.clean_expected_stdout