6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 22:13:05 +01:00
firebird-qa/tests/functional/basic/isql/test_02.py

613 lines
14 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
2021-04-28 11:54:08 +02:00
# id: functional.basic.isql.02
2021-04-26 20:07:00 +02:00
# title: ISQL - SHOW SYSTEM TABLES
# decription:
# Check for correct output of "SHOW SYSTEM;" command on empty database.
# Checked on:
# 2.5.9.27126
# 3.0.5.33086
# 4.0.0.2491
# 5.0.0.43 // 21.05.2021: created separate section for this major FB version.
2021-04-26 20:07:00 +02:00
#
# tracker_id:
# min_versions: []
# versions: 3.0, 4.0, 5.0
2021-04-26 20:07:00 +02:00
# qmid: functional.basic.isql.isql_02
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 3.0
# resources: None
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """show system ;"""
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
expected_stdout_1 = """
Tables:
MON$ATTACHMENTS MON$CALL_STACK
MON$CONTEXT_VARIABLES MON$DATABASE
MON$IO_STATS MON$MEMORY_USAGE
MON$RECORD_STATS MON$STATEMENTS
MON$TABLE_STATS MON$TRANSACTIONS
RDB$AUTH_MAPPING RDB$BACKUP_HISTORY
RDB$CHARACTER_SETS RDB$CHECK_CONSTRAINTS
RDB$COLLATIONS RDB$DATABASE
RDB$DB_CREATORS RDB$DEPENDENCIES
RDB$EXCEPTIONS RDB$FIELDS
RDB$FIELD_DIMENSIONS RDB$FILES
RDB$FILTERS RDB$FORMATS
RDB$FUNCTIONS RDB$FUNCTION_ARGUMENTS
RDB$GENERATORS RDB$INDEX_SEGMENTS
RDB$INDICES RDB$LOG_FILES
RDB$PACKAGES RDB$PAGES
RDB$PROCEDURES RDB$PROCEDURE_PARAMETERS
RDB$REF_CONSTRAINTS RDB$RELATIONS
RDB$RELATION_CONSTRAINTS RDB$RELATION_FIELDS
RDB$ROLES RDB$SECURITY_CLASSES
RDB$TRANSACTIONS RDB$TRIGGERS
RDB$TRIGGER_MESSAGES RDB$TYPES
RDB$USER_PRIVILEGES RDB$VIEW_RELATIONS
SEC$DB_CREATORS SEC$GLOBAL_AUTH_MAPPING
SEC$USERS SEC$USER_ATTRIBUTES
Collations:
ASCII BIG_5
BS_BA CP943C
CP943C_UNICODE CS_CZ
CYRL DA_DA
DB_CSY DB_DAN865
DB_DEU437 DB_DEU850
DB_ESP437 DB_ESP850
DB_FIN437 DB_FRA437
DB_FRA850 DB_FRC850
DB_FRC863 DB_ITA437
DB_ITA850 DB_NLD437
DB_NLD850 DB_NOR865
DB_PLK DB_PTB850
DB_PTG860 DB_RUS
DB_SLO DB_SVE437
DB_SVE850 DB_TRK
DB_UK437 DB_UK850
DB_US437 DB_US850
DE_DE DOS437
DOS737 DOS775
DOS850 DOS852
DOS857 DOS858
DOS860 DOS861
DOS862 DOS863
DOS864 DOS865
DOS866 DOS869
DU_NL EN_UK
EN_US ES_ES
ES_ES_CI_AI EUCJ_0208
FI_FI FR_CA
FR_CA_CI_AI FR_FR
FR_FR_CI_AI GB18030
GB18030_UNICODE GBK
GBK_UNICODE GB_2312
ISO8859_1 ISO8859_13
ISO8859_2 ISO8859_3
ISO8859_4 ISO8859_5
ISO8859_6 ISO8859_7
ISO8859_8 ISO8859_9
ISO_HUN ISO_PLK
IS_IS IT_IT
KOI8R KOI8R_RU
KOI8U KOI8U_UA
KSC_5601 KSC_DICTIONARY
LT_LT NEXT
NONE NO_NO
NXT_DEU NXT_ESP
NXT_FRA NXT_ITA
NXT_US OCTETS
PDOX_ASCII PDOX_CSY
PDOX_CYRL PDOX_HUN
PDOX_INTL PDOX_ISL
PDOX_NORDAN4 PDOX_PLK
PDOX_SLO PDOX_SWEDFIN
PT_BR PT_PT
PXW_CSY PXW_CYRL
PXW_GREEK PXW_HUN
PXW_HUNDC PXW_INTL
PXW_INTL850 PXW_NORDAN4
PXW_PLK PXW_SLOV
PXW_SPAN PXW_SWEDFIN
PXW_TURK SJIS_0208
SV_SV TIS620
TIS620_UNICODE UCS_BASIC
UNICODE UNICODE_CI
UNICODE_CI_AI UNICODE_FSS
UTF8 WIN1250
WIN1251 WIN1251_UA
WIN1252 WIN1253
WIN1254 WIN1255
WIN1256 WIN1257
WIN1257_EE WIN1257_LT
WIN1257_LV WIN1258
WIN_CZ WIN_CZ_CI_AI
WIN_PTBR
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0,<4.0')
2021-04-28 12:42:11 +02:00
def test_1(act_1: Action):
2021-04-26 20:07:00 +02:00
act_1.expected_stdout = expected_stdout_1
act_1.execute()
assert act_1.clean_stdout == act_1.clean_expected_stdout
2021-04-26 20:07:00 +02:00
# version: 4.0
# resources: None
substitutions_2 = []
init_script_2 = """"""
db_2 = db_factory(sql_dialect=3, init=init_script_2)
test_script_2 = """
show system;
"""
2021-04-26 20:07:00 +02:00
act_2 = isql_act('db_2', test_script_2, substitutions=substitutions_2)
expected_stdout_2 = """
Tables:
MON$ATTACHMENTS
MON$CALL_STACK
MON$CONTEXT_VARIABLES
MON$DATABASE
MON$IO_STATS
MON$MEMORY_USAGE
MON$RECORD_STATS
MON$STATEMENTS
MON$TABLE_STATS
MON$TRANSACTIONS
RDB$AUTH_MAPPING
RDB$BACKUP_HISTORY
RDB$CHARACTER_SETS
RDB$CHECK_CONSTRAINTS
RDB$COLLATIONS
RDB$CONFIG
RDB$DATABASE
RDB$DB_CREATORS
RDB$DEPENDENCIES
RDB$EXCEPTIONS
RDB$FIELDS
RDB$FIELD_DIMENSIONS
RDB$FILES
RDB$FILTERS
RDB$FORMATS
RDB$FUNCTIONS
RDB$FUNCTION_ARGUMENTS
RDB$GENERATORS
RDB$INDEX_SEGMENTS
RDB$INDICES
RDB$LOG_FILES
RDB$PACKAGES
RDB$PAGES
RDB$PROCEDURES
RDB$PROCEDURE_PARAMETERS
RDB$PUBLICATIONS
RDB$PUBLICATION_TABLES
RDB$REF_CONSTRAINTS
RDB$RELATIONS
RDB$RELATION_CONSTRAINTS
RDB$RELATION_FIELDS
RDB$ROLES
RDB$SECURITY_CLASSES
RDB$TIME_ZONES
RDB$TRANSACTIONS
RDB$TRIGGERS
RDB$TRIGGER_MESSAGES
RDB$TYPES
RDB$USER_PRIVILEGES
RDB$VIEW_RELATIONS
SEC$DB_CREATORS
SEC$GLOBAL_AUTH_MAPPING
SEC$USERS
SEC$USER_ATTRIBUTES
Collations:
ASCII
BIG_5
BS_BA
CP943C
CP943C_UNICODE
CS_CZ
CYRL
DA_DA
DB_CSY
DB_DAN865
DB_DEU437
DB_DEU850
DB_ESP437
DB_ESP850
DB_FIN437
DB_FRA437
DB_FRA850
DB_FRC850
DB_FRC863
DB_ITA437
DB_ITA850
DB_NLD437
DB_NLD850
DB_NOR865
DB_PLK
DB_PTB850
DB_PTG860
DB_RUS
DB_SLO
DB_SVE437
DB_SVE850
DB_TRK
DB_UK437
DB_UK850
DB_US437
DB_US850
DE_DE
DOS437
DOS737
DOS775
DOS850
DOS852
DOS857
DOS858
DOS860
DOS861
DOS862
DOS863
DOS864
DOS865
DOS866
DOS869
DU_NL
EN_UK
EN_US
ES_ES
ES_ES_CI_AI
EUCJ_0208
FI_FI
FR_CA
FR_CA_CI_AI
FR_FR
FR_FR_CI_AI
GB18030
GB18030_UNICODE
GBK
GBK_UNICODE
GB_2312
ISO8859_1
ISO8859_13
ISO8859_2
ISO8859_3
ISO8859_4
ISO8859_5
ISO8859_6
ISO8859_7
ISO8859_8
ISO8859_9
ISO_HUN
ISO_PLK
IS_IS
IT_IT
KOI8R
KOI8R_RU
KOI8U
KOI8U_UA
KSC_5601
KSC_DICTIONARY
LT_LT
NEXT
NONE
NO_NO
NXT_DEU
NXT_ESP
NXT_FRA
NXT_ITA
NXT_US
OCTETS
PDOX_ASCII
PDOX_CSY
PDOX_CYRL
PDOX_HUN
PDOX_INTL
PDOX_ISL
PDOX_NORDAN4
PDOX_PLK
PDOX_SLO
PDOX_SWEDFIN
PT_BR
PT_PT
PXW_CSY
PXW_CYRL
PXW_GREEK
PXW_HUN
PXW_HUNDC
PXW_INTL
PXW_INTL850
PXW_NORDAN4
PXW_PLK
PXW_SLOV
PXW_SPAN
PXW_SWEDFIN
PXW_TURK
SJIS_0208
SV_SV
TIS620
TIS620_UNICODE
UCS_BASIC
UNICODE
UNICODE_CI
UNICODE_CI_AI
UNICODE_FSS
UTF8
WIN1250
WIN1251
WIN1251_UA
WIN1252
WIN1253
WIN1254
WIN1255
WIN1256
WIN1257
WIN1257_EE
WIN1257_LT
WIN1257_LV
WIN1258
WIN_CZ
WIN_CZ_CI_AI
WIN_PTBR
Roles:
RDB$ADMIN
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=4.0,<5.0')
2021-04-28 12:42:11 +02:00
def test_2(act_2: Action):
2021-04-26 20:07:00 +02:00
act_2.expected_stdout = expected_stdout_2
act_2.execute()
assert act_2.clean_stdout == act_2.clean_expected_stdout
# version: 5.0
# resources: None
substitutions_3 = []
init_script_3 = """"""
db_3 = db_factory(sql_dialect=3, init=init_script_3)
test_script_3 = """
show system;
"""
act_3 = isql_act('db_3', test_script_3, substitutions=substitutions_3)
expected_stdout_3 = """
Tables:
MON$ATTACHMENTS
MON$CALL_STACK
MON$CONTEXT_VARIABLES
MON$DATABASE
MON$IO_STATS
MON$MEMORY_USAGE
MON$RECORD_STATS
MON$STATEMENTS
MON$TABLE_STATS
MON$TRANSACTIONS
RDB$AUTH_MAPPING
RDB$BACKUP_HISTORY
RDB$CHARACTER_SETS
RDB$CHECK_CONSTRAINTS
RDB$COLLATIONS
RDB$CONFIG
RDB$DATABASE
RDB$DB_CREATORS
RDB$DEPENDENCIES
RDB$EXCEPTIONS
RDB$FIELDS
RDB$FIELD_DIMENSIONS
RDB$FILES
RDB$FILTERS
RDB$FORMATS
RDB$FUNCTIONS
RDB$FUNCTION_ARGUMENTS
RDB$GENERATORS
RDB$INDEX_SEGMENTS
RDB$INDICES
RDB$KEYWORDS
RDB$LOG_FILES
RDB$PACKAGES
RDB$PAGES
RDB$PROCEDURES
RDB$PROCEDURE_PARAMETERS
RDB$PUBLICATIONS
RDB$PUBLICATION_TABLES
RDB$REF_CONSTRAINTS
RDB$RELATIONS
RDB$RELATION_CONSTRAINTS
RDB$RELATION_FIELDS
RDB$ROLES
RDB$SECURITY_CLASSES
RDB$TIME_ZONES
RDB$TRANSACTIONS
RDB$TRIGGERS
RDB$TRIGGER_MESSAGES
RDB$TYPES
RDB$USER_PRIVILEGES
RDB$VIEW_RELATIONS
SEC$DB_CREATORS
SEC$GLOBAL_AUTH_MAPPING
SEC$USERS
SEC$USER_ATTRIBUTES
Collations:
ASCII
BIG_5
BS_BA
CP943C
CP943C_UNICODE
CS_CZ
CYRL
DA_DA
DB_CSY
DB_DAN865
DB_DEU437
DB_DEU850
DB_ESP437
DB_ESP850
DB_FIN437
DB_FRA437
DB_FRA850
DB_FRC850
DB_FRC863
DB_ITA437
DB_ITA850
DB_NLD437
DB_NLD850
DB_NOR865
DB_PLK
DB_PTB850
DB_PTG860
DB_RUS
DB_SLO
DB_SVE437
DB_SVE850
DB_TRK
DB_UK437
DB_UK850
DB_US437
DB_US850
DE_DE
DOS437
DOS737
DOS775
DOS850
DOS852
DOS857
DOS858
DOS860
DOS861
DOS862
DOS863
DOS864
DOS865
DOS866
DOS869
DU_NL
EN_UK
EN_US
ES_ES
ES_ES_CI_AI
EUCJ_0208
FI_FI
FR_CA
FR_CA_CI_AI
FR_FR
FR_FR_CI_AI
GB18030
GB18030_UNICODE
GBK
GBK_UNICODE
GB_2312
ISO8859_1
ISO8859_13
ISO8859_2
ISO8859_3
ISO8859_4
ISO8859_5
ISO8859_6
ISO8859_7
ISO8859_8
ISO8859_9
ISO_HUN
ISO_PLK
IS_IS
IT_IT
KOI8R
KOI8R_RU
KOI8U
KOI8U_UA
KSC_5601
KSC_DICTIONARY
LT_LT
NEXT
NONE
NO_NO
NXT_DEU
NXT_ESP
NXT_FRA
NXT_ITA
NXT_US
OCTETS
PDOX_ASCII
PDOX_CSY
PDOX_CYRL
PDOX_HUN
PDOX_INTL
PDOX_ISL
PDOX_NORDAN4
PDOX_PLK
PDOX_SLO
PDOX_SWEDFIN
PT_BR
PT_PT
PXW_CSY
PXW_CYRL
PXW_GREEK
PXW_HUN
PXW_HUNDC
PXW_INTL
PXW_INTL850
PXW_NORDAN4
PXW_PLK
PXW_SLOV
PXW_SPAN
PXW_SWEDFIN
PXW_TURK
SJIS_0208
SV_SV
TIS620
TIS620_UNICODE
UCS_BASIC
UNICODE
UNICODE_CI
UNICODE_CI_AI
UNICODE_FSS
UTF8
WIN1250
WIN1251
WIN1251_UA
WIN1252
WIN1253
WIN1254
WIN1255
WIN1256
WIN1257
WIN1257_EE
WIN1257_LT
WIN1257_LV
WIN1258
WIN_CZ
WIN_CZ_CI_AI
WIN_PTBR
Roles:
RDB$ADMIN
"""
@pytest.mark.version('>=5.0')
def test_3(act_3: Action):
act_3.expected_stdout = expected_stdout_3
act_3.execute()
assert act_3.clean_stdout == act_3.clean_expected_stdout
2021-04-26 20:07:00 +02:00