fsstress: translate flags in fiemap_f
[xfstests-dev.git] / src / fill2fs_check
1 #!/usr/bin/perl -w
2 #
3 #  Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # fill2fs_check:
6 #   Read a manifest generated by fill2fs from the command
7 #   line or stdin, checksum every file listed
8 #
9 #   $Id: fill2fs_check,v 1.1 2001/04/26 23:46:25 ajag Exp ajag $
10 #
11
12 use File::Basename;
13
14 $status = 0;
15
16 file: while (<>) {
17   chomp;
18   if ( ! -e $_) {
19     print "$0: $_ not found\n";
20     $status = 1; next file;
21   }
22   (undef, $expected) = split(/\./, basename $_);
23   chomp($sum = `sum -r $_`);
24   ($actual) = split(/\s+/, $sum);
25   if ($actual != $expected) {
26     print "$0: checksum is wrong for \"$_\"\n";
27     $status = 1; next file;
28   }
29 }
30
31 exit($status);