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= \
test944 \
test_truncate_txn_abort \
test_db_no_env \
loader-tpch-load \
loader-tpch-load.loader \
#\ ends prev line
#ifneq ($(OS_CHOICE),windows)
# TDB_TESTS_THAT_SHOULD_FAIL+= \
......@@ -382,7 +382,7 @@ ABORTCODE=137
.PHONY: %.loader
# Generally these subtests cannot run in parallel until we fix #2645.
%.loader: %.tdb$(BINSUF) $(PTHREAD_LOCAL)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) $(VERBVERBOSE)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
$(TDBVGRIND) ./$< $(EXTRA_ARGS) -p $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
loader-cleanup-test.loader: EXTRA_ARGS = -s -r 8000
......@@ -412,7 +412,7 @@ loader-stress-test: LOADLIBES+=-L.. -ltokudb -Wl,-rpath,..
clean:
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
ifeq ($(VGRIND),)
......
......@@ -713,7 +713,8 @@ static void test_loader(enum test_type t, DB **dbs, int trigger)
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)
{
......@@ -726,10 +727,10 @@ static void run_test(enum test_type t, int trigger)
fflush(stdout);
}
char rm_cmd[strlen("rm -rf ") + strlen(envdir) + 1];
sprintf(rm_cmd, "rm -rf %s", envdir);
char rm_cmd[strlen("rm -rf ") + strlen(env_dir) + 1];
sprintf(rm_cmd, "rm -rf %s", env_dir);
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 = 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)
CKERR(r);
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);
//Disable auto-checkpointing
r = env->checkpointing_set_period(env, 0); CKERR(r);
......@@ -883,11 +884,9 @@ static void run_all_tests(void) {
int test_main(int argc, char * const *argv) {
do_args(argc, argv);
run_all_tests();
printf("run_test_count=%d\n", run_test_count);
if (free_me) toku_free(free_me);
return 0;
}
......@@ -942,7 +941,12 @@ static void do_args(int argc, char * const argv[]) {
db_env_set_loader_size_factor(1);
} else if (strcmp(argv[0],"-e") == 0 && argc > 1) {
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 {
fprintf(stderr, "Unknown arg: %s\n", argv[0]);
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