-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_diagnostics.py
executable file
·125 lines (121 loc) · 4.45 KB
/
test_diagnostics.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
#!/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 diagnostics test -----\n")
ip = args[0]
browser = args[1]
#
#test temp reporting mode
#
temp_mode_options = ["Disable", "heating", "periodically"]
for temp_mode in temp_mode_options:
print "testing temp_mode " + temp_mode
callString = "./select.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_mode " + temp_mode + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test temp reporting ip
#
temp_report_ip_options = ["192.168.10.207"]
for temp_report_ip in temp_report_ip_options:
print "testing temp_report_ip " + temp_report_ip
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_ip " + temp_report_ip + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test temp report port
#
temp_report_port_options = [ "9000" ]
for temp_report_port in temp_report_port_options:
print "testing temp_report_port " + temp_report_port
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_port " + temp_report_port + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test min temp threshold
#
min_temp_threshold_options = ["70", "75"]
for min_temp_threshold in min_temp_threshold_options:
print "testing min_temp_threshold " + min_temp_threshold
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_min_threshold " + min_temp_threshold + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test max temp threshold
#
max_temp_threshold_options = ["85", "90"]
for max_temp_threshold in max_temp_threshold_options:
print "testing max_temp_threshold " + max_temp_threshold
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_max_threshold " + max_temp_threshold + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test temp report period
#
temp_period_options = ["5", "10"]
for temp_period in temp_period_options:
print "testing temp_report_period " + temp_period
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_period " + temp_period + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#disable report
temp_mode_options2 = ["Disable"]
for temp_mode2 in temp_mode_options2:
callString = "./select.py '" + ip + " " + browser + " webinterface7.sh temp_reporting_mode " + temp_mode2 + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test rssi report mode
#
rssi_report_mode_options = ["Disable", "Enable"]
for rssi_report_mode in rssi_report_mode_options:
print "testing rssi_report_mode " + rssi_report_mode
callString = "./select.py '" + ip + " " + browser + " webinterface7.sh rssi_report_enable " + rssi_report_mode + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test rssi ip
#
rssi_report_ip_options = ["192.168.10.207"]
for rssi_report_ip in rssi_report_ip_options:
print "testing rssi_report_ip " + rssi_report_ip
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh rssi_report_ip " + rssi_report_ip + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test rssi port
#
rssi_report_port_options = [ "9000" ]
for rssi_report_port in rssi_report_port_options:
print "testing rssi_report_port " + rssi_report_port
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh rssi_report_port " + rssi_report_port + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#test rssi report period
#
rssi_report_period_options = [ "5", "10" ]
for rssi_report_period in rssi_report_period_options:
print "testing rssi_report_period " + rssi_report_period
callString = "./textfield.py '" + ip + " " + browser + " webinterface7.sh rssi_report_period " + rssi_report_period + "'"
proc = subprocess.Popen(callString, shell=True)
proc.wait()
#
#end of serial test
#
print "----- End of diagnostics test -----"
f.write("------------------------" + time.asctime() + "------------------------\n")
f.write("----- End of diagnostics test -----\n\n")
f.close()