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

80 lines
2.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-24 20:27:02 +01:00
"""
ID: issue-5137
ISSUE: 5137
TITLE: Make message about missing password being always displayed as reply on attempt to issue CREATE new login without PASSWORD clause
2022-01-24 20:27:02 +01:00
DESCRIPTION:
JIRA: CORE-4841
FBTEST: bugs.core_4841
NOTES:
[04.02.2022] pcisar
Test fails with 3.0.8, because command
create or alter user u01 tags (password = 'foo');
does not produce any error.
[18.09.2022] pzotov
Could NOT find any problems on both Windows and Linux. Test works FINE.
Checked on 3.0.8.33535 (SS/CS), 4.0.1.2692 (SS/CS), 5.0.0.730 (SS/CS).
2022-01-24 20:27:02 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
-- All following statements must fail with message that contains phrase:
-- "Password must be specified when creating user"
create user u01;
create user u01 using plugin Srp;
create user u01 firstname 'john';
create user u01 grant admin role;
create user u01 inactive;
create or alter user u01 tags (password = 'foo');
create user password;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
act = isql_act('db', test_script, substitutions=[('[-]?Password', 'Password')])
2022-01-25 22:55:48 +01:00
expected_stderr = """
2021-12-22 20:23:11 +01:00
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE USER U01 failed
-Password must be specified when creating user
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE USER U01 failed
-Password must be specified when creating user
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE USER U01 failed
-Password must be specified when creating user
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE USER U01 failed
-Password must be specified when creating user
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE USER U01 failed
-Password must be specified when creating user
Statement failed, SQLSTATE = HY000
Password must be specified when creating user
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE USER PASSWORD failed
-Password must be specified when creating user
"""
2022-01-25 22:55:48 +01:00
@pytest.mark.version('>=3.0.8')
def test_1(act: Action):
act.expected_stderr = expected_stderr
2022-01-24 20:27:02 +01:00
act.execute()
assert act.clean_stderr == act.clean_expected_stderr