2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
2022-01-23 20:41:55 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-4894
|
|
|
|
ISSUE: 4894
|
|
|
|
TITLE: INPUT file not properly closed
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4578
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4578
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
import pytest
|
2022-01-23 20:41:55 +01:00
|
|
|
from firebird.qa import *
|
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
act = python_act('db', substitutions=[('Unable to open.*', 'Unable to open')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
expected_stdout = """
|
|
|
|
ID 1
|
|
|
|
Unable to open
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
@pytest.mark.skip('FIXME: Not IMPLEMENTED')
|
2022-01-23 20:41:55 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
@pytest.mark.platform('Windows')
|
|
|
|
def test_1(act: Action):
|
2022-01-25 22:55:48 +01:00
|
|
|
pytest.fail("Not IMPLEMENTED")
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
# test_script_1
|
|
|
|
#---
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# import os
|
|
|
|
# import subprocess
|
|
|
|
# import time
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# db_conn.close()
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# txt_in = '''set list on;
|
|
|
|
# recreate table test(id int);
|
|
|
|
# commit;
|
|
|
|
# insert into test values(1);
|
|
|
|
# select id from test;
|
|
|
|
# commit;
|
|
|
|
# '''
|
|
|
|
# tmp_input_sql=open( os.path.join(context['temp_directory'],'tmp_4578_in.sql'), 'w')
|
|
|
|
# tmp_input_sql.write(txt_in)
|
|
|
|
# tmp_input_sql.close()
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# sql_main_file=open( os.path.join(context['temp_directory'],'tmp_4578_go.sql'), 'w')
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# sql_main_file.write("set bail on;\\n" )
|
|
|
|
# sql_main_file.write("in "+tmp_input_sql.name+";\\n" )
|
|
|
|
# sql_main_file.write("shell del "+tmp_input_sql.name+" 2>nul;\\n" )
|
|
|
|
# sql_main_file.write("in "+tmp_input_sql.name+";\\n" )
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# sql_main_file.close()
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# sql_main_log=open( os.path.join(context['temp_directory'],'tmp_isql_4578.log'), 'w')
|
|
|
|
# p_isql = subprocess.call([ "isql" , dsn, "-user" , "SYSDBA" , "-password", "masterkey", "-i", sql_main_file.name ], stdout=sql_main_log, stderr=subprocess.STDOUT)
|
|
|
|
# sql_main_log.close()
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# time.sleep(1)
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# with open( sql_main_log.name,'r') as f:
|
|
|
|
# print(f.read())
|
|
|
|
# f.close()
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
|
|
|
# # do NOT remove this pause otherwise log of trace will not be enable for deletion and test will finish with
|
2021-04-26 20:07:00 +02:00
|
|
|
# # Exception raised while executing Python test script. exception: WindowsError: 32
|
|
|
|
# time.sleep(1)
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# os.remove(sql_main_log.name)
|
|
|
|
# os.remove(sql_main_file.name)
|
2021-12-15 22:02:07 +01:00
|
|
|
#
|
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
#---
|