Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs Skip tests when we know there is not enough space a...



details:   https://anonhg.NetBSD.org/src/rev/2ea0b6e9a530
branches:  trunk
changeset: 745900:2ea0b6e9a530
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Mar 15 20:10:26 2020 +0000

description:
Skip tests when we know there is not enough space available

diffstat:

 tests/fs/common/h_fsmacros.h |  6 +++++-
 tests/fs/zfs/t_zpool.sh      |  7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 75d58530175a -r 2ea0b6e9a530 tests/fs/common/h_fsmacros.h
--- a/tests/fs/common/h_fsmacros.h      Sun Mar 15 19:41:04 2020 +0000
+++ b/tests/fs/common/h_fsmacros.h      Sun Mar 15 20:10:26 2020 +0000
@@ -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 @@
 
 #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");                      \
diff -r 75d58530175a -r 2ea0b6e9a530 tests/fs/zfs/t_zpool.sh
--- a/tests/fs/zfs/t_zpool.sh   Sun Mar 15 19:41:04 2020 +0000
+++ b/tests/fs/zfs/t_zpool.sh   Sun Mar 15 20:10:26 2020 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index