Skipping disk_space tests if df doesn't work
authorChristoph Berg <[email protected]>
Wed, 18 Sep 2013 15:37:11 +0000 (17:37 +0200)
committerChristoph Berg <[email protected]>
Wed, 18 Sep 2013 15:37:11 +0000 (17:37 +0200)
df might fail in chroot environments, e.g. on build daemons where
check-postgres packages are built

t/02_disk_space.t

index 0dee62a9bf0b192890d9366763882c01efece037..7226a627dec850cc915cbc6fc7c7140d2e64cfe9 100644 (file)
@@ -6,10 +6,19 @@ use 5.006;
 use strict;
 use warnings;
 use Data::Dumper;
-use Test::More tests => 8;
+use Test::More;
 use lib 't','.';
 use CP_Testing;
 
+# df might fail in chroot environments, e.g. on build daemons where
+# check-postgres packages are built
+system "df > /dev/null 2>&1";
+if ($?) {
+    plan skip_all => 'Skipping disk_space tests because df does not work';
+} else {
+    plan tests => 8;
+}
+
 use vars qw/$dbh $result $t $host $dbname/;
 
 my $cp = CP_Testing->new( {default_action => 'disk_space'} );