-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path\
92 lines (77 loc) · 2.38 KB
/
\
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
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("------------------------\n" + time.asctime() + "\n------------------------\n")
f.write("----- Start of serial test -----")
ip = args[0]
browser = args[1]
#
#test baud rate
#
baud_rate_options = ["2400", "4800", "9600", "19200", "38400", "57600", "115200"]
for baud_rate in baud_rate_options:
print "testing baud_rate " + baud_rate
callString = "./select.py '" + ip + " " + browser + " webinterface5.sh baud_rate " + baud_rate + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test data_bits
#
data_bit_options = ["5", "6", "7", "8"]
for data_bit in data_bit_options:
print "testing data_bit " + data_bit
callString = "./select.py '" + ip + " " + browser + " webinterface5.sh char_size " + data_bit + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test parity
#
parity_options = ["odd", "even", "none"]
for parity in parity_options:
print "testing parity " + parity
callString = "./select.py '" + ip + " " + browser + " webinterface5.sh parity " + parity + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test stop bits
#
stop_bit_options = ["1", "2"]
for stop_bit in stop_bit_options:
print "testing stop_bit " + stop_bit
callString = "./select.py '" + ip + " " + browser + " webinterface5.sh stop_bits " + stop_bit + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test sw_control_flow
#
sw_flow_options = ["Enable", "Disable"]
for sw_flow in sw_flow_options:
print "testing sw_flow_control " + sw_flow
callString = "./select.py '" + ip + " " + browser + " webinterface5.sh sw_flow_control " + sw_flow + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test hw_control_flow
#
hw_flow_options = ["Enable", "Disable"]
for hw_flow in hw_flow_options:
print "testing hw_flow_control " + hw_flow
callString = "./select.py '" + ip + " " + browser + " webinterface5.sh hw_flow_control " + hw_flow + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#end of advanced test
#
print "----- End of serial test -----"
f.write("----- End of serial test -----")
f.close()