From c5a6c5136a2a7e629907b04a63dff059603bdb09 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Thu, 12 Jun 2014 13:56:48 +0200 Subject: tests: testCmd has own timeout which overwrites local one so add configurable/optional timeout to testCmd. Signed-off-by: Sven Nierlein --- NPTest.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'NPTest.pm') diff --git a/NPTest.pm b/NPTest.pm index 2baed0b0..e04ebba3 100644 --- a/NPTest.pm +++ b/NPTest.pm @@ -627,12 +627,13 @@ sub only_output { } sub testCmd { - my $class = shift; + my $class = shift; my $command = shift or die "No command passed to testCmd"; + my $timeout = shift || 120; my $object = $class->new; local $SIG{'ALRM'} = sub { die("timeout in command: $command"); }; - alarm(120); # no test should take longer than 120 seconds + alarm($timeout); # no test should take longer than 120 seconds my $output = `$command`; $object->return_code($? >> 8); -- cgit v1.2.3