-
Notifications
You must be signed in to change notification settings - Fork 0
/
Network-wide.py
123 lines (113 loc) · 3.95 KB
/
Network-wide.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
#!/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
#args[2] --- node_id
#
#write current time into output file
#
f = open('outputfile', 'a')
f.write("------------------------" + time.asctime() + "------------------------\n")
f.write("----- Start of Network-wide test -----\n")
f.close()
ip = args[0]
browser = args[1]
node_id = args[2]
'''
#
#test freq select
#
frequencies = [2420,2440,2452,2466.666667,2480,2492,4942.5,4947.5,4952.5,4955,4957.5,4960,4962.5,4967.5,4972.5,4975,4977.5,4982.5,4987.5,5120,5745,5765,5785,5805,5825]
for freqline in frequencies:
freq = str(freqline)
print "testing frequency " + freq
callString = "./net_select.py '" + ip + " " + browser + " Network-wide freq " + freq + " " + node_id + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
'''
#
#test bw select
#
bw_options = ["5", "20"]
for bw in bw_options:
print "testing bandwidth " + bw
callString = "./net_select.py '" + ip + " " + browser + " Network-wide bw " + bw + " " + node_id + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test transmit power
#
power_dBm_options = ["0", "10", "12", "18", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"]
for power_dBm in power_dBm_options:
print "testing power_dBm " + power_dBm
callString = "./net_select.py '" + ip + " " + browser + " Network-wide txpower " + power_dBm + " " + node_id + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test link distance
#
distance_value = ["500"]
for distance in distance_value:
print "testing link_distance " + distance
callString = "./net_textfield.py '" + ip + " " + browser + " Network-wide link_distance " + distance + " " + node_id + "'"
#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 = "./net_select.py '" + ip + " " + browser + " Network-wide rts_disable " + E_D + " " + node_id + "'"
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 = "./net_select.py '" + ip + " " + browser + " Network-wide aggr_thresh " + threshold + " " + node_id + "'"
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 = "./net_select.py '" + ip + " " + browser + " Network-wide max_speed " + max_speed + " " + node_id + "'"
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 = "./net_select.py '" + ip + " " + browser + " Network-wide burst_time " + burst_time + " " + node_id + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test
#
mcs_options = ["Auto", "0", "1", "2", "3", "4", "8", "9", "10", "11", "12", "16", "17", "18", "19", "20", "24", "25", "26", "27", "28"]
for mcs in mcs_options:
print "testing mcs " + mcs
callString = "./net_select.py '" + ip + " " + browser + " Network-wide mcs " + mcs + " " + node_id + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#end of Network-wide test
#
print "----- End of Network-wide test -----"
f = open('outputfile', 'a')
f.write("------------------------" + time.asctime() + "------------------------\n")
f.write("----- End of Network-wide test -----\n\n")
f.close()