mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-19 22:46:36 -05:00
Fixes the -G option and adds test for it.
This commit is contained in:
parent
4f8f4cf534
commit
3b6dfd9ffe
3 changed files with 18 additions and 16 deletions
|
|
@ -116,7 +116,9 @@ endif
|
||||||
echo --- Create some files, sync raid6 and check
|
echo --- Create some files, sync raid6 and check
|
||||||
$(TESTENV) ./mktest$(EXEEXT) generate 1 3 $(CHECKCOUNT) $(CHECKSIZE)
|
$(TESTENV) ./mktest$(EXEEXT) generate 1 3 $(CHECKCOUNT) $(CHECKSIZE)
|
||||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf diff > test.log
|
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf diff > test.log
|
||||||
|
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf diff -G > test.log
|
||||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf dup
|
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf dup
|
||||||
|
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf dup -G
|
||||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf --test-force-order-physical sync
|
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf --test-force-order-physical sync
|
||||||
$(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 status
|
||||||
if HAVE_SYMLINK
|
if HAVE_SYMLINK
|
||||||
|
|
|
||||||
30
snapraid.c
30
snapraid.c
|
|
@ -508,6 +508,21 @@ int main(int argc, char* argv[])
|
||||||
raid_init();
|
raid_init();
|
||||||
crc32c_init();
|
crc32c_init();
|
||||||
|
|
||||||
|
/* open the log file */
|
||||||
|
if (log == 0)
|
||||||
|
log = "2";
|
||||||
|
if (strcmp(log, "1") == 0) {
|
||||||
|
stdlog = stdout;
|
||||||
|
} else if (strcmp(log, "2") == 0) {
|
||||||
|
stdlog = stderr;
|
||||||
|
} else {
|
||||||
|
stdlog = fopen(log, "wt");
|
||||||
|
if (!stdlog) {
|
||||||
|
fprintf(stderr, "Error opening the log file '%s'. %s.\n", log, strerror(errno));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!opt.skip_self)
|
if (!opt.skip_self)
|
||||||
selftest(opt.gui);
|
selftest(opt.gui);
|
||||||
|
|
||||||
|
|
@ -534,21 +549,6 @@ int main(int argc, char* argv[])
|
||||||
(void)lock;
|
(void)lock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* open the log file */
|
|
||||||
if (log == 0)
|
|
||||||
log = "2";
|
|
||||||
if (strcmp(log, "1") == 0) {
|
|
||||||
stdlog = stdout;
|
|
||||||
} else if (strcmp(log, "2") == 0) {
|
|
||||||
stdlog = stderr;
|
|
||||||
} else {
|
|
||||||
stdlog = fopen(log, "wt");
|
|
||||||
if (!stdlog) {
|
|
||||||
fprintf(stderr, "Error opening the log file '%s'. %s.\n", log, strerror(errno));
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (operation == OPERATION_DIFF) {
|
if (operation == OPERATION_DIFF) {
|
||||||
state_read(&state);
|
state_read(&state);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue