2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5326
|
|
|
|
ISSUE: 5326
|
|
|
|
TITLE: Connecting to service with invalid servicename yields incorrect error message
|
|
|
|
DESCRIPTION:
|
|
|
|
NOTES:
|
|
|
|
[28.01.2019]
|
|
|
|
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...")
|
|
|
|
[26.05.2021] changed code for FB 4.x and enabled after discuss with Alex.
|
|
|
|
JIRA: CORE-5039
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_5039
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
# version: 3.0
|
2021-11-26 19:20:43 +01:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
act_1 = python_act('db')
|
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
|
2021-12-31 12:06:51 +01:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
act_2 = python_act('db', substitutions=[('Server version: .* Firebird \\d+\\.\\d+.*',
|
|
|
|
'Server version: Firebird')])
|
2021-12-30 19:43:52 +01:00
|
|
|
|
|
|
|
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
|