bsc: make perform_clear() work when VTY is not initialized

To be able to invoke perform_clear() also in tests where the VTY isn't
used, in f_logp() only access the VTY when it is actually ready.
Otherwise this causes an error and a failed test, for no good reason.

Related: OS#5337
Change-Id: I8116075f32937bd06ba14b426010bf6fec2ef402
This commit is contained in:
Neels Hofmeyr 2021-12-14 17:25:48 +01:00
parent 589972fead
commit 8bdafe5be6
1 changed files with 3 additions and 1 deletions

View File

@ -1077,7 +1077,9 @@ friend function f_logp(TELNETasp_PT pt, charstring log_msg)
// log on TTCN3 log output
log(log_msg);
// log in stderr log
f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
if (pt.checkstate("Mapped")) {
f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
}
}
private function f_sysinfo_seen(integer rsl_idx, RSL_Message rsl) runs on test_CT