From db4bce547f2e66d7ceb67e3c0d9065284c7f4c10 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 22 Mar 2019 16:34:44 +0100 Subject: [PATCH 01/44] CI: running l2-nfapi-simulator on 2 separate VM Signed-off-by: Raphael Defosseux --- .../conf_files/rcc.band7.tm1.nfapi.conf | 16 +-- ci-scripts/conf_files/ue.nfapi.conf | 14 +- ci-scripts/oai-ci-vm-tool | 28 ++-- ci-scripts/runTestOnVM.sh | 121 ++++++++++++------ 4 files changed, 112 insertions(+), 67 deletions(-) diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 40fba82f9c..52c0593d1b 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -201,13 +201,13 @@ eNBs = MACRLCs = ( { num_cc = 1; - local_s_if_name = "lo:"; - remote_s_address = "127.0.0.1"; - local_s_address = "127.0.0.2"; - local_s_portc = 50001; - remote_s_portc = 50000; - local_s_portd = 50011; - remote_s_portd = 50010; + local_s_if_name = "ens3"; + remote_s_address = "CI_UE_IP_ADDR"; + local_s_address = "CI_ENB_IP_ADDR"; + local_s_portc = 50001; + remote_s_portc = 50000; + local_s_portd = 50011; + remote_s_portd = 50010; tr_s_preference = "nfapi"; tr_n_preference = "local_RRC"; } @@ -216,7 +216,7 @@ MACRLCs = ( THREAD_STRUCT = ( { #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + parallel_config = "PARALLEL_SINGLE_THREAD"; #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" worker_config = "WORKER_ENABLE"; } diff --git a/ci-scripts/conf_files/ue.nfapi.conf b/ci-scripts/conf_files/ue.nfapi.conf index ea0236cab4..a5584f20f9 100644 --- a/ci-scripts/conf_files/ue.nfapi.conf +++ b/ci-scripts/conf_files/ue.nfapi.conf @@ -20,13 +20,13 @@ L1s = ( { num_cc = 1; tr_n_preference = "nfapi"; - local_n_if_name = "lo"; - remote_n_address = "127.0.0.2"; - local_n_address = "127.0.0.1"; - local_n_portc = 50000; - remote_n_portc = 50001; - local_n_portd = 50010; - remote_n_portd = 50011; + local_n_if_name = "ens3"; + remote_n_address = "CI_ENB_IP_ADDR"; + local_n_address = "CI_UE_IP_ADDR"; + local_n_portc = 50000; + remote_n_portc = 50001; + local_n_portd = 50010; + remote_n_portd = 50011; } ); diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 917b0e7491..909975d060 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -270,26 +270,28 @@ case $key in ;; -v7) VM_NAME=ci-enb-ethernet + VM_MEMORY=4096 + VM_CPU=4 ARCHIVES_LOC=enb_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=8 - BUILD_OPTIONS="--eNB -t ETHERNET --noS1" + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--eNB -t ETHERNET" NBARGS=$[$NBARGS+256] shift ;; -v8) VM_NAME=ci-ue-ethernet + VM_MEMORY=4096 + VM_CPU=4 ARCHIVES_LOC=ue_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=8 - BUILD_OPTIONS="--UE -t ETHERNET --noS1" + NB_PATTERN_FILES=10 + BUILD_OPTIONS="--UE -t ETHERNET" NBARGS=$[$NBARGS+256] shift ;; -v9) VM_NAME=ci-l2-sim - VM_MEMORY=8192 - VM_CPU=8 ARCHIVES_LOC=l2_sim LOG_PATTERN=.Rel14.txt NB_PATTERN_FILES=6 @@ -349,24 +351,26 @@ case $key in ;; enb-ethernet) VM_NAME=ci-enb-ethernet + VM_MEMORY=4096 + VM_CPU=4 ARCHIVES_LOC=enb_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=8 - BUILD_OPTIONS="--eNB -t ETHERNET --noS1" + NB_PATTERN_FILES=6 + BUILD_OPTIONS="--eNB -t ETHERNET" NBARGS=$[$NBARGS+256] ;; ue-ethernet) VM_NAME=ci-ue-ethernet + VM_MEMORY=4096 + VM_CPU=4 ARCHIVES_LOC=ue_eth LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=8 - BUILD_OPTIONS="--UE -t ETHERNET --noS1" + NB_PATTERN_FILES=10 + BUILD_OPTIONS="--UE -t ETHERNET" NBARGS=$[$NBARGS+256] ;; l2-sim) VM_NAME=ci-l2-sim - VM_MEMORY=8192 - VM_CPU=8 ARCHIVES_LOC=l2_sim LOG_PATTERN=.Rel14.txt NB_PATTERN_FILES=6 diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 8d2c5cda06..05464560d8 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -536,11 +536,12 @@ function build_ue_on_separate_folder { } function start_l2_sim_enb { - local LOC_VM_IP_ADDR=$2 + local LOC_ENB_VM_IP_ADDR=$2 local LOC_EPC_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_NB_RBS=$5 - local LOC_CONF_FILE=$6 + local LOC_UE_VM_IP_ADDR=$4 + local LOC_LOG_FILE=$5 + local LOC_NB_RBS=$6 + local LOC_CONF_FILE=$7 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 @@ -548,7 +549,7 @@ function start_l2_sim_enb { 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_VM_IP_ADDR#' 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/lte_build_oai/build/\"" >> $1 @@ -560,7 +561,7 @@ function start_l2_sim_enb { 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=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 + ssh -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1 rm $1 local i="0" @@ -568,7 +569,7 @@ function start_l2_sim_enb { while [ $i -lt 10 ] do sleep 5 - CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1` + CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_ENB_VM_IP_ADDR < $1` if [ $CONNECTED -ne 0 ] then i="100" @@ -589,19 +590,25 @@ function start_l2_sim_enb { } function start_l2_sim_ue { - local LOC_VM_IP_ADDR=$2 - local LOC_LOG_FILE=$3 - local LOC_CONF_FILE=$4 - echo "echo \"cd /home/ubuntu/tmp-ue/cmake_targets/lte_build_oai/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp-ue/cmake_targets/lte_build_oai/build/" >> $1 - echo "cd /home/ubuntu/tmp-ue/cmake_targets/lte_build_oai/build/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp-ue/ci-scripts/conf_files/$LOC_CONF_FILE --L2-emul 3 --num-ues 1\" > ./my-lte-softmodem-run.sh " >> $1 + local LOC_UE_VM_IP_ADDR=$2 + local LOC_ENB_VM_IP_ADDR=$3 + local LOC_LOG_FILE=$4 + local LOC_CONF_FILE=$5 + 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 "cd /home/ubuntu/tmp/ci-scripts/conf_files/" >> $1 + echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 + echo "sed -i -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 \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 + echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues 1\" > ./my-lte-softmodem-run.sh " >> $1 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-ue/cmake_targets/lte_build_oai/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 + echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/lte_build_oai/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 + ssh -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 rm $1 local i="0" @@ -609,7 +616,7 @@ function start_l2_sim_ue { while [ $i -lt 10 ] do sleep 5 - CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1` + CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` if [ $CONNECTED -eq 1 ] then i="100" @@ -633,7 +640,7 @@ function start_l2_sim_ue { while [ $i -lt 10 ] do sleep 5 - CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1` + CONNECTED=`ssh -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1` if [ $CONNECTED -eq 1 ] then i="100" @@ -657,18 +664,49 @@ function run_test_on_vm { echo "############################################################" echo "OAI CI VM script" echo "############################################################" - echo "VM_NAME = $VM_NAME" - echo "VM_CMD_FILE = $VM_CMDS" + if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-l2-sim.* ]] + then + ENB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-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#"` + UE_VM_CMDS=${UE_VM_NAME}_cmds.txt + echo "ENB_VM_NAME = $ENB_VM_NAME" + echo "ENB_VM_CMD_FILE = $ENB_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" - echo "############################################################" - echo "Waiting for VM to be started" - echo "############################################################" - uvt-kvm wait $VM_NAME --insecure + if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-l2-sim.* ]] + then + echo "############################################################" + echo "Waiting for ENB VM to be started" + echo "############################################################" + uvt-kvm wait $ENB_VM_NAME --insecure - VM_IP_ADDR=`uvt-kvm ip $VM_NAME` - echo "$VM_NAME has for IP addr = $VM_IP_ADDR" + 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" + 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" ] then @@ -1270,7 +1308,7 @@ function run_test_on_vm { mkdir --parents $ARCHIVES_LOC # Building UE elsewhere in VM - build_ue_on_separate_folder $VM_CMDS $VM_IP_ADDR + #build_ue_on_separate_folder $VM_CMDS $VM_IP_ADDR # Creating a VM for EPC and installing SW EPC_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#l2-epc#"` @@ -1289,19 +1327,20 @@ function run_test_on_vm { echo "Starting the eNB in FDD-5MHz mode" echo "############################################################" CURRENT_ENB_LOG_FILE=fdd_05MHz_enb.log - start_l2_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf echo "############################################################" echo "Starting the UEs" echo "############################################################" CURRENT_UE_LOG_FILE=fdd_05MHz_ue.log - start_l2_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - 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 + terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR + terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log STATUS=-1 @@ -1312,21 +1351,21 @@ function run_test_on_vm { echo "Pinging the EPC from UE" echo "############################################################" PING_LOG_FILE=fdd_05MHz_ping_epc.txt - ping_epc_ip_addr $VM_CMDS $VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE + 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 echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR - 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 + terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR + terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 echo "############################################################" echo "Terminate EPC" echo "############################################################" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR if [ $KEEP_VM_ALIVE -eq 0 ] @@ -1334,8 +1373,10 @@ function run_test_on_vm { echo "############################################################" echo "Destroying VMs" echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR + uvt-kvm destroy $ENB_VM_NAME + ssh-keygen -R $ENB_VM_IP_ADDR + uvt-kvm destroy $UE_VM_NAME + ssh-keygen -R $UE_VM_IP_ADDR uvt-kvm destroy $EPC_VM_NAME ssh-keygen -R $EPC_VM_IP_ADDR fi From 6271ca3705999811b57100ee8b4b9b7b4f461552 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 27 Mar 2019 17:37:10 +0100 Subject: [PATCH 02/44] CI: Improvement to 4 users -- EPC lists are expended to 16 users -- UE .u* files are regenerated on demand -- ping still one UE from EPC CI: pipeline improvement -- L2-Sim is no more a build variant One VM less to be created Signed-off-by: Raphael Defosseux --- ci-scripts/add_user_to_conf_file.awk | 33 ++++++ ci-scripts/add_user_to_subscriber_list.awk | 27 +++++ ci-scripts/oai-ci-vm-tool | 30 ++++-- ci-scripts/runTestOnVM.sh | 112 +++++++++++++++++++-- 4 files changed, 185 insertions(+), 17 deletions(-) create mode 100644 ci-scripts/add_user_to_conf_file.awk create mode 100644 ci-scripts/add_user_to_subscriber_list.awk diff --git a/ci-scripts/add_user_to_conf_file.awk b/ci-scripts/add_user_to_conf_file.awk new file mode 100644 index 0000000000..b338d5e7ac --- /dev/null +++ b/ci-scripts/add_user_to_conf_file.awk @@ -0,0 +1,33 @@ +BEGIN{lineIdx=0;captureUEDesc=0} +{ + if ($0 ~/UE0/) { + captureUEDesc = 1 + } + if (captureUEDesc == 1) { + captureLine[lineIdx] = $0 + lineIdx = lineIdx + 1 + } + print $0 +} +END { + for (ueIdx = 1; ueIdx < num_ues; ueIdx++) { + print "" + for (k = 0; k < lineIdx; k++) { + if (captureLine[k] ~/UE0/) { + mLine = captureLine[k] + gsub("UE0", "UE"ueIdx, mLine) + print mLine + } else { + if (captureLine[k] ~/MSIN=/) { + mLine = captureLine[k] + MSIN=sprintf("%08d", 1111+int(ueIdx)) + gsub("00001111", MSIN, mLine) + print mLine + } else { + print captureLine[k] + } + } + + } + } +} diff --git a/ci-scripts/add_user_to_subscriber_list.awk b/ci-scripts/add_user_to_subscriber_list.awk new file mode 100644 index 0000000000..1e25990f59 --- /dev/null +++ b/ci-scripts/add_user_to_subscriber_list.awk @@ -0,0 +1,27 @@ +BEGIN{lineIdx=0} +{ + captureLine[lineIdx] = $0 + lineIdx = lineIdx + 1 + print $0 +} +END{ + for (ueIdx = 1; ueIdx < num_ues; ueIdx++) { + for (k = 0; k < lineIdx; k++) { + if (captureLine[k] ~/UserName=/) { + mLine = captureLine[k] + MSIN=sprintf("%08d", 1111+int(ueIdx)) + gsub("00001111", MSIN, mLine) + print mLine + } else { + if (captureLine[k] ~/SubscriptionIndex/) { + mLine = captureLine[k] + MSIN=sprintf("%d", 111+int(ueIdx)) + gsub("111", MSIN, mLine) + print mLine + } else { + print captureLine[k] + } + } + } + } +} diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 909975d060..364e70d714 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -293,9 +293,6 @@ case $key in -v9) VM_NAME=ci-l2-sim ARCHIVES_LOC=l2_sim - LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET" RUN_OPTIONS="complex" NBARGS=$[$NBARGS+256] shift @@ -372,9 +369,6 @@ case $key in l2-sim) VM_NAME=ci-l2-sim ARCHIVES_LOC=l2_sim - LOG_PATTERN=.Rel14.txt - NB_PATTERN_FILES=6 - BUILD_OPTIONS="--eNB -t ETHERNET" RUN_OPTIONS="complex" NBARGS=$[$NBARGS+256] ;; @@ -540,11 +534,23 @@ ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC} STATUS=0 if [ $CREATE_CMD -eq 1 ] then - create_vm + if [[ $VM_NAME =~ .*-l2-sim.* ]] + then + echo "Selected variant is no more a build variant" + exit 0 + else + create_vm + fi fi if [ $BUILD_CMD -eq 1 ] then - build_on_vm + if [[ $VM_NAME =~ .*-l2-sim.* ]] + then + echo "Selected variant is no more a build variant" + exit 0 + else + build_on_vm + fi if [ $DAEMON -eq 0 ] && [ $STATUS -eq 0 ] then check_on_vm_build @@ -552,7 +558,13 @@ then fi if [ $WAIT_CMD -eq 1 ] then - wait_on_vm_build + if [[ $VM_NAME =~ .*-l2-sim.* ]] + then + echo "Selected variant is no more a build variant" + exit 0 + else + wait_on_vm_build + fi if [ $STATUS -eq 0 ] then check_on_vm_build diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 05464560d8..be3e592dbe 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -405,6 +405,26 @@ function install_epc_on_vm { fi } +function add_user_to_epc_lists { + local LOC_EPC_VM_CMDS=$1 + local LOC_EPC_VM_IP_ADDR=$2 + local LOC_NB_USERS=$3 + if [ $LTEBOX -eq 1 ] + then + scp -o StrictHostKeyChecking=no $JENKINS_WKSP/ci-scripts/add_user_to_subscriber_list.awk ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu/ + echo "cd /opt/hss_sim0609" > $LOC_EPC_VM_CMDS + echo "sudo cp subscriber.data subscriber.data.orig" >> $LOC_EPC_VM_CMDS + echo "sudo cp profile.data profile.data.orig" >> $LOC_EPC_VM_CMDS + echo "sudo awk -v num_ues=$LOC_NB_USERS -f /home/ubuntu/add_user_to_subscriber_list.awk subscriber.data.orig > /tmp/subscriber.data" >> $LOC_EPC_VM_CMDS + echo "sudo awk -v num_ues=$LOC_NB_USERS -f /home/ubuntu/add_user_to_subscriber_list.awk profile.data.orig > /tmp/profile.data" >> $LOC_EPC_VM_CMDS + echo "sudo cp /tmp/subscriber.data subscriber.data" >> $LOC_EPC_VM_CMDS + echo "sudo cp /tmp/profile.data profile.data" >> $LOC_EPC_VM_CMDS + + ssh -o StrictHostKeyChecking=no ubuntu@$LOC_EPC_VM_IP_ADDR < $LOC_EPC_VM_CMDS + rm -f $LOC_EPC_VM_CMDS + fi +} + function start_epc { local LOC_EPC_VM_NAME=$1 local LOC_EPC_VM_CMDS=$2 @@ -589,11 +609,30 @@ function start_l2_sim_enb { sleep 10 } +function add_ue_l2_sim_ue { + local LOC_UE_VM_IP_ADDR=$2 + local LOC_NB_UES=$3 + echo "cd /home/ubuntu/tmp/" > $1 + echo "source oaienv" >> $1 + echo "echo \"cd openair3/NAS/TOOLS/\"" >> $1 + echo "cd openair3/NAS/TOOLS/" >> $1 + echo "echo \"awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf\"" >> $1 + echo "awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf" >> $1 + echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 + echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 + echo "echo \"sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o .\"" >> $1 + echo "sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o . > /home/ubuntu/tmp/cmake_targets/log/ue_adapt.txt 2>&1" >> $1 + + ssh -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 + rm $1 +} + function start_l2_sim_ue { local LOC_UE_VM_IP_ADDR=$2 local LOC_ENB_VM_IP_ADDR=$3 local LOC_LOG_FILE=$4 local LOC_CONF_FILE=$5 + local LOC_NB_UES=$6 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 "cd /home/ubuntu/tmp/ci-scripts/conf_files/" >> $1 @@ -602,7 +641,7 @@ function start_l2_sim_ue { echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues 1\" > ./my-lte-softmodem-run.sh " >> $1 + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES\" > ./my-lte-softmodem-run.sh " >> $1 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 @@ -672,8 +711,8 @@ function run_test_on_vm { echo "ENB_VM_CMD_FILE = $ENB_VM_CMDS" UE_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#ue-ethernet#"` UE_VM_CMDS=${UE_VM_NAME}_cmds.txt - echo "ENB_VM_NAME = $ENB_VM_NAME" - echo "ENB_VM_CMD_FILE = $ENB_VM_CMDS" + echo "UE_VM_NAME = $UE_VM_NAME" + echo "UE_VM_CMD_FILE = $UE_VM_CMDS" else echo "VM_NAME = $VM_NAME" echo "VM_CMD_FILE = $VM_CMDS" @@ -1317,6 +1356,9 @@ function run_test_on_vm { install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` + # adding 16 users to EPC subscriber lists + add_user_to_epc_lists $EPC_VM_CMDS $EPC_VM_IP_ADDR 16 + # Starting EPC start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR @@ -1326,14 +1368,14 @@ function run_test_on_vm { echo "############################################################" echo "Starting the eNB in FDD-5MHz mode" echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_enb.log + CURRENT_ENB_LOG_FILE=fdd_05MHz_01users_enb.log start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf echo "############################################################" - echo "Starting the UEs" + echo "Starting the UE (1 user)" echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf + CURRENT_UE_LOG_FILE=fdd_05MHz_01users_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" @@ -1350,7 +1392,61 @@ function run_test_on_vm { echo "############################################################" echo "Pinging the EPC from UE" echo "############################################################" - PING_LOG_FILE=fdd_05MHz_ping_epc.txt + PING_LOG_FILE=fdd_05MHz_01users_ping_epc.txt + ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE + 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 + + echo "############################################################" + echo "Pinging the UE from EPC" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_01users_ping_ue.txt + get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + 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 + + echo "############################################################" + echo "Terminate enb/ue simulators" + echo "############################################################" + terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR + terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 + + echo "############################################################" + echo "Adding UE to conf file and recompile" + echo "############################################################" + add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 4 + + echo "############################################################" + echo "Starting the eNB in FDD-5MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=fdd_05MHz_04users_enb.log + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf + + echo "############################################################" + echo "Starting the UE (4 users)" + echo "############################################################" + CURRENT_UE_LOG_FILE=fdd_05MHz_04users_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 4 + 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 + terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 + terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log + STATUS=-1 + return + fi + + echo "############################################################" + echo "Pinging the EPC from UE" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_04users_ping_epc.txt ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE 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 From 0a05acc29f8389544d532dadcbd00725ca8d5077 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 28 Mar 2019 10:34:53 +0100 Subject: [PATCH 03/44] CI: fix reporting for L2-simulator Signed-off-by: Raphael Defosseux --- ci-scripts/reportTestLocally.sh | 16 ++-- ci-scripts/runTestOnVM.sh | 127 +++++++++++++++++++++----------- 2 files changed, 93 insertions(+), 50 deletions(-) diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index 63cd3f831f..e169df84a3 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -468,11 +468,14 @@ function report_test { TRANS_MODES=("fdd") BW_CASES=(05) + NB_USERS=(01 04) for TMODE in ${TRANS_MODES[@]} do - for BW in ${BW_CASES[@]} + for BW in ${BW_CASES[@]} + do + for UES in ${NB_USERS[@]} do - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log + ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_enb.log UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` if [ -f $ENB_LOG ] && [ -f $UE_LOG ] then @@ -512,9 +515,9 @@ function report_test { echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html fi - PING_CASE=$ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_epc.txt - if [ -f $PING_CASE ] - then + PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_ping*.txt` + for PING_CASE in $PING_LOGS + do echo " " >> ./test_simulator_results.html NAME=`echo $PING_CASE | sed -e "s#$ARCHIVES_LOC/##"` echo " $NAME" >> ./test_simulator_results.html @@ -548,9 +551,10 @@ function report_test { echo " " >> ./test_simulator_results.html fi echo " " >> ./test_simulator_results.html - fi + done done + done done echo " " >> ./test_simulator_results.html diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index be3e592dbe..be3da4a610 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -150,7 +150,7 @@ function ping_ue_ip_addr { function ping_epc_ip_addr { echo "echo \"COMMAND IS: ping -I oaitun_ue1 -c 20 $3\" > $4" > $1 - echo "rm -f $4" >> $1 + echo "echo \"ping -I oaitun_ue1 -c 20 $3\"" >> $1 echo "ping -I oaitun_ue1 -c 20 $3 | tee -a $4" >> $1 cat $1 ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1 @@ -267,26 +267,42 @@ function check_iperf { } function terminate_enb_ue_basic_sim { + # mode = 0 : eNB + UE + # mode = 1 : eNB + # mode = 2 : UE + local LOC_MODE=$3 echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" > $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo daemon --name=enb_daemon --stop\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo daemon --name=enb_daemon --stop; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo daemon --name=ue_daemon --stop\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo daemon --name=ue_daemon --stop; fi" >> $1 + if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 1 ] + then + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo daemon --name=enb_daemon --stop\"; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo daemon --name=enb_daemon --stop; fi" >> $1 + fi + if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 2 ] + then + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo daemon --name=ue_daemon --stop\"; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo daemon --name=ue_daemon --stop; fi" >> $1 + fi echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 echo "echo \"ps -aux | grep softmodem\"" >> $1 echo "ps -aux | grep softmodem | grep -v grep" >> $1 echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGINT lte-softmodem\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGINT lte-softmodem; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 - echo "echo \"ps -aux | grep softmodem\"" >> $1 - echo "ps -aux | grep softmodem | grep -v grep" >> $1 - echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGKILL lte-softmodem\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGKILL lte-softmodem; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGKILL lte-uesoftmodem\"; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGKILL lte-uesoftmodem; fi" >> $1 - echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 + if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 1 ] + then + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGINT lte-softmodem\"; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGINT lte-softmodem; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 + echo "echo \"ps -aux | grep softmodem\"" >> $1 + echo "ps -aux | grep softmodem | grep -v grep" >> $1 + echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGKILL lte-softmodem\"; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGKILL lte-softmodem; fi" >> $1 + fi + if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 2 ] + then + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGKILL lte-uesoftmodem\"; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGKILL lte-uesoftmodem; fi" >> $1 + echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1 + fi echo "echo \"ps -aux | grep softmodem\"" >> $1 echo "ps -aux | grep softmodem | grep -v grep" >> $1 ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1 @@ -413,6 +429,8 @@ function add_user_to_epc_lists { then scp -o StrictHostKeyChecking=no $JENKINS_WKSP/ci-scripts/add_user_to_subscriber_list.awk ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu/ echo "cd /opt/hss_sim0609" > $LOC_EPC_VM_CMDS + echo "if [ -e subscriber.data.orig ]; then sudo mv subscriber.data.orig subscriber.data; fi" >> $1 + echo "if [ -e profile.data.orig ]; then sudo mv profile.data.orig profile.data; fi" >> $1 echo "sudo cp subscriber.data subscriber.data.orig" >> $LOC_EPC_VM_CMDS echo "sudo cp profile.data profile.data.orig" >> $LOC_EPC_VM_CMDS echo "sudo awk -v num_ues=$LOC_NB_USERS -f /home/ubuntu/add_user_to_subscriber_list.awk subscriber.data.orig > /tmp/subscriber.data" >> $LOC_EPC_VM_CMDS @@ -614,14 +632,24 @@ function add_ue_l2_sim_ue { local LOC_NB_UES=$3 echo "cd /home/ubuntu/tmp/" > $1 echo "source oaienv" >> $1 - echo "echo \"cd openair3/NAS/TOOLS/\"" >> $1 - echo "cd openair3/NAS/TOOLS/" >> $1 - echo "echo \"awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf\"" >> $1 - echo "awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf" >> $1 + if [ $LOC_NB_UES -gt 1 ] + then + echo "echo \"cd openair3/NAS/TOOLS/\"" >> $1 + echo "cd openair3/NAS/TOOLS/" >> $1 + echo "echo \"awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf\"" >> $1 + echo "awk -v num_ues=$LOC_NB_UES -f /home/ubuntu/tmp/ci-scripts/add_user_to_conf_file.awk ue_eurecom_test_sfr.conf > ue_eurecom_test_sfr_multi_ues.conf" >> $1 + fi echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 - echo "echo \"sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o .\"" >> $1 - echo "sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o . > /home/ubuntu/tmp/cmake_targets/log/ue_adapt.txt 2>&1" >> $1 + echo "sudo rm -f *.u*" >> $1 + if [ $LOC_NB_UES -eq 1 ] + then + echo "echo \"sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o .\"" >> $1 + echo "sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o . > /home/ubuntu/tmp/cmake_targets/log/ue_adapt.txt 2>&1" >> $1 + else + echo "echo \"sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o .\"" >> $1 + echo "sudo ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr_multi_ues.conf -o . > /home/ubuntu/tmp/cmake_targets/log/ue_adapt.txt 2>&1" >> $1 + fi ssh -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1 rm $1 @@ -894,7 +922,7 @@ function run_test_on_vm { if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -934,7 +962,7 @@ function run_test_on_vm { echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -954,7 +982,7 @@ function run_test_on_vm { if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -994,7 +1022,7 @@ function run_test_on_vm { echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1014,7 +1042,7 @@ function run_test_on_vm { if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1045,7 +1073,7 @@ function run_test_on_vm { echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1113,7 +1141,7 @@ function run_test_on_vm { if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1130,7 +1158,7 @@ function run_test_on_vm { echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1157,7 +1185,7 @@ function run_test_on_vm { if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1189,7 +1217,7 @@ function run_test_on_vm { echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR + 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 @@ -1210,7 +1238,7 @@ function run_test_on_vm { # if [ $UE_SYNC -eq 0 ] # then # echo "Problem w/ eNB and UE not syncing" -# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR +# 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 @@ -1241,7 +1269,7 @@ function run_test_on_vm { # echo "############################################################" # echo "Terminate enb/ue simulators" # echo "############################################################" -# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR +# 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 @@ -1262,7 +1290,7 @@ function run_test_on_vm { # if [ $UE_SYNC -eq 0 ] # then # echo "Problem w/ eNB and UE not syncing" -# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR +# 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 @@ -1293,7 +1321,7 @@ function run_test_on_vm { # echo "############################################################" # echo "Terminate enb/ue simulators" # echo "############################################################" -# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR +# 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 @@ -1359,6 +1387,9 @@ function run_test_on_vm { # adding 16 users to EPC subscriber lists add_user_to_epc_lists $EPC_VM_CMDS $EPC_VM_IP_ADDR 16 + # For re-runs + add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 1 + # Starting EPC start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR @@ -1379,8 +1410,8 @@ function run_test_on_vm { 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 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR @@ -1409,8 +1440,8 @@ function run_test_on_vm { echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 @@ -1433,8 +1464,8 @@ function run_test_on_vm { 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 - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR @@ -1451,11 +1482,19 @@ function run_test_on_vm { 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 + echo "############################################################" + echo "Pinging the UE from EPC" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_04users_ping_ue.txt + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + 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 + echo "############################################################" echo "Terminate enb/ue simulators" echo "############################################################" - terminate_enb_ue_basic_sim $ENB_VM_CMDS $ENB_VM_IP_ADDR - terminate_enb_ue_basic_sim $UE_VM_CMDS $UE_VM_IP_ADDR + 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 From 2d58f3541e900326d6d43595afe17900e49f6f3e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 28 Mar 2019 14:54:43 +0100 Subject: [PATCH 04/44] CI: adding noS1 test on L2-simulator Signed-off-by: Raphael Defosseux --- ci-scripts/reportTestLocally.sh | 22 +++- ci-scripts/runTestOnVM.sh | 172 ++++++++++++++++++++++++++++---- 2 files changed, 172 insertions(+), 22 deletions(-) diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index e169df84a3..717b5f73e9 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -466,16 +466,27 @@ function report_test { 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 TMODE in ${TRANS_MODES[@]} + for CN_CONFIG in ${EPC_CONFIGS[@]} do - for BW in ${BW_CASES[@]} + echo " " >> ./test_simulator_results.html + if [[ $CN_CONFIG =~ .*wS1.* ]] + then + echo " Test with EPC (aka withS1)" >> ./test_simulator_results.html + else + echo " Test without EPC (aka noS1)" >> ./test_simulator_results.html + fi + echo " " >> ./test_simulator_results.html + for TMODE in ${TRANS_MODES[@]} do - for UES in ${NB_USERS[@]} + for BW in ${BW_CASES[@]} do - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_enb.log + for UES in ${NB_USERS[@]} + do + 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 @@ -515,7 +526,7 @@ function report_test { echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html fi - PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_ping*.txt` + PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.txt` for PING_CASE in $PING_LOGS do echo " " >> ./test_simulator_results.html @@ -553,6 +564,7 @@ function report_test { echo " " >> ./test_simulator_results.html done + done done done done diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index be3da4a610..7ff42405e3 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -136,13 +136,20 @@ function start_basic_sim_ue { function get_ue_ip_addr { echo "ifconfig oaitun_ue1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 UE_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1` - echo "UE IP Address for EPC is : $UE_IP_ADDR" + echo "Test UE IP Address is : $UE_IP_ADDR" + rm $1 +} + +function get_enb_noS1_ip_addr { + echo "ifconfig oaitun_enb1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 + ENB_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1` + echo "Test eNB IP Address is : $UE_IP_ADDR" rm $1 } function ping_ue_ip_addr { - echo "echo \"ping -c 20 $3\"" > $1 echo "echo \"COMMAND IS: ping -c 20 $3\" > $4" > $1 + echo "echo \"ping -c 20 $3\"" >> $1 echo "ping -c 20 $UE_IP_ADDR | tee -a $4" >> $1 ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1 rm -f $1 @@ -152,7 +159,14 @@ function ping_epc_ip_addr { echo "echo \"COMMAND IS: ping -I oaitun_ue1 -c 20 $3\" > $4" > $1 echo "echo \"ping -I oaitun_ue1 -c 20 $3\"" >> $1 echo "ping -I oaitun_ue1 -c 20 $3 | tee -a $4" >> $1 - cat $1 + ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1 + rm -f $1 +} + +function ping_enb_ip_addr { + echo "echo \"COMMAND IS: ping -I oaitun_enb1 -c 20 $3\" > $4" > $1 + echo "echo \"ping -I oaitun_enb1 -c 20 $3\"" >> $1 + echo "ping -I oaitun_enb1 -c 20 $3 | tee -a $4" >> $1 ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1 rm -f $1 } @@ -580,6 +594,8 @@ function start_l2_sim_enb { local LOC_LOG_FILE=$5 local LOC_NB_RBS=$6 local LOC_CONF_FILE=$7 + # 1 is with S1 and 0 without S1 aka noS1 + local LOC_S1_CONFIGURATION=$8 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 @@ -593,7 +609,12 @@ function start_l2_sim_enb { echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./my-lte-softmodem-run.sh " >> $1 + if [ $LOC_S1_CONFIGURATION -eq 0 ] + then + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + else + echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE\" > ./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 @@ -661,6 +682,8 @@ function start_l2_sim_ue { local LOC_LOG_FILE=$4 local LOC_CONF_FILE=$5 local LOC_NB_UES=$6 + # 1 is with S1 and 0 without S1 aka noS1 + local LOC_S1_CONFIGURATION=$7 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 "cd /home/ubuntu/tmp/ci-scripts/conf_files/" >> $1 @@ -669,7 +692,12 @@ function start_l2_sim_ue { echo "echo \"cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/\"" >> $1 echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 echo "cd /home/ubuntu/tmp/cmake_targets/lte_build_oai/build/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES\" > ./my-lte-softmodem-run.sh " >> $1 + if [ $LOC_S1_CONFIGURATION -eq 0 ] + then + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES --noS1\" > ./my-lte-softmodem-run.sh " >> $1 + else + echo "echo \"ulimit -c unlimited && ./lte-uesoftmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --L2-emul 3 --num-ues $LOC_NB_UES\" > ./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 @@ -1399,14 +1427,14 @@ function run_test_on_vm { echo "############################################################" echo "Starting the eNB in FDD-5MHz mode" echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_01users_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf + CURRENT_ENB_LOG_FILE=fdd_05MHz_01users_wS1_enb.log + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 1 echo "############################################################" echo "Starting the UE (1 user)" echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_01users_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 + CURRENT_UE_LOG_FILE=fdd_05MHz_01users_wS1_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 1 if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" @@ -1423,7 +1451,7 @@ function run_test_on_vm { echo "############################################################" echo "Pinging the EPC from UE" echo "############################################################" - PING_LOG_FILE=fdd_05MHz_01users_ping_epc.txt + PING_LOG_FILE=fdd_05MHz_01users_wS1_ping_epc.txt ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE 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 @@ -1431,7 +1459,7 @@ function run_test_on_vm { echo "############################################################" echo "Pinging the UE from EPC" echo "############################################################" - PING_LOG_FILE=fdd_05MHz_01users_ping_ue.txt + PING_LOG_FILE=fdd_05MHz_01users_wS1_ping_ue.txt get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC @@ -1453,14 +1481,14 @@ function run_test_on_vm { echo "############################################################" echo "Starting the eNB in FDD-5MHz mode" echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_04users_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf + CURRENT_ENB_LOG_FILE=fdd_05MHz_04users_wS1_enb.log + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 1 echo "############################################################" echo "Starting the UE (4 users)" echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_04users_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 4 + CURRENT_UE_LOG_FILE=fdd_05MHz_04users_wS1_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 4 1 if [ $UE_SYNC -eq 0 ] then echo "Problem w/ eNB and UE not syncing" @@ -1477,7 +1505,7 @@ function run_test_on_vm { echo "############################################################" echo "Pinging the EPC from UE" echo "############################################################" - PING_LOG_FILE=fdd_05MHz_04users_ping_epc.txt + PING_LOG_FILE=fdd_05MHz_04users_wS1_ping_epc.txt ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE 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 @@ -1485,7 +1513,7 @@ function run_test_on_vm { echo "############################################################" echo "Pinging the UE from EPC" echo "############################################################" - PING_LOG_FILE=fdd_05MHz_04users_ping_ue.txt + PING_LOG_FILE=fdd_05MHz_04users_wS1_ping_ue.txt ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 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 @@ -1503,6 +1531,116 @@ function run_test_on_vm { echo "############################################################" terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + echo "############################################################" + echo "Running now in a no-S1 configuration" + echo "############################################################" + add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 1 + + echo "############################################################" + echo "noS1 : Starting the eNB in FDD-5MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=fdd_05MHz_01users_noS1_enb.log + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 0 + + echo "############################################################" + echo "noS1 : Starting the UE (1 user)" + echo "############################################################" + CURRENT_UE_LOG_FILE=fdd_05MHz_01users_noS1_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 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 + echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log + STATUS=-1 + return + fi + + get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR + get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR + + echo "############################################################" + echo "noS1 : Pinging the eNB from UE" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_01users_noS1_ping_enb.txt + ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE + 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 + + echo "############################################################" + echo "noS1 : Pinging the UE from eNB" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_01users_noS1_ping_ue.txt + ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + 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 + + echo "############################################################" + echo "noS1: 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 + + echo "############################################################" + echo "Adding UE to conf file and recompile" + echo "############################################################" + add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 4 + + echo "############################################################" + echo "noS1 : Starting the eNB in FDD-5MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=fdd_05MHz_04users_noS1_enb.log + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 0 + + echo "############################################################" + echo "noS1 : Starting the UE (4 users)" + echo "############################################################" + CURRENT_UE_LOG_FILE=fdd_05MHz_04users_noS1_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 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 + echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log + STATUS=-1 + return + fi + + get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR + get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR + + echo "############################################################" + echo "noS1 : Pinging the eNB from UE" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_04users_noS1_ping_enb.txt + ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE + 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 + + echo "############################################################" + echo "noS1 : Pinging the UE from eNB" + echo "############################################################" + PING_LOG_FILE=fdd_05MHz_04users_noS1_ping_ue.txt + ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + 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 + + echo "############################################################" + echo "noS1: 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 + if [ $KEEP_VM_ALIVE -eq 0 ] then echo "############################################################" From 34b4f693e16dae3799e18054c30896c8b9256177 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 28 Mar 2019 17:49:55 +0100 Subject: [PATCH 05/44] CI: proper factorisation on basic-sim and l2-sim tests Signed-off-by: Raphael Defosseux --- ci-scripts/reportTestLocally.sh | 10 +- ci-scripts/runTestOnVM.sh | 790 ++++++++++---------------------- 2 files changed, 240 insertions(+), 560 deletions(-) diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index 717b5f73e9..f228946076 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -215,6 +215,14 @@ function report_test { 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 @@ -526,7 +534,7 @@ function report_test { echo " " >> ./test_simulator_results.html echo " " >> ./test_simulator_results.html fi - PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.txt` + PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.log` for PING_CASE in $PING_LOGS do echo " " >> ./test_simulator_results.html diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 7ff42405e3..88d510a079 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -341,6 +341,35 @@ function recover_core_dump { fi } +function full_terminate { + 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 +} + +function full_basic_sim_destroy { + if [ $KEEP_VM_ALIVE -eq 0 ] + then + echo "############################################################" + echo "Destroying VMs" + echo "############################################################" + uvt-kvm destroy $VM_NAME + ssh-keygen -R $VM_IP_ADDR + uvt-kvm destroy $EPC_VM_NAME + ssh-keygen -R $EPC_VM_IP_ADDR + if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] + then + uvt-kvm destroy $FLEXRAN_CTL_VM_NAME + ssh-keygen -R $FLEXRAN_CTL_VM_IP_ADDR + fi + fi +} + function install_epc_on_vm { local LOC_EPC_VM_NAME=$1 local LOC_EPC_VM_CMDS=$2 @@ -755,6 +784,21 @@ function start_l2_sim_ue { sleep 10 } +function full_l2_sim_destroy { + if [ $KEEP_VM_ALIVE -eq 0 ] + then + echo "############################################################" + echo "Destroying VMs" + echo "############################################################" + uvt-kvm destroy $ENB_VM_NAME + ssh-keygen -R $ENB_VM_IP_ADDR + uvt-kvm destroy $UE_VM_NAME + ssh-keygen -R $UE_VM_IP_ADDR + uvt-kvm destroy $EPC_VM_NAME + ssh-keygen -R $EPC_VM_IP_ADDR + fi +} + function run_test_on_vm { echo "############################################################" echo "OAI CI VM script" @@ -936,176 +980,89 @@ function run_test_on_vm { # Retrieve EPC real IP address retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - echo "############################################################" - echo "Starting the eNB in FDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_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 none + TRANS_MODES=("fdd" "tdd") + BW_CASES=(05 10 20) - echo "############################################################" - echo "Starting the UE in FDD-5MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_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 - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + for TMODE in ${TRANS_MODES[@]} + do + for BW in ${BW_CASES[@]} + do + # Not Running in TDD-10MHz and TDD-20MHz : too unstable + if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then continue; fi + if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 + 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 "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 10 $CURR_IPERF_LOG_BASE - 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 10 + 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 "Iperf UL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_05MHz_iperf_ul - iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 2 $CURR_IPERF_LOG_BASE - 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 2 + 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" + 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 + full_basic_sim_destroy + echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log + STATUS=-1 + return + fi + get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - 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 "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 + 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 - echo "############################################################" - echo "Starting the eNB in FDD-10MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_10MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-fdd-basic-sim.conf none + # Not more testing in TDD-5MHz : too unstable + if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*05.* ]]; 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 + iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE + 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - echo "############################################################" - echo "Starting the UE in FDD-10MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_10MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 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 - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR + # 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 + iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE + 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC + check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=fdd_10MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 + full_terminate - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 10 $CURR_IPERF_LOG_BASE - 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 10 - - echo "############################################################" - echo "Iperf UL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_10MHz_iperf_ul - iperf_ul $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 2 $CURR_IPERF_LOG_BASE - 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 2 - - 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 "Starting the eNB in FDD-20MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_20MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-fdd-basic-sim.conf none - - echo "############################################################" - echo "Starting the UE in FDD-20MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_20MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 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 - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=fdd_20MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - CURR_IPERF_LOG_BASE=fdd_20MHz_iperf_dl - iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 12 $CURR_IPERF_LOG_BASE - 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 12 - - 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 + done + done if [ -d $JENKINS_WKSP/flexran ] then @@ -1139,6 +1096,7 @@ function run_test_on_vm { then echo "ERROR: Flexran Ctl VM is not alive" terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR + full_basic_sim_destroy echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log STATUS=-1 return @@ -1199,183 +1157,13 @@ function run_test_on_vm { scp -o StrictHostKeyChecking=no ubuntu@$FLEXRAN_CTL_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/flexran_ctl_*.log $ARCHIVES_LOC fi - echo "############################################################" - echo "Starting the eNB in TDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=tdd_05MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-tdd-basic-sim.conf none - - echo "############################################################" - echo "Starting the UE in TDD-5MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=tdd_05MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2350 - 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 - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR - - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=tdd_05MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 - -# Bug in TDD 5Mhz --- not running it -# echo "############################################################" -# echo "Iperf DL" -# echo "############################################################" -# CURR_IPERF_LOG_BASE=tdd_05MHz_iperf_dl -# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE -# 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC -# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 - - 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 "Starting the eNB in TDD-10MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=tdd_10MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 50 lte-tdd-basic-sim.conf none - -# Disabling TDD-10MHz in order to stop getting false negatives -# echo "############################################################" -# echo "Starting the UE in TDD-10MHz mode" -# echo "############################################################" -# CURRENT_UE_LOG_FILE=tdd_10MHz_ue.log -# start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 50 2350 -# 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 -# echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log -# STATUS=-1 -# return -# fi -# get_ue_ip_addr $VM_CMDS $VM_IP_ADDR -# -# echo "############################################################" -# echo "Pinging the UE" -# echo "############################################################" -# PING_LOG_FILE=tdd_10MHz_ping_ue.txt -# ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE -# 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 -# -# echo "############################################################" -# echo "Iperf DL" -# echo "############################################################" -# CURR_IPERF_LOG_BASE=tdd_10MHz_iperf_dl -# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE -# 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC -# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 -# -# 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 -# -# Disabling TDD-20MHz in order to stop getting false negatives -# echo "############################################################" -# echo "Starting the eNB in TDD-20MHz mode" -# echo "############################################################" -# CURRENT_ENB_LOG_FILE=tdd_20MHz_enb.log -# start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-tdd-basic-sim.conf none -# -# echo "############################################################" -# echo "Starting the UE in TDD-20MHz mode" -# echo "############################################################" -# CURRENT_UE_LOG_FILE=tdd_20MHz_ue.log -# start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2350 -# 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 -# echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log -# STATUS=-1 -# return -# fi -# get_ue_ip_addr $VM_CMDS $VM_IP_ADDR -# -# echo "############################################################" -# echo "Pinging the UE" -# echo "############################################################" -# PING_LOG_FILE=tdd_20MHz_ping_ue.txt -# ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE -# 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 -# -# echo "############################################################" -# echo "Iperf DL" -# echo "############################################################" -# CURR_IPERF_LOG_BASE=tdd_20MHz_iperf_dl -# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE -# 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/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC -# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6 -# -# 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 "Terminate EPC" echo "############################################################" terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - if [ $KEEP_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Destroying VMs" - echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR - uvt-kvm destroy $EPC_VM_NAME - ssh-keygen -R $EPC_VM_IP_ADDR - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - uvt-kvm destroy $FLEXRAN_CTL_VM_NAME - ssh-keygen -R $FLEXRAN_CTL_VM_IP_ADDR - fi - fi + full_basic_sim_destroy echo "############################################################" echo "Checking run status" @@ -1415,244 +1203,128 @@ function run_test_on_vm { # adding 16 users to EPC subscriber lists add_user_to_epc_lists $EPC_VM_CMDS $EPC_VM_IP_ADDR 16 - # For re-runs - add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 1 + EPC_CONFIGS=("wS1" "noS1") + TRANS_MODES=("fdd") + BW_CASES=(05) + NB_USERS=(01 04) + for CN_CONFIG in ${EPC_CONFIGS[@]} + do + if [[ $CN_CONFIG =~ .*wS1.* ]] + then + echo "############################################################" + echo "Start EPC for the wS1 configuration" + echo "############################################################" + start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - # Starting EPC - 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 "Terminate EPC" + echo "############################################################" + terminate_epc $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 + echo "############################################################" + echo "Running now in a no-S1 configuration" + echo "############################################################" + S1_NOS1_CFG=0 + fi + for TMODE in ${TRANS_MODES[@]} + do + for BW in ${BW_CASES[@]} + do + for UES in ${NB_USERS[@]} + do + INT_NB_UES=`echo $UES | sed -e "s#^0*##"` + echo "############################################################" + echo "${CN_CONFIG} : Adding ${INT_NB_UES} UE(s) to conf file and recompile" + echo "############################################################" + add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $INT_NB_UES - echo "############################################################" - echo "Starting the eNB in FDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_01users_wS1_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 1 + echo "############################################################" + echo "${CN_CONFIG} : Starting the eNB in ${TMODE}-${BW}MHz mode" + echo "############################################################" + CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_enb.log + start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf $S1_NOS1_CFG - echo "############################################################" - echo "Starting the UE (1 user)" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_01users_wS1_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 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 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi + echo "############################################################" + echo "${CN_CONFIG} : Starting the UE for ${INT_NB_UES} user(s)" + echo "############################################################" + CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ue.log + start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf $INT_NB_UES $S1_NOS1_CFG + 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 + full_l2_sim_destroy + echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log + STATUS=-1 + return + fi - echo "############################################################" - echo "Pinging the EPC from UE" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_01users_wS1_ping_epc.txt - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE - 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 + if [ $S1_NOS1_CFG -eq 1 ] + then + get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR - echo "############################################################" - echo "Pinging the UE from EPC" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_01users_wS1_ping_ue.txt - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 + echo "############################################################" + echo "${CN_CONFIG} : Pinging the EPC from UE" + echo "############################################################" + PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_epc.log + ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + else + get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR + get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - echo "############################################################" - echo "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 + echo "############################################################" + echo "${CN_CONFIG} : Pinging the eNB from UE" + echo "############################################################" + PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_enb.log + ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + fi + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Adding UE to conf file and recompile" - echo "############################################################" - add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 4 + if [ $S1_NOS1_CFG -eq 1 ] + then + echo "############################################################" + echo "${CN_CONFIG} : Pinging the UE from EPC" + echo "############################################################" + PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_ue.log + ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + else + echo "############################################################" + echo "${CN_CONFIG} : Pinging the UE from eNB" + echo "############################################################" + PING_LOG_FILE=${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping_ue.log + ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE + scp -o StrictHostKeyChecking=no ubuntu@$ENB_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC + fi + check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - echo "############################################################" - echo "Starting the eNB in FDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_04users_wS1_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 1 + 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 - echo "############################################################" - echo "Starting the UE (4 users)" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_04users_wS1_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 4 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 - scp -o StrictHostKeyChecking=no ubuntu@$UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi + done + done + done + done - echo "############################################################" - echo "Pinging the EPC from UE" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_04users_wS1_ping_epc.txt - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $REAL_EPC_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "Pinging the UE from EPC" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_04users_wS1_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "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 - - echo "############################################################" - echo "Terminate EPC" - echo "############################################################" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - - echo "############################################################" - echo "Running now in a no-S1 configuration" - echo "############################################################" - add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 1 - - echo "############################################################" - echo "noS1 : Starting the eNB in FDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_01users_noS1_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 0 - - echo "############################################################" - echo "noS1 : Starting the UE (1 user)" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_01users_noS1_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 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 - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR - get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - - echo "############################################################" - echo "noS1 : Pinging the eNB from UE" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_01users_noS1_ping_enb.txt - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "noS1 : Pinging the UE from eNB" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_01users_noS1_ping_ue.txt - ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "noS1: 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 - - echo "############################################################" - echo "Adding UE to conf file and recompile" - echo "############################################################" - add_ue_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR 4 - - echo "############################################################" - echo "noS1 : Starting the eNB in FDD-5MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05MHz_04users_noS1_enb.log - start_l2_sim_enb $ENB_VM_CMDS $ENB_VM_IP_ADDR $EPC_VM_IP_ADDR $UE_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 rcc.band7.tm1.nfapi.conf 0 - - echo "############################################################" - echo "noS1 : Starting the UE (4 users)" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05MHz_04users_noS1_ue.log - start_l2_sim_ue $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_VM_IP_ADDR $CURRENT_UE_LOG_FILE ue.nfapi.conf 1 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 - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - - get_ue_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR - get_enb_noS1_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR - - echo "############################################################" - echo "noS1 : Pinging the eNB from UE" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_04users_noS1_ping_enb.txt - ping_epc_ip_addr $UE_VM_CMDS $UE_VM_IP_ADDR $ENB_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "noS1 : Pinging the UE from eNB" - echo "############################################################" - PING_LOG_FILE=fdd_05MHz_04users_noS1_ping_ue.txt - ping_enb_ip_addr $ENB_VM_CMDS $ENB_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE - 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 - - echo "############################################################" - echo "noS1: 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 - - if [ $KEEP_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Destroying VMs" - echo "############################################################" - uvt-kvm destroy $ENB_VM_NAME - ssh-keygen -R $ENB_VM_IP_ADDR - uvt-kvm destroy $UE_VM_NAME - ssh-keygen -R $UE_VM_IP_ADDR - uvt-kvm destroy $EPC_VM_NAME - ssh-keygen -R $EPC_VM_IP_ADDR - fi + full_l2_sim_destroy echo "############################################################" echo "Checking run status" From 802f4c6158a9e0514d83d19f88e0d44906f73769 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 29 Mar 2019 16:41:11 +0100 Subject: [PATCH 06/44] CI: separating the OSA, non-OSA build variants from the test variants Signed-off-by: Raphael Defosseux --- ci-scripts/oai-ci-vm-tool | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index b641dded25..bfef93a844 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -34,14 +34,17 @@ function top_usage { } function variant_usage { + echo " # OpenAirInterface Build Variants" echo " --variant enb-usrp OR -v1" echo " --variant basic-sim OR -v2" echo " --variant phy-sim OR -v3" echo " --variant cppcheck OR -v4" echo " --variant enb-ethernet OR -v7" echo " --variant ue-ethernet OR -v8" - echo " --variant l2-sim OR -v9" + echo " # non-OSA Build Variants" echo " --variant flexran-rtc OR -v10" + echo " # OpenAirInterface Test Variants" + echo " --variant l2-sim OR -v22" } MY_DIR=$(dirname $(readlink -f $0)) @@ -290,13 +293,6 @@ case $key in NBARGS=$[$NBARGS+256] shift ;; - -v9) - VM_NAME=ci-l2-sim - ARCHIVES_LOC=l2_sim - RUN_OPTIONS="complex" - NBARGS=$[$NBARGS+256] - shift - ;; -v10) VM_NAME=ci-flexran-rtc ARCHIVES_LOC=flexran @@ -306,6 +302,13 @@ case $key in NBARGS=$[$NBARGS+256] shift ;; + -v22) + VM_NAME=ci-l2-sim + ARCHIVES_LOC=l2_sim + RUN_OPTIONS="complex" + NBARGS=$[$NBARGS+256] + shift + ;; --variant) variant="$2" case $variant in @@ -366,12 +369,6 @@ case $key in BUILD_OPTIONS="--UE -t ETHERNET" NBARGS=$[$NBARGS+256] ;; - l2-sim) - VM_NAME=ci-l2-sim - ARCHIVES_LOC=l2_sim - RUN_OPTIONS="complex" - NBARGS=$[$NBARGS+256] - ;; flexran-rtc) VM_NAME=ci-flexran-rtc ARCHIVES_LOC=flexran @@ -380,6 +377,12 @@ case $key in BUILD_OPTIONS="cmake . && make -j2" NBARGS=$[$NBARGS+256] ;; + l2-sim) + VM_NAME=ci-l2-sim + ARCHIVES_LOC=l2_sim + RUN_OPTIONS="complex" + NBARGS=$[$NBARGS+256] + ;; *) echo "" echo "Syntax Error: Invalid Variant option -> $variant" From 35a38fbee87ee678acd809af59730007bc965ead Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 26 Mar 2019 17:03:55 +0100 Subject: [PATCH 07/44] bugfix: fix T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION parameters --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 6 +++--- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 4657493e59..fe7dcf6e6c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -2994,10 +2994,10 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, last_ulsch_ue_id[CC_id] = ulsch_ue_select[CC_id].list[ulsch_ue_num].UE_id; } } else if (ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_RETRANS) { // round > 0 => retransmission - T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), - T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), - T_INT(round)); round = UE_sched_ctrl->round_UL[CC_id][harq_pid]; + T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), + T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb), T_INT(ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb), + T_INT(round)); UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power; UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power; uint8_t mcs_rv = 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index efe60be84f..34a6788408 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1799,8 +1799,8 @@ schedule_ulsch_rnti(module_id_t module_idP, T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template_ptr->mcs_UL[harq_pid]), - T_INT(first_rb_slice[CC_id]), - T_INT(rb_table[rb_table_index]), + T_INT(UE_template_ptr->first_rb_ul[harq_pid]), + T_INT(UE_template_ptr->nb_rb_ul[harq_pid]), T_INT(round_index)); /* Add UL_config PDUs */ From daee800e3ecc88616564737050667188f68d2002 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 27 Mar 2019 14:32:42 +0100 Subject: [PATCH 08/44] bugfix: keep frame in [0..1023] --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 34a6788408..3dbf55022b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1226,6 +1226,7 @@ schedule_ulsch(module_id_t module_idP, if (sched_subframe < subframeP) { sched_frame++; + sched_frame %= 1024; } #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) From 04c24ff698ea45d74f91938c503ba313e1020265 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 27 Mar 2019 14:33:57 +0100 Subject: [PATCH 09/44] minor cleanup --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3dbf55022b..59d316dea5 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1117,6 +1117,8 @@ schedule_ulsch(module_id_t module_idP, eNB_MAC_INST *mac = NULL; slice_info_t *sli = NULL; COMMON_channels_t *cc = NULL; + int sched_subframe; + int sched_frame; /* Init */ mac = RC.mac[module_idP]; @@ -1125,11 +1127,6 @@ schedule_ulsch(module_id_t module_idP, start_meas(&(mac->schedule_ulsch)); - /* Second setup step */ - int sched_subframe = 0; - int sched_frame = 0; - - /* Second init step */ sched_subframe = (subframeP + 4) % 10; sched_frame = frameP; cc = mac->common_channels; From 9565544e3fea4626e3de182e2bc4f40d41822d14 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 28 Mar 2019 12:29:41 +0100 Subject: [PATCH 10/44] bugfix: test free RBs and CCE allocation feasible only for new transmissions --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 234 +++++++++++----------- 1 file changed, 116 insertions(+), 118 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 59d316dea5..4781936850 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1415,34 +1415,6 @@ schedule_ulsch_rnti(module_id_t module_idP, /* This is the actual CC_id in the list */ CC_id = UE_list->ordered_ULCCids[n][UE_id]; - /* Be sure that there are some free RBs */ - if (first_rb_slice[CC_id] >= n_rb_ul_tab[CC_id] - 1) { - LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", - module_idP, - frameP, - subframeP, - UE_id, - rnti, - CC_id); - - continue; - } - - /* Should format_flag be 2 in CCE_allocation_infeasible??? */ - /* This test seems to be way too long, can we provide an optimization? */ - if (CCE_allocation_infeasible(module_idP, CC_id, 1, subframeP, aggregation, rnti)) { - LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: not enough CCE\n", - module_idP, - frameP, - subframeP, - UE_id, - rnti, - CC_id); - - continue; - } - - /* UE is active and can be scheduled, setting up struct */ UE_template_ptr = &(UE_list->UE_template[CC_id][UE_id]); UE_sched_ctrl_ptr = &(UE_list->UE_sched_ctrl[UE_id]); harq_pid = subframe2harqpid(&cc[CC_id], sched_frame, sched_subframeP); @@ -1474,7 +1446,6 @@ schedule_ulsch_rnti(module_id_t module_idP, * If there is information on bsr of DCCH, DTCH or if there is UL_SR, * or if there is a packet to retransmit, or we want to schedule a periodic feedback */ - /* Shouldn't this test be done earlier?? */ if (UE_is_to_be_scheduled(module_idP, CC_id, UE_id) > 0 || round_index > 0) { LOG_D(MAC, "[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n", module_idP, @@ -1492,98 +1463,125 @@ schedule_ulsch_rnti(module_id_t module_idP, // reset the scheduling request UE_template_ptr->ul_SR = 0; status = mac_eNB_get_rrc_status(module_idP, rnti); - cqi_req = 0; - - /* Handle the aperiodic CQI report */ - /* These aperiodic reports behave as periodic ones... */ - if (status >= RRC_CONNECTED && UE_sched_ctrl_ptr->cqi_req_timer > 30) { - if (UE_sched_ctrl_ptr->cqi_received == 0) { - if (nfapi_mode) { - cqi_req = 0; - } else { - cqi_req = 1; - - /* TDD: to be safe, do not ask CQI in special Subframes:36.213/7.2.3 CQI definition */ - if (cc[CC_id].tdd_Config) { - switch (cc[CC_id].tdd_Config->subframeAssignment) { - case 1: - if(subframeP == 1 || subframeP == 6) { - cqi_req=0; - } - break; - - case 3: - if(subframeP == 1) { - cqi_req=0; - } - break; - - default: - LOG_E(MAC," TDD config not supported\n"); - break; - } - } - - if(cqi_req == 1) { - UE_sched_ctrl_ptr->cqi_req_flag |= 1 << sched_subframeP; - } - } - } else { - UE_sched_ctrl_ptr->cqi_req_flag = 0; - UE_sched_ctrl_ptr->cqi_received = 0; - UE_sched_ctrl_ptr->cqi_req_timer = 0; - } - } - - /* Power control */ - /* - * Compute the expected ULSCH RX power (for the stats) - * This is the normalized RX power and this should be constant (regardless of mcs) - * Is not in dBm, unit from nfapi, converting to dBm - * ToDo: Noise power hard coded to 30 - */ - normalized_rx_power = ((5 * UE_sched_ctrl_ptr->pusch_snr[CC_id] - 640) / 10) + 30; - target_rx_power = (mac->puSch10xSnr / 10) + 30; - - /* - * This assumes accumulated tpc - * Make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out - */ - framex10psubframe = (UE_template_ptr->pusch_tpc_tx_frame * 10) + UE_template_ptr->pusch_tpc_tx_subframe; - - if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || // normal case - ((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) { //frame wrap-around - - UE_template_ptr->pusch_tpc_tx_frame = frameP; - UE_template_ptr->pusch_tpc_tx_subframe = subframeP; - - if (normalized_rx_power > (target_rx_power + 4)) { - tpc = 0; // -1 - tpc_accumulated--; - } else if (normalized_rx_power < (target_rx_power - 4)) { - tpc = 2; // +1 - tpc_accumulated++; - } else { - tpc = 1; // 0 - } - } else { - tpc = 1; // 0 - } - - if (tpc != 1) { - LOG_D(MAC, "[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", - module_idP, - frameP, - subframeP, - harq_pid, - tpc, - tpc_accumulated, - normalized_rx_power, - target_rx_power); - } /* New transmission */ if (round_index == 0) { + /* Be sure that there are some free RBs */ + if (first_rb_slice[CC_id] >= n_rb_ul_tab[CC_id] - 1) { + LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", + module_idP, + frameP, + subframeP, + UE_id, + rnti, + CC_id); + + continue; + } + + /* Should format_flag be 2 in CCE_allocation_infeasible??? */ + /* This test seems to be way too long, can we provide an optimization? */ + if (CCE_allocation_infeasible(module_idP, CC_id, 1, subframeP, aggregation, rnti)) { + LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: not enough CCE\n", + module_idP, + frameP, + subframeP, + UE_id, + rnti, + CC_id); + + continue; + } + + /* Handle the aperiodic CQI report */ + cqi_req = 0; + + if (status >= RRC_CONNECTED && UE_sched_ctrl_ptr->cqi_req_timer > 30) { + if (UE_sched_ctrl_ptr->cqi_received == 0) { + if (nfapi_mode) { + cqi_req = 0; + } else { + cqi_req = 1; + + /* TDD: to be safe, do not ask CQI in special Subframes:36.213/7.2.3 CQI definition */ + if (cc[CC_id].tdd_Config) { + switch (cc[CC_id].tdd_Config->subframeAssignment) { + case 1: + if(subframeP == 1 || subframeP == 6) { + cqi_req=0; + } + break; + + case 3: + if(subframeP == 1) { + cqi_req=0; + } + break; + + default: + LOG_E(MAC," TDD config not supported\n"); + break; + } + } + + if(cqi_req == 1) { + UE_sched_ctrl_ptr->cqi_req_flag |= 1 << sched_subframeP; + } + } + } else { + UE_sched_ctrl_ptr->cqi_req_flag = 0; + UE_sched_ctrl_ptr->cqi_received = 0; + UE_sched_ctrl_ptr->cqi_req_timer = 0; + } + } + + /* Power control */ + /* + * Compute the expected ULSCH RX power (for the stats) + * This is the normalized RX power and this should be constant (regardless of mcs) + * Is not in dBm, unit from nfapi, converting to dBm + * ToDo: Noise power hard coded to 30 + */ + normalized_rx_power = ((5 * UE_sched_ctrl_ptr->pusch_snr[CC_id] - 640) / 10) + 30; + target_rx_power = (mac->puSch10xSnr / 10) + 30; + + /* + * This assumes accumulated tpc + * Make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out + */ + framex10psubframe = (UE_template_ptr->pusch_tpc_tx_frame * 10) + UE_template_ptr->pusch_tpc_tx_subframe; + + if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || // normal case + ((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) { //frame wrap-around + + UE_template_ptr->pusch_tpc_tx_frame = frameP; + UE_template_ptr->pusch_tpc_tx_subframe = subframeP; + + if (normalized_rx_power > (target_rx_power + 4)) { + tpc = 0; // -1 + tpc_accumulated--; + } else if (normalized_rx_power < (target_rx_power - 4)) { + tpc = 2; // +1 + tpc_accumulated++; + } else { + tpc = 1; // 0 + } + } else { + tpc = 1; // 0 + } + + if (tpc != 1) { + LOG_D(MAC, "[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n", + module_idP, + frameP, + subframeP, + harq_pid, + tpc, + tpc_accumulated, + normalized_rx_power, + target_rx_power); + } + ndi = 1 - UE_template_ptr->oldNDI_UL[harq_pid]; // NDI: new data indicator UE_template_ptr->oldNDI_UL[harq_pid] = ndi; UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power = normalized_rx_power; From 26118ed860234f0450d8eabadb0973aa327b5a8b Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 28 Mar 2019 12:37:39 +0100 Subject: [PATCH 11/44] bugfix: fix cqi_req usage in UL scheduler For retransmission, let's use cqi_req used for the 1st transmission. Maybe incorrect, should check the specs. (In the worst case, we simply won't decode this transmission at all. No big deal.) --- openair2/LAYER2/MAC/defs.h | 3 +++ openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 2 ++ openair2/LAYER2/MAC/mac.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 2416fab7f1..4e781e5b3f 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -676,6 +676,9 @@ typedef struct { /// Number of Allocated RBs for UL after scheduling uint16_t first_rb_ul[8]; // num_max_harq + /// Is CQI requested for UL after scheduling 1st transmission + uint8_t cqi_req[8]; // num_max_harq + /// Cyclic shift for DMRS after scheduling uint16_t cshift[8]; // num_max_harq diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 4781936850..3b502167ef 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1624,6 +1624,7 @@ schedule_ulsch_rnti(module_id_t module_idP, /* Store information for possible retransmission */ UE_template_ptr->nb_rb_ul[harq_pid] = rb_table[rb_table_index]; UE_template_ptr->first_rb_ul[harq_pid] = first_rb_slice[CC_id]; + UE_template_ptr->cqi_req[harq_pid] = cqi_req; UE_sched_ctrl_ptr->ul_scheduled |= (1 << harq_pid); if (UE_id == UE_list->head) { @@ -1811,6 +1812,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ul_req_index = 0; dlsch_flag = 0; + cqi_req = UE_template_ptr->cqi_req[harq_pid]; for(ul_req_index = 0; ul_req_index < ul_req_tmp_body->number_of_pdus; ul_req_index++) { if(ul_req_tmp_body->ul_config_pdu_list[ul_req_index].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE && diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index fc457c2ee7..2b436a0a04 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -815,6 +815,9 @@ typedef struct { /// Number of Allocated RBs for UL after scheduling uint16_t first_rb_ul[8]; // num_max_harq + /// Is CQI requested for UL after scheduling 1st transmission + uint8_t cqi_req[8]; // num_max_harq + /// Cyclic shift for DMRS after scheduling uint16_t cshift[8]; // num_max_harq From 0e38852b05de8504eb6c2683955746d422ef4357 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 30 Mar 2019 12:01:51 +0100 Subject: [PATCH 12/44] bugfix: access correctly round_UL --- openair2/LAYER2/MAC/pre_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 89756e7baa..b14b7eab65 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -1745,7 +1745,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); - if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id] > 0) { + if (UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid] > 0) { nb_allocated_rbs[CC_id][UE_id] = UE_list->UE_template[CC_id][UE_id].nb_rb_ul[harq_pid]; } else { nb_allocated_rbs[CC_id][UE_id] = From a5a1690394c53aa3a1ef9f48cfefa0586ad5b932 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sat, 30 Mar 2019 15:01:54 +0100 Subject: [PATCH 13/44] bugfixes for UL scheduling - size of PUCCH has been fixed to: - 2 RBs for N_RB_UL = 25 (1 RB at top of resource grid, 1 RB at bottom) - 4 RBs for N_RB_UL = 50 - 6 RBs for N_RB_UL = 100 this is arbitrary and will need some rework at some point. This may be also wrong. PUCCH size actually depends on DL traffic (if the ack/nack is not done in PUSCH) and scheduling request configurations. - add sched_frame %= 1024 at one needed place - reserve RBs for retransmission this was not done so new transmissions were scheduled in the same RBs. Since the code works with the notion of 'first_rb' only, it was decided to skip all RBs lower than those retransmitted. This works but is not correct (imagine we have to retransmit RB 23, then all RBs < 23 will not be used for new transmission). The work to fix this properly is complex, a lot has to change, so let's do it this simple way for now. - sort_ue_ul was not correct - add the function maxround_ul to use the correct 'round' (the one from DL was used, which is totally wrong) - be sure to use the correct frame/subframe to get the correct HARQ pid --- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 45 +++++++++++++++--- openair2/LAYER2/MAC/mac_proto.h | 4 +- openair2/LAYER2/MAC/pre_processor.c | 58 +++++++++++++++++------ 3 files changed, 84 insertions(+), 23 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 3b502167ef..fce11235a1 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1234,12 +1234,16 @@ schedule_ulsch(module_id_t module_idP, /* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */ for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) { - first_rb[CC_id] = 1; // leave out first RB for PUCCH - #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) first_rb[CC_id] = (emtc_active[CC_id] == 1) ? 7 : 1; #else - first_rb[CC_id] = 1; + /* Note: the size of PUCCH is arbitrary, to be done properly. */ + switch (RC.eNB[module_idP][CC_id]->frame_parms.N_RB_DL) { + case 25: first_rb[CC_id] = 1; break; // leave out first RB for PUCCH + case 50: first_rb[CC_id] = 2; break; // leave out first RB for PUCCH + case 100: first_rb[CC_id] = 3; break; // leave out first RB for PUCCH + default: LOG_E(MAC, "nb RBs not handled, todo.\n"); exit(1); + } #endif RA_t *ra_ptr = cc->ra; @@ -1351,6 +1355,7 @@ schedule_ulsch_rnti(module_id_t module_idP, if (sched_subframeP < subframeP) { sched_frame++; + sched_frame %= 1024; } /* NFAPI struct init */ @@ -1366,6 +1371,21 @@ schedule_ulsch_rnti(module_id_t module_idP, /* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */ for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { n_rb_ul_tab[CC_id] = to_prb(cc[CC_id].ul_Bandwidth); // return total number of PRB + /* HACK: let's remove the PUCCH from available RBs + * we suppose PUCCH size is: + * - for 25 RBs: 1 RB (top and bottom of ressource grid) + * - for 50: 2 RBs + * - for 100: 3 RBs + * This is totally arbitrary and might even be wrong. + * We suppose 'first_rb[]' has been correctly populated by the caller, + * so we only remove the top part of the resource grid. + */ + switch (n_rb_ul_tab[CC_id]) { + case 25: n_rb_ul_tab[CC_id] -= 1; break; + case 50: n_rb_ul_tab[CC_id] -= 2; break; + case 100: n_rb_ul_tab[CC_id] -= 3; break; + default: LOG_E(MAC, "RBs setting not handled. Todo.\n"); exit(1); + } UE_list->first_rb_offset[CC_id][slice_idx] = cmin(n_rb_ul_tab[CC_id], sli->ul[slice_idx].first_rb); } @@ -1374,7 +1394,7 @@ schedule_ulsch_rnti(module_id_t module_idP, * pre_assigned_mcs_ul * pre_allocated_rb_table_index_ul */ - ulsch_scheduler_pre_processor(module_idP, slice_idx, frameP, subframeP, sched_subframeP, first_rb); + ulsch_scheduler_pre_processor(module_idP, slice_idx, frameP, subframeP, sched_frame, sched_subframeP, first_rb); for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { first_rb_slice[CC_id] = first_rb[CC_id] + UE_list->first_rb_offset[CC_id][slice_idx]; @@ -1467,7 +1487,7 @@ schedule_ulsch_rnti(module_id_t module_idP, /* New transmission */ if (round_index == 0) { /* Be sure that there are some free RBs */ - if (first_rb_slice[CC_id] >= n_rb_ul_tab[CC_id] - 1) { + if (first_rb_slice[CC_id] >= n_rb_ul_tab[CC_id]) { LOG_W(MAC, "[eNB %d] frame %d, subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", module_idP, frameP, @@ -1903,7 +1923,20 @@ schedule_ulsch_rnti(module_id_t module_idP, sched_frame, sched_subframeP, cqi_req); - } // end of round > 0 + + /* HACK: RBs used by retransmission have to be reserved. + * The current mechanism uses the notion of 'first_rb', so + * we skip all RBs below the ones retransmitted. This is + * not correct. Imagine only RB 23 is retransmitted, then all + * RBs < 23 will be marked unusable for new transmissions (case where round == 0). + * Note also that this code works only if the preprocessor orders + * UEs with retransmission with higher priority than UEs with new + * transmission. + * All this should be cleaned up properly. + */ + if (first_rb_slice[CC_id] < UE_template_ptr->first_rb_ul[harq_pid] + UE_template_ptr->nb_rb_ul[harq_pid]) + first_rb_slice[CC_id] = UE_template_ptr->first_rb_ul[harq_pid] + UE_template_ptr->nb_rb_ul[harq_pid]; + } // end of round > 0 } // UE_is_to_be_scheduled } // loop over all active CC_ids } // loop over UE_ids diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index 8943a21d60..e902065ad1 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -711,8 +711,6 @@ int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP); void store_dlsch_buffer(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframeP); void assign_rbs_required(module_id_t Mod_id, int slice_idx, frame_t frameP, sub_frame_t subframe, uint16_t nb_rbs_required[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB], int min_rb_unit[NFAPI_CC_MAX]); -int maxround(module_id_t Mod_id, uint16_t rnti, int frame, - sub_frame_t subframe, uint8_t ul_flag); void swap_UEs(UE_list_t * listP, int nodeiP, int nodejP, int ul_flag); int prev(UE_list_t * listP, int nodeP, int ul_flag); void dump_ue_list(UE_list_t * listP, int ul_flag); @@ -730,11 +728,11 @@ void set_ul_DAI(int module_idP, void ulsch_scheduler_pre_processor(module_id_t module_idP, int slice_idx, int frameP, sub_frame_t subframeP, + int sched_frameP, unsigned char sched_subframeP, uint16_t * first_rb); void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP); -void sort_ue_ul(module_id_t module_idP, int slice_idx, int frameP, sub_frame_t subframeP, rnti_t *rntiTable); void assign_max_mcs_min_rb(module_id_t module_idP, int slice_idx, int frameP, sub_frame_t subframeP, uint16_t * first_rb); void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index b14b7eab65..292eecbb28 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -56,6 +56,13 @@ extern RAN_CONTEXT_t RC; //#define ICIC 0 +void +sort_ue_ul(module_id_t module_idP, + int slice_idx, + int sched_frameP, + sub_frame_t sched_subframeP, + rnti_t *rntiTable); + /* this function checks that get_eNB_UE_stats returns * a non-NULL pointer for all the active CCs of an UE */ @@ -264,7 +271,7 @@ assign_rbs_required(module_id_t Mod_id, // This function scans all CC_ids for a particular UE to find the maximum round index of its HARQ processes int maxround(module_id_t Mod_id, uint16_t rnti, int frame, - sub_frame_t subframe, uint8_t ul_flag) { + sub_frame_t subframe) { uint8_t round, round_max = 0, UE_id; int CC_id, harq_pid; UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; @@ -284,6 +291,28 @@ maxround(module_id_t Mod_id, uint16_t rnti, int frame, return round_max; } +int +maxround_ul(module_id_t Mod_id, uint16_t rnti, int sched_frame, + sub_frame_t sched_subframe) { + uint8_t round, round_max = 0, UE_id; + int CC_id, harq_pid; + UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list; + COMMON_channels_t *cc; + + for (CC_id = 0; CC_id < RC.nb_mac_CC[Mod_id]; CC_id++) { + cc = &RC.mac[Mod_id]->common_channels[CC_id]; + UE_id = find_UE_id(Mod_id, rnti); + harq_pid = subframe2harqpid(cc, sched_frame, sched_subframe); + round = UE_list->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid]; + + if (round > round_max) { + round_max = round; + } + } + + return round_max; +} + // This function scans all CC_ids for a particular UE to find the maximum DL CQI // it returns -1 if the UE is not found in PHY layer (get_eNB_UE_stats gives NULL) int maxcqi(module_id_t Mod_id, int32_t UE_id) { @@ -332,10 +361,10 @@ static int ue_dl_compare(const void *_a, const void *_b, void *_params) { int UE_id2 = *(const int *) _b; int rnti1 = UE_RNTI(params->Mod_idP, UE_id1); int pCC_id1 = UE_PCCID(params->Mod_idP, UE_id1); - int round1 = maxround(params->Mod_idP, rnti1, params->frameP, params->subframeP, 1); + int round1 = maxround(params->Mod_idP, rnti1, params->frameP, params->subframeP); int rnti2 = UE_RNTI(params->Mod_idP, UE_id2); int pCC_id2 = UE_PCCID(params->Mod_idP, UE_id2); - int round2 = maxround(params->Mod_idP, rnti2, params->frameP, params->subframeP, 1); + int round2 = maxround(params->Mod_idP, rnti2, params->frameP, params->subframeP); int cqi1 = maxcqi(params->Mod_idP, UE_id1); int cqi2 = maxcqi(params->Mod_idP, UE_id2); long lcgid1 = min_lcgidpriority(params->Mod_idP, UE_id1); @@ -1626,6 +1655,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, int slice_idx, int frameP, sub_frame_t subframeP, + int sched_frameP, unsigned char sched_subframeP, uint16_t *first_rb) { int UE_id; @@ -1646,7 +1676,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, // sort ues LOG_D(MAC, "In ulsch_preprocessor: sort ue \n"); - sort_ue_ul(module_idP, slice_idx, frameP, subframeP, rntiTable); + sort_ue_ul(module_idP, slice_idx, sched_frameP, sched_subframeP, rntiTable); // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB LOG_D(MAC, "In ulsch_preprocessor: assign max mcs min rb\n"); assign_max_mcs_min_rb(module_idP, slice_idx, frameP, subframeP, first_rb); @@ -1741,7 +1771,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, CC_id = UE_list->ordered_ULCCids[n][UE_id]; UE_template = &UE_list->UE_template[CC_id][UE_id]; harq_pid = subframe2harqpid(&RC.mac[module_idP]->common_channels[CC_id], - frameP, sched_subframeP); + sched_frameP, sched_subframeP); // mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,openair_harq_UL); @@ -1924,8 +1954,8 @@ assign_max_mcs_min_rb(module_id_t module_idP, struct sort_ue_ul_params { int module_idP; - int frameP; - int subframeP; + int sched_frameP; + int sched_subframeP; }; static int ue_ul_compare(const void *_a, const void *_b, void *_params) { @@ -1935,12 +1965,12 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) { int UE_id2 = *(const int *) _b; int rnti1 = UE_RNTI(params->module_idP, UE_id1); int pCCid1 = UE_PCCID(params->module_idP, UE_id1); - int round1 = maxround(params->module_idP, rnti1, params->frameP, - params->subframeP, 1); + int round1 = maxround_ul(params->module_idP, rnti1, params->sched_frameP, + params->sched_subframeP); int rnti2 = UE_RNTI(params->module_idP, UE_id2); int pCCid2 = UE_PCCID(params->module_idP, UE_id2); - int round2 = maxround(params->module_idP, rnti2, params->frameP, - params->subframeP, 1); + int round2 = maxround_ul(params->module_idP, rnti2, params->sched_frameP, + params->sched_subframeP); if (round1 > round2) return -1; @@ -1984,14 +2014,14 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) { void sort_ue_ul(module_id_t module_idP, int slice_idx, - int frameP, - sub_frame_t subframeP, + int sched_frameP, + sub_frame_t sched_subframeP, rnti_t *rntiTable) { int i; int list[MAX_MOBILES_PER_ENB]; int list_size = 0; - struct sort_ue_ul_params params = { module_idP, frameP, subframeP }; + struct sort_ue_ul_params params = { module_idP, sched_frameP, sched_subframeP }; UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { From cc4aeb6a0cf53265772109a87707c0d50ce9db2a Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 1 Apr 2019 13:33:45 +0200 Subject: [PATCH 14/44] CI: hack to running l2-nfapi-sim in current pipeline Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 21 ++------------------- ci-scripts/waitBuildOnVM.sh | 5 +++++ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index cd2d783638..ffbebde2ad 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -171,14 +171,6 @@ pipeline { } } - stage ("Start VM -- L2-Sim") { - steps { - timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - stage ("Start VM -- phy-sim") { steps { timeout (time: 5, unit: 'MINUTES') { @@ -228,7 +220,7 @@ pipeline { steps { gitlabCommitStatus(name: "Build eNb-ethernet") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" } } } @@ -237,20 +229,11 @@ pipeline { steps { gitlabCommitStatus(name: "Build UE-ethernet") { timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}" + sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" } } } } - stage ("Build L2-Simulator-eNB") { - steps { - //gitlabCommitStatus(name: "Build UE-ethernet") { - timeout (time: 20, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - //} - } - } stage ("Build physical simulators") { steps { gitlabCommitStatus(name: "Build phy-sim") { diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh index 7e4504944f..557cbc9267 100755 --- a/ci-scripts/waitBuildOnVM.sh +++ b/ci-scripts/waitBuildOnVM.sh @@ -124,11 +124,16 @@ function check_on_vm_build { if [ $KEEP_VM_ALIVE -eq 0 ] then + if [[ "$VM_NAME" == *"-enb-ethernet"* ]] || [[ "$VM_NAME" == *"-ue-ethernet"* ]] + then + echo "Hack to not destroy in current pipeline" + else echo "############################################################" echo "Destroying VM" echo "############################################################" uvt-kvm destroy $VM_NAME ssh-keygen -R $VM_IP_ADDR + fi fi rm -f $VM_CMDS From b40335613f5aafaa92bb256f28ef43eb14c99e9c Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 1 Apr 2019 16:28:33 +0200 Subject: [PATCH 15/44] CI: after Radio Setup modification, increase on the max Rx gain for UE scenario Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml | 2 +- ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml index 0e61e75d56..8353dca160 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_orange.xml @@ -32,7 +32,7 @@ Initialize_OAI_UE Initialize OAI UE -- sniffing Orange frequency - -C 816000000 -r 50 --ue-rxgain 120 --ue-scan-carrier --no-L2-connect + -C 816000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect diff --git a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml index ae8aa0e668..197d2fdbf9 100644 --- a/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml +++ b/ci-scripts/xml_files/ue_band20_test_10mhz_sfr.xml @@ -32,7 +32,7 @@ Initialize_OAI_UE Initialize OAI UE -- sniffing SFR frequency - -C 806000000 -r 50 --ue-rxgain 120 --ue-scan-carrier --no-L2-connect + -C 806000000 -r 50 --ue-rxgain 130 --ue-scan-carrier --no-L2-connect From f53d025e0da84b275fd198a58246b7f9cab3f925 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 2 Apr 2019 18:19:31 +0200 Subject: [PATCH 16/44] CI: better email reporting Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 192 +++++++++++++++++++++++++++++++--- 1 file changed, 176 insertions(+), 16 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index cd2d783638..8bd6a107c0 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -36,6 +36,21 @@ def doFlexranCtrlTest = false // Location of the executor node def nodeExecutor = params.nodeExecutor +// Stage Pass Statuses +def build_enb_usrp = false +def build_basic_sim = false +def build_phy_sim = false +def build_enb_ethernet = false +def build_ue_ethernet = false +def test_basic_sim = false +def test_phy_sim = false +def test_l2_sim = false +def test_fdd_mono_band7 = false +def test_fdd_mono_band13 = false +def test_tdd_mono_band40 = false +def test_fdd_if4p5_band7 = false +def test_tdd_if4p5_band40 = false + pipeline { agent { label nodeExecutor @@ -88,6 +103,9 @@ pipeline { echo "GitLab Act is ${env.gitlabActionType}" script { if ("MERGE".equals(env.gitlabActionType)) { + // since a bit, in push events, gitlabUserEmail is not populated + gitCommitAuthorEmailAddr = ${env.gitlabUserEmail} + echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}" // GitLab-Jenkins plugin integration is lacking to perform the merge by itself // Doing it manually --> it may have merge conflicts sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" @@ -107,6 +125,10 @@ pipeline { } else { echo "Git Branch is ${GIT_BRANCH}" echo "Git Commit is ${GIT_COMMIT}" + // since a bit, in push events, gitlabUserEmail is not populated + gitCommitAuthorEmailAddr = sh returnStdout: true, script: 'git log -n1 --pretty=format:%ae ${GIT_COMMIT}' + gitCommitAuthorEmailAddr = gitCommitAuthorEmailAddr.trim() + echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}" sh "git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG" sh "zip -r -qq localZip.zip ." @@ -214,6 +236,13 @@ pipeline { } } } + post { + success { + script { + build_enb_usrp = true + } + } + } } stage ("Build basic simulator") { steps { @@ -223,6 +252,13 @@ pipeline { } } } + post { + success { + script { + build_basic_sim = true + } + } + } } stage ("Build eNb-ethernet") { steps { @@ -232,6 +268,13 @@ pipeline { } } } + post { + success { + script { + build_enb_ethernet = true + } + } + } } stage ("Build UE-ethernet") { steps { @@ -241,6 +284,13 @@ pipeline { } } } + post { + success { + script { + build_ue_ethernet = true + } + } + } } stage ("Build L2-Simulator-eNB") { steps { @@ -259,6 +309,13 @@ pipeline { } } } + post { + success { + script { + build_phy_sim = true + } + } + } } stage ("Build eNb-USRP on Red Hat") { when { @@ -349,6 +406,13 @@ pipeline { } } } + post { + success { + script { + test_phy_sim = true + } + } + } } stage ("Build Flexran Controller") { when { @@ -380,6 +444,13 @@ pipeline { } } } + post { + success { + script { + test_basic_sim = true + } + } + } } stage ("Test L2 simulator") { steps { @@ -395,6 +466,13 @@ pipeline { } } } + post { + success { + script { + test_l2_sim = true + } + } + } } } } @@ -426,9 +504,13 @@ pipeline { } } post { + success { + script { + test_fdd_mono_band7 = true + } + } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. - // The only drop-back is that we may retrieve the HTML report of a previous build + // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { script { if (!fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) { @@ -477,9 +559,13 @@ pipeline { } } post { + success { + script { + test_tdd_mono_band40 = true + } + } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. - // The only drop-back is that we may retrieve the HTML report of a previous build + // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { script { if (!fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) { @@ -528,9 +614,13 @@ pipeline { } } post { + success { + script { + test_fdd_if4p5_band7 = true + } + } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. - // The only drop-back is that we may retrieve the HTML report of a previous build + // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { script { if (!fileExists('test_results-eNB-CI-IF4p5-FDD-Band7-B210.html')) { @@ -579,9 +669,13 @@ pipeline { } } post { + success { + script { + test_tdd_if4p5_band40 = true + } + } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. - // The only drop-back is that we may retrieve the HTML report of a previous build + // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { script { if (!fileExists('test_results-eNB-CI-IF4p5-TDD-Band40-B210.html')) { @@ -630,9 +724,13 @@ pipeline { } } post { + success { + script { + test_fdd_mono_band13 = true + } + } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. - // The only drop-back is that we may retrieve the HTML report of a previous build + // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { script { if (!fileExists('test_results-eNB-CI-MONO-FDD-Band13-B210.html')) { @@ -682,8 +780,7 @@ pipeline { } post { // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. - // The only drop-back is that we may retrieve the HTML report of a previous build + // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { script { if (!fileExists('test_results-UE-CI-FDD-Band20-B200.html')) { @@ -738,15 +835,78 @@ pipeline { script { // Stage destroy may not be run if error in previous stage sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - emailext attachmentsPattern: '*results*.html', - body: '''Hi, + def bodyMsg = '''Hi, + +''' + if ((!build_enb_usrp) || (!build_basic_sim) || (!build_phy_sim) || (!build_enb_ethernet) || (!build_ue_ethernet) || + (!test_basic_sim) || (!test_phy_sim) || (!test_l2_sim) || + (!test_fdd_mono_band7) || (!test_fdd_mono_band13) || (!test_tdd_mono_band40) || (!test_fdd_if4p5_band7) || (!test_tdd_if4p5_band40)) { + bodyMsg += '''Stages that did fail: +''' + } + if (!build_enb_usrp) { + bodyMsg += ''' -- Build eNB + USRP stage +''' + } + if (!build_basic_sim) { + bodyMsg += ''' -- Build Basic-Simulator stage +''' + } + if (!build_phy_sim) { + bodyMsg += ''' -- Build Physical-Simulators stage +''' + } + if (!build_enb_ethernet) { + bodyMsg += ''' -- Build eNB + ETHERNET transport stage +''' + } + if (!build_ue_ethernet) { + bodyMsg += ''' -- Build UE + ETHERNET transport stage +''' + } + if (!test_basic_sim) { + bodyMsg += ''' -- Test Basic-Simulator stage +''' + } + if (!test_phy_sim) { + bodyMsg += ''' -- Test Physical-Simulators stage +''' + } + if (!test_l2_sim) { + bodyMsg += ''' -- Test L2-nFAPI-Simulator stage +''' + } + if (!test_fdd_mono_band7) { + bodyMsg += ''' -- Test B210-FDD-Monolithic-Band7 stage +''' + } + if (!test_fdd_mono_band13) { + bodyMsg += ''' -- Test B210-FDD-Monolithic-Band13 stage +''' + } + if (!test_tdd_mono_band40) { + bodyMsg += ''' -- Test B210-TDD-Monolithic-Band40 stage +''' + } + if (!test_fdd_if4p5_band7) { + bodyMsg += ''' -- Test B210-FDD-IF4.5-Band7 stage +''' + } + if (!test_tdd_if4p5_band40) { + bodyMsg += ''' -- Test B210-TDD-IF4.5-Band40 stage +''' + } + bodyMsg += ''' + Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS! Regards, -OAI CI Team''', +OAI CI Team''' + emailext attachmentsPattern: '*results*.html', + body: bodyMsg, replyTo: 'no-reply@openairinterface.org', subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', - to: env.gitlabUserEmail + to: gitCommitAuthorEmailAddr if (fileExists('.git/CI_COMMIT_MSG')) { sh "rm -f .git/CI_COMMIT_MSG" From b39bf79bab4ccc46ab432cfa668a6190643da4cc Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 2 Apr 2019 18:38:27 +0200 Subject: [PATCH 17/44] CI: pipeline is too big Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 164 +--------------------------------- 1 file changed, 3 insertions(+), 161 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 8bd6a107c0..d0446f0ec0 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -36,21 +36,6 @@ def doFlexranCtrlTest = false // Location of the executor node def nodeExecutor = params.nodeExecutor -// Stage Pass Statuses -def build_enb_usrp = false -def build_basic_sim = false -def build_phy_sim = false -def build_enb_ethernet = false -def build_ue_ethernet = false -def test_basic_sim = false -def test_phy_sim = false -def test_l2_sim = false -def test_fdd_mono_band7 = false -def test_fdd_mono_band13 = false -def test_tdd_mono_band40 = false -def test_fdd_if4p5_band7 = false -def test_tdd_if4p5_band40 = false - pipeline { agent { label nodeExecutor @@ -236,13 +221,6 @@ pipeline { } } } - post { - success { - script { - build_enb_usrp = true - } - } - } } stage ("Build basic simulator") { steps { @@ -252,13 +230,6 @@ pipeline { } } } - post { - success { - script { - build_basic_sim = true - } - } - } } stage ("Build eNb-ethernet") { steps { @@ -268,13 +239,6 @@ pipeline { } } } - post { - success { - script { - build_enb_ethernet = true - } - } - } } stage ("Build UE-ethernet") { steps { @@ -284,13 +248,6 @@ pipeline { } } } - post { - success { - script { - build_ue_ethernet = true - } - } - } } stage ("Build L2-Simulator-eNB") { steps { @@ -309,13 +266,6 @@ pipeline { } } } - post { - success { - script { - build_phy_sim = true - } - } - } } stage ("Build eNb-USRP on Red Hat") { when { @@ -406,13 +356,6 @@ pipeline { } } } - post { - success { - script { - test_phy_sim = true - } - } - } } stage ("Build Flexran Controller") { when { @@ -444,13 +387,6 @@ pipeline { } } } - post { - success { - script { - test_basic_sim = true - } - } - } } stage ("Test L2 simulator") { steps { @@ -466,13 +402,6 @@ pipeline { } } } - post { - success { - script { - test_l2_sim = true - } - } - } } } } @@ -504,11 +433,6 @@ pipeline { } } post { - success { - script { - test_fdd_mono_band7 = true - } - } // In case of any non-success, we are retrieving the HTML report of the last completed // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { @@ -559,11 +483,6 @@ pipeline { } } post { - success { - script { - test_tdd_mono_band40 = true - } - } // In case of any non-success, we are retrieving the HTML report of the last completed // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { @@ -614,11 +533,6 @@ pipeline { } } post { - success { - script { - test_fdd_if4p5_band7 = true - } - } // In case of any non-success, we are retrieving the HTML report of the last completed // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { @@ -669,11 +583,6 @@ pipeline { } } post { - success { - script { - test_tdd_if4p5_band40 = true - } - } // In case of any non-success, we are retrieving the HTML report of the last completed // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { @@ -724,11 +633,6 @@ pipeline { } } post { - success { - script { - test_fdd_mono_band13 = true - } - } // In case of any non-success, we are retrieving the HTML report of the last completed // slave job. The only drop-back is that we may retrieve the HTML report of a previous build always { @@ -835,75 +739,13 @@ pipeline { script { // Stage destroy may not be run if error in previous stage sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - def bodyMsg = '''Hi, - -''' - if ((!build_enb_usrp) || (!build_basic_sim) || (!build_phy_sim) || (!build_enb_ethernet) || (!build_ue_ethernet) || - (!test_basic_sim) || (!test_phy_sim) || (!test_l2_sim) || - (!test_fdd_mono_band7) || (!test_fdd_mono_band13) || (!test_tdd_mono_band40) || (!test_fdd_if4p5_band7) || (!test_tdd_if4p5_band40)) { - bodyMsg += '''Stages that did fail: -''' - } - if (!build_enb_usrp) { - bodyMsg += ''' -- Build eNB + USRP stage -''' - } - if (!build_basic_sim) { - bodyMsg += ''' -- Build Basic-Simulator stage -''' - } - if (!build_phy_sim) { - bodyMsg += ''' -- Build Physical-Simulators stage -''' - } - if (!build_enb_ethernet) { - bodyMsg += ''' -- Build eNB + ETHERNET transport stage -''' - } - if (!build_ue_ethernet) { - bodyMsg += ''' -- Build UE + ETHERNET transport stage -''' - } - if (!test_basic_sim) { - bodyMsg += ''' -- Test Basic-Simulator stage -''' - } - if (!test_phy_sim) { - bodyMsg += ''' -- Test Physical-Simulators stage -''' - } - if (!test_l2_sim) { - bodyMsg += ''' -- Test L2-nFAPI-Simulator stage -''' - } - if (!test_fdd_mono_band7) { - bodyMsg += ''' -- Test B210-FDD-Monolithic-Band7 stage -''' - } - if (!test_fdd_mono_band13) { - bodyMsg += ''' -- Test B210-FDD-Monolithic-Band13 stage -''' - } - if (!test_tdd_mono_band40) { - bodyMsg += ''' -- Test B210-TDD-Monolithic-Band40 stage -''' - } - if (!test_fdd_if4p5_band7) { - bodyMsg += ''' -- Test B210-FDD-IF4.5-Band7 stage -''' - } - if (!test_tdd_if4p5_band40) { - bodyMsg += ''' -- Test B210-TDD-IF4.5-Band40 stage -''' - } - bodyMsg += ''' + emailext attachmentsPattern: '*results*.html', + body: '''Hi, Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS! Regards, -OAI CI Team''' - emailext attachmentsPattern: '*results*.html', - body: bodyMsg, +OAI CI Team''', replyTo: 'no-reply@openairinterface.org', subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: gitCommitAuthorEmailAddr From b9379834497ed9c738751410377c28d1f1bd5b8e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 3 Apr 2019 12:27:31 +0200 Subject: [PATCH 18/44] T: minor fix: ensure printing is inside the widget --- common/utils/T/tracer/gui/xy_plot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c index 0f15f4862a..c10b76c6ee 100644 --- a/common/utils/T/tracer/gui/xy_plot.c +++ b/common/utils/T/tracer/gui/xy_plot.c @@ -130,9 +130,13 @@ static void paint(gui *_gui, widget *_this) this->common.y + FLIP(y), this->common.x + this->vrule_width + 5, this->common.y + FLIP(y)); + /* do not print out of the widget (take care of top) */ + y = FLIP(y)-this->label_height/2+this->label_baseline; + if (y - this->label_baseline < 0) + y = this->label_baseline; x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, this->common.x + this->vrule_width - vwidth - 2, - this->common.y + FLIP(y)-this->label_height/2+this->label_baseline, + this->common.y + y, v); } break; From 4905a5e8e81e5f756395b46f5681f01f69b0fb8e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 3 Apr 2019 12:44:17 +0200 Subject: [PATCH 19/44] bugfixes for the ue T tracer Not much major changes. In openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c, in the function generate_ue_dlsch_params_from_dci, 'harq_pid' was removed and dci_info_extarcted.harq_pid is now used for all cases. The ue T tracer only deals with PHY signals (no MAC, RLC, PDCP, RRC). --- common/utils/T/tracer/ue.c | 299 +++++++------------ openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 18 +- openair1/SCHED_UE/phy_procedures_lte_ue.c | 45 +-- targets/RT/USER/lte-ue.c | 1 + 4 files changed, 136 insertions(+), 227 deletions(-) diff --git a/common/utils/T/tracer/ue.c b/common/utils/T/tracer/ue.c index 7b03210cd2..bafa0384f2 100644 --- a/common/utils/T/tracer/ue.c +++ b/common/utils/T/tracer/ue.c @@ -23,9 +23,6 @@ typedef struct { view *pdcpview; view *rrcview; view *legacy; - widget *current_ue_label; - widget *prev_ue_button; - widget *next_ue_button; widget *pdsch_iq_ue_xy_plot; widget *dl_estimate_ue_xy_plot; widget *pdcch_energy_ue_xy_plot; @@ -121,15 +118,14 @@ static void *gui_thread(void *_g) return NULL; } -static filter *ticktime_filter(void *database, char *event, int i, int ue) +static filter *ticktime_filter(void *database, char *event, int i) { - /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */ + /* filter is "harq_pid == i and eNB_id == 0" */ return filter_and( filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)), - filter_and( - filter_eq(filter_evarg(database, event, "UE_id"), filter_int(ue)), - filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0)))); + filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0))); + } static void set_current_ue(gui *g, ue_data *e, int ue) @@ -137,8 +133,6 @@ static void set_current_ue(gui *g, ue_data *e, int ue) int i; char s[256]; - sprintf(s, "[UE %d] ", ue); - label_set_text(g, e->e->current_ue_label, s); sprintf(s, "PDSCH IQ [UE %d]", ue); xy_plot_set_title(g, e->e->pdsch_iq_ue_xy_plot, s); sprintf(s, "DL estimated channel [UE %d]", ue); @@ -161,97 +155,24 @@ static void set_current_ue(gui *g, ue_data *e, int ue) xy_plot_set_title(g, e->e->pucch_power_xy_plot, s); sprintf(s, "PHY Measurements [UE %d]", ue); xy_plot_set_title(g, e->e->phy_meas_xy_plot, s); - - logger_set_filter(e->e->pdsch_iq_ue_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PDSCH_IQ", "UE_ID"), - filter_int(ue))); - logger_set_filter(e->e->dl_estimate_ue_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_DL_CHANNEL_ESTIMATE", "UE_ID"), - filter_int(ue))); - logger_set_filter(e->e->pdcch_energy_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PDCCH_ENERGY", "UE_ID"), - filter_int(ue))); - logger_set_filter(e->e->pdsch_energy_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PDSCH_ENERGY", "UE_ID"), - filter_int(ue))); - logger_set_filter(e->e->phy_meas_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_MEAS", "UE_ID"), - filter_int(ue))); - /*logger_set_filter(e->pucch1_energy_ue_energy_logger, - filter_eq( - filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"), - filter_int(ue)));*/ - /*logger_set_filter(e->e->pdcch_iq_ue_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PDCCH_IQ", "UE_ID"), - filter_int(ue)));*/ + for (i = 0; i < 8; i++) { logger_set_filter(e->e->dl_dci_logger[i], - ticktime_filter(e->database, "UE_PHY_DLSCH_UE_DCI", i, ue)); + ticktime_filter(e->database, "UE_PHY_DLSCH_UE_DCI", i)); logger_set_filter(e->e->dl_ack_logger[i], - ticktime_filter(e->database, "UE_PHY_DLSCH_UE_ACK", i, ue)); + ticktime_filter(e->database, "UE_PHY_DLSCH_UE_ACK", i)); logger_set_filter(e->e->dl_nack_logger[i], - ticktime_filter(e->database, "UE_PHY_DLSCH_UE_NACK", i, ue)); + ticktime_filter(e->database, "UE_PHY_DLSCH_UE_NACK", i)); logger_set_filter(e->e->ul_dci_logger[i], - ticktime_filter(e->database, "UE_PHY_ULSCH_UE_DCI", i, ue)); + ticktime_filter(e->database, "UE_PHY_ULSCH_UE_DCI", i)); /*logger_set_filter(e->ul_dci_retransmission_logger[i], ticktime_filter(e->database, - "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", i, ue));*/ + "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", i));*/ logger_set_filter(e->e->ul_ack_logger[i], - ticktime_filter(e->database, "UE_PHY_ULSCH_UE_ACK", i, ue)); + ticktime_filter(e->database, "UE_PHY_ULSCH_UE_ACK", i)); logger_set_filter(e->e->ul_nack_logger[i], - ticktime_filter(e->database, "UE_PHY_ULSCH_UE_NACK", i, ue)); + ticktime_filter(e->database, "UE_PHY_ULSCH_UE_NACK", i)); } - logger_set_filter(e->e->dl_mcs_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_DLSCH_UE_DCI", "UE_id"), - filter_int(ue))); - logger_set_filter(e->e->ul_mcs_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_ULSCH_UE_DCI", "UE_id"), - filter_int(ue))); - logger_set_filter(e->e->pusch_power_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PUSCH_TX_POWER", "UE_id"), - filter_int(ue))); - logger_set_filter(e->e->pusch_ampl_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PUSCH_TX_POWER", "UE_id"), - filter_int(ue))); - logger_set_filter(e->e->pucch_power_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PUCCH_TX_POWER", "UE_id"), - filter_int(ue))); - logger_set_filter(e->e->pucch_ampl_logger, - filter_eq( - filter_evarg(e->database, "UE_PHY_PUCCH_TX_POWER", "UE_id"), - filter_int(ue))); -} - -static void click(void *private, gui *g, - char *notification, widget *w, void *notification_data) -{ - int *d = notification_data; - int button = d[0]; - ue_data *ed = private; - ue_gui *e = ed->e; - int ue = ed->ue; - - if (button != 1) return; - if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; } - if (w == e->next_ue_button) ue++; - - if (pthread_mutex_lock(&ed->lock)) abort(); - if (ue != ed->ue) { - set_current_ue(g, ed, ue); - ed->ue = ue; - } - if (pthread_mutex_unlock(&ed->lock)) abort(); } static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, @@ -271,7 +192,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, widget *text; view *textview; int i; - widget *w, *w2; + widget *w; view *v; logger *l; @@ -283,24 +204,8 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, widget_add_child(g, top_container, line, -1); logo = new_image(g, openair_logo_png, openair_logo_png_len); - /* logo + prev/next UE buttons */ - col = new_container(g, VERTICAL); - widget_add_child(g, col, logo, -1); - w = new_container(g, HORIZONTAL); - widget_add_child(g, col, w, -1); - w2 = new_label(g, ""); - widget_add_child(g, w, w2, -1); - e->current_ue_label = w2; - /* TODO: use button widget, not label widget */ - w2 = new_label(g, " [prev UE] "); - widget_add_child(g, w, w2, -1); - label_set_clickable(g, w2, 1); - e->prev_ue_button = w2; - w2 = new_label(g, " [next UE] "); - widget_add_child(g, w, w2, -1); - label_set_clickable(g, w2, 1); - e->next_ue_button = w2; - widget_add_child(g, line, col, -1); + /* logo */ + widget_add_child(g, line, logo, -1); input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20); widget_add_child(g, line, input_signal_plot, -1); @@ -356,80 +261,13 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, v = new_view_tti(10, g, w, new_color(g, "#0c720c")); logger_add_view(l, v); e->phy_meas_logger = l; - - /* UE x PDSCH energy */ - w = new_xy_plot(g, 128, 55, "", 50); - e->pdsch_energy_ue_xy_plot = w; + + /* a bit of space */ + line = new_container(g, HORIZONTAL); + widget_add_child(g, top_container, line, -1); + w = new_space(g, 1, 10); widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 1024*10, -10, 80); - l = new_ttilog(h, database, - "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level00", 1); - v = new_view_tti(10, g, w, new_color(g, "#ff0000")); - logger_add_view(l, v); - e->pdsch_energy_logger = l; - l = new_ttilog(h, database, - "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level01", 1); - v = new_view_tti(10, g, w, new_color(g, "#00ff00")); - logger_add_view(l, v); - e->pdsch_energy_logger = l; - l = new_ttilog(h, database, - "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level10", 1); - v = new_view_tti(10, g, w, new_color(g, "#0f0f0f")); - logger_add_view(l, v); - e->pdsch_energy_logger = l; - l = new_ttilog(h, database, - "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level11", 1); - v = new_view_tti(10, g, w, new_color(g, "#0000ff")); - logger_add_view(l, v); - e->pdsch_energy_logger = l; - - /* UE x PDCCH energy */ - w = new_xy_plot(g, 128, 55, "", 50); - e->pdcch_energy_ue_xy_plot = w; - widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 1024*10, -10, 80); - l = new_ttilog(h, database, - "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level00", 1); - v = new_view_tti(10, g, w, new_color(g, "#ff0000")); - logger_add_view(l, v); - e->pdcch_energy_logger = l; - l = new_ttilog(h, database, - "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level01", 1); - v = new_view_tti(10, g, w, new_color(g, "#00ff00")); - logger_add_view(l, v); - e->pdcch_energy_logger = l; - l = new_ttilog(h, database, - "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level10", 1); - v = new_view_tti(10, g, w, new_color(g, "#0f0f0f")); - logger_add_view(l, v); - e->pdcch_energy_logger = l; - l = new_ttilog(h, database, - "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level11", 1); - v = new_view_tti(10, g, w, new_color(g, "#0000ff")); - logger_add_view(l, v); - e->pdcch_energy_logger = l; - - /* UE x PDCCH IQ data */ - w = new_xy_plot(g, 55, 55, "", 50); - e->pdcch_iq_ue_xy_plot = w; - widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, -100, 100, -100, 100); - l = new_iqlog(h, database, "UE_PHY_PDCCH_IQ", "nb_rb", - "NB_RB_DL", "symbols_per_tti", "rxdataF_comp"); - v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE); - logger_add_view(l, v); - e->pdcch_iq_ue_logger = l; - - /* UE x PDCCH IQ data */ - /*w = new_xy_plot(g, 55, 55, "", 50); - e->pdcch_iq_ue_xy_plot = w; - widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, -2000, 2000, -2000, 2000); - l = new_iqdotlog(h, database, "UE_PHY_PDCCH_IQ", "I", "Q"); - v = new_view_xy(500, 10, g, w, new_color(g,"#000"), XY_LOOP_MODE); - logger_add_view(l, v); - e->pdcch_iq_ue_logger = l;*/ - + /* UE x DL mcs */ line = new_container(g, HORIZONTAL); widget_add_child(g, top_container, line, -1); @@ -448,7 +286,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, xy_plot_set_range(g, w, 0, 1024*10, -2, 30); e->ul_mcs_xy_plot = w; widget_add_child(g, line, w, -1); - l = new_ticked_ttilog(h, database, "UE_PHY_UL_TICK", "frame", "subframe", + l = new_ticked_ttilog(h, database, "UE_PHY_DL_TICK", "frame", "subframe", "UE_PHY_ULSCH_UE_DCI", "mcs", 0, -1); v = new_view_tti(10, g, w, new_color(g, "#0c0c72")); logger_add_view(l, v); @@ -471,7 +309,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, v = new_view_tti(10, g, w, new_color(g, "#720c0c")); logger_add_view(l, v); e->pusch_ampl_logger = l; - + /* UE x PUCCH TX Power */ // line = new_container(g, HORIZONTAL); // widget_add_child(g, top_container, line, -1); @@ -489,8 +327,81 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, v = new_view_tti(10, g, w, new_color(g, "#720c0c")); logger_add_view(l, v); e->pucch_ampl_logger = l; - - + + /* UE x PDSCH energy */ + w = new_xy_plot(g, 128, 55, "", 50); + e->pdsch_energy_ue_xy_plot = w; + widget_add_child(g, line, w, -1); + xy_plot_set_range(g, w, 0, 1024*10, -10, 80); + l = new_ttilog(h, database, + "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level00", 1); + v = new_view_tti(10, g, w, new_color(g, "#ff0000")); + logger_add_view(l, v); + e->pdsch_energy_logger = l; + l = new_ttilog(h, database, + "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level01", 1); + v = new_view_tti(10, g, w, new_color(g, "#00ff00")); + logger_add_view(l, v); + e->pdsch_energy_logger = l; + l = new_ttilog(h, database, + "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level10", 1); + v = new_view_tti(10, g, w, new_color(g, "#0f0f0f")); + logger_add_view(l, v); + e->pdsch_energy_logger = l; + l = new_ttilog(h, database, + "UE_PHY_PDSCH_ENERGY", "frame", "subframe", "pdsch_ch_level11", 1); + v = new_view_tti(10, g, w, new_color(g, "#0000ff")); + logger_add_view(l, v); + e->pdsch_energy_logger = l; + + /* UE x PDCCH energy */ + w = new_xy_plot(g, 128, 55, "", 50); + e->pdcch_energy_ue_xy_plot = w; + widget_add_child(g, line, w, -1); + xy_plot_set_range(g, w, 0, 1024*10, -10, 80); + l = new_ttilog(h, database, + "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level00", 1); + v = new_view_tti(10, g, w, new_color(g, "#ff0000")); + logger_add_view(l, v); + e->pdcch_energy_logger = l; + l = new_ttilog(h, database, + "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level01", 1); + v = new_view_tti(10, g, w, new_color(g, "#00ff00")); + logger_add_view(l, v); + e->pdcch_energy_logger = l; + l = new_ttilog(h, database, + "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level10", 1); + v = new_view_tti(10, g, w, new_color(g, "#0f0f0f")); + logger_add_view(l, v); + e->pdcch_energy_logger = l; + l = new_ttilog(h, database, + "UE_PHY_PDCCH_ENERGY", "frame", "subframe", "pdcch_ch_level11", 1); + v = new_view_tti(10, g, w, new_color(g, "#0000ff")); + logger_add_view(l, v); + e->pdcch_energy_logger = l; + + /* UE x PDCCH IQ data */ + w = new_xy_plot(g, 55, 55, "", 50); + e->pdcch_iq_ue_xy_plot = w; + widget_add_child(g, line, w, -1); + xy_plot_set_range(g, w, -100, 100, -100, 100); + l = new_iqlog(h, database, "UE_PHY_PDCCH_IQ", "nb_rb", + "NB_RB_DL", "symbols_per_tti", "rxdataF_comp"); + v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE); + logger_add_view(l, v); + e->pdcch_iq_ue_logger = l; + + /* UE x PDCCH IQ data */ + /*w = new_xy_plot(g, 55, 55, "", 50); + e->pdcch_iq_ue_xy_plot = w; + widget_add_child(g, line, w, -1); + xy_plot_set_range(g, w, -2000, 2000, -2000, 2000); + l = new_iqdotlog(h, database, "UE_PHY_PDCCH_IQ", "I", "Q"); + v = new_view_xy(500, 10, g, w, new_color(g,"#000"), XY_LOOP_MODE); + logger_add_view(l, v); + e->pdcch_iq_ue_logger = l;*/ + + /* downlink/uplink UE DCIs */ widget_add_child(g, top_container, new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1); @@ -600,14 +511,14 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, logger_add_view(timelog, subview); e->ul_dci_logger[i] = timelog; /* retransmission */ - + timelog = new_ticklog(h, database, "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", "frame", "subframe"); subview = new_subview_ticktime(timeview, i+9+1, new_color(g,"#99f"), 3600*1000); logger_add_view(timelog, subview); e->ul_dci_retransmission_logger[i] = timelog; - + } /* UL ACK */ @@ -707,8 +618,6 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, #endif set_current_ue(g, ed, 0); - register_notifier(g, "click", e->prev_ue_button, click, ed); - register_notifier(g, "click", e->next_ue_button, click, ed); } void view_add_log(view *v, char *log, event_handler *h, void *database, @@ -824,13 +733,11 @@ int main(int n, char **v) on_off(database, "UE_PHY_PUSCH_TX_POWER", is_on, 1); on_off(database, "UE_PHY_PUCCH_TX_POWER", is_on, 1); on_off(database, "UE_PHY_MEAS", is_on, 1); - + on_off(database, "LEGACY_GROUP_INFO", is_on, 1); on_off(database, "LEGACY_GROUP_ERROR", is_on, 1); on_off(database, "LEGACY_GROUP_WARNING", is_on, 1); - - view_add_log(eg.phyview, "UE_PHY_UL_TICK", h, database, is_on); - view_add_log(eg.phyview, "UE_PHY_DL_TICK", h, database, is_on); + view_add_log(eg.phyview, "UE_PHY_DLSCH_UE_DCI", h, database, is_on); view_add_log(eg.phyview, "UE_PHY_DLSCH_UE_ACK", h, database, is_on); view_add_log(eg.phyview, "UE_PHY_DLSCH_UE_NACK",h, database, is_on); @@ -838,8 +745,6 @@ int main(int n, char **v) view_add_log(eg.phyview, "UE_PHY_ULSCH_UE_ACK", h, database, is_on); view_add_log(eg.phyview, "UE_PHY_ULSCH_UE_NACK", h, database, is_on); - - /* deactivate those two by default, they are a bit heavy */ //on_off(database, "ENB_MAC_UE_UL_SDU_WITH_DATA", is_on, 0); //on_off(database, "ENB_MAC_UE_UL_PDU_WITH_DATA", is_on, 0); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index dbade04739..4f65edd6d5 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -2171,8 +2171,6 @@ int generate_ue_dlsch_params_from_dci(int frame, uint8_t beamforming_mode, uint16_t tc_rnti) { - - uint8_t harq_pid=0; uint8_t frame_type=frame_parms->frame_type; uint8_t tpmi=0; LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; @@ -2488,15 +2486,15 @@ int generate_ue_dlsch_params_from_dci(int frame, case format1E_2A_M10PRB: if (!dlsch[0]) return -1; - harq_pid = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->harq_pid; + dci_info_extarcted.harq_pid = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->harq_pid; - if (harq_pid>=8) { - LOG_E(PHY,"Format 1E_2A_M10PRB: harq_pid=%d >= 8\n", harq_pid); + if (dci_info_extarcted.harq_pid>=8) { + LOG_E(PHY,"Format 1E_2A_M10PRB: harq_pid=%d >= 8\n", dci_info_extarcted.harq_pid); return(-1); } - dlsch[0]->current_harq_pid = harq_pid; - dlsch[0]->harq_ack[subframe].harq_id = harq_pid; + dlsch[0]->current_harq_pid = dci_info_extarcted.harq_pid; + dlsch[0]->harq_ack[subframe].harq_id = dci_info_extarcted.harq_pid; /* tbswap = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->tb_swap; @@ -2511,7 +2509,7 @@ int generate_ue_dlsch_params_from_dci(int frame, */ dlsch0 = dlsch[0]; - dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; + dlsch0_harq = dlsch[0]->harq_processes[dci_info_extarcted.harq_pid]; // Needs to be checked dlsch0_harq->codeword=0; conv_rballoc(((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rah, @@ -2627,7 +2625,7 @@ int generate_ue_dlsch_params_from_dci(int frame, // is NAK or an ACK was not received dlsch0->harq_ack[subframe].ack = 1; - dlsch0->harq_ack[subframe].harq_id = harq_pid; + dlsch0->harq_ack[subframe].harq_id = dci_info_extarcted.harq_pid; dlsch0->harq_ack[subframe].send_harq_status = 1; dlsch0->active = 0; return(0); @@ -2683,7 +2681,7 @@ int generate_ue_dlsch_params_from_dci(int frame, { T(T_UE_PHY_DLSCH_UE_DCI, T_INT(0), T_INT(frame%1024), T_INT(subframe), T_INT(dlsch[0]->rnti), T_INT(dci_format), - T_INT(harq_pid), + T_INT(dci_info_extarcted.harq_pid), T_INT(dlsch0_harq->mcs), T_INT(dlsch0_harq->TBS)); } diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index 807c79e6e0..b49ca1eda2 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -1517,15 +1517,19 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1; } + if (ue->ulsch[eNB_id]->o_ACK[0]) { + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); + } else { + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); + } + if ( LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { if(ue->ulsch[eNB_id]->o_ACK[0]) { LOG_I(PHY,"PUSCH ACK\n"); - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), - T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } else { LOG_I(PHY,"PUSCH NACK\n"); - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), - T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } LOG_I(PHY,"[UE %d][PDSCH %x] AbsSubFrame %d.%d Generating ACK (%d,%d) for %d bits on PUSCH\n", @@ -2035,14 +2039,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin } } - if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { - if(pucch_payload[0]) { - T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), - T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); - } else { - T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), - T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); - } + if (pucch_payload[0]) { + T(T_UE_PHY_DLSCH_UE_ACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); + } else { + T(T_UE_PHY_DLSCH_UE_NACK, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx), T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->rnti), + T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->current_harq_pid)); } generate_pucch1x(ue->common_vars.txdataF, @@ -2739,18 +2741,21 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint CBA_RNTI, eNB_id, 0)==0)) { + int harq_pid = subframe2harq_pid(&ue->frame_parms, + pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx), + pdcch_alloc2ul_subframe(&ue->frame_parms,proc->subframe_rx)); + T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), + T_INT(dci_alloc_rx[i].rnti), + T_INT(harq_pid), + T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs), + T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->round), + T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb), + T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb), + T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS)); if (LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)) { LOG_USEDINLOG_VAR(int8_t,harq_pid) = subframe2harq_pid(&ue->frame_parms, pdcch_alloc2ul_frame(&ue->frame_parms,proc->frame_rx,proc->subframe_rx), pdcch_alloc2ul_subframe(&ue->frame_parms,proc->subframe_rx)); - T(T_UE_PHY_ULSCH_UE_DCI, T_INT(eNB_id), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx), - T_INT(dci_alloc_rx[i].rnti), - T_INT(harq_pid), - T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs), - T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->round), - T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb), - T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb), - T_INT(ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS)); LOG_D(PHY,"[UE %d] Generate UE ULSCH C_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx); } } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index bb2319774c..20b42b59bf 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1763,6 +1763,7 @@ void *UE_thread(void *arg) { UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0; proc->instance_cnt_rxtx++; LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx); + T(T_UE_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx)); AssertFatal (pthread_cond_signal(&proc->cond_rxtx) ==0,""); AssertFatal(pthread_mutex_unlock(&proc->mutex_rxtx) ==0,""); initRefTimes(t1); From ee547c1d5afe3b94bd39de3d54033b171e455e39 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 3 Apr 2019 13:53:39 +0200 Subject: [PATCH 20/44] CI: fix address from committer in Merge Request case Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index d0446f0ec0..03f88053b3 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -89,7 +89,7 @@ pipeline { script { if ("MERGE".equals(env.gitlabActionType)) { // since a bit, in push events, gitlabUserEmail is not populated - gitCommitAuthorEmailAddr = ${env.gitlabUserEmail} + gitCommitAuthorEmailAddr = env.gitlabUserEmail echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}" // GitLab-Jenkins plugin integration is lacking to perform the merge by itself // Doing it manually --> it may have merge conflicts From 5f5cef7a20acd34be48e1c3332ff74df533cd1c9 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 3 Apr 2019 21:41:11 +0200 Subject: [PATCH 21/44] CI: supporting ping in noS1 configuration in python Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 421 ++++++++++-------- .../enb_ue_usrp210_band7_test_05mhz_tm1.xml | 175 ++++++++ .../xml_files/ue_band20_test_10mhz_orange.xml | 4 +- .../xml_files/ue_band20_test_10mhz_sfr.xml | 4 +- 4 files changed, 420 insertions(+), 184 deletions(-) create mode 100644 ci-scripts/xml_files/enb_ue_usrp210_band7_test_05mhz_tm1.xml diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 96d7397e46..d8b0a4a02c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -118,6 +118,7 @@ class SSHConnection(): self.htmlFooterCreated = False self.htmlUEConnected = -1 self.htmleNBFailureMsg = '' + self.htmlUEFailureMsg = '' self.picocom_closure = False self.idle_sleep_time = 0 self.htmlTabRefs = [] @@ -437,12 +438,14 @@ class SSHConnection(): if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '' or self.eNBSourceCodePath == '': Usage() sys.exit('Insufficient Parameter') - initialize_eNB_flag = True - pStatus = self.CheckProcessExist(initialize_eNB_flag) - if (pStatus < 0): - self.CreateHtmlTestRow(self.Initialize_eNB_args, 'KO', pStatus) - self.CreateHtmlTabFooter(False) - sys.exit(1) + result = re.search('noS1', str(self.Initialize_eNB_args)) + if result is None: + initialize_eNB_flag = True + pStatus = self.CheckProcessExist(initialize_eNB_flag) + if (pStatus < 0): + self.CreateHtmlTestRow(self.Initialize_eNB_args, 'KO', pStatus) + self.CreateHtmlTabFooter(False) + sys.exit(1) # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB result = re.search('T_stdout', str(self.Initialize_eNB_args)) if result is not None: @@ -487,7 +490,7 @@ class SSHConnection(): result = re.search('type: b200', str(self.ssh.before)) if result is not None: logging.debug('Found a B2xx device --> resetting it') - self.command('echo ' + self.eNBPassword + ' | sudo -S sudo b2xx_fx3_utils --reset-device', '\$', 5) + self.command('echo ' + self.eNBPassword + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 5) # Reloading FGPA bin firmware self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 5) # Make a copy and adapt to EPC / eNB IP addresses @@ -596,38 +599,21 @@ class SSHConnection(): result = re.search('type: b200', str(self.ssh.before)) if result is not None: logging.debug('Found a B2xx device --> resetting it') - self.command('echo ' + self.UEPassword + ' | sudo -S sudo b2xx_fx3_utils --reset-device', '\$', 5) + self.command('echo ' + self.UEPassword + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 5) # Reloading FGPA bin firmware self.command('echo ' + self.UEPassword + ' | sudo -S uhd_find_devices', '\$', 5) else: logging.debug('Did not find any B2xx device') self.command('cd ' + self.UESourceCodePath, '\$', 5) - # Initialize_OAI_UE_args usually start with -C and followed by the location in repository - #full_config_file = self.Initialize_OAI_UE_args.replace('-O ','') - #extIdx = full_config_file.find('.conf') - #if (extIdx > 0): - # extra_options = full_config_file[extIdx + 5:] - # # if tracer options is on, compiling and running T Tracer - # result = re.search('T_stdout', str(extra_options)) - ## if result is not None: - # logging.debug('\u001B[1m Compiling and launching T Tracer\u001B[0m') - # self.command('cd common/utils/T/tracer', '\$', 5) - # self.command('make', '\$', 10) - # self.command('echo $USER; nohup ./record -d ../T_messages.txt -o ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '_record.raw -ON -off VCD -off HEAVY -off LEGACY_GROUP_TRACE -off LEGACY_GROUP_DEBUG > ' + self.UESourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '_record.log 2>&1 &', self.UEUserName, 5) - # self.command('cd ' + self.UESourceCodePath, '\$', 5) - # full_config_file = full_config_file[:extIdx + 5] - # config_path, config_file = os.path.split(full_config_file) - #ci_full_config_file = config_path + '/ci-' + config_file - #rruCheck = False - #result = re.search('rru', str(config_file)) - #if result is not None: - # rruCheck = True - ## Make a copy and adapt to EPC / UE IP addresses - #self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5) - #self.command('sed -i -e \'s/CI_UE_IP_ADDR/' + self.UEIPAddress + '/\' ' + ci_full_config_file, '\$', 2); - # Launch UE with the modified config file self.command('source oaienv', '\$', 5) self.command('cd cmake_targets/lte_build_oai/build', '\$', 5) + result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) + # We may have to regenerate the .u* files + if result is None: + self.command('sed -e "s#93#92#" -e "s#8baf473f2f8fd09487cccbd7097c6862#fec86ba6eb707ed08905757b1bb44b8f#" -e "s#e734f8734007d6c5ce7a0508809e7e9c#C42449363BBAD02B66D16BC975D77CC1#" ../../../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf > ../../../openair3/NAS/TOOLS/ci-ue_eurecom_test_sfr.conf', '\$', 5) + self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf .u*', '\$', 5) + self.command('echo ' + self.UEPassword + ' | sudo -S ../../../targets/bin/conf2uedata -c ../../../openair3/NAS/TOOLS/ci-ue_eurecom_test_sfr.conf -o .', '\$', 5) + # Launch UE with the modified config file self.command('echo "ulimit -c unlimited && ./lte-uesoftmodem ' + self.Initialize_OAI_UE_args + '" > ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) self.command('chmod 775 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh', '\$', 5) self.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) @@ -640,27 +626,6 @@ class SSHConnection(): while (doLoop): loopCounter = loopCounter - 1 if (loopCounter == 0): - # In case of T tracer recording, we may need to kill it - #result = re.search('T_stdout', str(self.Initialize_OAI_UE_args)) - #if result is not None: - # self.command('killall --signal SIGKILL record', '\$', 5) - self.close() - doLoop = False - logging.error('\u001B[1;37;41m UE logging system did not show got sync! \u001B[0m') - self.CreateHtmlTestRow(self.Initialize_OAI_UE_args, 'KO', ALL_PROCESSES_OK, 'OAI UE') - self.CreateHtmlTabFooter(False) - ## In case of T tracer recording, we need to kill tshark on EPC side - #result = re.search('T_stdout', str(self.Initialize_OAI_UE_args)) - #if result is not None: - # self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword) - # logging.debug('\u001B[1m Stopping tshark \u001B[0m') - # self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) - # self.close() - # time.sleep(1) - # pcap_log_file = 'enb_' + self.testCase_id + '_s1log.pcap' - # copyin_res = self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + pcap_log_file, '.') - # if (copyin_res == 0): - # self.copyout(self.UEIPAddress, self.UEUserName, self.UEPassword, pcap_log_file, self.UESourceCodePath + '/cmake_targets/.') sys.exit(1) else: self.command('stdbuf -o0 cat ue_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4) @@ -1233,7 +1198,85 @@ class SSHConnection(): except: os.kill(os.getppid(),signal.SIGUSR1) + def PingNoS1(self): + ping_from_eNB = re.search('oaitun_enb1', str(self.ping_args)) + if ping_from_eNB is not None: + if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '': + Usage() + sys.exit('Insufficient Parameter') + else: + if self.UEIPAddress == '' or self.UEUserName == '' or self.UEPassword == '': + Usage() + sys.exit('Insufficient Parameter') + try: + if ping_from_eNB is not None: + self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) + self.command('cd ' + self.eNBSourceCodePath + '/cmake_targets/', '\$', 5) + else: + self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) + self.command('cd ' + self.UESourceCodePath + '/cmake_targets/', '\$', 5) + self.command('cd cmake_targets', '\$', 5) + ping_time = re.findall("-c (\d+)",str(self.ping_args)) + ping_status = self.command('stdbuf -o0 ping ' + self.ping_args + ' 2>&1 | stdbuf -o0 tee -a ping_' + self.testCase_id + '.log', '\$', int(ping_time[0])*1.5) + # TIMEOUT CASE + if ping_status < 0: + message = 'Ping with OAI UE crashed due to TIMEOUT!' + logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + return + result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before)) + if result is None: + message = 'Packet Loss Not Found!' + logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + return + packetloss = result.group('packetloss') + if float(packetloss) == 100: + message = 'Packet Loss is 100%' + logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + return + result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before)) + if result is None: + message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!' + logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m') + return + rtt_min = result.group('rtt_min') + rtt_avg = result.group('rtt_avg') + rtt_max = result.group('rtt_max') + pal_msg = 'Packet Loss : ' + packetloss + '%' + min_msg = 'RTT(Min) : ' + rtt_min + ' ms' + avg_msg = 'RTT(Avg) : ' + rtt_avg + ' ms' + max_msg = 'RTT(Max) : ' + rtt_max + ' ms' + logging.debug('\u001B[1;37;44m OAI UE ping result \u001B[0m') + logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m') + logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m') + logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m') + logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') + qMsg = pal_msg + '\n' + min_msg + '\n' + avg_msg + '\n' + max_msg + packetLossOK = True + if packetloss is not None: + if float(packetloss) > float(self.ping_packetloss_threshold): + qMsg += '\nPacket Loss too high' + logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m') + packetLossOK = False + elif float(packetloss) > 0: + qMsg += '\nPacket Loss is not 0%' + logging.debug('\u001B[1;30;43m Packet Loss is not 0% \u001B[0m') + self.close() + html_queue = SimpleQueue() + ip_addr = 'TBD' + html_cell = '
OAI UE ping result\n' + qMsg + '
' + html_queue.put(html_cell) + if packetLossOK: + self.CreateHtmlTestRowQueue(self.ping_args, 'OK', len(self.UEDevices), html_queue) + else: + self.CreateHtmlTestRowQueue(self.ping_args, 'KO', len(self.UEDevices), html_queue) + except: + os.kill(os.getppid(),signal.SIGUSR1) + def Ping(self): + result = re.search('noS1', str(self.Initialize_eNB_args)) + if result is not None: + self.PingNoS1() + return if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '': Usage() sys.exit('Insufficient Parameter') @@ -1924,6 +1967,7 @@ class SSHConnection(): if (not os.path.isfile('./' + eNBlogFile)): return -1 enb_log_file = open('./' + eNBlogFile, 'r') + exitSignalReceived = False foundAssertion = False msgAssertion = '' msgLine = 0 @@ -1954,17 +1998,20 @@ class SSHConnection(): self.htmleNBFailureMsg += ' Command line option(s) correctly applied ' + self.rruOptions + '\n\n' else: self.htmleNBFailureMsg += ' Command line option(s) NOT applied ' + self.rruOptions + '\n\n' - result = re.search('[Ss]egmentation [Ff]ault', str(line)) + result = re.search('Exiting OAI softmodem', str(line)) if result is not None: + exitSignalReceived = True + result = re.search('[Ss]egmentation [Ff]ault', str(line)) + if result is not None and not exitSignalReceived: foundSegFault = True result = re.search('[Cc]ore [dD]ump', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: foundSegFault = True result = re.search('[Aa]ssertion', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: foundAssertion = True result = re.search('LLL', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: foundRealTimeIssue = True if foundAssertion and (msgLine < 3): msgLine += 1 @@ -2075,39 +2122,52 @@ class SSHConnection(): if (not os.path.isfile('./' + UElogFile)): return -1 ue_log_file = open('./' + UElogFile, 'r') + exitSignalReceived = False foundAssertion = False msgAssertion = '' msgLine = 0 foundSegFault = False foundRealTimeIssue = False - rlcDiscardBuffer = 0 - rachCanceledProcedure = 0 uciStatMsgCount = 0 - pdcpFailure = 0 - ulschFailure = 0 + pdcpDataReqFailedCount = 0 + badDciCount = 0 + rrcConnectionRecfgComplete = 0 no_cell_sync_found = False mib_found = False frequency_found = False + plmn_found = False self.htmlUEFailureMsg = '' for line in ue_log_file.readlines(): - result = re.search('[Ss]egmentation [Ff]ault', str(line)) + result = re.search('Exiting OAI softmodem', str(line)) if result is not None: + exitSignalReceived = True + result = re.search('[Ss]egmentation [Ff]ault', str(line)) + if result is not None and not exitSignalReceived: foundSegFault = True result = re.search('[Cc]ore [dD]ump', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: foundSegFault = True result = re.search('[Aa]ssertion', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: foundAssertion = True result = re.search('LLL', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: foundRealTimeIssue = True if foundAssertion and (msgLine < 3): msgLine += 1 msgAssertion += str(line) result = re.search('uci->stat', str(line)) - if result is not None: + if result is not None and not exitSignalReceived: uciStatMsgCount += 1 + result = re.search('PDCP data request failed', str(line)) + if result is not None and not exitSignalReceived: + pdcpDataReqFailedCount += 1 + result = re.search('bad DCI 1A', str(line)) + if result is not None and not exitSignalReceived: + badDciCount += 1 + result = re.search('Generating RRCConnectionReconfigurationComplete', str(line)) + if result is not None: + rrcConnectionRecfgComplete += 1 # No cell synchronization found, abandoning result = re.search('No cell synchronization found, abandoning', str(line)) if result is not None: @@ -2145,6 +2205,15 @@ class SSHConnection(): frequency_found = True except Exception as e: logging.error('\033[91m' + "Measured Carrier Frequency not found" + '\033[0m') + result = re.search("PLMN MCC (?P\d{1,3}), MNC (?P\d{1,3}), TAC", str(line)) + if result is not None and (not plmn_found): + try: + mibMsg = 'PLMN MCC = ' + result.group('mcc') + ' MNC = ' + result.group('mnc') + self.htmlUEFailureMsg += mibMsg + '\n' + logging.debug('\033[94m' + mibMsg + '\033[0m') + plmn_found = True + except Exception as e: + logging.error('\033[91m' + "PLMN not found" + '\033[0m') result = re.search("Found (?P[\w,\s]{1,15}) \(name from internal table\)", str(line)) if result is not None: try: @@ -2180,30 +2249,28 @@ class SSHConnection(): except Exception as e: logging.error('\033[91m' + " AllowedMeasBandwidth not found" + '\033[0m') ue_log_file.close() + if rrcConnectionRecfgComplete > 0: + statMsg = 'UE connected to eNB (' + str(rrcConnectionRecfgComplete) + ' RRCConnectionReconfigurationComplete message(s) generated)' + logging.debug('\033[94m' + statMsg + '\033[0m') + self.htmlUEFailureMsg += statMsg + '\n' if uciStatMsgCount > 0: statMsg = 'UE showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') self.htmlUEFailureMsg += statMsg + '\n' - if pdcpFailure > 0: - statMsg = 'UE showed ' + str(pdcpFailure) + ' "PDCP Out of Resources" message(s)' + if pdcpDataReqFailedCount > 0: + statMsg = 'UE showed ' + str(pdcpDataReqFailedCount) + ' "PDCP data request failed" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') self.htmlUEFailureMsg += statMsg + '\n' - if ulschFailure > 0: - statMsg = 'UE showed ' + str(ulschFailure) + ' "ULSCH in error in round" message(s)' + if badDciCount > 0: + statMsg = 'UE showed ' + str(badDciCount) + ' "bad DCI 1A" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') self.htmlUEFailureMsg += statMsg + '\n' - if rachCanceledProcedure > 0: - rachMsg = 'UE cancelled ' + str(rachCanceledProcedure) + ' RA procedure(s)' - logging.debug('\u001B[1;30;43m ' + rachMsg + ' \u001B[0m') - self.htmlUEFailureMsg += rachMsg + '\n' if foundSegFault: logging.debug('\u001B[1;37;41m UE ended with a Segmentation Fault! \u001B[0m') return ENB_PROCESS_SEG_FAULT if foundAssertion: - logging.debug('\u001B[1;37;43m UE ended with an assertion! \u001B[0m') - # removed for esthetics - #self.htmlUEFailureMsg += msgAssertion - self.htmlUEFailureMsg += 'UE ended with an assertion!\n' + logging.debug('\u001B[1;30;43m UE showed an assertion! \u001B[0m') + self.htmlUEFailureMsg += 'UE showed an assertion!\n' if not mib_found or not frequency_found: return UE_PROCESS_ASSERTION if foundRealTimeIssue: @@ -2214,11 +2281,6 @@ class SSHConnection(): logging.debug('\u001B[1;37;41m UE could not synchronize ! \u001B[0m') self.htmlUEFailureMsg += 'UE could not synchronize!\n' return UE_PROCESS_COULD_NOT_SYNC - if rlcDiscardBuffer > 0: - rlcMsg = 'UE RLC discarded ' + str(rlcDiscardBuffer) + ' buffer(s)' - logging.debug('\u001B[1;37;41m ' + rlcMsg + ' \u001B[0m') - self.htmlUEFailureMsg += rlcMsg + '\n' - return ENB_PROCESS_REALTIME_ISSUE return 0 def TerminateeNB(self): @@ -2374,61 +2436,36 @@ class SSHConnection(): self.command('echo ' + self.UEPassword + ' | sudo -S killall --signal SIGKILL lte-uesoftmodem || true', '\$', 5) time.sleep(5) self.close() - # If tracer options is on, stopping tshark on EPC side - result = re.search('T_stdout', str(self.Initialize_OAI_UE_args)) + result = re.search('ue_', str(self.UELogFile)) if result is not None: - self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) - logging.debug('\u001B[1m Stopping tshark \u001B[0m') - self.command('echo ' + self.UEPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) - time.sleep(1) - pcap_log_file = self.UELogFile.replace('.log', '_s1log.pcap') - self.command('echo ' + self.UEPassword + ' | sudo -S chmod 666 /tmp/' + pcap_log_file, '\$', 5) - self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, '/tmp/' + pcap_log_file, '.') - self.copyout(self.UEIPAddress, self.UEUserName, self.UEPassword, pcap_log_file, self.UESourceCodePath + '/cmake_targets/.') - self.close() - logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') - self.open(self.UEIPAddress, self.UEUserName, self.UEPassword) - self.command('cd ' + self.UESourceCodePath + '/common/utils/T/tracer/', '\$', 5) - raw_record_file = self.UELogFile.replace('.log', '_record.raw') - replay_log_file = self.UELogFile.replace('.log', '_replay.log') - extracted_txt_file = self.UELogFile.replace('.log', '_extracted_messages.txt') - extracted_log_file = self.UELogFile.replace('.log', '_extracted_messages.log') - self.command('./extract_config -i ' + self.UESourceCodePath + '/cmake_targets/' + raw_record_file + ' > ' + self.UESourceCodePath + '/cmake_targets/' + extracted_txt_file, '\$', 5) - self.command('echo $USER; nohup ./replay -i ' + self.UESourceCodePath + '/cmake_targets/' + raw_record_file + ' > ' + self.UESourceCodePath + '/cmake_targets/' + replay_log_file + ' 2>&1 &', self.UEUserName, 5) - self.command('./textlog -d ' + self.UESourceCodePath + '/cmake_targets/' + extracted_txt_file + ' -no-gui -ON -full > ' + self.UESourceCodePath + '/cmake_targets/' + extracted_log_file, '\$', 5) - self.close() - self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/' + extracted_log_file, '.') - logging.debug('\u001B[1m Analyzing UE replay logfile \u001B[0m') - logStatus = self.AnalyzeLogFile_UE(extracted_log_file) - self.CreateHtmlTestRow(html_queue, 'OK', ALL_PROCESSES_OK) + copyin_res = self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/' + self.UELogFile, '.') + if (copyin_res == -1): + logging.debug('\u001B[1;37;41m Could not copy UE logfile to analyze it! \u001B[0m') + self.htmlUEFailureMsg = 'Could not copy UE logfile to analyze it!' + self.CreateHtmlTestRow('N/A', 'KO', UE_PROCESS_NOLOGFILE_TO_ANALYZE, 'UE') + self.UELogFile = '' + return + logging.debug('\u001B[1m Analyzing UE logfile \u001B[0m') + logStatus = self.AnalyzeLogFile_UE(self.UELogFile) + result = re.search('--no-L2-connect', str(self.Initialize_OAI_UE_args)) + if result is not None: + ueAction = 'Sniffing' + else: + ueAction = 'Connection' + if (logStatus < 0): + logging.debug('\u001B[1m' + ueAction + ' Failed \u001B[0m') + self.htmlUEFailureMsg = '' + ueAction + ' Failed\n' + self.htmlUEFailureMsg + self.CreateHtmlTestRow('N/A', 'KO', logStatus, 'UE') + self.CreateHtmlTabFooter(False) + sys.exit(1) + else: + logging.debug('\u001B[1m' + ueAction + ' Completed \u001B[0m') + self.htmlUEFailureMsg = '' + ueAction + ' Completed\n' + self.htmlUEFailureMsg + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) self.UELogFile = '' else: - result = re.search('ue_', str(self.UELogFile)) - if result is not None: - copyin_res = self.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/' + self.UELogFile, '.') - if (copyin_res == -1): - logging.debug('\u001B[1;37;41m Could not copy UE logfile to analyze it! \u001B[0m') - optionsMsg = '
Could not copy UE logfile to analyze it!
' - self.CreateHtmlTestRow(optionsMsg, 'KO', UE_PROCESS_NOLOGFILE_TO_ANALYZE, 'UE') - self.UELogFile = '' - return - logging.debug('\u001B[1m Analyzing UE logfile \u001B[0m') - logStatus = self.AnalyzeLogFile_UE(self.UELogFile) - if (logStatus < 0): - optionsMsg = '
Sniffing Unsuccessful\n'
-					optionsMsg += self.htmlUEFailureMsg
-					optionsMsg += '
' - self.CreateHtmlTestRow(optionsMsg, 'KO', logStatus, 'UE') - self.CreateHtmlTabFooter(False) - sys.exit(1) - else: - optionsMsg = '
Sniffing Successful\n'
-					optionsMsg += self.htmlUEFailureMsg
-					optionsMsg += '
' - self.CreateHtmlTestRow(optionsMsg, 'OK', ALL_PROCESSES_OK) - self.UELogFile = '' - else: - self.CreateHtmlTestRow('
No Log File to analyze
', 'OK', ALL_PROCESSES_OK) + self.htmlUEFailureMsg = 'No Log File to analyze!' + self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK) def AutoTerminateUEandeNB(self): self.testCase_id = 'AUTO-KILL-UE' @@ -2541,8 +2578,8 @@ class SSHConnection(): self.command('echo ' + self.UEPassword + ' | sudo -S rm ue*.log core* ue_*record.raw ue_*.pcap ue_*txt', '\$', 5) self.close() - def RetrieveSystemVersion(self): - if self.eNBIPAddress == 'none': + def RetrieveSystemVersion(self, machine): + if self.eNBIPAddress == 'none' or self.UEIPAddress == 'none': self.OsVersion = 'Ubuntu 16.04.5 LTS' self.KernelVersion = '4.15.0-45-generic' self.UhdVersion = '3.13.0.1-0' @@ -2550,21 +2587,22 @@ class SSHConnection(): self.CpuNb = '4' self.CpuModel = 'Intel(R) Core(TM) i5-6200U' self.CpuMHz = '2399.996 MHz' - return - machine = None - if self.eNBIPAddress != '' and self.eNBUserName != '' and self.eNBPassword != '': - machine = 'eNB' - IPAddress = self.eNBIPAddress - UserName = self.eNBUserName - Password = self.eNBPassword - elif self.UEIPAddress != '' and self.UEUserName != '' and self.UEPassword != '': - machine = 'UE' - IPAddress = self.UEIPAddress - UserName = self.UEUserName - Password = self.UEPassword - if machine is None: - Usage() - sys.exit('Insufficient Parameter') + return 0 + if machine == 'eNB': + if self.eNBIPAddress != '' and self.eNBUserName != '' and self.eNBPassword != '': + IPAddress = self.eNBIPAddress + UserName = self.eNBUserName + Password = self.eNBPassword + else: + return -1 + if machine == 'UE': + if self.UEIPAddress != '' and self.UEUserName != '' and self.UEPassword != '': + IPAddress = self.UEIPAddress + UserName = self.UEUserName + Password = self.UEPassword + else: + return -1 + self.open(IPAddress, UserName, Password) self.command('lsb_release -a', '\$', 5) result = re.search('Description:\\\\t(?P[a-zA-Z0-9\-\_\.\ ]+)', str(self.ssh.before)) @@ -2689,6 +2727,10 @@ class SSHConnection(): self.htmlUEConnected = len(self.UEDevices) self.htmlFile.write('

' + str(len(self.UEDevices)) + ' UE(s) is(are) connected to ADB bench server

\n') self.htmlFile.write('

' + str(len(self.CatMDevices)) + ' CAT-M UE(s) is(are) connected to bench server

\n') + else: + self.UEDevices.append('OAI-UE') + self.htmlUEConnected = len(self.UEDevices) + self.htmlFile.write('

' + str(len(self.UEDevices)) + ' OAI UE(s) is(are) connected to CI bench

\n') self.htmlFile.write('
\n') self.htmlFile.write('