-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_advanced.py
executable file
·201 lines (190 loc) · 6.64 KB
/
test_advanced.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#!/usr/bin/python
import subprocess, time
import jsonrpclib
import fileinput
import sys
if __name__ == '__main__':
args = sys.argv[1].split(" ")
#args[0] --- radio_ip
#args[1] --- browser
#
#
#write current time into output file
#
f = open('outputfile', 'a')
f.write("------------------------" + time.asctime() + "------------------------\n")
f.write("----- Start of advanced test -----\n")
ip = args[0]
browser = args[1]
#
#test link distance
#
distance_value = ["500"]
for distance in distance_value:
print "testing link_distance " + distance
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh link_distance " + distance + "'"
#callString = "./textfield.py '172.20.4.180 firefox webinterface2.sh link_distance " + str(distance) + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test rts_disable
#
rts_cts = ["Enable", "Disable"]
for E_D in rts_cts:
print "testing rts_disable " + E_D
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh rts_disable " + E_D + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test threshold
#
thresholds = ["1600", "800", "400", "200"]
for threshold in thresholds:
print "testing fragmentation threshold " + threshold
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh aggr_thresh " + threshold + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test max_gound_speed
#
max_speeds = ["0", "2", "10", "20", "40", "70"]
for max_speed in max_speeds:
print "testing max_ground_speed " + max_speed
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh max_speed " + max_speed + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test burst time
#
burst_times = ["2", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"]
for burst_time in burst_times:
print "testing burst_time " + burst_time
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh burst_time " + burst_time + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test encryption_disable
#
encryption_disable = ["Disable", "Enable"]
for enc_disable in encryption_disable:
print "testing enc_disable " + enc_disable
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh enc_disable " + enc_disable + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test enc_key_len
#
enc_key_lens = ["128", "256"]
for enc_key_len in enc_key_lens:
print "testing enc_key_len " + enc_key_len
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh enc_key_len " + enc_key_len + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test enc_key
#
enc_key = ["silvus745"]
for key in enc_key:
print "testing enc_key " + key
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh enc_key " + key + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#disable encryption_disable
#
enc_disable = ["Disable"]
for en_disable in enc_disable:
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh enc_disable " + en_disable + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test mcs
#
mcs_options = ["Auto", "mcs0", "mcs1", "mcs2", "mcs3", "mcs4", "mcs8", "mcs9", "mcs10", "mcs11", "mcs12", "mcs16", "mcs17", "mcs18", "mcs19", "mcs20", "mcs24", "mcs25", "mcs26", "mcs27", "mcs28"]
for mcs in mcs_options:
print "testing mcs " + mcs
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh class0_mcs " + mcs + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test phytest
#
phytest_options = ["Network", "PHY"]
for phytest in phytest_options:
print "testing phytest " + phytest
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh phytest " + phytest + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test virtual ip
#
virtual_ip_disable = ["Disable", "Enable"]
for virtual_disable in virtual_ip_disable:
print "testing virtual_ip_disable " + virtual_disable
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh vir_ip_disable " + virtual_disable + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
vir_addrs = ["192.168.10.254", "192.168.10.253"]
for vir_addr in vir_addrs:
print "testing virtual_ip_address " + vir_addr
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh vir_addr " + vir_addr + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
vir_netmasks = ["255.255.255.0"]
for vir_netmask in vir_netmasks:
print "testing virtual_ip_netmask " + vir_netmask
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh vir_netmask " + vir_netmask + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
vir_gws = ["192.168.10.1"]
for vir_gw in vir_gws:
print "testing virtual_ip_gw " + vir_gw
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh vir_gw " + vir_gw + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#disable
vir_ip_disable = ["Disable"]
for vir_disable in vir_ip_disable:
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh vir_ip_disable " + vir_disable + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test vpn
#
vpn_disable_options = ["Disable", "Enable"]
for vpn_disable in vpn_disable_options:
print "testing vpn_disable " + vpn_disable
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh vpn_disable " + vpn_disable + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test vpn_ip
#
vpn_ip_options = ["10.0.1.4"]
for vpn_ip in vpn_ip_options:
print "testing vpn_ip " + vpn_ip
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh vpn_addr " + vpn_ip + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test vpn_port
#
vpn_port_options = ["9000"]
for vpn_port in vpn_port_options:
print "testing vpn_port " + vpn_port
callString = "./textfield.py '" + ip + " " + browser + " webinterface2.sh vpn_addr " + vpn_port + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#disable
disable_vpn = ["Disable"]
for vpn_d in disable_vpn:
callString = "./select.py '" + ip + " " + browser + " webinterface2.sh vpn_disable " + vpn_d + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#end of advanced test
#
print "----- End of advanced test -----"
f.write("------------------------" + time.asctime() + "------------------------\n")
f.write("----- End of advanced test -----\n\n")
f.close()