8 ######################Test Executor main starts here###################
10 #TEST_RUN_DIR should be set before running this
11 if [ ! "$TEST_RUN_ROOT" ]
13 echo "TEST_RUN_ROOT should be set before running the tests"
20 echo $MODULE |
grep "#" >/dev
/null
25 #echo "MODULE READ is $MODULE"
27 TEST_SCRIPT_DIR
=${ROOT_DIR}/${MODULE}
28 TEST_RUN_DIR
=${TEST_RUN_ROOT}/${MODULE}
29 if [ -s "$TEST_RUN_DIR" ]
31 echo "TEST_RUN_ROOT already has Connection directory. Remove and try again."
34 mkdir
-p $TEST_RUN_DIR
36 # TODO::check whether server is running
38 TEST_LOG
=$TEST_RUN_DIR/testlog
42 echo "TEST_RUN_DIR has files in it. Remove before running the tests"
46 TEST_EXEC_DIR
=$TEST_RUN_DIR/tests
50 echo "Test Executor log file" >$TEST_LOG
51 echo "----------------------" >$TEST_LOG
53 TestList
=`ls ${TEST_SCRIPT_DIR}/test*`
57 echo "Running $test" >>$TEST_LOG
58 echo "Test started at : `date` "
59 echo "Test started at : `date` " >>$TEST_LOG
62 EXP_FILE
=exp.
`basename ${test}`
63 #echo "EXP_FILE is $EXP_FILE"
64 if [ -s "${TEST_SCRIPT_DIR}/${EXP_FILE}" ]
69 if [ "$expPresent" = "yes" ]
71 cp ${TEST_SCRIPT_DIR}/${EXP_FILE} ${TEST_EXEC_DIR}
72 ${test} > ${TEST_EXEC_DIR}/cur.${EXP_FILE} 2>&1
74 ${test} >> ${TEST_LOG} 2>&1
77 echo "Test Ended at : `date` "
78 echo "Test Ended at : `date` " >>$TEST_LOG
81 if [ "$expPresent" = "yes" ]
83 #compare exp and current output
84 diff ${TEST_SCRIPT_DIR}/${EXP_FILE} ${TEST_EXEC_DIR}/cur.${EXP_FILE} > ${TEST_EXEC_DIR}/diff.${EXP_FILE}
88 echo "Exp and current output matched."
89 echo "Test $test passed"
90 echo "Exp and current output matched." >>$TEST_LOG
91 echo "PASSED:Test $test passed" >>$TEST_LOG
92 rm ${TEST_EXEC_DIR}/cur.
${EXP_FILE}
93 rm ${TEST_EXEC_DIR}/diff.
${EXP_FILE}
94 rm ${TEST_EXEC_DIR}/${EXP_FILE}
96 echo "Exp and current output not matched."
97 echo "Test $test failed"
98 echo "Exp and current output not matched." >>$TEST_LOG
99 echo "FAILED:Test $test failed" >>$TEST_LOG
100 #TODO:get all the trace files from server and store it in a folder
104 echo "Test $test passed"
105 echo "Returned 0." >>$TEST_LOG
106 echo "PASSED:Test $test passed" >>$TEST_LOG
110 echo "Returned $ret "
111 echo "Test $test failed"
112 echo "Returned $ret " >>$TEST_LOG
113 echo "FAILED:Test $test failed" >>$TEST_LOG
114 #TODO:get all the trace files from server and store it in a folder