Commit f32c0305 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: HTML reporting improvements with bootstrap usage

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 5994d448
......@@ -198,12 +198,18 @@ do
fi
done
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]
then
echo "Expecting $NB_PATTERN_FILES log files and found $NB_FOUND_FILES"
STATUS=-1
fi
if [ $STATUS -eq 0 ]
then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log
echo "STATUS seems OK"
else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log
echo "STATUS failed?"
fi
exit $STATUS
......@@ -670,9 +670,9 @@ class SSHConnection():
device_id = status_queue.get()
message = status_queue.get()
if (count < 0):
html_cell = "<pre>UE (" + device_id + ")\n" + message + "</pre>"
html_cell = '<pre style="background-color:white">UE (' + device_id + ')\n' + message + '</pre>'
else:
html_cell = "<pre>UE (" + device_id + ")\n" + message + ' in ' + str(count + 2) + ' seconds</pre>'
html_cell = '<pre style="background-color:white">UE (' + device_id + ')\n' + message + ' in ' + str(count + 2) + ' seconds</pre>'
html_queue.put(html_cell)
if (attach_status):
self.CreateHtmlTestRowQueue('N/A', 'OK', len(self.UEDevices), html_queue)
......@@ -955,7 +955,7 @@ class SSHConnection():
device_id = status_queue.get()
ip_addr = status_queue.get()
message = status_queue.get()
html_cell = "<pre>UE (" + device_id + ")\nIP Address : " + ip_addr + "\n" + message + "</pre>"
html_cell = '<pre style="background-color:white">UE (' + device_id + ')\nIP Address : ' + ip_addr + '\n' + message + '</pre>'
html_queue.put(html_cell)
if (ping_status):
self.CreateHtmlTestRowQueue(self.ping_args, 'OK', len(self.UEDevices), html_queue)
......@@ -1438,7 +1438,7 @@ class SSHConnection():
device_id = status_queue.get()
ip_addr = status_queue.get()
message = status_queue.get()
html_cell = "<pre>UE (" + device_id + ")\nIP Address : " + ip_addr + "\n" + message + "</pre>"
html_cell = '<pre>UE (' + device_id + ')\nIP Address : ' + ip_addr + '\n' + message + '</pre>'
html_queue.put(html_cell)
if (iperf_noperf and iperf_status):
self.CreateHtmlTestRowQueue(self.iperf_args, 'PERF NOT MET', len(self.UEDevices), html_queue)
......@@ -1923,9 +1923,13 @@ class SSHConnection():
self.htmlFile.write('<!DOCTYPE html>\n')
self.htmlFile.write('<html class="no-js" lang="en-US">\n')
self.htmlFile.write('<head>\n')
self.htmlFile.write(' <meta name="viewport" content="width=device-width, initial-scale=1">\n')
self.htmlFile.write(' <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">\n')
self.htmlFile.write(' <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>\n')
self.htmlFile.write(' <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>\n')
self.htmlFile.write(' <title>Test Results for TEMPLATE_JOB_NAME job build #TEMPLATE_BUILD_ID</title>\n')
self.htmlFile.write('</head>\n')
self.htmlFile.write('<body>\n')
self.htmlFile.write('<body><div class="container">\n')
self.htmlFile.write(' <table style="border-collapse: collapse; border: none;">\n')
self.htmlFile.write(' <tr style="border-collapse: collapse; border: none;">\n')
self.htmlFile.write(' <td style="border-collapse: collapse; border: none;">\n')
......@@ -2016,7 +2020,8 @@ class SSHConnection():
self.htmlFile.write(' <th bgcolor = "red" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">FAIL</font></th>\n')
self.htmlFile.write(' </tr>\n')
self.htmlFile.write(' </table>\n')
self.htmlFile.write('</body>\n')
self.htmlFile.write(' <div class="well well-lg">End of Test Report -- Copyright <span class="glyphicon glyphicon-copyright-mark"></span> 2018 <a href="http://www.openairinterface.org/">OpenAirInterface</a>. All Rights Reserved.</div>\n')
self.htmlFile.write('</div></body>\n')
self.htmlFile.write('</html>\n')
self.htmlFile.close()
self.htmlFooterCreated = False
......@@ -2061,7 +2066,8 @@ class SSHConnection():
result = re.search('showed|Reestablishment', self.htmleNBFailureMsg)
if result is not None:
cellBgColor = 'orange'
self.htmlFile.write(' <td bgcolor = "' + cellBgColor + '" colspan=' + str(self.htmlUEConnected) + '><pre>' + self.htmleNBFailureMsg + '</pre></td>\n')
self.htmlFile.write(' <td bgcolor = "' + cellBgColor + '" colspan=' + str(self.htmlUEConnected) + '><pre style="background-color:' +
cellBgColor + '">' + self.htmleNBFailureMsg + '</pre></td>\n')
self.htmleNBFailureMsg = ''
else:
i = 0
......@@ -2089,7 +2095,7 @@ class SSHConnection():
if (i < ue_status):
if (not ue_queue.empty()):
if (addOrangeBK):
self.htmlFile.write(' <td bgcolor = "orange" >' + str(ue_queue.get()) + '</td>\n')
self.htmlFile.write(' <td bgcolor = "orange" >' + str(ue_queue.get()).replace('white', 'orange') + '</td>\n')
else:
self.htmlFile.write(' <td>' + str(ue_queue.get()) + '</td>\n')
else:
......
......@@ -141,6 +141,23 @@ function details_table {
function summary_table_header {
echo " <h3>$1</h3>" >> ./build_results.html
if [ -f $2/build_final_status.log ]
then
if [ `grep -c BUILD_OK $2/build_final_status.log` -eq 1 ]
then
echo " <div class=\"alert alert-success\">" >> ./build_results.html
echo " <strong>BUILD was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./build_results.html
echo " <strong>BUILD was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html
fi
else
echo " <div class=\"alert alert-danger\">" >> ./build_results.html
echo " <strong>COULD NOT DETERMINE BUILD FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html
fi
echo " <table border = \"1\">" >> ./build_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
echo " <th>Element</th>" >> ./build_results.html
......@@ -198,7 +215,28 @@ function summary_table_footer {
}
function sca_summary_table_header {
echo " <h3>$1</h3>" >> ./build_results.html
echo " <h3>$2</h3>" >> ./build_results.html
NB_ERRORS=`egrep -c "severity=\"error\"" $1`
NB_WARNINGS=`egrep -c "severity=\"warning\"" $1`
if [ $NB_ERRORS -eq 0 ] && [ $NB_WARNINGS -eq 0 ]
then
echo " <div class=\"alert alert-success\">" >> ./build_results.html
echo " <strong>CPPCHECK found NO error and NO warning <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html
else
if [ $NB_ERRORS -eq 0 ]
then
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./build_results.html
echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html
fi
fi
echo " <button data-toggle=\"collapse\" data-target=\"#oai-cppcheck-details\">More details on CPPCHECK results</button>" >> ./build_results.html
echo " <div id=\"oai-cppcheck-details\" class=\"collapse\">" >> ./build_results.html
echo " <table border = \"1\">" >> ./build_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
echo " <th>Error / Warning Type</th>" >> ./build_results.html
......@@ -263,6 +301,7 @@ function sca_summary_table_footer {
echo " </table>" >> ./build_results.html
echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html
echo " <p style=\"margin-left: 30px\">Graphical Interface tool : <strong><code>cppcheck-gui -l cppcheck/cppcheck.xml</code></strong></p>" >> ./build_results.html
echo " </div>" >> ./build_results.html
}
function report_build {
......@@ -276,10 +315,14 @@ function report_build {
echo "<!DOCTYPE html>" > ./build_results.html
echo "<html class=\"no-js\" lang=\"en-US\">" >> ./build_results.html
echo "<head>" >> ./build_results.html
echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" >> ./build_results.html
echo " <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\">" >> ./build_results.html
echo " <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>" >> ./build_results.html
echo " <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>" >> ./build_results.html
echo " <title>Build Results for $JOB_NAME job build #$BUILD_ID</title>" >> ./build_results.html
echo " <base href = \"http://www.openairinterface.org/\" />" >> ./build_results.html
echo "</head>" >> ./build_results.html
echo "<body>" >> ./build_results.html
echo "<body><div class=\"container\">" >> ./build_results.html
echo " <table style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
echo " <tr style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
echo " <td style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
......@@ -344,33 +387,38 @@ function report_build {
if [ -f ./oai_rules_result.txt ]
then
echo " <h3>OAI Coding / Formatting Guidelines Check</h3>" >> ./build_results.html
echo " <table border = "1">" >> ./build_results.html
echo " <tr>" >> ./build_results.html
echo " <td bgcolor = \"lightcyan\" >Result:</td>" >> ./build_results.html
NB_FILES=`cat ./oai_rules_result.txt`
if [ $NB_FILES = "0" ]
then
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All files in repository follow OAI rules. </td>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All modified files in Merge-Request follow OAI rules.</td>" >> ./build_results.html; fi
echo " </tr>" >> ./build_results.html
echo " </table>" >> ./build_results.html
echo " <div class=\"alert alert-success\">" >> ./build_results.html
if [ $PU_TRIG -eq 1 ]; then echo " <strong>All files in repository follow OAI rules. <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <strong>All modified files in Merge-Request follow OAI rules. <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html; fi
echo " </div>" >> ./build_results.html
else
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES files in repository DO NOT follow OAI rules. </td>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES modified files in Merge-Request DO NOT follow OAI rules.</td>" >> ./build_results.html; fi
echo " </tr>" >> ./build_results.html
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
if [ $PU_TRIG -eq 1 ]; then echo " <strong>$NB_FILES files in repository DO NOT follow OAI rules. <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <strong>$NB_FILES modified files in Merge-Request DO NOT follow OAI rules. <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html; fi
echo " </div>" >> ./build_results.html
fi
if [ -f ./oai_rules_result_list.txt ]
then
awk '{print " <tr><td></td><td>"$1"</td></tr>"}' ./oai_rules_result_list.txt >> ./build_results.html
fi
echo " </table>" >> ./build_results.html
echo " <button data-toggle=\"collapse\" data-target=\"#oai-formatting-details\">More details on formatting check</button>" >> ./build_results.html
echo " <div id=\"oai-formatting-details\" class=\"collapse\">" >> ./build_results.html
echo " <p>Please apply the following command to this(ese) file(s): </p>" >> ./build_results.html
echo " <p style=\"margin-left: 30px\"><strong><code>astyle --options=ci-scripts/astyle-options.txt filename(s)</code></strong></p>" >> ./build_results.html
echo " <table border = 1>" >> ./build_results.html
echo " <tr>" >> ./build_results.html
echo " <th bgcolor = \"lightcyan\" >Filename</th>" >> ./build_results.html
echo " </tr>" >> ./build_results.html
awk '{print " <tr><td>"$1"</td></tr>"}' ./oai_rules_result_list.txt >> ./build_results.html
echo " </table>" >> ./build_results.html
echo " </div>" >> ./build_results.html
fi
fi
echo " <h2>Ubuntu 16.04 LTS -- Summary</h2>" >> ./build_results.html
sca_summary_table_header "OAI Static Code Analysis with CPPCHECK"
sca_summary_table_header ./archives/cppcheck/cppcheck.xml "OAI Static Code Analysis with CPPCHECK"
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized variable" uninitvar
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized struct member" uninitStructMember
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory leak" memleak
......@@ -382,20 +430,20 @@ function report_build {
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Expression depends on order of evaluation of side effects" unknownEvaluationOrder
sca_summary_table_footer ./archives/cppcheck/cppcheck.xml
summary_table_header "OAI Build eNB -- USRP option"
summary_table_header "OAI Build eNB -- USRP option" ./archives/enb_usrp
summary_table_row "LTE SoftModem - Release 14" ./archives/enb_usrp/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_row1.html
summary_table_row "Coding - Release 14" ./archives/enb_usrp/coding.Rel14.txt "Built target coding" ./enb_usrp_row2.html
summary_table_row "OAI USRP device if - Release 14" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_row4.html
summary_table_footer
summary_table_header "OAI Build basic simulator option"
summary_table_header "OAI Build basic simulator option" ./archives/basic_sim
summary_table_row "Basic Simulator eNb - Release 14" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html
summary_table_row "Basic Simulator UE - Release 14" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html
summary_table_row "Conf 2 UE data - Release 14" ./archives/basic_sim/conf2uedata.Rel14.txt "Built target conf2uedata" ./basic_sim_row3.html
summary_table_footer
summary_table_header "OAI Build Physical simulators option"
summary_table_header "OAI Build Physical simulators option" ./archives/phy_sim
summary_table_row "DL Simulator - Release 14" ./archives/phy_sim/dlsim.Rel14.txt "Built target dlsim" ./phy_sim_row1.html
summary_table_row "UL Simulator - Release 14" ./archives/phy_sim/ulsim.Rel14.txt "Built target ulsim" ./phy_sim_row2.html
summary_table_row "Coding - Release 14" ./archives/phy_sim/coding.Rel14.txt "Built target coding" ./phy_sim_row3.html
......@@ -404,7 +452,7 @@ function report_build {
if [ -f archives/gnb_usrp/nr-softmodem.Rel14.txt ]
then
summary_table_header "OAI Build gNB -- USRP option"
summary_table_header "OAI Build gNB -- USRP option" ./archives/gnb_usrp
summary_table_row "LTE SoftModem - Release 14" ./archives/gnb_usrp/nr-softmodem.Rel14.txt "Built target nr-softmodem" ./gnb_usrp_row1.html
summary_table_row "Coding - Release 14" ./archives/gnb_usrp/coding.Rel14.txt "Built target coding" ./gnb_usrp_row2.html
summary_table_row "OAI USRP device if - Release 14" ./archives/gnb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./gnb_usrp_row3.html
......@@ -414,7 +462,7 @@ function report_build {
if [ -f archives/nrue_usrp/nr-uesoftmodem.Rel14.txt ]
then
summary_table_header "OAI Build 5G NR UE -- USRP option"
summary_table_header "OAI Build 5G NR UE -- USRP option" ./archives/nrue_usrp
summary_table_row "UE SoftModem - Release 14" ./archives/nrue_usrp/nr-uesoftmodem.Rel14.txt "Built target nr-uesoftmodem" ./nrue_usrp_row1.html
summary_table_row "Coding - Release 14" ./archives/nrue_usrp/coding.Rel14.txt "Built target coding" ./nrue_usrp_row2.html
summary_table_row "OAI USRP device if - Release 14" ./archives/nrue_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./nrue_usrp_row3.html
......@@ -422,7 +470,7 @@ function report_build {
summary_table_footer
fi
summary_table_header "OAI Build eNB -- ETHERNET transport option"
summary_table_header "OAI Build eNB -- ETHERNET transport option" ./archives/enb_eth
summary_table_row "LTE SoftModem w/o S1 - Release 14" ./archives/enb_eth/lte-softmodem-nos1.Rel14.txt "Built target lte-softmodem" ./enb_eth_row1.html
summary_table_row "Coding - Release 14" ./archives/enb_eth/coding.Rel14.txt "Built target coding" ./enb_eth_row2.html
summary_table_row "OAI ETHERNET transport - Release 14" ./archives/enb_eth/oai_eth_transpro.Rel14.txt "Built target oai_eth_transpro" ./enb_eth_row3.html
......@@ -431,7 +479,7 @@ function report_build {
summary_table_row "NAS Mesh - Release 14" ./archives/enb_eth/nasmesh.Rel14.txt "Built target nasmesh" ./enb_eth_row6.html
summary_table_footer
summary_table_header "OAI Build UE -- ETHERNET transport option"
summary_table_header "OAI Build UE -- ETHERNET transport option" ./archives/ue_eth
summary_table_row "LTE UE SoftModem w/o S1 - Release 14" ./archives/ue_eth/lte-uesoftmodem-nos1.Rel14.txt "Built target lte-uesoftmodem" ./ue_eth_row1.html
summary_table_row "Coding - Release 14" ./archives/ue_eth/coding.Rel14.txt "Built target coding" ./ue_eth_row2.html
summary_table_row "OAI ETHERNET transport - Release 14" ./archives/ue_eth/oai_eth_transpro.Rel14.txt "Built target oai_eth_transpro" ./ue_eth_row3.html
......@@ -444,7 +492,7 @@ function report_build {
then
echo " <h2>Red Hat (CentOS Linux release 7.4.1708) -- Summary</h2>" >> ./build_results.html
summary_table_header "Red Hat -- OAI Build eNB -- USRP option"
summary_table_header "Red Hat -- OAI Build eNB -- USRP option" ./archives/red_hat
summary_table_row "LTE SoftModem - Release 14" ./archives/red_hat/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html
summary_table_row "Coding - Release 14" ./archives/red_hat/coding.Rel14.txt "Built target coding" ./enb_usrp_rh_row2.html
summary_table_row "OAI USRP device if - Release 14" ./archives/red_hat/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html
......@@ -453,6 +501,8 @@ function report_build {
fi
echo " <h3>Details</h3>" >> ./build_results.html
echo " <button data-toggle=\"collapse\" data-target=\"#oai-compilation-details\">Details for Compilation Errors and Warnings </button>" >> ./build_results.html
echo " <div id=\"oai-compilation-details\" class=\"collapse\">" >> ./build_results.html
for DETAILS_TABLE in `ls ./enb_usrp_row*.html`
do
......@@ -492,6 +542,8 @@ function report_build {
fi
rm -f ./*_row*.html
echo "</body>" >> ./build_results.html
echo " </div>" >> ./build_results.html
echo " <div class=\"well well-lg\">End of Build Report -- Copyright <span class=\"glyphicon glyphicon-copyright-mark\"></span> 2018 <a href=\"http://www.openairinterface.org/\">OpenAirInterface</a>. All Rights Reserved.</div>" >> ./build_results.html
echo "</div></body>" >> ./build_results.html
echo "</html>" >> ./build_results.html
}
......@@ -92,10 +92,14 @@ function report_test {
echo "<!DOCTYPE html>" > ./test_simulator_results.html
echo "<html class=\"no-js\" lang=\"en-US\">" >> ./test_simulator_results.html
echo "<head>" >> ./test_simulator_results.html
echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" >> ./test_simulator_results.html
echo " <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\">" >> ./test_simulator_results.html
echo " <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>" >> ./test_simulator_results.html
echo " <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>" >> ./test_simulator_results.html
echo " <title>Simulator Results for $JOB_NAME job build #$BUILD_ID</title>" >> ./test_simulator_results.html
echo " <base href = \"http://www.openairinterface.org/\" />" >> ./test_simulator_results.html
echo "</head>" >> ./test_simulator_results.html
echo "<body>" >> ./test_simulator_results.html
echo "<body><div class=\"container\">" >> ./test_simulator_results.html
echo " <table style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
echo " <tr style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
echo " <td style=\"border-collapse: collapse; border: none;\">" >> ./test_simulator_results.html
......@@ -162,6 +166,26 @@ function report_test {
then
echo " <h3>Basic Simulator Check</h3>" >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
echo " <button data-toggle=\"collapse\" data-target=\"#oai-basic-sim-test-details\">More details on Basic Simulator test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-basic-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
......@@ -360,11 +384,17 @@ function report_test {
done
echo " </table>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
then
echo " <h3>Basic Simulator + FlexRan Controller Check</h3>" >> ./test_simulator_results.html
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
echo " <button data-toggle=\"collapse\" data-target=\"#oai-flexran-test-details\">More details on Basic Simulator + Fleran Controller test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-flexran-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
......@@ -383,6 +413,7 @@ function report_test {
echo " </tr>" >> ./test_simulator_results.html
done
echo " </table>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
ARCHIVES_LOC=archives/phy_sim/test
......@@ -390,6 +421,24 @@ function report_test {
then
echo " <h3>Physical Simulators Check</h3>" >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
......@@ -422,6 +471,10 @@ function report_test {
done
echo " </table>" >> ./test_simulator_results.html
echo " <br>" >> ./test_simulator_results.html
echo " <button data-toggle=\"collapse\" data-target=\"#oai-phy-sim-test-details\">More details on Physical Simulators test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-phy-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <h4>Details</h4>" >> ./test_simulator_results.html
for XML_FILE in $XML_TESTS
......@@ -472,6 +525,8 @@ function report_test {
done
fi
echo "</body>" >> ./test_simulator_results.html
echo "</div>" >> ./test_simulator_results.html
echo " <div class=\"well well-lg\">End of Test Report -- Copyright <span class=\"glyphicon glyphicon-copyright-mark\"></span> 2018 <a href=\"http://www.openairinterface.org/\">OpenAirInterface</a>. All Rights Reserved.</div>" >> ./test_simulator_results.html
echo "</div></body>" >> ./test_simulator_results.html
echo "</html>" >> ./test_simulator_results.html
}
......@@ -441,6 +441,12 @@ function run_test_on_vm {
if [ $NB_RUNS -eq 0 ]; then STATUS=-1; fi
if [ $NB_FAILURES -ne 0 ]; then STATUS=-1; fi
if [ $STATUS -eq 0 ]
then
echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log
else
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
fi
fi
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]]
......@@ -580,6 +586,7 @@ function run_test_on_vm {
if [ $i -lt 50 ]
then
echo "Problem w/ starting ltebox EPC"
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
fi
......@@ -615,6 +622,7 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
......@@ -673,6 +681,7 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
......@@ -731,6 +740,7 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
......@@ -782,6 +792,7 @@ function run_test_on_vm {
then
echo "ERROR: compiling flexran controller on vm went wrong"
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
FLEXRAN_CTL_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#flexran-rtc#"`
......@@ -791,6 +802,7 @@ function run_test_on_vm {
then
echo "ERROR: Flexran Ctl VM is not alive"
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
uvt-kvm wait $FLEXRAN_CTL_VM_NAME --insecure
......@@ -825,6 +837,7 @@ function run_test_on_vm {
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 03_enb_ue_connected
......@@ -866,6 +879,7 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
......@@ -916,6 +930,7 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
......@@ -965,6 +980,7 @@ function run_test_on_vm {
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
exit -1
fi
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
......@@ -1027,5 +1043,11 @@ function run_test_on_vm {
if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi
if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi
if [ $STATUS -eq 0 ]
then
echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log
else
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
fi
fi
}
......@@ -165,7 +165,11 @@ function check_on_vm_build {
fi
done
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]
then
echo "Expecting $NB_PATTERN_FILES log files and found $NB_FOUND_FILES"
STATUS=-1
fi
# If we were building the FlexRan Controller, flag-touch for basic-simulator to continue
if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
......@@ -175,4 +179,11 @@ function check_on_vm_build {
touch $JENKINS_WKSP/flexran/flexran_build_complete.txt
fi
fi
if [[ $STATUS -eq 0 ]]
then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log
else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log
fi
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment