mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Adds a test for the silent error fixing.
This commit is contained in:
parent
a774b62448
commit
9a57dd6dc8
2 changed files with 18 additions and 2 deletions
11
Makefile.am
11
Makefile.am
|
|
@ -165,6 +165,17 @@ endif
|
|||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf status
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf --test-force-scrub 100000 scrub
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf status
|
||||
echo --- Corrupt one file, scrub and fix filtering for error
|
||||
rm -f test/disk1/content
|
||||
cp test/content test/disk1/content
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf sync
|
||||
$(TESTENV) ./mktest$(EXEEXT) damage 1 10 1 test/disk1/content
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf --test-expect-recoverable --test-force-scrub 100000 scrub
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf status
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf fix -e
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf --test-force-scrub 100000 scrub
|
||||
rm test/disk1/content
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf sync
|
||||
echo --- Make a hole in the disk array
|
||||
mv test/disk2 test/disk2.old
|
||||
mkdir test/disk2
|
||||
|
|
|
|||
9
scrub.c
9
scrub.c
|
|
@ -424,8 +424,13 @@ bail:
|
|||
free(buffer);
|
||||
free(rehandle_alloc);
|
||||
|
||||
if (error != 0)
|
||||
return -1;
|
||||
if (state->opt.expect_recoverable) {
|
||||
if (error == 0)
|
||||
return -1;
|
||||
} else {
|
||||
if (error != 0)
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue