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).
This commit is contained in:
martin 2020-03-15 12:12:42 +00:00
parent 2555aa968c
commit 9fc99040ba

View File

@ -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;