pgw: improve launch program logging
Change-Id: I1feb6ddb1ed742585482dbfe3e38a0bece160e22
This commit is contained in:
parent
f97f6e2f90
commit
967d871b19
|
@ -114,6 +114,9 @@ type component PGW_Session_CT extends GTP2_ConnHdlr {
|
||||||
|
|
||||||
/* Store last received Gy message */
|
/* Store last received Gy message */
|
||||||
var PDU_DIAMETER g_rx_gy;
|
var PDU_DIAMETER g_rx_gy;
|
||||||
|
|
||||||
|
/* number of programs started, used as identifier. */
|
||||||
|
var integer g_start_prog_count := 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* configuration data for a given Session */
|
/* configuration data for a given Session */
|
||||||
|
@ -706,10 +709,12 @@ runs on PGW_Session_CT return integer
|
||||||
run_as_user := mp_run_prog_as_user,
|
run_as_user := mp_run_prog_as_user,
|
||||||
tun_netns_name := g_pars.tun_netns_name
|
tun_netns_name := g_pars.tun_netns_name
|
||||||
};
|
};
|
||||||
|
g_start_prog_count := g_start_prog_count + 1;
|
||||||
|
|
||||||
/* Redirect stdout/stderr to the user-specified location */
|
/* Redirect stdout/stderr to the user-specified location */
|
||||||
if (redirect_output) {
|
if (redirect_output) {
|
||||||
var charstring prefix := mp_run_prog_log_path & "/" & testcasename();
|
var charstring id := testcasename() & "-" & hex2str(g_pars.imsi) & "-" & int2str(g_start_prog_count);
|
||||||
|
var charstring prefix := mp_run_prog_log_path & "/" & id;
|
||||||
sprog.command := sprog.command & " 1>>" & prefix & ".prog.stdout";
|
sprog.command := sprog.command & " 1>>" & prefix & ".prog.stdout";
|
||||||
sprog.command := sprog.command & " 2>>" & prefix & ".prog.stderr";
|
sprog.command := sprog.command & " 2>>" & prefix & ".prog.stderr";
|
||||||
}
|
}
|
||||||
|
@ -720,6 +725,7 @@ runs on PGW_Session_CT return integer
|
||||||
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
||||||
log2str("Unable to start program '", command, "'"));
|
log2str("Unable to start program '", command, "'"));
|
||||||
}
|
}
|
||||||
|
log("Started program '", command, "' with PID ", res.pid);
|
||||||
return res.pid;
|
return res.pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,7 +747,7 @@ private function f_wait_term(integer pid, template (present) integer exit_code :
|
||||||
}
|
}
|
||||||
[] T.timeout {
|
[] T.timeout {
|
||||||
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
|
||||||
"timeout waiting for user-plane program termination");
|
log2str("timeout (", tout, " seconds) waiting for user-plane program PID ", pid, " termination"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue