#!/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
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
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 "ip link set oaitun_ue1 up" $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
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
#RA test (--do-ra option)
#build log files names
RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_test.log
RA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_test.log
if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
then
#get rid of full path
NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo "
" >> ./test_simulator_results.html
echo "
$NAME_ENB --- $NAME_UE
" >> ./test_simulator_results.html
echo "
Check if RA proc succeeded
" >> ./test_simulator_results.html
#gNB RA check
GNB_RECEIVED=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $RA_ENB_LOG`
#UE RA check
UE_RA_PROC_OK=`egrep -c "\[RAPROC\] RA procedure succeeded" $RA_UE_LOG`
if [ $GNB_RECEIVED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ]
then
echo "
OK
" >> ./test_simulator_results.html
else
echo "
KO
" >> ./test_simulator_results.html
fi
echo "
" >> ./test_simulator_results.html
if [ $GNB_RECEIVED -gt 0 ]
then
echo "- gNB --> RA received" >> ./test_simulator_results.html
else
echo "- gNB RA NOT RECEIVED" >> ./test_simulator_results.html
fi
if [ $UE_RA_PROC_OK -gt 0 ]
then
echo "- NR UE --> RA procedure succeded" >> ./test_simulator_results.html
else
echo "- NR UE RA procedure failed" >> ./test_simulator_results.html
fi
echo "
" >> ./test_simulator_results.html
echo "
" >> ./test_simulator_results.html
fi
#SYNC test
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
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
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 "