Make recovery tests quieter. Fixes #2293. close[t:2293]

git-svn-id: file:///svn/toku/tokudb@16861 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Bradley C. Kuszmaul 2013-04-16 23:58:57 -04:00 committed by Yoni Fogel
parent 528949b699
commit ca0bc8f302
6 changed files with 35 additions and 1 deletions

View file

@ -33,6 +33,12 @@ run_test(void) {
r = toku_logger_close(&logger); assert(r == 0);
}
// redirect stderr
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr));
r = close(devnul); assert(r==0);
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, 0);
assert(r == 0);

View file

@ -22,8 +22,12 @@ run_test(void) {
r = toku_logger_close(&logger); assert(r == 0);
// run recovery
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr));
r = close(devnul); assert(r==0);
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, 0);
printf("%s:%d %d\n", __FUNCTION__, __LINE__, r);
assert(r == 0);
return 0;
}

View file

@ -27,6 +27,12 @@ run_test(void) {
r = toku_log_fopen(logger, NULL, TRUE, iname, filenum, treeflags);
r = toku_logger_close(&logger); assert(r == 0);
// redirect stderr
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr));
r = close(devnul); assert(r==0);
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, 0);
assert(r == 0);

View file

@ -27,6 +27,12 @@ run_test(void) {
r = toku_log_comment(logger, NULL, TRUE, 0, there); assert(r == 0);
r = toku_logger_close(&logger); assert(r == 0);
// redirect stderr
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr));
r = close(devnul); assert(r==0);
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, 0);
assert(r == 0);

View file

@ -21,6 +21,12 @@ run_test(void) {
r = toku_log_comment(logger, NULL, TRUE, 0, hello);
r = toku_logger_close(&logger); assert(r == 0);
// redirect stderr
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr));
r = close(devnul); assert(r==0);
// run recovery
r = tokudb_recover("/junk", TESTDIR, 0, 0, 0);
assert(r != 0);

View file

@ -13,6 +13,12 @@ run_test(void) {
system("rm -rf " TESTDIR);
r = toku_os_mkdir(TESTDIR, S_IRWXU); assert(r == 0);
// redirect stderr
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr));
r = close(devnul); assert(r==0);
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, 0);
assert(r != 0);