mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Some more regression tests for move/copy/invalidate
This commit is contained in:
parent
4209f0cec3
commit
a66ccb5cc1
2 changed files with 29 additions and 2 deletions
23
Makefile.am
23
Makefile.am
|
|
@ -282,6 +282,29 @@ endif
|
|||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync -l ">&1"
|
||||
rm -r bench/disk1/TEST*
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -E sync
|
||||
# Now create, duplicate, move and partial sync
|
||||
head -c 8192 /dev/zero > bench/disk1/INVA1
|
||||
head -c 8192 /dev/zero > bench/disk1/INVA2
|
||||
head -c 8192 /dev/zero > bench/disk1/INVA3
|
||||
head -c 8192 /dev/zero > bench/disk1/MOVE1
|
||||
cp -a bench/disk1/MOVE1 bench/disk1/MOVE2
|
||||
cp -a bench/disk1/MOVE1 bench/disk1/MOVE3
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync
|
||||
mv bench/disk1/MOVE2 bench/disk2/MOVE2
|
||||
mv bench/disk1/MOVE3 bench/disk3/MOVE3
|
||||
head -c 8192 /dev/zero > bench/disk4/MOVE4
|
||||
cp -a bench/disk1/INVA1 bench/disk1/EXTRA1
|
||||
cp -a bench/disk1/INVA2 bench/disk1/EXTRA2
|
||||
cp -a bench/disk1/INVA3 bench/disk1/EXTRA3
|
||||
rm bench/disk1/INVA1
|
||||
touch bench/disk1/INVA2
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-kill-after-sync sync
|
||||
mv bench/disk2/MOVE2 bench/disk4/MOVE4
|
||||
mv bench/disk3/MOVE3 bench/disk5/MOVE5
|
||||
mv bench/disk4/MOVE4 bench/disk6/MOVE6
|
||||
rm bench/disk1/EXTRA1
|
||||
touch bench/disk1/EXTRA2
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -E sync
|
||||
#### NOT EMPTY ####
|
||||
echo --- Create some files
|
||||
$(TESTENV) ./mktest$(EXEEXT) generate 1 6 $(CHECKCOUNT) $(CHECKSIZE)
|
||||
|
|
|
|||
|
|
@ -1133,8 +1133,12 @@ int main(int argc, char* argv[])
|
|||
ret = state_sync(&state, blockstart, blockcount);
|
||||
|
||||
/* save the new state if required */
|
||||
if (!opt.kill_after_sync && (state.need_write || state.opt.force_content_write))
|
||||
state_write(&state);
|
||||
if (!opt.kill_after_sync) {
|
||||
if ((state.need_write || state.opt.force_content_write))
|
||||
state_write(&state);
|
||||
} else {
|
||||
log_fatal("WARNING! Skipped state write for --test-kill-after-sync option.\n");
|
||||
}
|
||||
|
||||
/* abort if required */
|
||||
if (ret != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue