Commit | Line | Data |
daf48400 |
1 | use strictures 1; |
2 | use Test::More; |
3 | |
afd7c030 |
4 | use System::Introspector::Probe::MountPoints; |
daf48400 |
5 | |
afd7c030 |
6 | my $probe = System::Introspector::Probe::MountPoints->new; |
daf48400 |
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) { |
579b73f0 |
25 | my @entries = @{ $tab->{entries} }; |
26 | ok not(grep { not defined $_->{$field} } @entries), |
daf48400 |
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; |