2 @message |
assert
- Found expected line: 1
LOG DETAILS:
2024-08-25 19:42:56.064
2024-08-25 19:42:56.075 act = <firebird.qa.plugin.Action object at [hex]>
2024-08-25 19:42:56.085 tmp_trace_cfg = PosixPath('/var/tmp/qa_2024/test_1659/tmp_trace_3658.cfg')
2024-08-25 19:42:56.100 tmp_trace_log = PosixPath('/var/tmp/qa_2024/test_1659/tmp_trace_3658.log')
2024-08-25 19:42:56.115 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-08-25 19:42:56.130
2024-08-25 19:42:56.142 @pytest.mark.trace
2024-08-25 19:42:56.153 @pytest.mark.version('>=3')
2024-08-25 19:42:56.165 def test_1(act: Action, tmp_trace_cfg: Path, tmp_trace_log: Path, capsys):
2024-08-25 19:42:56.179 #print( os.environ.get('ISC_USER', 'UNKNOWN_ISC_USR') )
2024-08-25 19:42:56.193 #print( os.environ.get('ISC_PASSWORD', 'UNKNOWN_ISC_PSW') )
2024-08-25 19:42:56.205
2024-08-25 19:42:56.216 trace_txt = """
2024-08-25 19:42:56.225 services
2024-08-25 19:42:56.234 {
2024-08-25 19:42:56.243 enabled = true
2024-08-25 19:42:56.252 log_initfini = false
2024-08-25 19:42:56.261 log_services = true
2024-08-25 19:42:56.269 log_errors = true
2024-08-25 19:42:56.277 }
2024-08-25 19:42:56.287 """
2024-08-25 19:42:56.295
2024-08-25 19:42:56.305 tmp_trace_cfg.write_text(trace_txt)
2024-08-25 19:42:56.315
2024-08-25 19:42:56.325 with act.envar('ISC_USER', act.db.user), act.envar('ISC_PASSWORD', act.db.password):
2024-08-25 19:42:56.336
2024-08-25 19:42:56.351 with tmp_trace_log.open('w') as f_log:
2024-08-25 19:42:56.363 # EXPLICIT call of FB utility 'fbsvcmgr':
2024-08-25 19:42:56.375 p = subprocess.Popen( [act.vars['fbsvcmgr'], 'localhost:service_mgr', 'action_trace_start', 'trc_cfg', tmp_trace_cfg], stdout = f_log, stderr = subprocess.STDOUT )
2024-08-25 19:42:56.386 time.sleep(2)
2024-08-25 19:42:56.396
2024-08-25 19:42:56.407 # ::: DO NOT USE HERE :::
2024-08-25 19:42:56.417 # with act.trace(svc_events = svc_items, ...):
2024-08-25 19:42:56.426 # pass
2024-08-25 19:42:56.440
2024-08-25 19:42:56.452 p.terminate()
2024-08-25 19:42:56.468
2024-08-25 19:42:56.480 # Windows: service_mgr, (Service 0000000000C8B140, SYSDBA, TCPv6:::1/60775, ...)
2024-08-25 19:42:56.491 # Linux: service_mgr, (Service 0x7fc58f6073c0, SYSDBA, TCPv6:::1/35666, ...)
2024-08-25 19:42:56.507 p = re.compile('service_mgr,\\s+\\(\\s*Service\\s+\\w+[,]?\\s+' + act.db.user+ '[,]?', re.IGNORECASE)
2024-08-25 19:42:56.516
2024-08-25 19:42:56.531 expected_stdout = 'Found expected line: 1'
2024-08-25 19:42:56.544 with open(tmp_trace_log,'r') as f:
2024-08-25 19:42:56.558 for line in f:
2024-08-25 19:42:56.579 if line.strip():
2024-08-25 19:42:56.595 if p.search(line):
2024-08-25 19:42:56.609 print(expected_stdout)
2024-08-25 19:42:56.623 break
2024-08-25 19:42:56.637
2024-08-25 19:42:56.649 act.expected_stdout = expected_stdout
2024-08-25 19:42:56.661 act.stdout = capsys.readouterr().out
2024-08-25 19:42:56.672 > assert act.clean_stdout == act.clean_expected_stdout
2024-08-25 19:42:56.683 E assert
2024-08-25 19:42:56.692 E - Found expected line: 1
2024-08-25 19:42:56.702
2024-08-25 19:42:56.711 tests/bugs/core_3658_test.py:89: AssertionError
2024-08-25 19:42:56.720 ---------------------------- Captured stdout setup -----------------------------
2024-08-25 19:42:56.733 Creating db: localhost:/var/tmp/qa_2024/test_1659/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
tmp_trace_cfg = PosixPath('/var/tmp/qa_2024/test_1659/tmp_trace_3658.cfg')
tmp_trace_log = PosixPath('/var/tmp/qa_2024/test_1659/tmp_trace_3658.log')
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.trace
@pytest.mark.version('>=3')
def test_1(act: Action, tmp_trace_cfg: Path, tmp_trace_log: Path, capsys):
#print( os.environ.get('ISC_USER', 'UNKNOWN_ISC_USR') )
#print( os.environ.get('ISC_PASSWORD', 'UNKNOWN_ISC_PSW') )
trace_txt = """
services
{
enabled = true
log_initfini = false
log_services = true
log_errors = true
}
"""
tmp_trace_cfg.write_text(trace_txt)
with act.envar('ISC_USER', act.db.user), act.envar('ISC_PASSWORD', act.db.password):
with tmp_trace_log.open('w') as f_log:
# EXPLICIT call of FB utility 'fbsvcmgr':
p = subprocess.Popen( [act.vars['fbsvcmgr'], 'localhost:service_mgr', 'action_trace_start', 'trc_cfg', tmp_trace_cfg], stdout = f_log, stderr = subprocess.STDOUT )
time.sleep(2)
# ::: DO NOT USE HERE :::
# with act.trace(svc_events = svc_items, ...):
# pass
p.terminate()
# Windows: service_mgr, (Service 0000000000C8B140, SYSDBA, TCPv6:::1/60775, ...)
# Linux: service_mgr, (Service 0x7fc58f6073c0, SYSDBA, TCPv6:::1/35666, ...)
p = re.compile('service_mgr,\\s+\\(\\s*Service\\s+\\w+[,]?\\s+' + act.db.user+ '[,]?', re.IGNORECASE)
expected_stdout = 'Found expected line: 1'
with open(tmp_trace_log,'r') as f:
for line in f:
if line.strip():
if p.search(line):
print(expected_stdout)
break
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E - Found expected line: 1
tests/bugs/core_3658_test.py:89: AssertionError
|