Browse Source

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
pull/1611/head
Richard Fuchs 3 years ago
parent
commit
0b0ad562be
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      perl/NGCP/Rtpengine/AutoTest.pm

+ 7
- 3
perl/NGCP/Rtpengine/AutoTest.pm View File

@ -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;
}


Loading…
Cancel
Save