2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
|
|
|
ID: issue-4781
|
|
|
|
ISSUE: 4781
|
|
|
|
TITLE: nbackup prints error messages to stdout instead stderr
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4461
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_4461
|
2022-01-23 20:41:55 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
db = db_factory()
|
2021-11-26 19:20:43 +01:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
act = python_act('db', substitutions=[('Failure: Database error', '')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
expected_stderr = """
|
2021-04-26 20:07:00 +02:00
|
|
|
[
|
|
|
|
PROBLEM ON "attach database".
|
|
|
|
Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
|
|
|
|
SQLCODE:-902
|
|
|
|
]
|
2021-11-26 19:20:43 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=2.5.4')
|
2022-01-23 20:41:55 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stderr = expected_stderr
|
|
|
|
act.nbackup(switches=['-user', 'nonExistentFoo', '-password', 'invalidBar',
|
|
|
|
'-L', act.db.dsn], credentials=False)
|
|
|
|
assert act.clean_stderr == act.clean_expected_stderr
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|