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

55 lines
1.4 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-02-04 19:05:19 +01:00
"""
ID: shadow.create-02
TITLE: CREATE SHADOW
DESCRIPTION:
FBTEST: functional.shadow.create_02
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
test_script = """
2021-04-28 11:54:08 +02:00
create shadow 1 manual conditional '$(DATABASE_LOCATION)TEST.SHD' file '$(DATABASE_LOCATION)TEST.S00' starting at page 1000;
2021-04-26 20:07:00 +02:00
commit;
set list on;
set count on;
2022-02-04 19:05:19 +01:00
select
2021-04-26 20:07:00 +02:00
right(trim(rdb$file_name), char_length('test.s??')) as file_name
,rdb$file_sequence as file_sequence
,rdb$file_start as file_start
,rdb$file_length as file_length
,rdb$file_flags as file_flags
,rdb$shadow_number as shadow_number
from rdb$files;
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
FILE_NAME TEST.SHD
FILE_SEQUENCE 0
FILE_START 0
FILE_LENGTH 0
FILE_FLAGS 5
SHADOW_NUMBER 1
FILE_NAME TEST.S00
FILE_SEQUENCE 1
FILE_START 1000
FILE_LENGTH 0
FILE_FLAGS 5
SHADOW_NUMBER 1
Records affected: 2
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout