Skip to content
Snippets Groups Projects
runTestOnVM.sh 122 KiB
Newer Older
    then
        ENB_SYNC=0
        echo "RF-SIM eNB is NOT sync'ed: process still alive?"
    else
        ENB_SYNC=1
        echo "RF-SIM eNB is sync'ed: waiting for UE(s) to connect"
    fi
    if [ $LOC_S1_CONFIGURATION -eq 0 ]
    then
        echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
        # Checking oaitun_enb1 interface has now an IP address
        i="0"
        while [ $i -lt 10 ]
        do
            CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1`
            if [ $CONNECTED -eq 1 ]
            then
                i="100"
            else
                i=$[$i+1]
                sleep 5
            fi
        done
        rm $1
        if [ $i -lt 50 ]
        then
            ENB_SYNC=0
            echo "RF-SIM eNB oaitun_enb1 is DOWN or NOT CONFIGURED"
        else
            echo "RF-SIM eNB oaitun_enb1 is UP and CONFIGURED"
        fi
        if [[ $LOC_CONF_FILE =~ .*mbms.* ]]
        then
            echo "ifconfig oaitun_enm1 | egrep -c \"inet addr\"" > $1
            # Checking oaitun_enm1 interface has now an IP address
            i="0"
            while [ $i -lt 10 ]
            do
                CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1`
                if [ $CONNECTED -eq 1 ]
                then
                    i="100"
                else
                    i=$[$i+1]
                    sleep 5
                fi
            done
            rm $1
            if [ $i -lt 50 ]
            then
                ENB_SYNC=0
                echo "RF-SIM eNB oaitun_enm1 is DOWN or NOT CONFIGURED"
            else
                echo "RF-SIM eNB oaitun_enm1 is UP and CONFIGURED"
            fi
        fi
    sleep 10
}

