Module Name: src Committed By: martin Date: Sun Mar 15 20:10:26 UTC 2020
Modified Files: src/tests/fs/common: h_fsmacros.h src/tests/fs/zfs: t_zpool.sh Log Message: Skip tests when we know there is not enough space available To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/tests/fs/common/h_fsmacros.h cvs rdiff -u -r1.5 -r1.6 src/tests/fs/zfs/t_zpool.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/fs/common/h_fsmacros.h diff -u src/tests/fs/common/h_fsmacros.h:1.43 src/tests/fs/common/h_fsmacros.h:1.44 --- src/tests/fs/common/h_fsmacros.h:1.43 Sun Mar 15 12:12:42 2020 +++ src/tests/fs/common/h_fsmacros.h Sun Mar 15 20:10:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: h_fsmacros.h,v 1.43 2020/03/15 12:12:42 martin Exp $ */ +/* $NetBSD: h_fsmacros.h,v 1.44 2020/03/15 20:10:26 martin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -77,6 +77,10 @@ FSPROTOS(zfs); #define FSTEST_CONSTRUCTOR(_tc_, _fs_, _args_) \ do { \ + struct statvfs fsstat; \ + if (statvfs(".", &fsstat) == 0 && \ + (fsstat.f_frsize * fsstat.f_bfree) <= FSTEST_IMGSIZE) \ + atf_tc_skip("not enough free space in work directory"); \ if (_fs_##_fstest_newfs(_tc_, &_args_, \ FSTEST_IMGNAME, FSTEST_IMGSIZE, NULL) != 0) \ atf_tc_fail_errno("newfs failed"); \ Index: src/tests/fs/zfs/t_zpool.sh diff -u src/tests/fs/zfs/t_zpool.sh:1.5 src/tests/fs/zfs/t_zpool.sh:1.6 --- src/tests/fs/zfs/t_zpool.sh:1.5 Tue Jun 11 14:00:16 2019 +++ src/tests/fs/zfs/t_zpool.sh Sun Mar 15 20:10:26 2020 @@ -1,4 +1,4 @@ -# $NetBSD: t_zpool.sh,v 1.5 2019/06/11 14:00:16 hannken Exp $ +# $NetBSD: t_zpool.sh,v 1.6 2020/03/15 20:10:26 martin Exp $ # # Copyright (c) 2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -43,6 +43,11 @@ jippo on /jippo type zfs (local) create_body() { + AVAIL=$( df -m ${TMPDIR} | awk '{if (int($4) > 0) print $4}' ) + if [ $AVAIL -lt 65 ]; then + atf_skip "not enough free space in working directory" + fi + atf_check -s exit:0 -o ignore -e ignore ${server} ${RUMP_SERVER} export LD_PRELOAD=/usr/lib/librumphijack.so