mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 21:43:06 +01:00
Added/Updated bugs\core_4743_test.py: One need to specify utf8filename=True in db_factory() call if we want to establish connection as non-ascii user.
This commit is contained in:
parent
60719a13c0
commit
859140fa10
@ -8,6 +8,14 @@ DESCRIPTION:
|
||||
NOTES:
|
||||
[09.02.2022] pcisar
|
||||
On Windows the act.db.connect() fails with "Your user name and password are not defined."
|
||||
[08.04.2022] pzotov
|
||||
One need to specify utf8filename=True in db_factory() call if we want to establish connection as "non-ascii user".
|
||||
Specifying of this parameter in firebird-driver.conf (in the servger section) has no effect.
|
||||
Checked on 4.0.1 Release, 5.0.0.467.
|
||||
See also:
|
||||
email discusion, subject: "firebird-qa [new framework]: unable to make connection as NON-ASCII user, only on Windows (WI-V4.0.1.2692)",
|
||||
message from pcisar 08-mar-2022 13:52 ('utf8filename' parameter was added to db_factory()).
|
||||
|
||||
JIRA: CORE-4743
|
||||
FBTEST: bugs.core_4743
|
||||
"""
|
||||
@ -16,48 +24,47 @@ import pytest
|
||||
import platform
|
||||
from firebird.qa import *
|
||||
|
||||
db = db_factory(charset='UTF8')
|
||||
|
||||
db = db_factory(utf8filename=True)
|
||||
non_acii_user = user_factory('db', name='"Вася Пупкин"', password= '123')
|
||||
test_role = role_factory('db', name='"Старший дворник"')
|
||||
|
||||
act = python_act('db', substitutions=[('[\t ]+', ' ')])
|
||||
|
||||
ddl_script = """
|
||||
grant "Старший дворник" to "Вася Пупкин";
|
||||
commit;
|
||||
grant "Старший дворник" to "Вася Пупкин";
|
||||
commit;
|
||||
|
||||
create table "Документы"(id int primary key, pid int references "Документы");
|
||||
create exception "НЕ_число" 'Ваша строка не может быть преобразована в число.';
|
||||
create sequence "ИД_документа";
|
||||
set term ^;
|
||||
create procedure "Хранимка" as
|
||||
begin
|
||||
end
|
||||
^
|
||||
create function "СтрВЧисло"(a_text varchar(100)) returns int as
|
||||
begin
|
||||
create table "Документы"(id int primary key, pid int references "Документы");
|
||||
create exception "НЕ_число" 'Ваша строка не может быть преобразована в число.';
|
||||
create sequence "ИД_документа";
|
||||
set term ^;
|
||||
create procedure "Хранимка" as
|
||||
begin
|
||||
end
|
||||
^
|
||||
create function "СтрВЧисло"(a_text varchar(100)) returns int as
|
||||
begin
|
||||
return 0;
|
||||
end
|
||||
^
|
||||
end
|
||||
^
|
||||
|
||||
create or alter package "Утилиты" as
|
||||
begin
|
||||
create or alter package "Утилиты" as
|
||||
begin
|
||||
procedure pg_sp_worker;
|
||||
end
|
||||
^
|
||||
recreate package body "Утилиты" as
|
||||
begin
|
||||
end
|
||||
^
|
||||
recreate package body "Утилиты" as
|
||||
begin
|
||||
procedure pg_sp_worker as
|
||||
begin
|
||||
end
|
||||
end
|
||||
^
|
||||
set term ;^
|
||||
commit;
|
||||
end
|
||||
^
|
||||
set term ;^
|
||||
commit;
|
||||
|
||||
create or alter view v_current_privileges as
|
||||
select
|
||||
create or alter view v_current_privileges as
|
||||
select
|
||||
g.rdb$user as who_is_granted
|
||||
,g.rdb$relation_name as obj_name
|
||||
,decode( g.rdb$object_type
|
||||
@ -87,21 +94,21 @@ select
|
||||
,max(iif(g.rdb$privilege='L','YES',' ')) as "privilege:alter"
|
||||
,max(iif(g.rdb$privilege='O','YES',' ')) as "privilege:drop"
|
||||
,max(iif(g.rdb$privilege='M','YES',' ')) as "privilege:member"
|
||||
from rdb$user_privileges g
|
||||
where g.rdb$user in( current_user, current_role )
|
||||
group by 1,2,3;
|
||||
from rdb$user_privileges g
|
||||
where g.rdb$user in( current_user, current_role )
|
||||
group by 1,2,3;
|
||||
|
||||
grant select on v_current_privileges to "Старший дворник";
|
||||
grant select,insert,update,delete,references on "Документы" to "Старший дворник";
|
||||
grant usage on exception "НЕ_число" to "Старший дворник";
|
||||
grant usage on sequence "ИД_документа" to "Старший дворник";
|
||||
grant execute on procedure "Хранимка" to "Старший дворник";
|
||||
grant execute on function "СтрВЧисло" to "Старший дворник";
|
||||
grant execute on package "Утилиты" to "Старший дворник";
|
||||
grant create table to "Старший дворник";
|
||||
grant alter any table to "Старший дворник";
|
||||
grant drop any table to "Старший дворник";
|
||||
commit;
|
||||
grant select on v_current_privileges to "Старший дворник";
|
||||
grant select,insert,update,delete,references on "Документы" to "Старший дворник";
|
||||
grant usage on exception "НЕ_число" to "Старший дворник";
|
||||
grant usage on sequence "ИД_документа" to "Старший дворник";
|
||||
grant execute on procedure "Хранимка" to "Старший дворник";
|
||||
grant execute on function "СтрВЧисло" to "Старший дворник";
|
||||
grant execute on package "Утилиты" to "Старший дворник";
|
||||
grant create table to "Старший дворник";
|
||||
grant alter any table to "Старший дворник";
|
||||
grant drop any table to "Старший дворник";
|
||||
commit;
|
||||
"""
|
||||
|
||||
expected_stdout = """
|
||||
@ -160,7 +167,8 @@ expected_stdout = """
|
||||
privilege:exec : YES
|
||||
"""
|
||||
|
||||
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
|
||||
#@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
|
||||
|
||||
@pytest.mark.version('>=4.0')
|
||||
def test_1(act: Action, non_acii_user: User, test_role: Role, capsys):
|
||||
act.isql(switches=['-b', '-q'], input=ddl_script)
|
||||
|
Loading…
Reference in New Issue
Block a user