inttrospector cli
[scpubgit/System-Introspector.git] / t / mountpoints.t
1 use strictures 1;
2 use Test::More;
3
4 use System::Introspector::MountPoints;
5
6 my $probe = System::Introspector::MountPoints->new;
7 my $data  = $probe->gather;
8
9 ok $data->{fstab}, 'received fstab data';
10 ok $data->{mtab},  'received mtab data';
11
12 my @fields = qw(
13     device_name
14     dump_freq
15     fs_type
16     mount_point
17     options
18     pass_num
19 );
20
21 my $run_test = sub {
22     my $tab = shift;
23     return sub {
24         for my $field (@fields) {
25             my @entries = @{ $tab->{entries} };
26             ok not(grep { not defined $_->{$field} } @entries),
27                 "all have $field";
28         }
29     };
30 };
31
32 subtest fstab => $run_test->($data->{fstab});
33 subtest mtab => $run_test->($data->{mtab});
34
35 done_testing;