// generate the parity files.
doRaid(srcPath, codec);
FileStatus stat = fileSys.getFileStatus(srcPath);
// verify the GOOD_FILE
ParityFilePair pfPair = ParityFilePair.getParityFile(codec, stat, conf);
assertNotNull(pfPair);
assertTrue(FastFileCheck.checkFile(conf, (DistributedFileSystem)fileSys,
fileSys, srcPath, pfPair.getPath(), codec,
RaidUtils.NULL_PROGRESSABLE, false));
// verify the BAD_FILE
fileSys.delete(srcPath);
TestRaidDfs.createTestFilePartialLastBlock(fileSys, srcPath,
1, 8, 8192L);
fileSys.setTimes(pfPair.getPath(),
fileSys.getFileStatus(srcPath).getModificationTime(), -1);
stat = fileSys.getFileStatus(srcPath);
pfPair = ParityFilePair.getParityFile(codec, stat, conf);
assertNotNull(pfPair);
assertFalse(FastFileCheck.checkFile(conf, (DistributedFileSystem)fileSys,
fileSys, srcPath, pfPair.getPath(), codec,
RaidUtils.NULL_PROGRESSABLE, false));
} finally {
stopCluster();
}
}