2021-12-30 19:43:52 +01:00
#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID : issue - 6709
ISSUE : 6709
TITLE : gbak discards replica mode
DESCRIPTION :
JIRA : CORE - 6478
2022-02-02 15:46:19 +01:00
FBTEST : bugs . gh_6709
2022-01-27 20:08:36 +01:00
"""
2021-12-30 19:43:52 +01:00
import pytest
2022-01-27 20:08:36 +01:00
from firebird . qa import *
2021-12-30 19:43:52 +01:00
2022-01-27 20:08:36 +01:00
db = db_factory ( )
2021-12-30 19:43:52 +01:00
2022-01-27 20:08:36 +01:00
act = python_act ( ' db ' , substitutions = [ ( ' [ \t ]+ ' , ' ' ) ] )
2021-12-30 19:43:52 +01:00
2022-01-27 20:08:36 +01:00
expected_stdout = """
Result of gfix - replica read_only : READ - ONLY
Result of backup / restore for read_only : READ - ONLY
Result of gfix - replica read_write : READ - WRITE
Result of backup / restore for read_write : READ - WRITE
"""
2021-12-30 19:43:52 +01:00
2022-01-27 20:08:36 +01:00
@pytest.mark.skip ( ' FIXME: Not IMPLEMENTED ' )
@pytest.mark.version ( ' >=4.0 ' )
def test_1 ( act : Action ) :
pytest . fail ( " Not IMPLEMENTED " )
2021-12-30 19:43:52 +01:00
# test_script_1
#---
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# import os
# import shutil
# import subprocess
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# os.environ["ISC_USER"] = user_name
# os.environ["ISC_PASSWORD"] = user_password
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# this_fdb=db_conn.database_name
# db_conn.close()
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# #--------------------------------------------
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# def cleanup( f_names_list ):
# global os
# for i in range(len( f_names_list )):
# if type(f_names_list[i]) == file:
# del_name = f_names_list[i].name
# elif type(f_names_list[i]) == str:
# del_name = f_names_list[i]
# else:
# print('Unrecognized type of element:', f_names_list[i], ' - can not be treated as file.')
# print('type(f_names_list[i])=',type(f_names_list[i]))
# del_name = None
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# if del_name and os.path.isfile( del_name ):
# os.remove( del_name )
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# #--------------------------------------------
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# test_fdb=os.path.join(context['temp_directory'],'tmp_gh_6709.source.fdb')
# test_fbk=os.path.join(context['temp_directory'],'tmp_gh_6709.fbk')
# test_res=os.path.join(context['temp_directory'],'tmp_gh_6709.restored')
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# for r_mode in ('read_only', 'read_write'):
# cleanup( (test_fdb, test_res) )
# shutil.copy2( this_fdb, test_fdb )
# runProgram('gfix', [ 'localhost:' + test_fdb, '-replica', r_mode ] )
# runProgram('isql', [ 'localhost:' + test_fdb ], '''set list on; select rdb$get_context('SYSTEM', 'REPLICA_MODE') as "Result of gfix -replica %(r_mode)s:" from rdb$database;''' % locals() )
# runProgram('gbak', [ '-b', 'localhost:' + test_fdb, test_fbk ] )
# runProgram('gbak', [ '-c', '-m', test_fbk, 'localhost:' + test_res ] )
# runProgram('isql', [ 'localhost:' + test_res ], '''set list on; select rdb$get_context('SYSTEM', 'REPLICA_MODE') as "Result of backup/restore for %(r_mode)s:" from rdb$database;''' % locals() )
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
# cleanup( (test_fdb, test_fbk, test_res) )
2022-01-25 22:55:48 +01:00
#
2021-12-30 19:43:52 +01:00
#---