File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,13 @@ if [ -z $packetdrill ]; then
2727 exit 1
2828fi
2929
30+ if [ ! -e $directory ]; then
31+ echo " File not found!"
32+ exit 1
33+ fi
34+
3035if [ ! -e $file ]; then
31- sh update-test-list
36+ sh update-test-list tests_list
3237fi
3338
3439# Check if the argument is a ".pkt" file
3843
3944# Check if the argument is a directory
4045if [ ! -z $directory ] && [ $pkt_file_flag == 0 ]; then
41- sh update-test-list
46+ sh update-test-list temp_list $directory
4247 file=temp_list
4348fi
4449
@@ -86,11 +91,11 @@ if [ $pkt_file_flag == 1 ]; then
8691else
8792 while IFS= read test
8893 do
89- printf " %-55.55s " . $test
94+ printf " %-55.55s " $test
9095 sleep $delay
91- if [ -e . ${test} .pkt ]; then
96+ if [ -e ${test} .pkt ]; then
9297 rm -f temp.log
93- $packetdrill -v --tolerance_usecs=1000000 . ${test} .pkt >> temp.log 2>&1
98+ $packetdrill -v --tolerance_usecs=1000000 ${test} .pkt >> temp.log 2>&1
9499 result=" ` echo $? ` "
95100 check_status
96101 else
Original file line number Diff line number Diff line change 22# Script for updating local list of tests.
33# Please run this script timely, especially after adding new tests.
44
5- rm -f tests_list
6- find . -type f -iname ' *.pkt' | cut -f 2 -d ' .' > tests_list
5+ if [ -z $1 ] && [ -z $2 ]; then
6+ echo " Usage ./update-test-list <test-file> <directory>"
7+ exit 1
8+
9+ else
10+ rm -f $1
11+ if [ -z $2 ]; then
12+ find . -type f -iname ' *.pkt' | cut -f 2 -d ' .' | cut -c 2- > $1
13+ else
14+ find $2 -type f -iname ' *.pkt' | cut -f 1 -d ' .' > $1
15+ fi
16+ fi
You can’t perform that action at this time.
0 commit comments