function start_rf_sim_ue {
    local LOC_UE_VM_IP_ADDR=$2
    local LOC_ENB_VM_IP_ADDR=$3
    local LOC_LOG_FILE=$4
    local LOC_PRB=$5
    local LOC_FREQUENCY=$6
    # 1 is with S1 and 0 without S1 aka noS1
    local LOC_S1_CONFIGURATION=$7
    local LOC_MBMS_CONFIGURATION=$8
    echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1
    echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
    echo "echo \"export RFSIMULATOR=${LOC_ENB_VM_IP_ADDR}\"" >> $1
    echo "export RFSIMULATOR=${LOC_ENB_VM_IP_ADDR}" >> $1
    echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
    echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    if [ $LOC_S1_CONFIGURATION -eq 0 ]
    then
        echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-lte-softmodem-run.sh " >> $1
        echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor\" > ./my-lte-softmodem-run.sh " >> $1
    fi
    echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
    echo "cat ./my-lte-softmodem-run.sh" >> $1
    echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
    echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1

    ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1
    rm $1

    local i="0"
    echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
    while [ $i -lt 10 ]
    do
        sleep 5
        CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1`
        if [ $CONNECTED -ne 0 ]
    rm $1
    if [ $i -lt 50 ]
    then
        UE_SYNC=0
        echo "RF-SIM UE is NOT sync'ed w/ eNB"
        return
    else
        echo "RF-SIM UE is sync'ed w/ eNB"
    fi
    # Checking oaitun_ue1 interface has now an IP address
    echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
    while [ $i -lt 10 ]
    do
        sleep 5
        CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1`
        if [ $CONNECTED -eq 1 ]
        then
            i="100"
        else
            i=$[$i+1]
        fi
    done
    echo "echo \"free -m\"" > $1
    echo "free -m" >> $1
    ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1
    rm $1
    if [ $i -lt 50 ]
    then
        UE_SYNC=0
        echo "RF-SIM UE oaitun_ue1 is DOWN or NOT CONFIGURED"
        echo "RF-SIM UE oaitun_ue1 is UP and CONFIGURED"
    if [ $LOC_MBMS_CONFIGURATION -eq 1 ]
    then
        # Checking oaitun_uem1 interface has now an IP address
        i="0"
        echo "ifconfig oaitun_uem1 | egrep -c \"inet addr\"" > $1
        while [ $i -lt 10 ]
        do
            sleep 5
            CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1`
            if [ $CONNECTED -eq 1 ]
            then
                i="100"
            else
                i=$[$i+1]
            fi
        done
        rm $1
        if [ $i -lt 50 ]
        then
            UE_SYNC=0
            echo "RF-SIM UE oaitun_uem1 is DOWN or NOT CONFIGURED"
        else
            echo "RF-SIM UE oaitun_uem1 is UP and CONFIGURED"
        fi
    fi
function start_rf_sim_gnb {
    local LOC_GNB_VM_IP_ADDR=$2
    local LOC_LOG_FILE=$3
    local LOC_NB_RBS=$4
    local LOC_CONF_FILE=$5
    # 1 is with S1 and 0 without S1 aka noS1
    local LOC_S1_CONFIGURATION=$6

    if [ -e rbconfig.raw ]; then rm -f rbconfig.raw; fi
    if [ -e reconfig.raw ]; then rm -f reconfig.raw; fi

    echo "cd /home/ubuntu/tmp" > $1
    echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1
    echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
    echo "echo \"source oaienv\"" >> $1
    echo "source oaienv" >> $1
    echo "cd ci-scripts/conf_files/" >> $1
    echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1
    #echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL                                         = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1
    #echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1
    #echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1
    echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
    echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    echo "sudo rm -f r*config.raw" >> $1
    if [ $LOC_S1_CONFIGURATION -eq 0 ]
    then
        echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
    fi
    echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
    echo "cat ./my-nr-softmodem-run.sh" >> $1
    echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
    echo "sudo -E daemon --inherit --unsafe --name=gnb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-nr-softmodem-run.sh" >> $1

    ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
    rm $1

    local i="0"
    echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
    while [ $i -lt 10 ]
    do
        sleep 5
        CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1`
        if [ $CONNECTED -ne 0 ]
        then
            i="100"
        else
            i=$[$i+1]
        fi
    done
    rm $1
    if [ $i -lt 50 ]
    then
        GNB_SYNC=0
        echo "RF-SIM gNB is NOT sync'ed: process still alive?"
    else
        GNB_SYNC=1
        echo "RF-SIM gNB is sync'ed: waiting for UE(s) to connect"
    fi
    if [ $LOC_S1_CONFIGURATION -eq 0 ]
    then
        echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
        # Checking oaitun_enb1 interface has now an IP address
        i="0"
        while [ $i -lt 10 ]
        do
            CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1`
            if [ $CONNECTED -eq 1 ]
            then
                i="100"
            else
                i=$[$i+1]
                sleep 5
            fi
        done
        rm $1
        if [ $i -lt 50 ]
        then
            GNB_SYNC=0
            echo "RF-SIM gNB oaitun_enb1 is DOWN or NOT CONFIGURED"
        else
            echo "RF-SIM gNB oaitun_enb1 is UP and CONFIGURED"
        fi
    fi
    sleep 10
    echo "echo \"free -m\"" > $1
    echo "free -m" >> $1
    ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
    rm $1
    # Copy the RAW files from the gNB run for the NR-UE
    scp -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/rbconfig.raw .
    scp -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/ran_build/build/reconfig.raw .
}

function start_rf_sim_nr_ue {
    local LOC_NR_UE_VM_IP_ADDR=$2
    local LOC_GNB_VM_IP_ADDR=$3
    local LOC_LOG_FILE=$4
    local LOC_PRB=$5
    local LOC_FREQUENCY=$6
    # 1 is with S1 and 0 without S1 aka noS1
    local LOC_S1_CONFIGURATION=$7

    # Copy the RAW files from the gNB run
    scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
    scp -o StrictHostKeyChecking=no reconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp

    echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1
    echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
    echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
    echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    echo "sudo cp /home/ubuntu/tmp/r*config.raw /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    echo "sudo chmod 666 /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1
    echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
    if [ $LOC_S1_CONFIGURATION -eq 0 ]
    then
        echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}  ./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
    fi
    echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
    echo "cat ./my-nr-softmodem-run.sh" >> $1
    echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
    echo "sudo -E daemon --inherit --unsafe --name=nr_ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-nr-softmodem-run.sh" >> $1

    ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
    rm $1

    local i="0"
    echo "egrep -c \"Initial sync: pbch decoded sucessfully\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
    while [ $i -lt 10 ]
    do
        sleep 5
        CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1`
        if [ $CONNECTED -ne 0 ]
        then
            i="100"
        else
            i=$[$i+1]
        fi
    done
    NR_UE_SYNC=1
    rm $1
    if [ $i -lt 50 ]
    then
        NR_UE_SYNC=0
        echo "RF-SIM NR-UE is NOT sync'ed w/ gNB"
        return
    else
        echo "RF-SIM NR-UE is sync'ed w/ gNB"
    fi
    # Checking oaitun_ue1 interface has now an IP address
    i="0"
    echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
    while [ $i -lt 10 ]
    do
        sleep 5
        CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1`
        if [ $CONNECTED -eq 1 ]
        then
            i="100"
        else
            i=$[$i+1]
        fi
    done
    echo "echo \"free -m\"" > $1
    echo "free -m" >> $1
    ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
    rm $1
    if [ $i -lt 50 ]
    then
        NR_UE_SYNC=0
        echo "RF-SIM NR-UE oaitun_ue1 is DOWN or NOT CONFIGURED"
    else
        echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED"
    fi
    sleep 10
}


function run_test_on_vm {
    echo "############################################################"
    echo "OAI CI VM script"
    echo "############################################################"
    if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* ))  ]] ||  [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* ))  ]]
        ENB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#enb-ethernet#" -e "s#rf-sim#enb-ethernet#"`
        ENB_VM_CMDS=${ENB_VM_NAME}_cmds.txt
        echo "ENB_VM_NAME         = $ENB_VM_NAME"
        echo "ENB_VM_CMD_FILE     = $ENB_VM_CMDS"
        UE_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#ue-ethernet#" -e "s#rf-sim#ue-ethernet#"`
        UE_VM_CMDS=${UE_VM_NAME}_cmds.txt
        echo "UE_VM_NAME          = $UE_VM_NAME"
        echo "UE_VM_CMD_FILE      = $UE_VM_CMDS"
        GNB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#gnb-usrp#" -e "s#rf-sim#gnb-usrp#"`
        GNB_VM_CMDS=${GNB_VM_NAME}_cmds.txt
        echo "GNB_VM_NAME         = $GNB_VM_NAME"
        echo "GNB_VM_CMD_FILE     = $GNB_VM_CMDS"
        NR_UE_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#nr-ue-usrp#" -e "s#rf-sim#nr-ue-usrp#"`
        NR_UE_VM_CMDS=${UE_VM_NAME}_cmds.txt
        echo "NR_UE_VM_NAME       = $NR_UE_VM_NAME"
        echo "NR_UE_VM_CMD_FILE   = $NR_UE_VM_CMDS"
    else
        echo "VM_NAME             = $VM_NAME"
        echo "VM_CMD_FILE         = $VM_CMDS"
    fi
    echo "JENKINS_WKSP        = $JENKINS_WKSP"
    echo "ARCHIVES_LOC        = $ARCHIVES_LOC"
    if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-l2-sim.* ))  ]] ||  [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* ))  ]]
    then
        echo "############################################################"
        echo "Waiting for ENB VM to be started"
        echo "############################################################"
        uvt-kvm wait $ENB_VM_NAME --insecure

        ENB_VM_IP_ADDR=`uvt-kvm ip $ENB_VM_NAME`
        echo "$ENB_VM_NAME has for IP addr = $ENB_VM_IP_ADDR"
        echo "############################################################"
        echo "Waiting for UE VM to be started"
        echo "############################################################"
        uvt-kvm wait $UE_VM_NAME --insecure

        UE_VM_IP_ADDR=`uvt-kvm ip $UE_VM_NAME`
        echo "$UE_VM_NAME has for IP addr = $UE_VM_IP_ADDR"

        echo "############################################################"
        echo "Waiting for GNB VM to be started"
        echo "############################################################"
        uvt-kvm wait $GNB_VM_NAME --insecure

        GNB_VM_IP_ADDR=`uvt-kvm ip $GNB_VM_NAME`
        echo "$GNB_VM_NAME has for IP addr = $GNB_VM_IP_ADDR"

        echo "############################################################"
        echo "Waiting for NR-UE VM to be started"
        echo "############################################################"
        uvt-kvm wait $NR_UE_VM_NAME --insecure

        NR_UE_VM_IP_ADDR=`uvt-kvm ip $NR_UE_VM_NAME`
        echo "$NR_UE_VM_NAME has for IP addr = $NR_UE_VM_IP_ADDR"
    else
        echo "############################################################"
        echo "Waiting for VM to be started"
        echo "############################################################"
        uvt-kvm wait $VM_NAME --insecure

        VM_IP_ADDR=`uvt-kvm ip $VM_NAME`
        echo "$VM_NAME has for IP addr = $VM_IP_ADDR"
    fi
    if [ "$RUN_OPTIONS" == "none" ]
        echo "No run on VM testing for this variant currently"
Raphael Defosseux's avatar
Raphael Defosseux committed
        return
    if [[ $RUN_OPTIONS =~ .*run_exec_autotests.* ]]
    then
        echo "############################################################"
        echo "Running test script on VM ($VM_NAME)"
        echo "############################################################"
        echo "echo \"sudo apt-get --yes --quiet install bc \"" > $VM_CMDS
        echo "sudo apt-get update > bc-install.txt 2>&1" >> $VM_CMDS
        echo "sudo apt-get --yes install bc >> bc-install.txt 2>&1" >> $VM_CMDS
        echo "cd tmp" >> $VM_CMDS
        echo "echo \"source oaienv\"" >> $VM_CMDS
        echo "source oaienv" >> $VM_CMDS
        echo "echo \"cd cmake_targets/autotests\"" >> $VM_CMDS
        echo "cd cmake_targets/autotests" >> $VM_CMDS
        echo "echo \"rm -Rf log\"" >> $VM_CMDS
        echo "rm -Rf log" >> $VM_CMDS
        echo "$RUN_OPTIONS" | sed -e 's@"@\\"@g' -e 's@^@echo "@' -e 's@$@"@' >> $VM_CMDS
        echo "$RUN_OPTIONS" >> $VM_CMDS
        echo "cp /home/ubuntu/bc-install.txt log" >> $VM_CMDS
        echo "cd log" >> $VM_CMDS
        echo "zip -r -qq tmp.zip *.* 0*" >> $VM_CMDS
        echo "echo \"############################################################\"" >> $VM_CMDS
        echo "echo \"Evaluating remaining memory on disk!\"" >> $VM_CMDS
        echo "echo \"############################################################\"" >> $VM_CMDS
        echo "echo \"df -h\"" >> $VM_CMDS
        echo "df -h" >> $VM_CMDS
        ssh -T -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS
        echo "############################################################"
        echo "Creating a tmp folder to store results and artifacts"
        echo "############################################################"
        if [ -d $ARCHIVES_LOC ]
        then
            rm -Rf $ARCHIVES_LOC
        fi
        mkdir --parents $ARCHIVES_LOC
        scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip $ARCHIVES_LOC
        pushd $ARCHIVES_LOC
        unzip -qq -DD tmp.zip
        rm tmp.zip
        if [ -f results_autotests.xml ]
        then
            FUNCTION=`echo $VM_NAME | sed -e "s@$VM_TEMPLATE@@"`
            NEW_NAME=`echo "results_autotests.xml" | sed -e "s@results_autotests@results_autotests-$FUNCTION@"`
            echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $NEW_NAME
            echo "<?xml-stylesheet type=\"text/xsl\" href=\"$FUNCTION.xsl\" ?>" >> $NEW_NAME
            cat results_autotests.xml >> $NEW_NAME
            sed -e "s@TEMPLATE@$FUNCTION@" $JENKINS_WKSP/ci-scripts/template.xsl > $FUNCTION.xsl
            #mv results_autotests.xml $NEW_NAME
            rm results_autotests.xml
        fi
        popd
        if [ $KEEP_VM_ALIVE -eq 0 ]
        then
            echo "############################################################"
            echo "############################################################"
            uvt-kvm destroy $VM_NAME
            ssh-keygen -R $VM_IP_ADDR

        echo "############################################################"
        echo "Checking run status"
        echo "############################################################"

        LOG_FILES=`ls $ARCHIVES_LOC/results_autotests*.xml`
        NB_FOUND_FILES=0
        NB_RUNS=0
        NB_FAILURES=0
        for FULLFILE in $LOG_FILES
        do
            TESTSUITES=`egrep "testsuite errors" $FULLFILE`
            for TESTSUITE in $TESTSUITES
            do
                if [[ "$TESTSUITE" == *"tests="* ]]
                then
                    RUNS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" `
                    NB_RUNS=$((NB_RUNS + RUNS))
                fi
                if [[ "$TESTSUITE" == *"failures="* ]]
                then
                    FAILS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" `
                    NB_FAILURES=$((NB_FAILURES + FAILS))
                fi
            done
            NB_FOUND_FILES=$((NB_FOUND_FILES + 1))
        done

        echo "NB_FOUND_FILES = $NB_FOUND_FILES"
        echo "NB_RUNS        = $NB_RUNS"
        echo "NB_FAILURES    = $NB_FAILURES"

        if [ $NB_FOUND_FILES -eq 0 ]; then STATUS=-1; fi
        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
    if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]]
        PING_STATUS=0
        IPERF_STATUS=0
        if [ -d $ARCHIVES_LOC ]
        then
            rm -Rf $ARCHIVES_LOC
        fi
        mkdir --parents $ARCHIVES_LOC
        # Creating a VM for EPC and installing SW
        EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"`
        EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt
        if [[ "$EPC_IPADDR" == "" ]]
        then
            # Creating a VM for EPC and installing SW
            install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS
            EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME`
            # Starting EPC
            start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
        else
            echo "We will use EPC on $EPC_IPADDR"
            EPC_VM_IP_ADDR=$EPC_IPADDR
        # Retrieve EPC real IP address
        retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
        TRANS_MODES=("fdd" "tdd")
        BW_CASES=(05 10 20)
        for TMODE in ${TRANS_MODES[@]}
        do
          for BW in ${BW_CASES[@]}
          do
              if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi

              if [[ $BW =~ .*05.* ]]; then PRB=25; fi
              if [[ $BW =~ .*10.* ]]; then PRB=50; fi
              if [[ $BW =~ .*20.* ]]; then PRB=100; fi
              if [[ $TMODE =~ .*fdd.* ]]; then FREQUENCY=2680; else FREQUENCY=2350; fi

              echo "############################################################"
              echo "Starting the eNB in ${TMODE}-${BW}MHz mode"
              echo "############################################################"
              CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_enb.log
              start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE $PRB lte-${TMODE}-basic-sim.conf none

              echo "############################################################"
              echo "Starting the UE in ${TMODE}-${BW}MHz mode"
              echo "############################################################"
              CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_ue.log
              start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY
              if [ $UE_SYNC -eq 0 ]
              then
                  echo "Problem w/ eNB and UE not syncing"
              get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1
              echo "############################################################"
              echo "Pinging the UE"
              echo "############################################################"
              PING_LOG_FILE=${TMODE}_${BW}MHz_ping_ue.txt
              ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0
              scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
              check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20

              # Not more testing in any TDD : too unstable
              if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*05.* ]]; then full_terminate; continue; fi
              if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then full_terminate; continue; fi
              if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi
              echo "############################################################"
              echo "Iperf DL"
              echo "############################################################"
              if [[ $TMODE =~ .*fdd.* ]]
              then
                  if [[ $BW =~ .*20.* ]]; then THROUGHPUT=12; else THROUGHPUT=10; fi
              else
                  THROUGHPUT=6
              fi
              CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_dl
              generic_iperf $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0
              scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
              scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
              check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT

              # Not more testing in FDD-20MHz : too unstable
              if [[ $TMODE =~ .*fdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi
              echo "############################################################"
              echo "Iperf UL"
              echo "############################################################"
              THROUGHPUT=2
              CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_ul
              generic_iperf $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0
              scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
              scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
              check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT

              full_terminate

          done
        done
        if [ -d $JENKINS_WKSP/flexran ]
        then
            echo "############################################################"
            echo "Flexran testing is possible"
            echo "############################################################"
            local j="0"
            while [ $j -lt 20 ]
            do
                if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
                then
                    echo "Found an proper flexran controller vm build"
                    j="100"
                else
                    j=$[$j+1]
                    sleep 30
                fi
            done
            if [ $j -lt 50 ]
            then
                echo "ERROR: compiling flexran controller on vm went wrong"
                terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
                echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
Raphael Defosseux's avatar
Raphael Defosseux committed
                STATUS=-1
                return
            fi
            FLEXRAN_CTL_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#flexran-rtc#"`
            FLEXRAN_CTL_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#flexran-rtc-cmds#"`
            IS_FLEXRAN_VM_ALIVE=`uvt-kvm list | grep -c $FLEXRAN_CTL_VM_NAME`
            if [ $IS_FLEXRAN_VM_ALIVE -eq 0 ]
            then
                echo "ERROR: Flexran Ctl VM is not alive"
                terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
                echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
