6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 14:03:06 +01:00
firebird-qa/tests/bugs/core_6329_test.py

164 lines
5.0 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_6329
# title: GBAK with service_mgr and WinSSPI authentication for Windows SYSTEM user producing error in clumplet API
# decription:
# Confirmed bug on 4.0.0.2035 SS: got
2021-04-26 20:07:00 +02:00
# "gbak: ERROR:Internal error when using clumplet API: attempt to store 866 bytes in a clumplet with maximum size 255 bytes"
#
2021-04-26 20:07:00 +02:00
# Checked on 4.0.0.2066 SS/CS, 3.0.6.33212 SS/CS.
#
2021-04-26 20:07:00 +02:00
# tracker_id: CORE-6329
# min_versions: ['3.0.6']
# versions: 3.0.6
# qmid:
2021-04-26 20:07:00 +02:00
import pytest
from firebird.qa import db_factory, python_act, Action
2021-04-26 20:07:00 +02:00
# version: 3.0.6
# resources: None
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# test_script_1
#---
#
2021-04-26 20:07:00 +02:00
# import sys
# import os
# import re
# import time
# import subprocess
# from fdb import services
# import socket
# import getpass
#
2021-04-26 20:07:00 +02:00
# THIS_DBA_USER=user_name
# THIS_DBA_PSWD=user_password
#
2021-04-26 20:07:00 +02:00
# THIS_COMPUTER_NAME = socket.gethostname()
# CURRENT_WIN_ADMIN = getpass.getuser()
#
2021-04-26 20:07:00 +02:00
# ##########################################
# THIS_FDB = db_conn.database_name
# THIS_FBK=os.path.join(context['temp_directory'],'tmp_6329.fbk')
# ##########################################
#
2021-04-26 20:07:00 +02:00
# #--------------------------------------------
#
2021-04-26 20:07:00 +02:00
# def cleanup( f_names_list ):
# global os
# for i in range(len( f_names_list )):
# if os.path.isfile( f_names_list[i]):
# os.remove( f_names_list[i] )
# if os.path.isfile( f_names_list[i]):
# print('ERROR: can not remove file ' + f_names_list[i])
#
2021-04-26 20:07:00 +02:00
# #--------------------------------------------
#
#
2021-04-26 20:07:00 +02:00
# fb_home = services.connect(host='localhost', user= THIS_DBA_USER, password= THIS_DBA_PSWD).get_home_directory()
#
2021-04-26 20:07:00 +02:00
# f_sql_make_map = open( os.path.join(context['temp_directory'],'tmp_6329.sql'), 'w', buffering=0)
# f_sql_txt='''
# set bail on;
# connect 'localhost:%(THIS_FDB)s' user %(THIS_DBA_USER)s password '%(THIS_DBA_PSWD)s';
#
2021-04-26 20:07:00 +02:00
# create or alter global mapping win_system using plugin win_sspi from user "%(THIS_COMPUTER_NAME)s\\%(CURRENT_WIN_ADMIN)s" to user %(THIS_DBA_USER)s;
# commit;
# ''' % locals()
#
2021-04-26 20:07:00 +02:00
# f_sql_make_map.write(f_sql_txt)
# f_sql_make_map.close()
#
2021-04-26 20:07:00 +02:00
# # do NOT remove this delay otherwise can get 'Windows error 2: file not found'.
# time.sleep(1)
#
2021-04-26 20:07:00 +02:00
# f_prepare_log=open( os.path.join(context['temp_directory'],'tmp_6329_prepare.log'), 'w', buffering=0)
# subprocess.call( [ fb_home + "isql", "-q", "-i", f_sql_make_map.name ], stdout=f_prepare_log, stderr=subprocess.STDOUT )
# f_prepare_log.close()
#
2021-04-26 20:07:00 +02:00
# f_backup_log=open( os.path.join(context['temp_directory'],'tmp_6329_backup.log'), 'w', buffering=0)
# subprocess.call( [ fb_home + "gbak", "-v", "-b", "-se", "localhost:service_mgr", THIS_FDB, THIS_FBK], stdout=f_backup_log, stderr=subprocess.STDOUT )
# f_backup_log.close()
#
#
2021-04-26 20:07:00 +02:00
# # Remove global mapping:
# ########################
#
2021-04-26 20:07:00 +02:00
# f_sql_drop_map = open( os.path.join(context['temp_directory'],'tmp_6329_cleanup.sql'), 'w', buffering=0)
# f_sql_txt='''
# set bail on;
# connect 'localhost:%(THIS_FDB)s' user %(THIS_DBA_USER)s password '%(THIS_DBA_PSWD)s';
#
2021-04-26 20:07:00 +02:00
# drop global mapping win_system;
# commit;
# ''' % locals()
# f_sql_drop_map.write(f_sql_txt)
# f_sql_drop_map.close()
#
2021-04-26 20:07:00 +02:00
# f_cleanup_log = open( os.path.join(context['temp_directory'],'tmp_6329_cleanup.log'), 'w', buffering=0)
# subprocess.call( [ fb_home + "isql", "-q", "-i", f_sql_drop_map.name ], stdout=f_cleanup_log, stderr=subprocess.STDOUT )
# f_cleanup_log.close()
#
2021-04-26 20:07:00 +02:00
# # Checks:
# #########
#
2021-04-26 20:07:00 +02:00
# with open( f_prepare_log.name,'r') as f:
# for line in f:
# if line.split():
# print('UNEXPECTED OUTPUT in '+f_prepare_log.name+': '+line)
#
#
2021-04-26 20:07:00 +02:00
# allowed_patterns = (
# re.compile('gbak:.*closing.*commit.*finish',re.IGNORECASE),
# )
#
2021-04-26 20:07:00 +02:00
# with open( f_backup_log.name,'r') as f:
# for line in f:
# if 'ERROR' in line:
# print('UNEXPECTED STDERR in '+f_backup_log.name+': '+line)
# elif 'closing' in line:
# match2some = filter( None, [ p.search(line) for p in allowed_patterns ] )
# if match2some:
# print('EXPECTED output found in the backup log')
#
2021-04-26 20:07:00 +02:00
# with open( f_cleanup_log.name,'r') as f:
# for line in f:
# if line.split():
# print('UNEXPECTED OUTPUT in '+f_cleanup_log.name+': '+line)
#
2021-04-26 20:07:00 +02:00
# # Cleanup:
# ##########
#
# # do NOT remove this pause otherwise some of logs 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-04-26 20:07:00 +02:00
# f_list=( f_sql_make_map, f_sql_drop_map, f_prepare_log, f_backup_log, f_cleanup_log )
# cleanup( [ i.name for i in f_list ] )
#
2021-04-26 20:07:00 +02:00
# os.remove(THIS_FBK)
#
#
#
2021-04-26 20:07:00 +02:00
#---
act_1 = python_act('db_1', substitutions=substitutions_1)
2021-04-26 20:07:00 +02:00
expected_stdout_1 = """
EXPECTED output found in the backup log
"""
@pytest.mark.version('>=3.0.6')
@pytest.mark.platform('Windows')
@pytest.mark.xfail
def test_1(act_1: Action):
2021-04-26 20:07:00 +02:00
pytest.fail("Test not IMPLEMENTED")