From 0b0ad562be9f00b080626c902b8481999583b229 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 31 Jan 2023 12:18:00 -0500 Subject: [PATCH] MT#56521 terminate test on request failure Catch the "die" and cascade it to "terminate" so that stderr log output is preserved. Change-Id: Ifd915c8b705c78f9f8864d092f7dbecb2fc76a8b --- perl/NGCP/Rtpengine/AutoTest.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/perl/NGCP/Rtpengine/AutoTest.pm b/perl/NGCP/Rtpengine/AutoTest.pm index e72e17452..7e4177afc 100644 --- a/perl/NGCP/Rtpengine/AutoTest.pm +++ b/perl/NGCP/Rtpengine/AutoTest.pm @@ -118,9 +118,13 @@ sub rtpe_req { my ($cmd, $name, $req) = @_; $req->{command} = $cmd; $req->{'call-id'} = $cid; - alarm(3); - my $resp = $c->req($req); - alarm(0); + my $resp; + eval { + alarm(3); + $resp = $c->req($req); + alarm(0); + }; + terminate("'$cmd' request failed ($@)") if $@; is $resp->{result}, 'ok', "$name - '$cmd' status"; return $resp; }