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

Fix for Windows with 4.0.1

This commit is contained in:
Pavel Císař 2022-02-09 20:47:40 +01:00
parent 2e0f861142
commit 8cd83ec67f
17 changed files with 124 additions and 43 deletions

View File

@ -5,6 +5,10 @@ ID: issue-3903
ISSUE: 3903
TITLE: Floating-point negative zero doesn't match positive zero in the index
DESCRIPTION:
NOTES:
[09.02.2022] pcisar
Specific stdout is required on Windows for v3 up to 3.0.8 due to small difference
It's possible that this problem would be fixed in 3.0.9.
JIRA: CORE-3547
FBTEST: bugs.core_3547
"""
@ -71,10 +75,18 @@ expected_stderr_non_win = """
-Problematic key value is ("COL" = 0.000000000000000)
"""
@pytest.mark.version('>=3')
@pytest.mark.version('>=3,<4')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.expected_stderr = expected_stderr_win if act.platform == 'Windows' else expected_stderr_non_win
act.execute()
assert (act.clean_stderr == act.clean_expected_stderr and
act.clean_stdout == act.clean_expected_stdout)
@pytest.mark.version('>=4')
def test_2(act: Action):
act.expected_stdout = expected_stdout
act.expected_stderr = expected_stderr_non_win
act.execute()
assert (act.clean_stderr == act.clean_expected_stderr and
act.clean_stdout == act.clean_expected_stdout)

View File

@ -31,6 +31,7 @@ FBTEST: bugs.core_4172
import pytest
import re
import platform
import locale
from pathlib import Path
from firebird.qa import *
@ -160,6 +161,6 @@ Records affected: 0
def test_2(act_2: Action):
act_2.expected_stderr = 'We expect error, but ignore it'
act_2.expected_stdout = expected_stdout_2
act_2.isql(switches=[], input=test_script_2)
act_2.isql(switches=[], input=test_script_2, io_enc=locale.getpreferredencoding())
assert act_2.clean_stdout == act_2.clean_expected_stdout

View File

@ -5,11 +5,15 @@ ID: issue-5048
ISSUE: 5048
TITLE: Granted role does not work with non-ascii username
DESCRIPTION:
NOTES:
[09.02.2022] pcisar
On Windows the act.db.connect() fails with "Your user name and password are not defined."
JIRA: CORE-4743
FBTEST: bugs.core_4743
"""
import pytest
import platform
from firebird.qa import *
db = db_factory(charset='UTF8')
@ -156,6 +160,7 @@ expected_stdout = """
privilege:exec : YES
"""
@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)

View File