Raphael Defosseux's avatar
Raphael Defosseux committed
                STATUS=-1
                return
            fi
            uvt-kvm wait $FLEXRAN_CTL_VM_NAME --insecure
            FLEXRAN_CTL_VM_IP_ADDR=`uvt-kvm ip $FLEXRAN_CTL_VM_NAME`

            echo "$FLEXRAN_CTL_VM_NAME has for IP addr = $FLEXRAN_CTL_VM_IP_ADDR"
            echo "FLEXRAN_CTL_VM_CMDS     = $FLEXRAN_CTL_VM_CMDS"
            echo "############################################################"
            echo "Starting the FLEXRAN CONTROLLER"
            echo "############################################################"
            start_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
            query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 01_no_enb_connected

            echo "############################################################"
            echo "Starting the eNB in FDD-5MHz mode with Flexran ON"
            echo "############################################################"
            CURRENT_ENB_LOG_FILE=fdd_05fMHz_enb.log
            start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-fdd-basic-sim.conf $FLEXRAN_CTL_VM_IP_ADDR
            query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 02_enb_connected

            echo "############################################################"
            echo "Starting the UE in FDD-5MHz mode"
            echo "############################################################"
            CURRENT_UE_LOG_FILE=fdd_05fMHz_ue.log
            start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2680
            if [ $UE_SYNC -eq 0 ]
            then
                echo "Problem w/ eNB and UE not syncing"
                terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0
                scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
                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_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
