#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
function report_test_usage {
echo "OAI CI VM script"
echo " Original Author: Raphael Defosseux"
echo ""
echo "Usage:"
echo "------"
echo " oai-ci-vm-tool report-test [OPTIONS]"
echo ""
command_options_usage
}
function analyzePingFiles {
for PING_CASE in $PING_LOGS
do
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 " Build Start Time (UTC) " >> ./test_simulator_results.html
echo " TEMPLATE_BUILD_TIME " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " GIT Repository " >> ./test_simulator_results.html
echo " $GIT_URL " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " " >> ./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 " " >> ./test_simulator_results.html
if [ $PU_TRIG -eq 1 ]
then
echo " " >> ./test_simulator_results.html
echo " Branch " >> ./test_simulator_results.html
echo " $SOURCE_BRANCH " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " Commit ID " >> ./test_simulator_results.html
echo " $SOURCE_COMMIT_ID " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
if [ -e .git/CI_COMMIT_MSG ]
then
echo " " >> ./test_simulator_results.html
echo " Commit Message " >> ./test_simulator_results.html
MSG=`cat .git/CI_COMMIT_MSG`
echo " $MSG " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
fi
if [ $MR_TRIG -eq 1 ]
then
echo " " >> ./test_simulator_results.html
echo " Source Branch " >> ./test_simulator_results.html
echo " $SOURCE_BRANCH " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " Source Commit ID " >> ./test_simulator_results.html
echo " $SOURCE_COMMIT_ID " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
if [ -e .git/CI_COMMIT_MSG ]
then
echo " " >> ./test_simulator_results.html
echo " Commit Message " >> ./test_simulator_results.html
MSG=`cat .git/CI_COMMIT_MSG`
echo " $MSG " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " Target Branch " >> ./test_simulator_results.html
echo " $TARGET_BRANCH " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " Target Commit ID " >> ./test_simulator_results.html
echo " $TARGET_COMMIT_ID " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
echo "
" >> ./test_simulator_results.html
echo "
Test Summary " >> ./test_simulator_results.html
ARCHIVES_LOC=archives/basic_sim/test
if [ -d $ARCHIVES_LOC ]
then
echo "
4G LTE Basic Simulator Check " >> ./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 "
" >> ./test_simulator_results.html
echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
else
echo "
" >> ./test_simulator_results.html
echo " TEST was a FAILURE! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
else
echo "
" >> ./test_simulator_results.html
echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
echo "
More details on Basic Simulator test results " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo " " >> ./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 " " >> ./test_simulator_results.html
TRANS_MODES=("fdd" "tdd")
BW_CASES=(05 10 20)
for TMODE in ${TRANS_MODES[@]}
do
echo " " >> ./test_simulator_results.html
if [[ $TMODE =~ .*fdd.* ]]
then
echo " Test in FDD " >> ./test_simulator_results.html
else
echo " Test in TDD " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
for BW in ${BW_CASES[@]}
do
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " " >> ./test_simulator_results.html
echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
echo " N/A " >> ./test_simulator_results.html
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "got UE capabilities for UE" $ENB_LOG`
if [ $NB_ENB_GOT_SYNC -eq 1 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
if [ $NB_ENB_GOT_SYNC -eq 1 ]
then
echo "- eNB --> got sync " >> ./test_simulator_results.html
else
echo "- eNB NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_UE_GOT_SYNC -eq 2 ]
then
echo "- UE --> got sync " >> ./test_simulator_results.html
else
echo "- UE NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
then
echo "- UE attached to eNB " >> ./test_simulator_results.html
else
echo "- UE NEVER attached to eNB " >> ./test_simulator_results.html
fi
NB_SEGFAULT_ENB=`egrep -i -c "Segmentation Fault" $ENB_LOG`
if [ $NB_SEGFAULT_ENB -ne 0 ]
then
echo "- eNB --> Segmentation Fault " >> ./test_simulator_results.html
fi
NB_SEGFAULT_UE=`egrep -i -c "Segmentation Fault" $UE_LOG`
if [ $NB_SEGFAULT_UE -ne 0 ]
then
echo "- UE --> Segmentation Fault " >> ./test_simulator_results.html
fi
NB_ASSERTION_ENB=`egrep -i -c "Assertion" $ENB_LOG`
if [ $NB_ASSERTION_ENB -ne 0 ]
then
echo "- eNB --> Assertion " >> ./test_simulator_results.html
awk 'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}' $ENB_LOG >> ./test_simulator_results.html
fi
NB_ASSERTION_UE=`egrep -i -c "Assertion" $UE_LOG`
if [ $NB_ASSERTION_UE -ne 0 ]
then
echo "- eNB --> Assertion " >> ./test_simulator_results.html
awk 'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}' $UE_LOG >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_ue.txt 2> /dev/null`
analyzePingFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}*iperf*client*txt 2> /dev/null`
analyzeIperfFiles
done
done
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
then
echo "
4G LTE Basic Simulator + FlexRan Controller Check " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
More details on Basic Simulator + Fleran Controller test results " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " Log File Name " >> ./test_simulator_results.html
echo " JSON Query Response " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
FLEXRAN_QUERIES=`ls $ARCHIVES_LOC/flexran_ctl_query_*log`
for QUERY in $FLEXRAN_QUERIES
do
echo " " >> ./test_simulator_results.html
NAME=`echo $QUERY | sed -e "s#$ARCHIVES_LOC/##"`
echo " $NAME " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
egrep -v "LOG_NAME|\-\-\-\-\-" $QUERY >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
done
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
ARCHIVES_LOC=archives/rf_sim/test
if [ -d $ARCHIVES_LOC ]
then
echo "
4G LTE RF Simulator Check " >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `egrep -c "LTE: TEST_OK" $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo "
" >> ./test_simulator_results.html
echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
else
echo "
" >> ./test_simulator_results.html
echo " TEST was a FAILURE! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
else
echo "
" >> ./test_simulator_results.html
echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
echo "
More details on 4G LTE RF Simulator test results " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo " " >> ./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 " " >> ./test_simulator_results.html
EPC_CONFIGS=("wS1 noS1")
TRANS_MODES=("fdd")
BW_CASES=(05 10)
for CN_CONFIG in ${EPC_CONFIGS[@]}
do
for TMODE in ${TRANS_MODES[@]}
do
for BW in ${BW_CASES[@]}
do
echo " " >> ./test_simulator_results.html
if [[ $CN_CONFIG =~ .*wS1.* ]]
then
echo " Test with EPC (aka withS1): ${TMODE} -- ${BW}MHz " >> ./test_simulator_results.html
else
echo " Test without EPC (aka noS1): ${TMODE} -- ${BW}MHz " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_enb.log
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " " >> ./test_simulator_results.html
echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
echo " N/A " >> ./test_simulator_results.html
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
if [[ $CN_CONFIG =~ .*noS1.* ]]
then
NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG`
fi
NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "Generating RRCConnectionReconfigurationComplete" $UE_LOG`
if [[ $CN_CONFIG =~ .*noS1.* ]]
then
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG`
else
NB_UE_TUNNEL_UP=`egrep -c "executing ifconfig oaitun_ue1" $UE_LOG`
fi
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "- eNB --> got sync " >> ./test_simulator_results.html
else
echo "- eNB NEVER got sync " >> ./test_simulator_results.html
fi
if [[ $CN_CONFIG =~ .*noS1.* ]]
then
if [ $NB_ENB_TUNNEL_UP -gt 0 ]
then
echo "- eNB mounted oaitun_enb1 interface " >> ./test_simulator_results.html
else
echo "- eNB NEVER mounted oaitun_enb1 interface " >> ./test_simulator_results.html
fi
fi
if [ $NB_UE_GOT_SYNC -gt 0 ]
then
echo "- LTE UE --> got sync " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo "- LTE UE attached to eNB " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER attached to eNB " >> ./test_simulator_results.html
fi
if [ $NB_UE_TUNNEL_UP -gt 0 ]
then
echo "- LTE UE mounted oaitun_ue1 interface " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER mounted oaitun_ue1 interface " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_ping*.log 2> /dev/null`
analyzePingFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl*client*txt | grep -v mbms 2> /dev/null`
analyzeIperfFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul*client*txt | grep -v mbms 2> /dev/null`
analyzeIperfFiles
done
done
done
# MBMS Case
CN_CONFIG="noS1"
TMODE="fdd"
BW_CASES=(05)
for BW in ${BW_CASES[@]}
do
echo " " >> ./test_simulator_results.html
echo " Test MBMS without EPC (aka noS1): ${TMODE} -- ${BW}MHz " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_enb_mbms.log
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " " >> ./test_simulator_results.html
echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
echo " N/A " >> ./test_simulator_results.html
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG`
NB_ENB_MTUNNEL_UP=`egrep -c "Interface oaitun_enm1 successfully configured" $ENB_LOG`
NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "Generating RRCConnectionReconfigurationComplete" $UE_LOG`
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG`
NB_UE_MTUNNEL_UP=`egrep -c "Interface oaitun_uem1 successfully configured" $UE_LOG`
NB_UE_MBMS_PUSH_MSG=`egrep -c "TRIED TO PUSH MBMS DATA TO" $UE_LOG`
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] && [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "- eNB --> got sync " >> ./test_simulator_results.html
else
echo "- eNB NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_TUNNEL_UP -gt 0 ]
then
echo "- eNB mounted oaitun_enb1 interface " >> ./test_simulator_results.html
else
echo "- eNB NEVER mounted oaitun_enb1 interface " >> ./test_simulator_results.html
fi
if [ $NB_ENB_MTUNNEL_UP -gt 0 ]
then
echo "- eNB mounted oaitun_enm1 interface " >> ./test_simulator_results.html
else
echo "- eNB NEVER mounted oaitun_enm1 interface " >> ./test_simulator_results.html
fi
if [ $NB_UE_GOT_SYNC -gt 0 ]
then
echo "- LTE UE --> got sync " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo "- LTE UE attached to eNB " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER attached to eNB " >> ./test_simulator_results.html
fi
if [ $NB_UE_TUNNEL_UP -gt 0 ]
then
echo "- LTE UE mounted oaitun_ue1 interface " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER mounted oaitun_ue1 interface " >> ./test_simulator_results.html
fi
if [ $NB_UE_MTUNNEL_UP -gt 0 ]
then
echo "- LTE UE mounted oaitun_uem1 interface " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER mounted oaitun_uem1 interface " >> ./test_simulator_results.html
fi
if [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
then
echo "- LTE UE tried to push ${NB_UE_MBMS_PUSH_MSG} MBMS DATA " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER pushed MBMS DATA " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
#PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_ping*.log 2> /dev/null`
#analyzePingFiles
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl*client*txt | grep -v mbms 2> /dev/null`
#analyzeIperfFiles
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul*client*txt | grep -v mbms 2> /dev/null`
#analyzeIperfFiles
done
# FeMBMS Case
CN_CONFIG="noS1"
TMODE="fdd"
BW_CASES=(05)
for BW in ${BW_CASES[@]}
do
echo " " >> ./test_simulator_results.html
echo " Test FeMBMS without EPC (aka noS1): ${TMODE} -- ${BW}MHz " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_enb_fembms.log
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " " >> ./test_simulator_results.html
echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
echo " N/A " >> ./test_simulator_results.html
#NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG`
NB_ENB_MTUNNEL_UP=`egrep -c "Interface oaitun_enm1 successfully configured" $ENB_LOG`
#NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG`
#NB_ENB_SYNCED_WITH_UE=`egrep -c "Generating RRCConnectionReconfigurationComplete" $UE_LOG`
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG`
NB_UE_MTUNNEL_UP=`egrep -c "Interface oaitun_uem1 successfully configured" $UE_LOG`
NB_UE_MBMS_PUSH_MSG=`egrep -c "TRIED TO PUSH MBMS DATA TO" $UE_LOG`
#if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] && [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
if [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
#if [ $NB_ENB_GOT_SYNC -gt 0 ]
#then
# echo "- eNB --> got sync " >> ./test_simulator_results.html
#else
# echo "- eNB NEVER got sync " >> ./test_simulator_results.html
#fi
if [ $NB_ENB_TUNNEL_UP -gt 0 ]
then
echo "- eNB mounted oaitun_enb1 interface " >> ./test_simulator_results.html
else
echo "- eNB NEVER mounted oaitun_enb1 interface " >> ./test_simulator_results.html
fi
if [ $NB_ENB_MTUNNEL_UP -gt 0 ]
then
echo "- eNB mounted oaitun_enm1 interface " >> ./test_simulator_results.html
else
echo "- eNB NEVER mounted oaitun_enm1 interface " >> ./test_simulator_results.html
fi
#if [ $NB_UE_GOT_SYNC -gt 0 ]
#then
# echo "- LTE UE --> got sync " >> ./test_simulator_results.html
#else
# echo "- LTE UE NEVER got sync " >> ./test_simulator_results.html
#fi
#if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
#then
# echo "- LTE UE attached to eNB " >> ./test_simulator_results.html
#else
# echo "- LTE UE NEVER attached to eNB " >> ./test_simulator_results.html
#fi
if [ $NB_UE_TUNNEL_UP -gt 0 ]
then
echo "- LTE UE mounted oaitun_ue1 interface " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER mounted oaitun_ue1 interface " >> ./test_simulator_results.html
fi
if [ $NB_UE_MTUNNEL_UP -gt 0 ]
then
echo "- LTE UE mounted oaitun_uem1 interface " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER mounted oaitun_uem1 interface " >> ./test_simulator_results.html
fi
if [ $NB_UE_MBMS_PUSH_MSG -gt 0 ]
then
echo "- LTE UE tried to push ${NB_UE_MBMS_PUSH_MSG} MBMS DATA " >> ./test_simulator_results.html
else
echo "- LTE UE NEVER pushed MBMS DATA " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
#PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_ping*.log 2> /dev/null`
#analyzePingFiles
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl*client*txt | grep -v mbms 2> /dev/null`
#analyzeIperfFiles
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul*client*txt | grep -v mbms 2> /dev/null`
#analyzeIperfFiles
done
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
5G NR RF Simulator Check " >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `egrep -c "5G-NR: TEST_OK" $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo "
" >> ./test_simulator_results.html
echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
else
echo "
" >> ./test_simulator_results.html
echo " TEST was a FAILURE! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
else
echo "
" >> ./test_simulator_results.html
echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
echo "
More details on 5G NR RF Simulator test results " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo " " >> ./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 " " >> ./test_simulator_results.html
EPC_CONFIGS=("noS1")
TRANS_MODES=("tdd")
BW_CASES=(106)
for CN_CONFIG in ${EPC_CONFIGS[@]}
do
for TMODE in ${TRANS_MODES[@]}
do
for BW in ${BW_CASES[@]}
do
echo " " >> ./test_simulator_results.html
if [[ $CN_CONFIG =~ .*wS1.* ]]
then
echo " Test with EPC (aka withS1): ${TMODE} -- ${BW}PRB " >> ./test_simulator_results.html
else
echo " Test without EPC (aka noS1): ${TMODE} -- ${BW}PRB " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
UE_LOG=`echo $ENB_LOG | sed -e "s#gnb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " " >> ./test_simulator_results.html
echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
echo " N/A " >> ./test_simulator_results.html
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfully configured" $ENB_LOG`
NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "Initial sync: starting PBCH detection" $UE_LOG`
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG`
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "- gNB --> got sync " >> ./test_simulator_results.html
else
echo "- gNB NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_TUNNEL_UP -gt 0 ]
then
echo "- gNB mounted oaitun_enb1 interface " >> ./test_simulator_results.html
else
echo "- gNB NEVER mounted oaitun_enb1 interface " >> ./test_simulator_results.html
fi
if [ $NB_UE_GOT_SYNC -gt 0 ]
then
echo "- NR UE --> got sync " >> ./test_simulator_results.html
else
echo "- NR UE NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo "- NR UE attached to gNB " >> ./test_simulator_results.html
else
echo "- NR UE NEVER attached to eNB " >> ./test_simulator_results.html
fi
if [ $NB_UE_TUNNEL_UP -gt 0 ]
then
echo "- NR UE mounted oaitun_ue1 interface " >> ./test_simulator_results.html
else
echo "- NR UE NEVER mounted oaitun_ue1 interface " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ping*.log 2> /dev/null`
analyzePingFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null`
analyzeIperfFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
analyzeIperfFiles
done
done
done
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
ARCHIVES_LOC=archives/l2_sim/test
if [ -d $ARCHIVES_LOC ]
then
echo "
4G LTE L2-NFAPI Simulator Check " >> ./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 "
" >> ./test_simulator_results.html
echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
else
echo "
" >> ./test_simulator_results.html
echo " TEST was a FAILURE! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
else
echo "
" >> ./test_simulator_results.html
echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
echo "
More details on L2-NFAPI Simulator test results " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo " " >> ./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 " " >> ./test_simulator_results.html
EPC_CONFIGS=("wS1" "noS1")
TRANS_MODES=("fdd")
BW_CASES=(05)
NB_USERS=(01 04)
for CN_CONFIG in ${EPC_CONFIGS[@]}
do
for TMODE in ${TRANS_MODES[@]}
do
for BW in ${BW_CASES[@]}
do
for UES in ${NB_USERS[@]}
do
echo " " >> ./test_simulator_results.html
if [[ $CN_CONFIG =~ .*wS1.* ]]
then
echo " Test with EPC (aka withS1): ${TMODE} -- ${BW}MHz -- ${UES} user(s) " >> ./test_simulator_results.html
else
echo " Test without EPC (aka noS1): ${TMODE} -- ${BW}MHz -- ${UES} user(s) " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_enb.log
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " " >> ./test_simulator_results.html
echo " $NAME_ENB --- $NAME_UE " >> ./test_simulator_results.html
echo " N/A " >> ./test_simulator_results.html
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "Sending NFAPI_START_RESPONSE" $UE_LOG`
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 2 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo " OK " >> ./test_simulator_results.html
else
echo " KO " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "- eNB --> got sync " >> ./test_simulator_results.html
else
echo "- eNB NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_UE_GOT_SYNC -gt 2 ]
then
echo "- UE --> got sync " >> ./test_simulator_results.html
else
echo "- UE NEVER got sync " >> ./test_simulator_results.html
fi
if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo "- UE attached to eNB " >> ./test_simulator_results.html
else
echo "- UE NEVER attached to eNB " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
fi
PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.log 2> /dev/null`
analyzePingFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null`
analyzeIperfFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
analyzeIperfFiles
done
done
done
done
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
ARCHIVES_LOC=archives/phy_sim/test
if [ -d $ARCHIVES_LOC ]
then
echo "
Physical Simulators Check " >> ./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 "
" >> ./test_simulator_results.html
echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
else
echo "
" >> ./test_simulator_results.html
echo " TEST was a FAILURE! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
else
echo "
" >> ./test_simulator_results.html
echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
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 " " >> ./test_simulator_results.html
XML_TESTS=`ls $ARCHIVES_LOC/*xml`
for XML_FILE in $XML_TESTS
do
echo " " >> ./test_simulator_results.html
NAME=`echo $XML_FILE | sed -e "s#$ARCHIVES_LOC/##"`
NB_TESTS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*tests='##" -e "s#' *time=.*##"`
NB_ERRORS=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*errors='##" -e "s#' *failures=.*##"`
NB_FAILURES=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*failures='##" -e "s#' *hostname=.*##"`
NB_SKIPPED=`egrep "testsuite errors" $XML_FILE | sed -e "s#^.*skipped='##" -e "s#' *tests=.*##"`
if [ $NB_ERRORS -eq 0 ] && [ $NB_FAILURES -eq 0 ]
then
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_simulator_results.html
done
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
More details on Physical Simulators test results " >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
echo "
Details " >> ./test_simulator_results.html
for XML_FILE in $XML_TESTS
do
echo "
" >> ./test_simulator_results.html
echo " " >> ./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 " " >> ./test_simulator_results.html
PREV_SECTION=0
PREV_TIME_IN_SECS=0
TESTCASES_LIST=`sed -e "s# #@#g" $XML_FILE | grep testcase`
for TESTCASE in $TESTCASES_LIST
do
NAME=`echo $TESTCASE | sed -e "s#^.*name='##" -e "s#'@description=.*##" | sed -e "s#@# #g"`
SECTION=`echo $NAME | sed -e "s#\..*##"`
if [ $SECTION != $PREV_SECTION ]
then
echo " " >> ./test_simulator_results.html
echo " \"$SECTION\" series " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
PREV_SECTION=$SECTION
PREV_TIME_IN_SECS=0
fi
DESC=`echo $TESTCASE | sed -e "s#^.*description='##" -e "s#'@Run_result=.*##" | sed -e "s#@# #g"`
RESULT=`echo $TESTCASE | sed -e "s#^.*RESULT='##" -e "s#'.*##" | sed -e "s#@# #g"`
TIME_IN_SECS=`echo $TESTCASE | sed -e "s#^.*time='##" -e "s#'@RESULT=.*##" | sed -e "s#@# #g" -e "s# s.*##"`
TIME=`echo "$TIME_IN_SECS - $PREV_TIME_IN_SECS" | bc -l | awk '{printf "%.2f s", $0}'`
PREV_TIME_IN_SECS=$TIME_IN_SECS
echo " " >> ./test_simulator_results.html
echo " $NAME " >> ./test_simulator_results.html
echo " $DESC " >> ./test_simulator_results.html
if [[ $RESULT =~ .*PASS.* ]]
then
echo " $RESULT " >> ./test_simulator_results.html
else
SPLITTED_LINE=`echo -e $TESTCASE | sed -e "s#@#\n#g"`
NB_RUNS=`echo -e "${SPLITTED_LINE}" | grep -v Run_result | egrep -c "Run_"`
NB_FAILS=`echo -e "${SPLITTED_LINE}" | grep -v Run_result | egrep -c "=FAIL"`
echo " ${RESULT} (${NB_FAILS}/${NB_RUNS}) " >> ./test_simulator_results.html
fi
echo " $TIME " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
done
echo "
" >> ./test_simulator_results.html
done
fi
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
}