Skip tests when we know there is not enough space available

This commit is contained in:
martin 2020-03-15 20:10:26 +00:00
parent a33dfea19c
commit e3d221ef2a
2 changed files with 11 additions and 2 deletions

View File

@ -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. * Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -77,6 +77,10 @@ FSPROTOS(zfs);
#define FSTEST_CONSTRUCTOR(_tc_, _fs_, _args_) \ #define FSTEST_CONSTRUCTOR(_tc_, _fs_, _args_) \
do { \ 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_, \ if (_fs_##_fstest_newfs(_tc_, &_args_, \
FSTEST_IMGNAME, FSTEST_IMGSIZE, NULL) != 0) \ FSTEST_IMGNAME, FSTEST_IMGSIZE, NULL) != 0) \
atf_tc_fail_errno("newfs failed"); \ atf_tc_fail_errno("newfs failed"); \

View File

@ -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. # Copyright (c) 2011 The NetBSD Foundation, Inc.
# All rights reserved. # All rights reserved.
@ -43,6 +43,11 @@ jippo on /jippo type zfs (local)
create_body() 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} atf_check -s exit:0 -o ignore -e ignore ${server} ${RUMP_SERVER}
export LD_PRELOAD=/usr/lib/librumphijack.so export LD_PRELOAD=/usr/lib/librumphijack.so