Browse Source

Merge pull request #8871 from gyuho/test-script-on-functional-tests

test: Clean agent directories on disk before functional test runs, no…
Gyu-Ho Lee 8 years ago
parent
commit
ec25a5c5b4
2 changed files with 4 additions and 1 deletions
  1. 1 0
      .gitignore
  2. 3 1
      test

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+/agent-*
 /coverage
 /coverage
 /covdir
 /covdir
 /gopath
 /gopath

+ 3 - 1
test

@@ -109,6 +109,9 @@ function integration_extra {
 }
 }
 
 
 function functional_pass {
 function functional_pass {
+  	# Clean up any data and logs from previous runs
+  	rm -rf ./agent-*
+
 	for a in 1 2 3; do
 	for a in 1 2 3; do
 		mkdir -p ./agent-$a
 		mkdir -p ./agent-$a
 		./bin/etcd-agent -etcd-path ./bin/etcd -etcd-log-dir "./agent-$a" -port ":${a}9027" -use-root=false &
 		./bin/etcd-agent -etcd-path ./bin/etcd -etcd-log-dir "./agent-$a" -port ":${a}9027" -use-root=false &
@@ -138,7 +141,6 @@ function functional_pass {
 	agent_pids=($agent_pids)
 	agent_pids=($agent_pids)
 	kill -s TERM "${agent_pids[@]}"
 	kill -s TERM "${agent_pids[@]}"
 	for a in "${agent_pids[@]}"; do wait "$a" || true; done
 	for a in "${agent_pids[@]}"; do wait "$a" || true; done
-	rm -rf ./agent-*
 
 
 	if [[ "${ETCD_TESTER_EXIT_CODE}" -ne "0" ]]; then
 	if [[ "${ETCD_TESTER_EXIT_CODE}" -ne "0" ]]; then
 		echo "--- FAIL: exit code" ${ETCD_TESTER_EXIT_CODE}
 		echo "--- FAIL: exit code" ${ETCD_TESTER_EXIT_CODE}