mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
lf_check.py : updated paths in report so path does not have to be edited
Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
@@ -35,6 +35,7 @@ TO DO NOTES:
|
|||||||
6/14/2021 :
|
6/14/2021 :
|
||||||
1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output.
|
1. add server (telnet localhost 4001) build info, GUI build sha, and Kernel version to the output.
|
||||||
2. add unique database prior to each run
|
2. add unique database prior to each run
|
||||||
|
3. note the symbolic link at 192.168.100.201:/var/www/html/html-reports is pointing to /home/lanforge/html-reports
|
||||||
|
|
||||||
'''
|
'''
|
||||||
import datetime
|
import datetime
|
||||||
@@ -141,6 +142,8 @@ class lf_check():
|
|||||||
report_url = report_url[1:]
|
report_url = report_url[1:]
|
||||||
# following recommendation
|
# following recommendation
|
||||||
# NOTE: https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-nic-in-python
|
# NOTE: https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-from-nic-in-python
|
||||||
|
# Mail
|
||||||
|
# command to check if mail running : systemctl status postfix
|
||||||
#command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com'
|
#command = 'echo "$HOSTNAME mail system works!" | mail -s "Test: $HOSTNAME $(date)" chuck.rekiere@candelatech.com'
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
ip = socket.gethostbyname(hostname)
|
ip = socket.gethostbyname(hostname)
|
||||||
@@ -629,16 +632,17 @@ NOTE: for now to see stdout and stderr remove /home/lanforge from path.
|
|||||||
self.logger.info("TIMEOUT FAILURE, Check LANforge Radios")
|
self.logger.info("TIMEOUT FAILURE, Check LANforge Radios")
|
||||||
self.test_result = "Time Out"
|
self.test_result = "Time Out"
|
||||||
background = self.background_purple
|
background = self.background_purple
|
||||||
|
# stdout_log_link is used for the email reporting to have the corrected path
|
||||||
|
stdout_log_link = str(stdout_log_txt).replace('/home/lanforge','')
|
||||||
|
stderr_log_link = str(stderr_log_txt).replace('/home/lanforge','')
|
||||||
self.html_results += """
|
self.html_results += """
|
||||||
<tr><td>""" + str(test) + """</td><td class='scriptdetails'>""" + str(command) + """</td>
|
<tr><td>""" + str(test) + """</td><td class='scriptdetails'>""" + str(command) + """</td>
|
||||||
<td style="""+ str(background) + """>""" + str(self.test_result) + """
|
<td style="""+ str(background) + """>""" + str(self.test_result) + """
|
||||||
<td><a href=""" + str(stdout_log_txt) + """ target=\"_blank\">STDOUT</a></td>"""
|
<td><a href=""" + str(stdout_log_link) + """ target=\"_blank\">STDOUT</a></td>"""
|
||||||
if self.test_result == "Failure":
|
if self.test_result == "Failure":
|
||||||
self.html_results += """<td><a href=""" + str(stderr_log_txt) + """ target=\"_blank\">STDERR</a></td>"""
|
self.html_results += """<td><a href=""" + str(stderr_log_link) + """ target=\"_blank\">STDERR</a></td>"""
|
||||||
elif self.test_result == "Time Out":
|
elif self.test_result == "Time Out":
|
||||||
self.html_results += """<td><a href=""" + str(stderr_log_txt) + """ target=\"_blank\">STDERR</a></td>"""
|
self.html_results += """<td><a href=""" + str(stderr_log_link) + """ target=\"_blank\">STDERR</a></td>"""
|
||||||
#self.html_results += """<td></td>"""
|
|
||||||
else:
|
else:
|
||||||
self.html_results += """<td></td>"""
|
self.html_results += """<td></td>"""
|
||||||
self.html_results += """</tr>"""
|
self.html_results += """</tr>"""
|
||||||
|
|||||||
Reference in New Issue
Block a user