@@ -21,7 +21,7 @@ if [ $? -ne 0 ]; then
2121fi
2222
2323if [ $final_ret -eq 0 ]; then
24- # to avoid device or resource busy error
24+ # To avoid device or resource busy error
2525 sleep 0.5
2626
2727 # set transmit power (mBm)
@@ -49,7 +49,7 @@ if [ $final_ret -eq 0 ]; then
4949 sudo ip netns add ns4
5050 sudo ip netns add ns5
5151
52- # add each phy (interface) to separate network namesapces
52+ # add each phy (interface) to separate network namespaces
5353 sudo iw phy $vw0_phy set netns name ns0
5454 sudo iw phy $vw1_phy set netns name ns1
5555 sudo iw phy $vw2_phy set netns name ns2
@@ -77,7 +77,7 @@ if [ $final_ret -eq 0 ]; then
7777 sudo ip netns exec ns5 ip link set vw5 up
7878 sudo ip netns exec ns5 ip link set lo up
7979
80- # assing IP address to each interface
80+ # assign IP address to each interface
8181 sudo ip netns exec ns0 ip addr add 10.0.0.1/24 dev vw0
8282 sudo ip netns exec ns1 ip addr add 10.0.0.2/24 dev vw1
8383 sudo ip netns exec ns2 ip addr add 10.0.0.3/24 dev vw2
@@ -91,14 +91,14 @@ if [ $final_ret -eq 0 ]; then
9191 echo " ================================================================================"
9292 echo " Ping Test: STA vw1 (10.0.0.2) (not connected) <--> STA vw2 (10.0.0.3) (not connected)"
9393 echo
94- echo " (should fail, because they haven't connnected to AP vw0 (10.0.0.1))"
94+ echo " (should fail, because they haven't connected to AP vw0 (10.0.0.1))"
9595 echo " (be patient, it will take some time to route...)"
9696 echo " ================================================================================"
9797 sudo ip netns exec ns1 ping -c 1 10.0.0.3
9898
9999 # STA vw1 performs scan and connect to TestAP
100100 sudo ip netns exec ns1 iw dev vw1 scan > scan_result.log
101- cat scan_result.log | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | tail -n 1 > scan_bssid.log
101+ cat scan_result.log | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | tail -n 1 > scan_bssid.log
102102 sudo ip netns exec ns1 iw dev vw1 connect test
103103 sudo ip netns exec ns1 iw dev vw1 link | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' > connected.log
104104
@@ -114,7 +114,7 @@ if [ $final_ret -eq 0 ]; then
114114
115115 # STA vw2 performs scan and connect to TestAP
116116 sudo ip netns exec ns2 iw dev vw2 scan > scan_result.log
117- cat scan_result.log | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | tail -n 1 > scan_bssid.log
117+ cat scan_result.log | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | tail -n 1 > scan_bssid.log
118118 sudo ip netns exec ns2 iw dev vw2 connect test
119119 sudo ip netns exec ns2 iw dev vw2 link | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' > connected.log
120120
@@ -129,12 +129,12 @@ if [ $final_ret -eq 0 ]; then
129129 echo " =================================="
130130
131131 # ping test: STA vw1 (10.0.0.2) <--> STA vw2 (10.0.0.3),
132- # should success , packet will be relayed by AP vw0 (10.0.0.1)
132+ # should succeed , packet will be relayed by AP vw0 (10.0.0.1)
133133 echo
134134 echo " ================================================================================"
135135 echo " Ping Test: STA vw1 (10.0.0.2) (connected) <--> STA vw2 (10.0.0.3) (connected)"
136136 echo
137- echo " (should success , packet will be relay by AP vw0 (10.0.0.1))"
137+ echo " (should succeed , packet will be relayed by AP vw0 (10.0.0.1))"
138138 echo " ================================================================================"
139139 sudo ip netns exec ns1 ping -c 4 10.0.0.3
140140
@@ -145,12 +145,12 @@ if [ $final_ret -eq 0 ]; then
145145 fi
146146
147147 # ping test: STA vw2 (10.0.0.3) <--> AP vw0 (10.0.0.1),
148- # should success , packet will directly send/receive between STA and AP
148+ # should succeed , packet will directly send/receive between STA and AP
149149 echo
150150 echo " ================================================================================"
151- echo " Ping Test: STA vw1 (10.0.0.3) (connected) <--> AP vw0 (10.0.0.1)"
151+ echo " Ping Test: STA vw2 (10.0.0.3) (connected) <--> AP vw0 (10.0.0.1)"
152152 echo
153- echo " (should success , packet will directly send/receive between STA vw1 and AP vw0)"
153+ echo " (should succeed , packet will directly send/receive between STA vw2 and AP vw0)"
154154 echo " ================================================================================"
155155 sudo ip netns exec ns2 ping -c 4 10.0.0.1
156156
@@ -192,7 +192,7 @@ if [ $final_ret -eq 0 ]; then
192192 echo " ================================================================================"
193193 sudo ip netns exec ns3 ping -c 1 10.0.0.3
194194
195- # ping test: IBSS vw3 <--> IBSS vw5, should fail
195+ # ping test: IBSS test: - vw3 <--> IBSS vw5, should fail
196196 echo
197197 echo " ================================================================================"
198198 echo " Ping Test: IBSS vw3 (10.0.0.4) (in ibss1) <--> IBSS vw5 (10.0.0.6) (in ibss2)"
@@ -202,12 +202,12 @@ if [ $final_ret -eq 0 ]; then
202202 echo " ================================================================================"
203203 sudo ip netns exec ns3 ping -c 1 10.0.0.6
204204
205- # ping test: IBSS vw3 <--> IBSS vw4, should success
205+ # ping test: IBSS vw3 <--> IBSS vw4, should succeed
206206 echo
207207 echo " ================================================================================"
208208 echo " Ping Test: IBSS vw3 (10.0.0.4) (in ibss1) <--> IBSS vw4 (10.0.0.5) (in ibss1)"
209209 echo
210- echo " (should success )"
210+ echo " (should succeed )"
211211 echo " (be patient, it will take some time to route...)"
212212 echo " ================================================================================"
213213 sudo ip netns exec ns3 ping -c 1 10.0.0.5
@@ -225,14 +225,14 @@ if [ $final_ret -eq 0 ]; then
225225 uptime=$( echo " $uptime *1000000" | bc | awk -F " ." ' {print $1}' )
226226 diff=$(( tsf - uptime))
227227
228- # difference between tsf and uptime should less than 0.5 sec.
228+ # difference between tsf and uptime should be less than or equal to 0.5 sec.
229229 if [ " ${diff# -} " -gt 500000 ]; then
230230 final_ret=9
231231 fi
232232
233233 # plot the distribution of RSSI of vw0
234- echo -e " \n\n######## collecting RSSI information of vw0, please wait... ##########"
235- vw0_mac=$( sudo ip netns exec ns0 iw dev | grep -E ' vw0$' -A 3 | grep addr | awk ' {print $2}' )
234+ echo -e " \n " \n \n ## ###### collecting RSSI information of vw0, please wait... ##########"
235+ vw0_mac=$( sudo ip netns exec ns0 iw dev | grep -E ' vw0$' -A - 3 | grep addr | awk ' {print $2}' )
236236 counts=1000 # do get_station 1000 times
237237
238238 for i in $( seq 1 1 $counts ) ; do
276276
277277echo " FAILED (code: $final_ret )"
278278echo " ==== Test FAILED ===="
279- exit $final_ret
279+ exit $final_ret
0 commit comments