Commit ca0bc8f3 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

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

git-svn-id: file:///svn/toku/tokudb@16861 c7de825b-a66e-492c-adef-691d508d4ae1
parent 528949b6
......@@ -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);
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment