diff --git a/tests/hook-inittab.t b/tests/hook-inittab.t index 2b06fa5..18b366d 100644 --- a/tests/hook-inittab.t +++ b/tests/hook-inittab.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: hook-inittab.t,v 1.4 2006-06-24 20:17:09 steve Exp $ +# $Id: hook-inittab.t,v 1.5 2006-06-25 20:02:33 steve Exp $ # use strict; @@ -20,14 +20,24 @@ ok( -e "/etc/inittab", "/etc/inittab exists." ); +# +# Rather than having a hardwired list of distributions to test +# against we look for subdirectories beneath hooks/ and test each +# one. +# +foreach my $dir ( glob( "hooks/*" ) ) +{ + next if ( $dir =~ /CVS/i ); + next if ( ! -d $dir ); + + if ( $dir =~ /hooks\/(.*)/ ) + { + my $dist = $1; + testHook( $dist ); + } +} + -# -# Test the inittab hooks -# -testHook( "centos4" ); -testHook( "debian" ); -testHook( "gentoo" ); -testHook( "ubuntu" ); sub testHook diff --git a/tests/hook-tls.t b/tests/hook-tls.t index 3ab5206..49e7806 100644 --- a/tests/hook-tls.t +++ b/tests/hook-tls.t @@ -4,7 +4,7 @@ # # Steve # -- -# $Id: hook-tls.t,v 1.3 2006-06-24 20:18:27 steve Exp $ +# $Id: hook-tls.t,v 1.4 2006-06-25 20:02:33 steve Exp $ # use strict; @@ -12,10 +12,26 @@ use Test::More qw( no_plan ); use File::Temp; -testTLSDisabling( "centos4" ); -testTLSDisabling( "debian" ); -testTLSDisabling( "gentoo" ); -testTLSDisabling( "ubuntu" ); + + +# +# Rather than having a hardwired list of distributions to test +# against we look for subdirectories beneath hooks/ and test each +# one. +# +foreach my $dir ( glob( "hooks/*" ) ) +{ + next if ( $dir =~ /CVS/i ); + next if ( ! -d $dir ); + + if ( $dir =~ /hooks\/(.*)/ ) + { + my $dist = $1; + testTLSDisabling( $dist ); + } +} + + # diff --git a/tests/hooks.t b/tests/hooks.t index c0a4f6c..cd27554 100644 --- a/tests/hooks.t +++ b/tests/hooks.t @@ -4,17 +4,30 @@ # # Steve # -- -# $Id: hooks.t,v 1.6 2006-06-24 20:18:27 steve Exp $ +# $Id: hooks.t,v 1.7 2006-06-25 20:02:33 steve Exp $ # use strict; use Test::More qw( no_plan ); -testDistroHooks( "centos4" ); -testDistroHooks( "debian" ); -testDistroHooks( "gentoo" ); -testDistroHooks( "ubuntu" ); +# +# Rather than having a hardwired list of distributions to test +# against we look for subdirectories beneath hooks/ and test each +# one. +# +foreach my $dir ( glob( "hooks/*" ) ) +{ + next if ( $dir =~ /CVS/i ); + next if ( ! -d $dir ); + + if ( $dir =~ /hooks\/(.*)/ ) + { + my $dist = $1; + testDistroHooks( $dist ); + } +} + sub testDistroHooks diff --git a/tests/plugin-checks.t b/tests/plugin-checks.t index cc91329..cc6a8dd 100644 --- a/tests/plugin-checks.t +++ b/tests/plugin-checks.t @@ -5,7 +5,7 @@ # # Steve # -- -# $Id: plugin-checks.t,v 1.6 2006-06-24 20:19:17 steve Exp $ +# $Id: plugin-checks.t,v 1.7 2006-06-25 20:02:33 steve Exp $ # @@ -13,11 +13,30 @@ use strict; use Test::More qw( no_plan ); -testPlugins( "centos4" ); -testPlugins( "debian" ); -testPlugins( "gentoo" ); -testPlugins( "ubuntu" ); +# +# Rather than having a hardwired list of distributions to test +# against we look for subdirectories beneath hooks/ and test each +# one. +# +foreach my $dir ( glob( "hooks/*" ) ) +{ + next if ( $dir =~ /CVS/i ); + next if ( ! -d $dir ); + if ( $dir =~ /hooks\/(.*)/ ) + { + my $dist = $1; + testPlugins( $dist ); + } +} + + + +=head2 testPlugins + + Test each plugin associated with the given directory. + +=cut sub testPlugins {