2 @message |
I/O error
assert
- CREATED_DB_NAME EXPECTED
- DB_OWNER DBA_4821
- MON$SEC_DATABASE Other
+ Statement failed, SQLSTATE = 08001
+ I/O error during "open O_CREAT" operation for file "/home/fbqa/qa-2024/unpacked-snapshot.tmp/examples/empbuild/qa/tmp_core_4821.fdb"
+ -Error while trying to create file
+ -File exists
+ Statement failed, SQLSTATE = 08001
+ I/O error during "re open() for SYNC/DIRECT" operation for file "/home/fbqa/qa-2024/unpacked-snapshot.tmp/examples/empbuild/qa/tmp_bind_4821.fdb"
+ -Error while trying to open file
+ -No such file or directory
LOG DETAILS:
2024-05-12 19:15:53.924
2024-05-12 19:15:53.929 act = <firebird.qa.plugin.Action object at [hex]>
2024-05-12 19:15:53.934 act_clone = <firebird.qa.plugin.Action object at [hex]>
2024-05-12 19:15:53.939 tmp_user = <firebird.qa.plugin.User object at [hex]>
2024-05-12 19:15:53.944 tmp_role = <firebird.qa.plugin.Role object at [hex]>
2024-05-12 19:15:53.949 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-05-12 19:15:53.956
2024-05-12 19:15:53.965 @pytest.mark.version('>=3.0.5')
2024-05-12 19:15:53.971 def test_1(act: Action,
2024-05-12 19:15:53.977 act_clone: Action,
2024-05-12 19:15:53.982 tmp_user: User,
2024-05-12 19:15:53.988 tmp_role: Role,
2024-05-12 19:15:53.993 capsys
2024-05-12 19:15:53.999 ):
2024-05-12 19:15:54.004
2024-05-12 19:15:54.010 db_work_file = get_filename_by_alias(act, REQUIRED_ALIAS)
2024-05-12 19:15:54.020 db_clone_file = get_filename_by_alias(act_clone, DB_BIND_ALIAS)
2024-05-12 19:15:54.026
2024-05-12 19:15:54.030 #----------------------------------------------------
2024-05-12 19:15:54.035
2024-05-12 19:15:54.043 dba_pswd = 'alterkey'
2024-05-12 19:15:54.048
2024-05-12 19:15:54.054 # The role MUST be created in security database!
2024-05-12 19:15:54.059 #
2024-05-12 19:15:54.064 sql_test = f"""
2024-05-12 19:15:54.069 set wng off;
2024-05-12 19:15:54.074 --set echo on;
2024-05-12 19:15:54.079 set list on;
2024-05-12 19:15:54.084 create database '{REQUIRED_ALIAS}' user {tmp_user.name};
2024-05-12 19:15:54.089
2024-05-12 19:15:54.094 create role {tmp_role.name};
2024-05-12 19:15:54.101 grant create database to role {tmp_role.name};
2024-05-12 19:15:54.109 grant drop database to role {tmp_role.name};
2024-05-12 19:15:54.116
2024-05-12 19:15:54.121 create user {tmp_user.name} password '{tmp_user.password}'
2024-05-12 19:15:54.127 -- ### ACHTUNG ### DO NOT specify in FB 4.x and 5.x:
2024-05-12 19:15:54.132 -- REVOKE ADMIN ROLE; ==> weird "SQLSTATE = 42000 / add record error ; ... / Zero length identifiers are not allowed"
2024-05-12 19:15:54.137 ;
2024-05-12 19:15:54.142 commit;
2024-05-12 19:15:54.148 grant {tmp_role.name} to {tmp_user.name}; -- actually not requied in FB 4.x and 5.x!
2024-05-12 19:15:54.153 commit;
2024-05-12 19:15:54.158
2024-05-12 19:15:54.163
2024-05-12 19:15:54.168 -- NOTE: following statement requires ROLE specification only in FB 3.x,
2024-05-12 19:15:54.173 -- otherwise:
2024-05-12 19:15:54.178 -- Statement failed, SQLSTATE = 28000
2024-05-12 19:15:54.183 -- no permission for CREATE access to DATABASE tmp_bind_4821_alias
2024-05-12 19:15:54.188 -- ### NO ### such requiremtnt in FB 4.x+
2024-05-12 19:15:54.192 create database 'localhost:{DB_BIND_ALIAS}' user {tmp_user.name} password '{tmp_user.password}'
2024-05-12 19:15:54.197 role {tmp_role.name} -- actually not requied in FB 4.x and 5.x!
2024-05-12 19:15:54.203 ;
2024-05-12 19:15:54.212 select
2024-05-12 19:15:54.218 iif( upper(mon$database_name) = upper('{db_clone_file}'), 'EXPECTED', 'UNEXPECTED! ' || coalesce(mon$database_name,'[null]')) as created_db_name
2024-05-12 19:15:54.223 ,mon$owner as db_owner
2024-05-12 19:15:54.229 ,mon$sec_database
2024-05-12 19:15:54.234 from mon$database;
2024-05-12 19:15:54.239 rollback;
2024-05-12 19:15:54.243 drop database;
2024-05-12 19:15:54.249 """
2024-05-12 19:15:54.254
2024-05-12 19:15:54.260 try:
2024-05-12 19:15:54.269 act.expected_stdout = f"""
2024-05-12 19:15:54.279 CREATED_DB_NAME EXPECTED
2024-05-12 19:15:54.284 DB_OWNER DBA_4821
2024-05-12 19:15:54.288 MON$SEC_DATABASE Other
2024-05-12 19:15:54.293 """
2024-05-12 19:15:54.298 # act.expected_stdout = ''
2024-05-12 19:15:54.304 act.isql(switches=['-q'], input=sql_test, connect_db=False, credentials = False, combine_output = True, io_enc = locale.getpreferredencoding())
2024-05-12 19:15:54.309 > assert act.clean_stdout == act.clean_expected_stdout
2024-05-12 19:15:54.314 E assert
2024-05-12 19:15:54.319 E - CREATED_DB_NAME EXPECTED
2024-05-12 19:15:54.323 E - DB_OWNER DBA_4821
2024-05-12 19:15:54.328 E - MON$SEC_DATABASE Other
2024-05-12 19:15:54.333 E + Statement failed, SQLSTATE = 08001
2024-05-12 19:15:54.338 E + I/O error during "open O_CREAT" operation for file "/home/fbqa/qa-2024/unpacked-snapshot.tmp/examples/empbuild/qa/tmp_core_4821.fdb"
2024-05-12 19:15:54.343 E + -Error while trying to create file
2024-05-12 19:15:54.348 E + -File exists
2024-05-12 19:15:54.353 E + Statement failed, SQLSTATE = 08001
2024-05-12 19:15:54.359 E + I/O error during "re open() for SYNC/DIRECT" operation for file "/home/fbqa/qa-2024/unpacked-snapshot.tmp/examples/empbuild/qa/tmp_bind_4821.fdb"
2024-05-12 19:15:54.364 E + -Error while trying to open file
2024-05-12 19:15:54.370 E + -No such file or directory
2024-05-12 19:15:54.376
2024-05-12 19:15:54.381 tests/bugs/core_4821_test.py:178: AssertionError
2024-05-12 19:15:54.386 ---------------------------- Captured stdout setup -----------------------------
2024-05-12 19:15:54.391 Cached db: db-12.0-None-None-NONE.fdb [page_size=None, sql_dialect=None, charset='NONE'
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
act_clone = <firebird.qa.plugin.Action pytest object at [hex]>
tmp_user = <firebird.qa.plugin.User pytest object at [hex]>
tmp_role = <firebird.qa.plugin.Role pytest object at [hex]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=3.0.5')
def test_1(act: Action,
act_clone: Action,
tmp_user: User,
tmp_role: Role,
capsys
):
db_work_file = get_filename_by_alias(act, REQUIRED_ALIAS)
db_clone_file = get_filename_by_alias(act_clone, DB_BIND_ALIAS)
#----------------------------------------------------
dba_pswd = 'alterkey'
# The role MUST be created in security database!
#
sql_test = f"""
set wng off;
--set echo on;
set list on;
create database '{REQUIRED_ALIAS}' user {tmp_user.name};
create role {tmp_role.name};
grant create database to role {tmp_role.name};
grant drop database to role {tmp_role.name};
create user {tmp_user.name} password '{tmp_user.password}'
-- ### ACHTUNG ### DO NOT specify in FB 4.x and 5.x:
-- REVOKE ADMIN ROLE; ==> weird "SQLSTATE = 42000 / add record error ; ... / Zero length identifiers are not allowed"
;
commit;
grant {tmp_role.name} to {tmp_user.name}; -- actually not requied in FB 4.x and 5.x!
commit;
-- NOTE: following statement requires ROLE specification only in FB 3.x,
-- otherwise:
-- Statement failed, SQLSTATE = 28000
-- no permission for CREATE access to DATABASE tmp_bind_4821_alias
-- ### NO ### such requiremtnt in FB 4.x+
create database 'localhost:{DB_BIND_ALIAS}' user {tmp_user.name} password '{tmp_user.password}'
role {tmp_role.name} -- actually not requied in FB 4.x and 5.x!
;
select
iif( upper(mon$database_name) = upper('{db_clone_file}'), 'EXPECTED', 'UNEXPECTED! ' || coalesce(mon$database_name,'[null]')) as created_db_name
,mon$owner as db_owner
,mon$sec_database
from mon$database;
rollback;
drop database;
"""
try:
act.expected_stdout = f"""
CREATED_DB_NAME EXPECTED
DB_OWNER DBA_4821
MON$SEC_DATABASE Other
"""
# act.expected_stdout = ''
act.isql(switches=['-q'], input=sql_test, connect_db=False, credentials = False, combine_output = True, io_enc = locale.getpreferredencoding())
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E - CREATED_DB_NAME EXPECTED
E - DB_OWNER DBA_4821
E - MON$SEC_DATABASE Other
E + Statement failed, SQLSTATE = 08001
E + I/O error during "open O_CREAT" operation for file "/home/fbqa/qa-2024/unpacked-snapshot.tmp/examples/empbuild/qa/tmp_core_4821.fdb"
E + -Error while trying to create file
E + -File exists
E + Statement failed, SQLSTATE = 08001
E + I/O error during "re open() for SYNC/DIRECT" operation for file "/home/fbqa/qa-2024/unpacked-snapshot.tmp/examples/empbuild/qa/tmp_bind_4821.fdb"
E + -Error while trying to open file
E + -No such file or directory
tests/bugs/core_4821_test.py:178: AssertionError
|