From 5eb2bd7d475ae34b884619f2d52e375103f99a7f Mon Sep 17 00:00:00 2001
From: Raphael Defosseux <raphael.defosseux@eurecom.fr>
Date: Mon, 5 Nov 2018 11:07:03 +0100
Subject: [PATCH] CI: fix basic simulator run   cherry-picked from
 5d4cde099e44dcaa37fc547e9aa52d200471d307

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
---
 ci-scripts/buildOnVM.sh   | 2 ++
 ci-scripts/runTestOnVM.sh | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ci-scripts/buildOnVM.sh b/ci-scripts/buildOnVM.sh
index 0fb85b24eb4..c1f554093d2 100755
--- a/ci-scripts/buildOnVM.sh
+++ b/ci-scripts/buildOnVM.sh
@@ -334,6 +334,7 @@ echo "unzip -qq -DD ../localZip.zip" >> $VM_CMDS
 if [[ "$VM_NAME" == *"-cppcheck"* ]]
 then
     echo "mkdir cmake_targets/log" >> $VM_CMDS
+    echo "chmod 777 cmake_targets/log" >> $VM_CMDS
     echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS
     echo "echo \"cppcheck $BUILD_OPTIONS . \"" >> $VM_CMDS
     if [ $DAEMON -eq 0 ]
@@ -349,6 +350,7 @@ else
     echo "source oaienv" >> $VM_CMDS
     echo "cd cmake_targets/" >> $VM_CMDS
     echo "mkdir log" >> $VM_CMDS
+    echo "chmod 777 log" >> $VM_CMDS
     echo "cp /home/ubuntu/zip-install.txt log" >> $VM_CMDS
     if [ $DAEMON -eq 0 ]
     then
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index efdfcec3e09..94af2d75ef4 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -89,6 +89,8 @@ function start_basic_sim_enb {
     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/basic_simulator/enb/\"" >> $1
+    echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator" >> $1
+    echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/" >> $1
     echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/enb/" >> $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
     echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
@@ -105,7 +107,8 @@ function start_basic_sim_ue {
     local LOC_NB_RBS=$4
     local LOC_FREQUENCY=$5
     echo "echo \"cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue\"" > $1
-    echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" > $1
+    echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" >> $1
+    echo "cd /home/ubuntu/tmp/cmake_targets/basic_simulator/ue" >> $1
     echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --ue-rxgain 140\" > ./my-lte-uesoftmodem-run.sh" >> $1
     echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1
     echo "cat ./my-lte-uesoftmodem-run.sh" >> $1
-- 
GitLab