assertLengthTrace("DevName", fs.getDevName());
assertLengthTrace("DirName", fs.getDirName());
assertLengthTrace("TypeName", fs.getTypeName());
assertLengthTrace("SysTypeName", fs.getSysTypeName());
FileSystemUsage usage;
try {
usage = sigar.getFileSystemUsage(fs.getDirName());
} catch (SigarException e) {
if (fs.getType() == FileSystem.TYPE_LOCAL_DISK) {
throw e;
}
//else ok, e.g. floppy drive on windows
continue;
}
switch (fs.getType()) {
case FileSystem.TYPE_LOCAL_DISK:
assertGtZeroTrace(" Total", usage.getTotal());
//possible machines have full filesystems
assertGtEqZeroTrace(" Free", usage.getFree());
assertGtEqZeroTrace(" Avail", usage.getAvail());
assertGtEqZeroTrace(" Used", usage.getUsed());
double usePercent = usage.getUsePercent() * 100;
traceln(" Usage=" + usePercent + "%");
assertTrue(usePercent <= 100.0);
default:
traceln(" DiskReads=" + usage.getDiskReads());
traceln(" DiskWrites=" + usage.getDiskWrites());
}
}
try {
sigar.getFileSystemUsage("T O T A L L Y B O G U S");