From 93901d5ff10cd7fd915cc09d7c496cec49f82ce5 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Fri, 13 Jun 2014 14:20:14 +0200 Subject: tests: fping checks require being root or setuid root on the fping binary. Check this before running the test. Signed-off-by: Sven Nierlein --- NPTest.pm | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'NPTest.pm') diff --git a/NPTest.pm b/NPTest.pm index e04ebba3..f72ed2df 100644 --- a/NPTest.pm +++ b/NPTest.pm @@ -6,7 +6,7 @@ package NPTest; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(getTestParameter checkCmd skipMissingCmd); +@EXPORT = qw(getTestParameter checkCmd skipMissingCmd skipMsg); @EXPORT_OK = qw(DetermineTestHarnessDirectory TestsFrom SetCacheFilename); use strict; @@ -38,8 +38,8 @@ testing. =head1 FUNCTIONS -This module defines three public functions, C, -C and C. These are exported by +This module defines four public functions, C, +C, C and C. These are exported by default via the C statement. =over @@ -185,6 +185,15 @@ of times. =back +=item C + +If for any reason the test harness must C some +or all of the tests in a given test harness this function provides a +simple iterator to issue an appropriate message the requested number +of times. + +=back + =head1 SEE ALSO L @@ -304,6 +313,20 @@ sub skipMissingCmd return $testStatus; } +sub skipMsg +{ + my( $msg, $count ) = @_; + + my $testStatus; + + for ( 1 .. $count ) + { + $testStatus += skip( $msg, 1 ); + } + + return $testStatus; +} + sub getTestParameter { my( $param, $envvar, $default, $brief, $scoped ); -- cgit v1.2.3