2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5370
|
|
|
|
ISSUE: 5370
|
|
|
|
TITLE: Allow to fixup (nbackup) database via Services API
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-5085
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_5085
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
act = python_act('db')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2021-11-26 19:20:43 +01:00
|
|
|
@pytest.mark.version('>=4.0')
|
2022-01-25 22:55:48 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.nbackup(switches=['-l', str(act.db.db_path)])
|
|
|
|
#with act.connect_server() as srv:
|
2021-11-26 19:20:43 +01:00
|
|
|
# This raises error in new FB OO API while calling spb.insert_string(SPBItem.DBNAME, database):
|
|
|
|
# "Internal error when using clumplet API: attempt to store data in dataless clumplet"
|
2022-01-25 22:55:48 +01:00
|
|
|
#srv.database.nfix_database(database=act.db.db_path)
|
2021-11-26 19:20:43 +01:00
|
|
|
# So we have to use svcmgr...
|
2022-01-25 22:55:48 +01:00
|
|
|
act.reset()
|
|
|
|
act.svcmgr(switches=['action_nfix', 'dbname', str(act.db.db_path)])
|
|
|
|
with act.db.connect() as con:
|
2021-11-26 19:20:43 +01:00
|
|
|
c = con.cursor()
|
|
|
|
result = c.execute('select mon$backup_state from mon$database').fetchall()
|
|
|
|
assert result == [(0, )]
|