6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_1076_test.py

50 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-19 17:54:56 +01:00
"""
ID: issue-1498
ISSUE: 1498
TITLE: Services Manager and gsec truncate First.Middle.Last Name fields to 17 chars instead of 32 chars available in field definition
DESCRIPTION:
NOTES:
[11.01.2016]
refactored for 3.0: use FBSVCMGR instead of GSEC. This was agreed with Alex, see his reply 11.01.2015 17:57.
JIRA: CORE-1076
FBTEST: bugs.core_1076
2022-01-19 17:54:56 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
db = db_factory()
2021-11-10 19:02:05 +01:00
2022-01-19 17:54:56 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
2022-01-19 17:54:56 +01:00
tmp_user = user_factory('db', name="Nebuchadnezzar2_King_of_Babylon",
password="Nebu_King_of_Babylon")
2021-11-11 18:01:08 +01:00
2022-01-19 17:54:56 +01:00
expected_stdout = """
2021-11-10 19:02:05 +01:00
SEC$USER_NAME NEBUCHADNEZZAR2_KING_OF_BABYLON
SEC$FIRST_NAME Nebuchadnezzar3_King_of_Babylon
SEC$MIDDLE_NAME Nebuchadnezzar4_King_of_Babylon
SEC$LAST_NAME Nebuchadnezzar5_King_of_Babylon
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-19 17:54:56 +01:00
def test_1(act: Action, tmp_user: User):
with act.connect_server() as srv:
2021-12-14 20:56:34 +01:00
sec_db = srv.info.security_database
2022-01-19 17:54:56 +01:00
act.svcmgr(switches=['action_modify_user', 'dbname', sec_db,
'sec_username', tmp_user.name,
2021-12-14 20:56:34 +01:00
'sec_firstname', 'Nebuchadnezzar3_King_of_Babylon',
'sec_middlename', 'Nebuchadnezzar4_King_of_Babylon',
'sec_lastname', 'Nebuchadnezzar5_King_of_Babylon'])
2021-11-11 18:01:08 +01:00
#
2022-01-19 17:54:56 +01:00
act.script = f"""set list on;
2021-11-10 19:02:05 +01:00
select sec$user_name, sec$first_name, sec$middle_name, sec$last_name from sec$users
2022-01-19 17:54:56 +01:00
where upper(sec$user_name) = upper('{tmp_user.name}');
2021-11-10 19:02:05 +01:00
"""
2022-01-19 17:54:56 +01:00
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00