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_4841_test.py

78 lines
2.1 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:
2022-02-04 19:05:19 +01:00
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.
2022-01-24 20:27:02 +01:00
JIRA: CORE-4841
FBTEST: bugs.core_4841
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-02-04 19:05:19 +01:00
@pytest.mark.skip("FIXME: see notes")
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