File: statfs.t

package info (click to toggle)
libfuse-perl 0.16.1%2B20180422git6becd92d7fce3fc411d7c-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 612 kB
  • sloc: perl: 1,938; makefile: 8
file content (25 lines) | stat: -rw-r--r-- 695 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
use test::helper qw($_real $_point);
use Test::More;
use Config;
use Filesys::Statvfs;

if ($^O eq 'netbsd') {
    # Ignoring the f_namelen field; NetBSD's statvfs1(2) syscall doesn't
    # seem to handle f_namelen right for PUFFS-based filesystems. Not our
    # failure, and mostly irrelevant.
    plan tests => 6;
}
else {
    plan tests => 7;
}
ok(my @list = (statvfs($_point))[1,2,3,5,6,9]);
diag "statfs: ",join(', ', @list);
is(shift(@list),4096,'block size');
is(shift(@list),1000000,'blocks');
is(shift(@list),500000,'blocks free');
is(shift(@list),1000000,'files');
is(shift(@list),500000,'files free');
unless ($^O eq 'netbsd') {
    is(shift(@list),255,'namelen');
}