ttcn3-tcpdump-stop: add timeout for talloc report

Prevent the script from idling for several minutes without any output if
obtaining the talloc report does not work. It seems to get killed
eventually, but trying for 5s should be enough.

Change-Id: I1bc5baeb94ecd25e1cdab98b060b99747c19d1f9
This commit is contained in:
Oliver Smith 2021-12-17 12:04:11 +01:00
parent 2514245bbd
commit 9678c22cec
1 changed files with 7 additions and 2 deletions

View File

@ -35,10 +35,15 @@ fi
# Order the SUT to print a talloc report
if [ "z$OSMO_SUT_HOST" != "z" ] && [ "z$OSMO_SUT_PORT" != "z" ]; then
if [ -x "$(command -v osmo_interact_vty.py)" ]; then
osmo_interact_vty.py \
echo "Saving talloc report from $OSMO_SUT_HOST:$OSMO_SUT_PORT to $TESTCASE.talloc"
if ! timeout 5 osmo_interact_vty.py \
-H $OSMO_SUT_HOST -p $OSMO_SUT_PORT \
-c "en; show talloc-context application full" \
> "$TTCN3_PCAP_PATH/$TESTCASE.talloc"
> "$TTCN3_PCAP_PATH/$TESTCASE.talloc"; then
echo
echo "ERROR: failed to get talloc report via vty"
echo
fi
else
echo "Missing osmo_interact_vty.py from osmo-python-tests!"
echo " -> Unable to obtain talloc report from the SUT"