Raphael Defosseux's avatar
Raphael Defosseux committed
                STATUS=-1
                return
            fi
            query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 03_enb_ue_connected
            get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1

            sleep 30
            echo "############################################################"
            echo "Terminate enb/ue simulators"
            echo "############################################################"
            terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0
            scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
            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
            sleep 10

            echo "############################################################"
            echo "Stopping the FLEXRAN CONTROLLER"
            echo "############################################################"
            stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
            scp -o StrictHostKeyChecking=no ubuntu@$FLEXRAN_CTL_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/flexran_ctl_*.log $ARCHIVES_LOC
        fi

        echo "############################################################"
        echo "Terminate EPC"
        echo "############################################################"
        if [[ "$EPC_IPADDR" == "" ]]
        then
            terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
        fi
        echo "############################################################"
        echo "Checking run status"
        echo "############################################################"
        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
    if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
        if [ -d $ARCHIVES_LOC ]
        then
            rm -Rf $ARCHIVES_LOC
        fi
        mkdir --parents $ARCHIVES_LOC
        # Creating a VM for EPC and installing SW
            EPC_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#epc#"`
            EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt
            LTEBOX=0
            install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS
            EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME`
        fi
        #EPC_CONFIGS=("wS1" "noS1")
        #TRANS_MODES=("fdd" "tdd")
        #BW_CASES=(05 10 20)
        EPC_CONFIGS=("wS1" "noS1")
        TRANS_MODES=("fdd")
        BW_CASES=(05 10)
        for CN_CONFIG in ${EPC_CONFIGS[@]}
        do
          if [[ $CN_CONFIG =~ .*wS1.* ]]
          then
              if [[ "$EPC_IPADDR" ==  "" ]]
              then
                  echo "############################################################"
                  echo "Start EPC for the wS1 configuration"
                  echo "############################################################"
                  start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
                  # Retrieve EPC real IP address
                  retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
                  S1_NOS1_CFG=1
              else
                  echo "############################################################"
                  echo "Using external EPC " $EPC_IPADDR
                  echo "############################################################"
                  $EPC_VM_IP_ADDR=$EPC_IPADDR
                  S1_NOS1_CFG=1
                  LTEBOX=0
              fi
              if [[ "$EPC_IPADDR" ==  "" ]]
              then
                  echo "############################################################"
                  echo "Terminate EPC"
                  echo "############################################################"
                  terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
                  echo "############################################################"
                  echo "Running now in a no-S1 "
                  echo "############################################################"
                  S1_NOS1_CFG=0
          fi
          for TMODE in ${TRANS_MODES[@]}
          do
              if [[ $TMODE =~ .*fdd.* ]]
              then
                  CONF_FILE=enb.band7.tm1.50PRB.usrpb210.conf
                  FREQUENCY=2680
              else
                  CONF_FILE=enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf
                  FREQUENCY=2350
              fi
              for BW in ${BW_CASES[@]}
              do
                  if [[ $BW =~ .*05.* ]]; then PRB=25; fi
                  if [[ $BW =~ .*10.* ]]; then PRB=50; fi
                  if [[ $BW =~ .*20.* ]]; then PRB=100; fi

                  echo "############################################################"
                  echo "${CN_CONFIG} : Starting the eNB in ${TMODE}-${BW}MHz mode"
                  echo "############################################################"
                  CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb.log
                  start_rf_sim_enb $ENB_VM_CMDS "$ENB_VM_IP_ADDR" "$EPC_VM_IP_ADDR" $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG

                  echo "############################################################"
                  echo "${CN_CONFIG} : Starting the UE"
                  echo "############################################################"
                  CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ue.log
                  start_rf_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 0
                  if [ $UE_SYNC -eq 0 ]
                  then
                      echo "Problem w/ eNB and UE not syncing"
                      terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1
                      terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2
                      scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
                      #if [ $S1_NOS1_CFG -eq 1 ]
                      #then
                      #    terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
                      #fi
                      # Now we keep running
                  if [ $S1_NOS1_CFG -eq 1 ]
                  then
                      get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1

                      echo "############################################################"
                      echo "${CN_CONFIG} : Pinging the EPC from UE"
                      echo "############################################################"
                      PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_epc.log
                      ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE 1 0
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
                      check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
                  else
                      get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR

                      echo "############################################################"
                      echo "${CN_CONFIG} : Pinging the eNB from UE"
                      echo "############################################################"
                      PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_enb_from_ue.log
                      ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE 1 0
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
                      check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
                  fi

                  if [ $S1_NOS1_CFG -eq 1 ]
                  then
                      echo "############################################################"
                      echo "${CN_CONFIG} : Pinging the UE from EPC"
                      echo "############################################################"
                      PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_ue.log
                      ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0
                      scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
                      check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
                  else
                      echo "############################################################"
                      echo "${CN_CONFIG} : Pinging the UE from eNB"
                      echo "############################################################"
                      get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1
                      PING_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ping_from_enb_ue.log
                      ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0
                      scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
                      check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
                  fi

                      echo "############################################################"
                      echo "${CN_CONFIG} : iperf DL -- UE is server and EPC is client"
                      echo "############################################################"
                      IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl
                      get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1
                      THROUGHPUT=10
                      generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC
                      scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC
                      check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT

                      echo "############################################################"
                      echo "${CN_CONFIG} : iperf UL -- EPC is server and UE is client"
                      echo "############################################################"
                      IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul
                      THROUGHPUT=2
                      get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1
                      generic_iperf $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0
                      scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC
                      check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT
                  else
                      echo "############################################################"
                      echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client"
                      echo "############################################################"
                      get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR
                      IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_dl
                      get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1
                      generic_iperf $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC
                      scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC
                      check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT

                      echo "############################################################"
                      echo "${CN_CONFIG} : iperf UL -- eNB is server and UE is client"
                      echo "############################################################"
                      IPERF_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_iperf_ul
                      THROUGHPUT=2
                      get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR 1
                      generic_iperf $ENB_VM_CMDS $ENB_VM_IP_ADDR $ENB_IP_ADDR $UE_VM_CMDS $UE_VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $IPERF_LOG_FILE 1 0
                      scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_server.txt $ARCHIVES_LOC
                      scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/${IPERF_LOG_FILE}_client.txt $ARCHIVES_LOC
                      check_iperf $ARCHIVES_LOC/$IPERF_LOG_FILE $THROUGHPUT
                  fi

                  echo "############################################################"
                  echo "${CN_CONFIG} : Terminate enb/ue simulators"
                  echo "############################################################"
                  terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1
                  terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2
                  scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
                  scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC

              done
          done
        done
        ####################
        ## MSMS CASE noS1 ##
        ####################
        CONF_FILE=lte-fdd-mbms-basic-sim.conf
        CN_CONFIG="noS1"
        S1_NOS1_CFG=0
        LTEBOX=0
        TMODE="fdd"
        FREQUENCY=2680
        BW_CASES=(05)
        MBMS_STATUS=0

        for BW in ${BW_CASES[@]}
        do
            if [[ $BW =~ .*05.* ]]; then PRB=25; fi
            if [[ $BW =~ .*10.* ]]; then PRB=50; fi
            if [[ $BW =~ .*20.* ]]; then PRB=100; fi

            echo "############################################################"
            echo "${CN_CONFIG} : Starting the eNB with MSMS in ${TMODE}-${BW}MHz mode"
            echo "############################################################"
            CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_enb_mbms.log
            start_rf_sim_enb $ENB_VM_CMDS "$ENB_VM_IP_ADDR" "$EPC_VM_IP_ADDR" $CURRENT_ENB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG

            echo "############################################################"
            echo "${CN_CONFIG} : Starting the UE"
            echo "############################################################"
            CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${CN_CONFIG}_ue_mbms.log
            start_rf_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1
            if [ $UE_SYNC -eq 0 ]
            then
                echo "Problem w/ eNB and UE not syncing"
                terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR 1
                terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR 2
                scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC