2 # check for data corruption on migrate/recall with TSM/HSM
3 # tridge@samba.org June 2008
5 # do 10k files by default
14 echo "Cleaning up from old run"
18 mkdir rand1M || exit 1
20 echo "Creating $N files"
21 for i in `seq 1 $N`; do echo $i; dd if=/dev/urandom of=rand$i.dat bs=1M count=1; done
23 echo "Syncing and sleeping 10 seconds"
29 for i in `seq 1 $N`; do
30 [ `stat -c '%b' rand$i.dat` = 2048 ] || {
31 echo "ERROR: rand$i.dat is not blocks 2048 in size"
38 echo "Checksumming $N files with md5sum"
39 md5sum rand*.dat | tee ../rand1Msum.dat
41 echo "Waiting 2 minutes for files to be migratable"
44 echo "Migrating $N files"
48 for i in `seq 1 $N`; do
49 [ `stat -c '%b' rand$i.dat` = 0 ] || {
50 echo "ERROR: rand$i.dat is not fully migrated"
56 echo "Checksumming again"
57 md5sum rand*.dat | tee ../rand1Msum_after_migration.dat
59 count=`comm -23 ../rand1Msum.dat ../rand1Msum_after_migration.dat | wc -l`
61 if [ $count -ne 0 ]; then
62 echo "ERROR: These $count files were CORRUPTED"
63 comm -23 ../rand1Msum.dat ../rand1Msum_after_migration.dat
67 echo "No files were corrupted on recall"