6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00

Added/Updated bugs\core_5808_test.py. Added check for success of 'alter database encrypt with ...': no sense to do anything if encryption could not start because of plugin problems.

This commit is contained in:
zotov 2022-06-13 23:04:37 +03:00
parent 7938cd18e4
commit b8680e4457

View File

@ -78,6 +78,7 @@ ENCRYPTION_KEY = 'Red'
@pytest.mark.encryption
@pytest.mark.version('>=4.0')
def test_1(act: Action, capsys):
encryption_started = False
encryption_finished = False
with act.db.connect() as con:
@ -87,14 +88,18 @@ def test_1(act: Action, capsys):
try:
con.execute_immediate(sttm)
con.commit()
encryption_started = True
except DatabaseError as e:
# -ALTER DATABASE failed
# -Crypt plugin fbSampleDbCrypt failed to load
# ==> no sense to do anything else, encryption_started remains False.
print( e.__str__() )
while True:
while encryption_started:
t2=py_dt.datetime.now()
d1=t2-t1
if d1.seconds*1000 + d1.microseconds//1000 > MAX_ENCRYPT_DECRYPT_MS:
print('TIMEOUT EXPIRATION: encryption took {d1.seconds*1000 + d1.microseconds//1000} ms which exceeds limit = {MAX_ENCRYPT_DECRYPT_MS} ms.')
print(f'TIMEOUT EXPIRATION: encryption took {d1.seconds*1000 + d1.microseconds//1000} ms which exceeds limit = {MAX_ENCRYPT_DECRYPT_MS} ms.')
break
# Possible output: