Skip to content

Commit

Permalink
[=] test casetest
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylsy committed Oct 25, 2024
1 parent 31b14df commit d21166b
Showing 1 changed file with 189 additions and 182 deletions.
371 changes: 189 additions & 182 deletions scripts/case_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,194 @@ function case_print_result() {


# start test_server

clear_log
rm -rf tp_localhost test_session xqc_token ctdlog
echo -e "qlog disable ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_disable > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_disable >> ctdlog
result=`grep ">>>>>>>> pass:1" >> ctdlog`
svr_qlog_res1=`grep "\[packet_received\]" slog`
svr_qlog_res2=`grep "\[packet_sent\]" slog`
cli_qlog_res1=`grep "\[packet_received\]" ctdlog`
cli_qlog_res2=`grep "\[packet_sent\]" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -z "$svr_qlog_res1" ] && [ -z "$svr_qlog_res2" ] \
&& [ -z "$cli_qlog_res1" ] && [ -z "$cli_qlog_res2" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_disable" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_disable" "fail"
echo "$errlog"
fi


clear_log
rm -rf ctdlog
echo -e "qlog importance selected 1 ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance s > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance s >> ctdlog
result=`grep ">>>>>>>> pass:1" ctdlog`
svr_qlog_res1=`grep "\[packet_received\]" slog`
svr_qlog_res2=`grep "\[connection_started\]" slog`
cli_qlog_res1=`grep "\[packet_received\]" ctdlog`
cli_qlog_res2=`grep "\[connection_started\]" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_selected_1" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_selected_1" "fail"
echo "$errlog"
fi


clear_log
rm -rf ctdlog
echo -e "qlog importance selected 2 ...\c"
killall test_server
${SERVER_BIN} -l i -e -x 1 --qlog_importance s > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l i -t 1 -E --qlog_importance s >> ctdlog
result=`grep ">>>>>>>> pass:1" ctdlog`
svr_qlog_res1=`grep "\[packet_received\]" slog`
svr_qlog_res2=`grep "\[connection_started\]" slog`
cli_qlog_res1=`grep "\[packet_received\]" ctdlog`
cli_qlog_res2=`grep "\[connection_started\]" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -z "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -z "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_selected_2" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_selected_2" "fail"
echo "$errlog"
fi


clear_log
rm -rf ctdlog
echo -e "qlog importance removed ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance r > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance r >> ctdlog
result=`grep ">>>>>>>> pass:1" ctdlog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" ctdlog`
cli_qlog_res2=`grep "\[connection_" ctdlog`
cli_qlog_res3=`grep "\[datagram" ctdlog`
cli_qlog_res4=`grep "\[qpack_" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -n "$svr_qlog_res3" ] && [ -n "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ] \
&& [ -n "$cli_qlog_res3" ] && [ -n "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_removed" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_removed" "fail"
echo "$errlog"
fi


clear_log
rm -rf ctdlog
echo -e "qlog importance extra ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance e > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance e >> ctdlog
result=`grep ">>>>>>>> pass:1" ctdlog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" ctdlog`
cli_qlog_res2=`grep "\[connection_" ctdlog`
cli_qlog_res3=`grep "\[datagram" ctdlog`
cli_qlog_res4=`grep "\[qpack_" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -n "$svr_qlog_res3" ] && [ -z "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ] \
&& [ -n "$cli_qlog_res3" ] && [ -z "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_extra" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_extra" "fail"
echo "$errlog"
fi

rm -rf ctdlog
clear_log
echo -e "qlog importance base ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance b > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance b >> ctdlog
result=`grep ">>>>>>>> pass:1" ctdlog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" ctdlog`
cli_qlog_res2=`grep "\[connection_" ctdlog`
cli_qlog_res3=`grep "\[datagram" ctdlog`
cli_qlog_res4=`grep "\[qpack_" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -z "$svr_qlog_res3" ] && [ -z "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ] \
&& [ -z "$cli_qlog_res3" ] && [ -z "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_base" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_base" "fail"
echo "$errlog"
fi


clear_log
rm -rf ctdlog
echo -e "qlog importance core ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance c > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance c >> ctdlog
result=`grep ">>>>>>>> pass:1" ctdlog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" ctdlog`
cli_qlog_res2=`grep "\[connection_" ctdlog`
cli_qlog_res3=`grep "\[datagram" ctdlog`
cli_qlog_res4=`grep "\[qpack_" ctdlog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -z "$svr_qlog_res2" ] \
&& [ -z "$svr_qlog_res3" ] && [ -z "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -z "$cli_qlog_res2" ] \
&& [ -z "$cli_qlog_res3" ] && [ -z "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_core" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_core" "fail"
echo "$errlog"
fi


rm -rf tp_localhost test_session xqc_token
killall test_server 2> /dev/null
${SERVER_BIN} -l d -e > /dev/null &
Expand Down Expand Up @@ -4413,188 +4601,7 @@ else
fi


clear_log
rm -rf tp_localhost test_session xqc_token
echo -e "qlog disable ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_disable > slog &
sleep 1
sudo ${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_disable >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_received\]" slog`
svr_qlog_res2=`grep "\[packet_sent\]" slog`
cli_qlog_res1=`grep "\[packet_received\]" clog`
cli_qlog_res2=`grep "\[packet_sent\]" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -z "$svr_qlog_res1" ] && [ -z "$svr_qlog_res2" ] \
&& [ -z "$cli_qlog_res1" ] && [ -z "$cli_qlog_res2" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_disable" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_disable" "fail"
echo "$errlog"
fi


clear_log
echo -e "qlog importance selected 1 ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance s > slog &
sleep 1
sudo ${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance s >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_received\]" slog`
svr_qlog_res2=`grep "\[connection_started\]" slog`
cli_qlog_res1=`grep "\[packet_received\]" clog`
cli_qlog_res2=`grep "\[connection_started\]" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_selected_1" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_selected_1" "fail"
echo "$errlog"
fi


clear_log
echo -e "qlog importance selected 2 ...\c"
killall test_server
${SERVER_BIN} -l i -e -x 1 --qlog_importance s > slog &
sleep 1
sudo ${CLIENT_BIN} -s 10240 -l i -t 1 -E --qlog_importance s >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_received\]" slog`
svr_qlog_res2=`grep "\[connection_started\]" slog`
cli_qlog_res1=`grep "\[packet_received\]" clog`
cli_qlog_res2=`grep "\[connection_started\]" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -z "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -z "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_selected_2" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_selected_2" "fail"
echo "$errlog"
fi


clear_log
echo -e "qlog importance removed ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance r > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance r >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" clog`
cli_qlog_res2=`grep "\[connection_" clog`
cli_qlog_res3=`grep "\[datagram" clog`
cli_qlog_res4=`grep "\[qpack_" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -n "$svr_qlog_res3" ] && [ -n "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ] \
&& [ -n "$cli_qlog_res3" ] && [ -n "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_removed" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_removed" "fail"
echo "$errlog"
fi


clear_log
echo -e "qlog importance extra ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance e > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance e >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" clog`
cli_qlog_res2=`grep "\[connection_" clog`
cli_qlog_res3=`grep "\[datagram" clog`
cli_qlog_res4=`grep "\[qpack_" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -n "$svr_qlog_res3" ] && [ -z "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ] \
&& [ -n "$cli_qlog_res3" ] && [ -z "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_extra" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_extra" "fail"
echo "$errlog"
fi


clear_log
echo -e "qlog importance base ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance b > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance b >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" clog`
cli_qlog_res2=`grep "\[connection_" clog`
cli_qlog_res3=`grep "\[datagram" clog`
cli_qlog_res4=`grep "\[qpack_" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -n "$svr_qlog_res2" ] \
&& [ -z "$svr_qlog_res3" ] && [ -z "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -n "$cli_qlog_res2" ] \
&& [ -z "$cli_qlog_res3" ] && [ -z "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_base" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_base" "fail"
echo "$errlog"
fi


clear_log
echo -e "qlog importance core ...\c"
killall test_server
${SERVER_BIN} -l d -e -x 1 --qlog_importance c > slog &
sleep 1
${CLIENT_BIN} -s 10240 -l d -t 1 -E --qlog_importance c >> clog
result=`grep ">>>>>>>> pass:1" clog`
svr_qlog_res1=`grep "\[packet_sent" slog`
svr_qlog_res2=`grep "\[connection_" slog`
svr_qlog_res3=`grep "\[datagram" slog`
svr_qlog_res4=`grep "\[qpack_" slog`
cli_qlog_res1=`grep "\[packet_sent" clog`
cli_qlog_res2=`grep "\[connection_" clog`
cli_qlog_res3=`grep "\[datagram" clog`
cli_qlog_res4=`grep "\[qpack_" clog`
errlog=`grep_err_log`
if [ -z "$errlog" ] && [ "$result" == ">>>>>>>> pass:1" ] && [ -n "$svr_qlog_res1" ] && [ -z "$svr_qlog_res2" ] \
&& [ -z "$svr_qlog_res3" ] && [ -z "$svr_qlog_res4" ] && [ -n "$cli_qlog_res1" ] && [ -z "$cli_qlog_res2" ] \
&& [ -z "$cli_qlog_res3" ] && [ -z "$cli_qlog_res4" ]; then
echo ">>>>>>>> pass:1"
case_print_result "qlog_importance_core" "pass"
else
echo ">>>>>>>> pass:0"
case_print_result "qlog_importance_core" "fail"
echo "$errlog"
fi

sudo rm -rf tp_localhost test_session xqc_token clog slog
sudo rm -rf tp_localhost test_session xqc_token clog slog ctdlog
killall test_server 2> /dev/null
${SERVER_BIN} -l d -e -f > /dev/null &
sleep 1
Expand Down

0 comments on commit d21166b

Please sign in to comment.