| GIT Repository | \n') - self.htmlFile.write('' + SSH.eNBRepository + ' | \n') + self.htmlFile.write('' + SSH.eNBRepository + ' | \n') self.htmlFile.write('||||||||||
| Job Trigger | \n') @@ -1394,7 +1502,7 @@ class SSHConnection(): self.htmlFile.close() self.htmlFooterCreated = False - def CreateHtmlTestRow(self, options, status, ue_status): + def CreateHtmlTestRow(self, options, status, processesStatus): if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)): self.htmlFile.write('||||||||||||
| ' + SSH.testCase_id + ' | \n') @@ -1403,15 +1511,23 @@ class SSHConnection(): if (str(status) == 'OK'): self.htmlFile.write('' + str(status) + ' | \n') elif (str(status) == 'KO'): - self.htmlFile.write('' + str(status) + ' | \n') + if (processesStatus == 0): + self.htmlFile.write('' + str(status) + ' | \n') + elif (processesStatus == -1): + self.htmlFile.write('KO - eNB process not found | \n') + elif (processesStatus == -2): + self.htmlFile.write('KO - HSS process not found | \n') + elif (processesStatus == -3): + self.htmlFile.write('KO - MME process not found | \n') + elif (processesStatus == -4): + self.htmlFile.write('KO - SPGW process not found | \n') + else: + self.htmlFile.write('' + str(status) + ' | \n') else: self.htmlFile.write('' + str(status) + ' | \n') i = 0 while (i < self.htmlUEConnected): - if (i < ue_status): - self.htmlFile.write('- | \n') - else: - self.htmlFile.write('- | \n') + self.htmlFile.write('- | \n') i += 1 self.htmlFile.write('
" >> ./test_simulator_results.html
+echo " " >> ./test_simulator_results.html
+echo " " >> ./test_simulator_results.html
+echo " " >> ./test_simulator_results.html
+echo " " >> ./test_simulator_results.html
+echo " | " >> ./test_simulator_results.html
+echo " " >> ./test_simulator_results.html +echo " Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID" >> ./test_simulator_results.html +echo " | " >> ./test_simulator_results.html +echo "
| GIT Repository | " >> ./test_simulator_results.html +echo "$GIT_URL | " >> ./test_simulator_results.html +echo "|
| Job Trigger | " >> ./test_simulator_results.html +if [ $PU_TRIG -eq 1 ]; then echo "Push Event | " >> ./test_simulator_results.html; fi +if [ $MR_TRIG -eq 1 ]; then echo "Merge-Request | " >> ./test_simulator_results.html; fi +echo "
| Branch | " >> ./test_simulator_results.html + echo "$SOURCE_BRANCH | " >> ./test_simulator_results.html + echo "|
| Commit ID | " >> ./test_simulator_results.html + echo "$SOURCE_COMMIT_ID | " >> ./test_simulator_results.html + echo "|
| Source Branch | " >> ./test_simulator_results.html + echo "$SOURCE_BRANCH | " >> ./test_simulator_results.html + echo "|
| Source Commit ID | " >> ./test_simulator_results.html + echo "$SOURCE_COMMIT_ID | " >> ./test_simulator_results.html + echo "|
| Target Branch | " >> ./test_simulator_results.html + echo "$TARGET_BRANCH | " >> ./test_simulator_results.html + echo "|
| Target Commit ID | " >> ./test_simulator_results.html + echo "$TARGET_COMMIT_ID | " >> ./test_simulator_results.html + echo "
| Log File Name | " >> ./test_simulator_results.html + echo "Command | " >> ./test_simulator_results.html + echo "Status | " >> ./test_simulator_results.html + echo "Statistics | " >> ./test_simulator_results.html + echo "|||
|---|---|---|---|---|---|---|
| $NAME | " >> ./test_simulator_results.html + CMD=`egrep "COMMAND IS" $PING_CASE | sed -e "s#COMMAND IS: ##"` + echo "$CMD | " >> ./test_simulator_results.html + FILE_COMPLETE=`egrep -c "ping statistics" $PING_CASE` + if [ $FILE_COMPLETE -eq 0 ] + then + echo "KO | " >> ./test_simulator_results.html + echo "N/A | " >> ./test_simulator_results.html + else + NB_TR_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s# packets transmitted.*##"` + NB_RC_PACKETS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*packets transmitted, ##" -e "s# received,.*##"` + if [ $NB_TR_PACKETS -eq $NB_RC_PACKETS ] + then + echo "OK | " >> ./test_simulator_results.html + else + echo "KO | " >> ./test_simulator_results.html + fi + echo "" >> ./test_simulator_results.html
+ echo " " >> ./test_simulator_results.html
+ STATS=`egrep "packets transmitted" $PING_CASE | sed -e "s#^.*received, ##" -e "s#, time.*##" -e "s# packet loss##"`
+ echo "Packet Loss : $STATS" >> ./test_simulator_results.html
+ RTTMIN=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[1] " " $5}'`
+ echo "RTT Minimal : $RTTMIN" >> ./test_simulator_results.html
+ RTTAVG=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[2] " " $5}'`
+ echo "RTT Average : $RTTAVG" >> ./test_simulator_results.html
+ RTTMAX=`egrep "rtt min" $PING_CASE | awk '{split($4,a,"/"); print a[3] " " $5}'`
+ echo "RTT Maximal : $RTTMAX" >> ./test_simulator_results.html
+ echo " " >> ./test_simulator_results.html
+ echo " | " >> ./test_simulator_results.html
+ fi
+ echo "
| $NAME | " >> ./test_simulator_results.html + CMD=`egrep "COMMAND IS" $IPERF_CASE | sed -e "s#COMMAND IS: ##"` + echo "$CMD | " >> ./test_simulator_results.html + REQ_BITRATE=`echo $CMD | sed -e "s#^.*-b ##" -e "s#-i 1.*##"` + if [[ $REQ_BITRATE =~ .*K.* ]] + then + REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#K##"` + FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000.0" | bc -l` + fi + if [[ $REQ_BITRATE =~ .*M.* ]] + then + REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#M##"` + FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000.0" | bc -l` + fi + if [[ $REQ_BITRATE =~ .*G.* ]] + then + REQ_BITRATE=`echo $REQ_BITRATE | sed -e "s#G##"` + FLOAT_REQ_BITRATE=`echo "$REQ_BITRATE * 1000000000.0" | bc -l` + fi + FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE` + if [ $FILE_COMPLETE -eq 0 ] + then + echo "KO | " >> ./test_simulator_results.html + SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"` + FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'` + EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'` + PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` + JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'` + PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'` + PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"` + else + EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` + if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]] + then + EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Kbits/sec.*##"` + FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000" | bc -l` + fi + if [[ $EFFECTIVE_BITRATE =~ .*Mbits/sec.* ]] + then + EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Mbits/sec.*##"` + FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000" | bc -l` + fi + if [[ $EFFECTIVE_BITRATE =~ .*Gbits/sec.* ]] + then + EFFECTIVE_BITRATE=`echo $EFFECTIVE_BITRATE | sed -e "s# *Gbits/sec.*##"` + FLOAT_EFF_BITRATE=`echo "$EFFECTIVE_BITRATE * 1000000000" | bc -l` + fi + PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` + PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'` + if [[ $PERF_INT -lt 90 ]] + then + echo "KO | " >> ./test_simulator_results.html + else + echo "OK | " >> ./test_simulator_results.html + fi + EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` + JITTER=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*Mbits/sec *##" -e "s#ms.*#ms#"` + PACKETLOSS=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*(##" -e "s#).*##"` + fi + echo "" >> ./test_simulator_results.html
+ echo " " >> ./test_simulator_results.html + echo "Bitrate : $EFFECTIVE_BITRATE" >> ./test_simulator_results.html + echo "Bitrate Perf : $PERF %" >> ./test_simulator_results.html + echo "Jitter : $JITTER" >> ./test_simulator_results.html + echo "Packet Loss : $PACKETLOSS" >> ./test_simulator_results.html + echo "" >> ./test_simulator_results.html + echo " | " >> ./test_simulator_results.html
+ echo "
| Log File Name | " >> ./test_simulator_results.html + echo "Nb Tests | " >> ./test_simulator_results.html + echo "Nb Errors | " >> ./test_simulator_results.html + echo "Nb Failures | " >> ./test_simulator_results.html + echo "Nb Failures | " >> ./test_simulator_results.html + echo "|
|---|---|---|---|---|---|
| $NAME | " >> ./test_simulator_results.html + else + echo "$NAME | " >> ./test_simulator_results.html + fi + echo "$NB_TESTS | " >> ./test_simulator_results.html + echo "$NB_ERRORS | " >> ./test_simulator_results.html + echo "$NB_FAILURES | " >> ./test_simulator_results.html + echo "$NB_SKIPPED | " >> ./test_simulator_results.html + echo "
| Test Name | " >> ./test_simulator_results.html + echo "Description | " >> ./test_simulator_results.html + echo "Result | " >> ./test_simulator_results.html + echo "Time | " >> ./test_simulator_results.html + echo "|
|---|---|---|---|---|
| $NAME | " >> ./test_simulator_results.html + DESC=`echo $TESTCASE | sed -e "s#^.*description='##" -e "s#'@Run_result=.*##" | sed -e "s#@# #g"` + echo "$DESC | " >> ./test_simulator_results.html + RESULT=`echo $TESTCASE | sed -e "s#^.*RESULT='##" -e "s#'.*##" | sed -e "s#@# #g"` + if [[ $RESULT =~ .*PASS.* ]] + then + echo "$RESULT | " >> ./test_simulator_results.html + else + echo "$RESULT | " >> ./test_simulator_results.html + fi + TIME=`echo $TESTCASE | sed -e "s#^.*time='##" -e "s#'@RESULT=.*##" | sed -e "s#@# #g"` + echo "$TIME | " >> ./test_simulator_results.html + echo "