@@ -21,7 +21,7 @@ if [ $? -ne 0 ]; then
21
21
fi
22
22
23
23
if [ $final_ret -eq 0 ]; then
24
- # to avoid device or resource busy error
24
+ # To avoid device or resource busy error
25
25
sleep 0.5
26
26
27
27
# set transmit power (mBm)
@@ -49,7 +49,7 @@ if [ $final_ret -eq 0 ]; then
49
49
sudo ip netns add ns4
50
50
sudo ip netns add ns5
51
51
52
- # add each phy (interface) to separate network namesapces
52
+ # add each phy (interface) to separate network namespaces
53
53
sudo iw phy $vw0_phy set netns name ns0
54
54
sudo iw phy $vw1_phy set netns name ns1
55
55
sudo iw phy $vw2_phy set netns name ns2
@@ -77,7 +77,7 @@ if [ $final_ret -eq 0 ]; then
77
77
sudo ip netns exec ns5 ip link set vw5 up
78
78
sudo ip netns exec ns5 ip link set lo up
79
79
80
- # assing IP address to each interface
80
+ # assign IP address to each interface
81
81
sudo ip netns exec ns0 ip addr add 10.0.0.1/24 dev vw0
82
82
sudo ip netns exec ns1 ip addr add 10.0.0.2/24 dev vw1
83
83
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
91
91
echo " ================================================================================"
92
92
echo " Ping Test: STA vw1 (10.0.0.2) (not connected) <--> STA vw2 (10.0.0.3) (not connected)"
93
93
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))"
95
95
echo " (be patient, it will take some time to route...)"
96
96
echo " ================================================================================"
97
97
sudo ip netns exec ns1 ping -c 1 10.0.0.3
98
98
99
99
# STA vw1 performs scan and connect to TestAP
100
100
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
102
102
sudo ip netns exec ns1 iw dev vw1 connect test
103
103
sudo ip netns exec ns1 iw dev vw1 link | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' > connected.log
104
104
@@ -114,7 +114,7 @@ if [ $final_ret -eq 0 ]; then
114
114
115
115
# STA vw2 performs scan and connect to TestAP
116
116
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
118
118
sudo ip netns exec ns2 iw dev vw2 connect test
119
119
sudo ip netns exec ns2 iw dev vw2 link | grep -o -E ' ([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' > connected.log
120
120
@@ -129,12 +129,12 @@ if [ $final_ret -eq 0 ]; then
129
129
echo " =================================="
130
130
131
131
# 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)
133
133
echo
134
134
echo " ================================================================================"
135
135
echo " Ping Test: STA vw1 (10.0.0.2) (connected) <--> STA vw2 (10.0.0.3) (connected)"
136
136
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))"
138
138
echo " ================================================================================"
139
139
sudo ip netns exec ns1 ping -c 4 10.0.0.3
140
140
@@ -145,12 +145,12 @@ if [ $final_ret -eq 0 ]; then
145
145
fi
146
146
147
147
# 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
149
149
echo
150
150
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)"
152
152
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)"
154
154
echo " ================================================================================"
155
155
sudo ip netns exec ns2 ping -c 4 10.0.0.1
156
156
@@ -192,7 +192,7 @@ if [ $final_ret -eq 0 ]; then
192
192
echo " ================================================================================"
193
193
sudo ip netns exec ns3 ping -c 1 10.0.0.3
194
194
195
- # ping test: IBSS vw3 <--> IBSS vw5, should fail
195
+ # ping test: IBSS test: - vw3 <--> IBSS vw5, should fail
196
196
echo
197
197
echo " ================================================================================"
198
198
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
202
202
echo " ================================================================================"
203
203
sudo ip netns exec ns3 ping -c 1 10.0.0.6
204
204
205
- # ping test: IBSS vw3 <--> IBSS vw4, should success
205
+ # ping test: IBSS vw3 <--> IBSS vw4, should succeed
206
206
echo
207
207
echo " ================================================================================"
208
208
echo " Ping Test: IBSS vw3 (10.0.0.4) (in ibss1) <--> IBSS vw4 (10.0.0.5) (in ibss1)"
209
209
echo
210
- echo " (should success )"
210
+ echo " (should succeed )"
211
211
echo " (be patient, it will take some time to route...)"
212
212
echo " ================================================================================"
213
213
sudo ip netns exec ns3 ping -c 1 10.0.0.5
@@ -225,14 +225,14 @@ if [ $final_ret -eq 0 ]; then
225
225
uptime=$( echo " $uptime *1000000" | bc | awk -F " ." ' {print $1}' )
226
226
diff=$(( tsf - uptime))
227
227
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.
229
229
if [ " ${diff# -} " -gt 500000 ]; then
230
230
final_ret=9
231
231
fi
232
232
233
233
# 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}' )
236
236
counts=1000 # do get_station 1000 times
237
237
238
238
for i in $( seq 1 1 $counts ) ; do
276
276
277
277
echo " FAILED (code: $final_ret )"
278
278
echo " ==== Test FAILED ===="
279
- exit $final_ret
279
+ exit $final_ret
0 commit comments