@ -10,11 +10,14 @@ NOTES:
1. This problem is covered by test for #5048 (CORE-4743) as side effect
2. For sake of completness, it was reimplemented by simply using
user_factory fixture.
[09.02.2022] pcisar
On Windows the act.db.connect() fails with "Your user name and password are not defined."
JIRA: CORE-4760
FBTEST: bugs.core_4760
"""
import pytest
import platform
from firebird.qa import *
db = db_factory(charset='UTF8')
@ -23,6 +26,7 @@ non_ascii_user = user_factory('db', name='"Εὐκλείδης"', password='123'
act = python_act('db')
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
@pytest.mark.version('>=4.0')
def test_1(act: Action, non_ascii_user: User):
with act.db.connect(user=non_ascii_user.name, password=non_ascii_user.password) as con:

View File

@ -27,6 +27,10 @@ DESCRIPTION: Timeout for IDLE connection (SET SESSION IDLE TIMEOUT <N>)
::: NB:::
No events related to SECOND statement should be in the trace log.
NOTES:
[09.02.2022] pcisar
Have to add ('quit;', '') to substitutions, because this command is echoed to stdout on Windows,
while it's not on Linux.
JIRA: CORE-5488
FBTEST: bugs.core_5488_session_idle
"""
@ -36,7 +40,7 @@ import os
import re
from firebird.qa import *
substitutions = [('timeout .* second', 'timeout second'),
substitutions = [('timeout .* second', 'timeout second'), ('quit;', ''),
('.*After line [\\d]+.*', ''), ('.*shell.*', '')]
db = db_factory()

View File

@ -37,7 +37,8 @@ test_script = """
commit;
"""
act = isql_act('db', test_script, substitutions=[('TCPv.*', 'TCP')])
act = isql_act('db', test_script, substitutions=[('TCPv.*', 'TCP'),
('Commit current transaction \\(y/n\\)\\?', '')])
expected_stdout = """
MON$USER TMP$C5495

View File

@ -18,7 +18,7 @@ import zipfile
from difflib import unified_diff
from pathlib import Path
from firebird.qa import *
from firebird.driver import SrvRestoreFlag
from firebird.driver import SrvRestoreFlag, ShutdownMode, ShutdownMethod
db = db_factory()
@ -42,6 +42,8 @@ def test_1(act: Action, sec_fbk: Path, sec_fdb: Path):
#
srv.database.validate(database=sec_fdb)
validation_log = srv.readlines()
srv.database.shutdown(database=sec_fdb, mode=ShutdownMode.FULL, method=ShutdownMethod.FORCED, timeout=0)
#
#
assert [line for line in restore_log if 'ERROR' in line.upper()] == []
assert [line for line in validation_log if 'ERROR' in line.upper()] == []

View File

@ -21,12 +21,15 @@ DESCRIPTION:
Reproduced on on several builds 4.x before 17.01.2020 (tested: 4.0.0.1712 CS, 4.0.0.1731 CS - got ratio = ~1.95).
Reproduced also on 3.0.5.33221 Classic - got ratio ~1.50 ... 1.70; could NOT reproduce on 3.0.5 SuperClassic / SuperServer.
[09.02.2022] pcisar
Fails on Windows 4.0.1 with ratio 1.98 - raw iron W10, does not fail with Linux on the same HW
JIRA: CORE-6237
FBTEST: bugs.core_6237
"""
import pytest
import datetime
import platform
from firebird.qa import *
db = db_factory()
@ -40,6 +43,7 @@ expected_stdout = """
EXPECTED. Ratio of total elapsed time when use Srp vs Legacy is less then threshold.
"""
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
@pytest.mark.version('>=3.0.5')
def test_1(act: Action, leg_user: User, srp_user: User, capsys):
N_ITER = 50

View File

@ -20,6 +20,15 @@ DESCRIPTION:
For L=259 we must see in backup log following phrase:
gbak:text for attribute 7 is too large in put_asciz(), truncating to 255 bytes
- but currently this is not checked here.
[09.02.2022] pcisar
Fails on Windows10 / 4.0.1 with:
"CreateFile (create)" operation for file "..."
-Error while trying to create file
-System can't find specified path
Variant with 255 chars fails in init script, while 259 chars variant fails in database fixture while
db creation.
On national windows with OS i/o error messages in locale.getpreferredencoding(), it may fail while
reading stderr from isql. But using io_enc=locale.getpreferredencoding() will show the message.
JIRA: CORE-6248
FBTEST: bugs.core_6248
"""
@ -27,6 +36,7 @@ FBTEST: bugs.core_6248
import pytest
import re
import time
import platform
from difflib import unified_diff
from firebird.qa import *
from firebird.driver import SrvRepairFlag
@ -107,6 +117,7 @@ def check_filename_presence(lines, *, log_name: str, db: Database):
print(f'{log_name} : DB NAME NOT FOUND')
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
@pytest.mark.version('>=4.0')
@pytest.mark.parametrize('test_db', [pytest.param((255, 'abc255def'), id='255'),
pytest.param((259, 'qwe259rty'), id='259')], indirect=True)

View File

@ -55,7 +55,7 @@ def test_1(act: Action, capsys):
act.isql(switches=[], input='\n'.join(chk_script))
# Checks
lines_with_charset = lines_without_charset = 0
for line in act.stdout.splitlines():
for line in act.clean_stdout.splitlines():
if line.split():
if 'CHARACTER SET' in line:
lines_with_charset += 1

View File

@ -18,12 +18,16 @@ NOTES:
NOTE-2. Some messages can appear in the trace log ONE or TWO times (SS/CS ?).
Because of this, we are interested only for at least one occurence of each message
rather than for each of them (see 'found_patterns', type: set()).
[09.02.2022] pcisar
Fails on Windows (with 4.0.1) - no patterns are found, because one can't use trace with embedded
version on this platform.
JIRA: CORE-6272
FBTEST: bugs.core_6272
"""
import pytest
import re
import platform
from pathlib import Path
from firebird.qa import *
from firebird.driver import DatabaseError
@ -52,6 +56,7 @@ trace = """
trace_conf = temp_file('trace.conf')
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
@pytest.mark.version('>=4.0')
def test_1(act: Action, db_nonexistent: Database, trace_conf: Path, capsys):
with ServerKeeper(act, None): # Use embedded server for trace

View File

@ -91,7 +91,7 @@ def test_1(act: Action, capsys):
with act.trace(db_events=trace, encoding='cp1252'):
act.isql(switches=['-q'], input=test_script)
# Process isql output
for line in act.stdout.splitlines():
for line in act.clean_stdout.splitlines():
if elements := line.rstrip().split():
count_intermediate_rows = int(elements[0])
break
@ -107,6 +107,7 @@ def test_1(act: Action, capsys):
else:
print(line)
# Check
act.reset() # necessary to reset 'clean_stdout' !!
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -96,7 +96,7 @@ act = python_act('db')
@pytest.mark.version('>=4.0')
def test_1(act: Action, test_user: User):
act.isql(switches=['-q'], input=init_script)
ddl_combinations_script = act.stdout
ddl_combinations_script = act.clean_stdout
#
act.reset()
act.isql(switches=['-q'], input=ddl_combinations_script)

View File

@ -68,7 +68,8 @@ import pytest
from firebird.qa import *
substitutions = [('COLL-VERSION=\\d{2,}.\\d{2,}', 'COLL-VERSION=111.222'),
('COLL-VERSION=\\d+\\.\\d+\\.\\d+\\.\\d+', 'COLL-VERSION=111.222')]
('COLL-VERSION=\\d+\\.\\d+\\.\\d+\\.\\d+', 'COLL-VERSION=111.222'),
('Commit current transaction \\(y/n\\)\\?', '')]
db = db_factory()

View File

@ -39,6 +39,11 @@ DESCRIPTION:
NO such trouble in the Classic.
The reason currently (03-mar-2021) remains unknown.
Sent letter to Alex et al, 03-mar-2021.
NOTES:
[09.02.2022] pcisar
Test fails on Windows as script execution fails with:
Statement failed, SQLSTATE = 0P000
Your attachment has no trusted role
JIRA: CORE-6469
FBTEST: bugs.core_6469
"""
@ -132,13 +137,13 @@ def run_script(act: Action):
commit;
connect '{THIS_COMPUTER_NAME}:{act.db.db_path}' role tmp$r6469;
#
select mon$user,mon$role,mon$auth_method from mon$attachments where mon$attachment_id = current_connection;
commit;
#
set trusted role;
commit;
#
connect '{act.db.dsn}' user {act.db.user} password '{act.db.password}';
drop mapping trusted_auth;
drop mapping win_admins;
@ -146,11 +151,12 @@ def run_script(act: Action):
"""
act.isql(switches=['-n'], input=script)
@pytest.mark.skipif(reason='FIXME: see notes')
@pytest.mark.version('>=4.0')
@pytest.mark.platform('Windows')
def test_1(act: Action, test_role: Role, capsys):
with act.trace(db_events=trace_win):
run_script()
run_script(act)
# process trace
for line in act.trace_log:
if line.split():

View File

@ -4,10 +4,17 @@
ID: dp-single-bit-in-representation
TITLE: Check result of EXP() which can be represented only by one ("last") significant bit
DESCRIPTION:
NOTES:
[09.02.2022] pcisar
Fails on Windows 4.0.1 with:
Statement failed, SQLSTATE = 22012
arithmetic exception, numeric overflow, or string truncation
-Floating-point divide by zero. The code attempted to divide a floating-point value by zero.
FBTEST: functional.datatypes.dp_single_bit_in_representation
"""
import pytest
import platform
from firebird.qa import *
db = db_factory()
@ -34,8 +41,17 @@ expected_stdout = """
E2_DIV_E2 1.000000000000000
"""
@pytest.mark.version('>=3')
@pytest.mark.version('>=3,<4')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
# This version was create just to skip version 4 for Windows!
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
@pytest.mark.version('>4')
def test_2(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -24,10 +24,17 @@ NOTES:
Invalid time zone offset: -03 - must use format +/-hours:minutes and be between -14:00 and +14:00
See: https://github.com/FirebirdSQL/firebird/commit/ff37d445ce844f991242b1e2c1f96b80a5d1636d
[09.02.2022] pcisar
Fails on Windows due to differences like:
- CAST 10:11:12.1345 America/Sao_Paulo
? ^
+ CAST 11:11:12.1345 America/Sao_Paulo
? ^
FBTEST: functional.gtcs.time_zone
"""
import pytest
import platform
from firebird.qa import *
db = db_factory()
@ -1311,6 +1318,7 @@ expected_stderr = """
-Problematic key value is ("V" = '2018-01-01 14:33:33.0000 +02:00')
"""
@pytest.mark.skipif(platform.system() == 'Windows', reason='FIXME: see notes')
@pytest.mark.version('>=4.0')
def test_1(act: Action):
act.expected_stdout = expected_stdout