2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
#
|
|
|
|
# id: bugs.core_5039
|
|
|
|
# title: Connecting to service with invalid servicename yields incorrect error message
|
2021-11-26 19:20:43 +01:00
|
|
|
# decription:
|
|
|
|
# 28.01.2019.
|
2021-04-26 20:07:00 +02:00
|
|
|
# Name of service manager is ignored in FB 4.0, see http://tracker.firebirdsql.org/browse/CORE-5883
|
|
|
|
# ("service_mgr" to be cleaned out from connection string completely...")
|
2021-12-30 19:43:52 +01:00
|
|
|
# 26.05.2021: changed code for FB 4.x and enabled after discuss with Alex.
|
2021-11-26 19:20:43 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# tracker_id: CORE-5039
|
|
|
|
# min_versions: ['3.0']
|
|
|
|
# versions: 3.0, 4.0
|
|
|
|
# qmid: None
|
|
|
|
|
|
|
|
import pytest
|
2021-11-26 19:20:43 +01:00
|
|
|
from firebird.qa import db_factory, python_act, Action
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
# version: 3.0
|
|
|
|
# resources: None
|
|
|
|
|
|
|
|
substitutions_1 = []
|
|
|
|
|
|
|
|
init_script_1 = """"""
|
|
|
|
|
|
|
|
db_1 = db_factory(sql_dialect=3, init=init_script_1)
|
|
|
|
|
|
|
|
# test_script_1
|
|
|
|
#---
|
2021-11-26 19:20:43 +01:00
|
|
|
#
|
2021-04-26 20:07:00 +02:00
|
|
|
# db_conn.close()
|
2021-12-30 19:43:52 +01:00
|
|
|
# runProgram('fbsvcmgr',['localhost:qwe_mnb_zxc_9','user', user_name, 'password', user_password, 'info_server_version'])
|
2021-04-26 20:07:00 +02:00
|
|
|
#---
|
2021-11-26 19:20:43 +01:00
|
|
|
|
|
|
|
act_1 = python_act('db_1', substitutions=substitutions_1)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
expected_stderr_1 = """
|
|
|
|
Cannot attach to services manager
|
|
|
|
-service qwe_mnb_zxc_9 is not defined
|
2021-11-26 19:20:43 +01:00
|
|
|
"""
|
|
|
|
|
2021-12-30 19:43:52 +01:00
|
|
|
@pytest.mark.version('>=3.0,<4.0')
|
2021-11-26 19:20:43 +01:00
|
|
|
def test_1(act_1: Action):
|
|
|
|
act_1.expected_stderr = expected_stderr_1
|
|
|
|
act_1.svcmgr(switches=['localhost:qwe_mnb_zxc_9', 'user', 'SYSDBA',
|
|
|
|
'password', 'masterkey', 'info_server_version'],
|
|
|
|
connect_mngr=False)
|
|
|
|
assert act_1.clean_stderr == act_1.clean_expected_stderr
|
2021-12-30 19:43:52 +01:00
|
|
|
|
|
|
|
# version: 4.0
|
|
|
|
# resources: None
|
|
|
|
|
|
|
|
substitutions_2 = [('Server version: .* Firebird \\d+\\.\\d+.*', 'Server version: Firebird')]
|
|
|
|
|
|
|
|
init_script_2 = """"""
|
|
|
|
|
|
|
|
db_2 = db_factory(sql_dialect=3, init=init_script_2)
|
|
|
|
|
|
|
|
# test_script_2
|
|
|
|
#---
|
|
|
|
#
|
|
|
|
# db_conn.close()
|
|
|
|
# # Server version must be issued here, regardless on the (invalid/non-existing) name of service manager, e.g.:
|
|
|
|
# # Server version: WI-V4.0.0.2491 Firebird 4.0 Release Candidate 1
|
|
|
|
# runProgram('fbsvcmgr',['localhost:qwe_mnb_zxc_9','user', user_name, 'password', user_password, 'info_server_version'])
|
|
|
|
#---
|
2021-12-31 12:06:51 +01:00
|
|
|
|
2021-12-30 19:43:52 +01:00
|
|
|
act_2 = python_act('db_2', substitutions=substitutions_2)
|
|
|
|
|
|
|
|
expected_stdout_2 = """
|
|
|
|
Server version: Firebird
|
|
|
|
"""
|
|
|
|
|
|
|
|
@pytest.mark.version('>=4.0')
|
|
|
|
def test_2(act_2: Action):
|
|
|
|
act_2.expected_stdout = expected_stdout_2
|
|
|
|
act_2.svcmgr(switches=['localhost:qwe_mnb_zxc_9', 'user', 'SYSDBA',
|
|
|
|
'password', 'masterkey', 'info_server_version'],
|
|
|
|
connect_mngr=False)
|
|
|
|
assert act_2.clean_stdout == act_2.clean_expected_stdout
|