Commit 4cdc781c authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs[t:2645] add -e option to the loader-cleanup-test

git-svn-id: file:///svn/toku/tokudb@20638 c7de825b-a66e-492c-adef-691d508d4ae1
parent d0028b46
...@@ -197,7 +197,7 @@ TDB_TESTS_THAT_SHOULD_FAIL= \ ...@@ -197,7 +197,7 @@ TDB_TESTS_THAT_SHOULD_FAIL= \
test944 \ test944 \
test_truncate_txn_abort \ test_truncate_txn_abort \
test_db_no_env \ test_db_no_env \
loader-tpch-load \ loader-tpch-load.loader \
#\ ends prev line #\ ends prev line
#ifneq ($(OS_CHOICE),windows) #ifneq ($(OS_CHOICE),windows)
# TDB_TESTS_THAT_SHOULD_FAIL+= \ # TDB_TESTS_THAT_SHOULD_FAIL+= \
...@@ -382,7 +382,7 @@ ABORTCODE=137 ...@@ -382,7 +382,7 @@ ABORTCODE=137
.PHONY: %.loader .PHONY: %.loader
# Generally these subtests cannot run in parallel until we fix #2645. # Generally these subtests cannot run in parallel until we fix #2645.
%.loader: %.tdb$(BINSUF) $(PTHREAD_LOCAL) %.loader: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) $(VERBVERBOSE) $(TDBVGRIND) ./$< $(EXTRA_ARGS) $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -p $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD) $(TDBVGRIND) ./$< $(EXTRA_ARGS) -p $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
loader-cleanup-test.loader: EXTRA_ARGS = -s -r 8000 loader-cleanup-test.loader: EXTRA_ARGS = -s -r 8000
...@@ -412,7 +412,7 @@ loader-stress-test: LOADLIBES+=-L.. -ltokudb -Wl,-rpath,.. ...@@ -412,7 +412,7 @@ loader-stress-test: LOADLIBES+=-L.. -ltokudb -Wl,-rpath,..
clean: clean:
rm -f $(ALL_BINS) rm -f $(ALL_BINS)
rm -rf dir.*.tdb dir.*.bdb dir.*.tdb.recover *.check.output *.check.valgrind rm -rf dir.* *.check.output *.check.valgrind
rm -f dump.bdb.1426 dump.tdb.1426 test1426.bdb rm -f dump.bdb.1426 dump.tdb.1426 test1426.bdb
ifeq ($(VGRIND),) ifeq ($(VGRIND),)
......
...@@ -713,7 +713,8 @@ static void test_loader(enum test_type t, DB **dbs, int trigger) ...@@ -713,7 +713,8 @@ static void test_loader(enum test_type t, DB **dbs, int trigger)
static int run_test_count = 0; static int run_test_count = 0;
static char *envdir = ENVDIR; static char *free_me = NULL;
static char *env_dir = ENVDIR;
static void run_test(enum test_type t, int trigger) static void run_test(enum test_type t, int trigger)
{ {
...@@ -726,10 +727,10 @@ static void run_test(enum test_type t, int trigger) ...@@ -726,10 +727,10 @@ static void run_test(enum test_type t, int trigger)
fflush(stdout); fflush(stdout);
} }
char rm_cmd[strlen("rm -rf ") + strlen(envdir) + 1]; char rm_cmd[strlen("rm -rf ") + strlen(env_dir) + 1];
sprintf(rm_cmd, "rm -rf %s", envdir); sprintf(rm_cmd, "rm -rf %s", env_dir);
r = system(rm_cmd); CKERR(r); r = system(rm_cmd); CKERR(r);
r = toku_os_mkdir(envdir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); r = toku_os_mkdir(env_dir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r = env->set_default_bt_compare(env, uint_dbt_cmp); CKERR(r); r = env->set_default_bt_compare(env, uint_dbt_cmp); CKERR(r);
...@@ -738,7 +739,7 @@ static void run_test(enum test_type t, int trigger) ...@@ -738,7 +739,7 @@ static void run_test(enum test_type t, int trigger)
CKERR(r); CKERR(r);
int envflags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE | DB_PRIVATE; int envflags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE | DB_PRIVATE;
r = env->open(env, envdir, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); r = env->open(env, env_dir, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
//Disable auto-checkpointing //Disable auto-checkpointing
r = env->checkpointing_set_period(env, 0); CKERR(r); r = env->checkpointing_set_period(env, 0); CKERR(r);
...@@ -883,11 +884,9 @@ static void run_all_tests(void) { ...@@ -883,11 +884,9 @@ static void run_all_tests(void) {
int test_main(int argc, char * const *argv) { int test_main(int argc, char * const *argv) {
do_args(argc, argv); do_args(argc, argv);
run_all_tests(); run_all_tests();
printf("run_test_count=%d\n", run_test_count); printf("run_test_count=%d\n", run_test_count);
if (free_me) toku_free(free_me);
return 0; return 0;
} }
...@@ -942,7 +941,12 @@ static void do_args(int argc, char * const argv[]) { ...@@ -942,7 +941,12 @@ static void do_args(int argc, char * const argv[]) {
db_env_set_loader_size_factor(1); db_env_set_loader_size_factor(1);
} else if (strcmp(argv[0],"-e") == 0 && argc > 1) { } else if (strcmp(argv[0],"-e") == 0 && argc > 1) {
argc--; argv++; argc--; argv++;
envdir = argv[0]; if (free_me) toku_free(free_me);
int len = strlen(ENVDIR) + strlen(argv[0]) + 2;
char full_env_dir[len];
int r = snprintf(full_env_dir, len, "%s.%s", ENVDIR, argv[0]);
assert(r<len);
free_me = env_dir = toku_strdup(full_env_dir);
} else { } else {
fprintf(stderr, "Unknown arg: %s\n", argv[0]); fprintf(stderr, "Unknown arg: %s\n", argv[0]);
resultcode=1; resultcode=1;
......
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