Module Name:    src
Committed By:   martin
Date:           Sun Mar 15 12:12:42 UTC 2020

Modified Files:
        src/tests/fs/common: h_fsmacros.h

Log Message:
Hardcode a check for ZFS and too little free space in workdir to skip
ZFS tests if the atf working directory is size restricted (ZFS has a
hardcoded minimal size of 64MB for a storage pool and 128 MB disk size).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/tests/fs/common/h_fsmacros.h

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.42 src/tests/fs/common/h_fsmacros.h:1.43
--- src/tests/fs/common/h_fsmacros.h:1.42	Tue Jun 19 09:20:46 2018
+++ src/tests/fs/common/h_fsmacros.h	Sun Mar 15 12:12:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.42 2018/06/19 09:20:46 gson Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.43 2020/03/15 12:12:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -249,6 +249,14 @@ static __inline bool
 atf_check_fstype(const atf_tc_t *tc, const char *fs)
 {
 	const char *fstype;
+	struct statvfs fsstat;
+
+	if (strcmp(fs, "zfs") == 0) {
+		/* XXX ZFS hardcodes a minimal size */
+		if (statvfs(".", &fsstat) == 0 &&
+		    (fsstat.f_frsize * fsstat.f_bfree) <= 64*1024*1024)
+			atf_tc_skip("not enough free space in work directory");
+	}
 
 	if (!atf_tc_has_config_var(tc, "fstype"))
 		return true;

Reply via email to