Loading README.md +5 −3 Original line number Diff line number Diff line Loading @@ -76,16 +76,18 @@ $ vagrant ssh - Switch to the next clause (Usage) NOTE The user password is vagrant. ### Using Docbox ### Using Docker Pre-requisites on your host machine: - Install Virtualbox - Install Docbox - Install Docker Procedure for a Windows host machine: - On your host machine, open a the Docker Quickstart Terminal - On your host machine, clone the ETSI ITS protocols project. NOTE that only Docbox folder and .jenkins.sh script file are required - On your host machine, clone the ETSI ITS protocols project. NOTE that only Docker folder and .jenkins.sh script file are required - From the ETSI ITS protocols project root directory, execute the following commands: ```sh Loading docker/Dockerfile +11 −7 Original line number Diff line number Diff line Loading @@ -67,13 +67,14 @@ RUN echo "docker-titan-STF525" > /etc/hostname \ && useradd --create-home --shell /bin/bash etsi \ && echo "etsi:etsi" | chpasswd \ && adduser etsi sudo \ && echo "" >> /etc/profile \ && echo "export HOME=/home/etsi" >> /etc/profile \ && echo "export LD_LIBRARY_PATH=/home/etsi/TriesAndDelete/etsi_its/lib:$LD_LIBRARY_PATH" >> /etc/profile \ && echo "export PATH=/home/etsi/bin:$PATH" >> /etc/profile \ && echo "cd /home/etsi" >> /etc/profile \ && echo ". ./devenv.bash" >> /etc/profile \ && cd /home/etsi \ && echo "" >> /home/etsi/.bashrc \ && echo "export HOME=/home/etsi" >> /home/etsi/.bashrc \ && echo "export LD_LIBRARY_PATH=/home/etsi/dev/etsi_its/lib:$LD_LIBRARY_PATH" >> /home/etsi/.bashrc \ && echo "export PATH=/home/etsi/bin:$PATH" >> /home/etsi/.bashrc \ && echo "cd /home/etsi" >> /home/etsi/.bashrc \ && echo ". ./devenv.bash" >> /home/etsi/.bashrc \ && . /home/etsi/.bashrc \ && mkdir -p .ssh bin lib include tmp frameworks docs man dev \ && chown etsi:etsi .ssh bin lib include tmp frameworks docs man dev Loading Loading @@ -103,7 +104,10 @@ RUN cd /home/etsi/dev \ && cd /home/etsi/dev/STF525_Its/scripts \ && ./build_titan.bash \ && . /home/etsi/devenv.bash \ && ./update_its_project.bash && ./update_its_project.bash \ && cd ${HOME}/dev/etsi_its/src/TestCodec/objs \ && ../bin/testcodec_generate_makefile.bash \ && ../bin/run_all.bash CMD ["/bin/bash"] Loading scripts/merge_its_project.bash 0 → 100644 +270 −0 Original line number Diff line number Diff line #!/bin/bash # Debug mode #set -evx # Usage: sudo ./merge_ite_project.bash # TODO Use git clone in temporary directory OLDPWD=`pwd` # Storing path VAGRANT_DIR=/vagrant if [ ! -d ${VAGRANT_DIR} ] then exit -1 else VAGRANT_DIR=/vagrant/to_be_merged if [ -d ${VAGRANT_DIR} ] then rm -f ${VAGRANT_DIR}/* else mkdir ${VAGRANT_DIR} fi fi # Execution path RUN_PATH="${0%/*}" UNAME=`uname -n` if [ "${UNAME}" == "Ubuntu64" ] then SRC_ITS_PATH=/media/sf_F_DRIVE/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src elif [ "${UNAME}" == "ubuntu-xenial" ] || [ "${UNAME}" == "vagrant" ] then SRC_ITS_PATH=/media/sf_F_DRIVE/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src elif [ "${UNAME}" == "vagrant-prov" ] then SRC_ITS_PATH=~/tmp/STF525 else # Cygwin SRC_ITS_PATH=/cygdrive/f/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src fi if [ "${PATH_DEV_ITS}" == "" ] then PATH_DEV_ITS=`pwd`/../etsi_its fi # Update ETSI Framework files echo 'Merging ETSI Framework files' FWK_SRC_PATH=${SRC_ITS_PATH}/ccsrc FWK_DST_PATH=${PATH_DEV_ITS}/framework FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Protocols/ -name "*.h*" -type f` for i in ${FWK_DIR_LIST_HH} do BN=`basename $i` if [ "${BN}" != "BTPPort.hh" ] then s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/include/${BN}~ ] then rm ${FWK_DST_PATH}/include/${BN}~ fi fi fi done FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Protocols/ -name "*.c*" -type f` for i in ${FWK_DIR_LIST_CC} do BN=`basename $i` if [ ${BN} != BTPPort.cc ] then s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi fi done FWK_DIR_LIST_Y=`find ${FWK_SRC_PATH}/Protocols/ -name "*.y" -type f` for i in ${FWK_DIR_LIST_Y} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ "${s1}" != "${s2}" ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done FWK_DIR_LIST_L=`find ${FWK_SRC_PATH}/Protocols/ -name "*.l" -type f` for i in ${FWK_DIR_LIST_L} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ "${s1}" != "${s2}" ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Framework/ -name "*.h*" -type f` FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Framework/ -name "*.c*" -type f` for i in ${FWK_DIR_LIST_HH} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/include/${BN}~ ] then rm ${FWK_DST_PATH}/include/${BN}~ fi fi done for i in ${FWK_DIR_LIST_CC} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/loggers/ -name "*.h*" -type f` for i in ${FWK_DIR_LIST_HH} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/include/${BN}~ ] then rm ${FWK_DST_PATH}/include/${BN}~ fi fi done FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/loggers/ -name "*.c*" -type f` for i in ${FWK_DIR_LIST_CC} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done # Update ATS TTCN-3 files echo 'Update TTCN-3 files' TTCN_3_ORG_PATH=${SRC_ITS_PATH}/ttcn TTCN_3_DST_PATH=${PATH_DEV_ITS}/src TTCN_3_ATS_LIST='AtsAutoInterop AtsCAM AtsDENM AtsBTP AtsGeoNetworking AtsSecurity LibCommon TestCodec' for i in ${TTCN_3_ATS_LIST} do LIST_TTCN_FILES=`find ${TTCN_3_ORG_PATH}/$i -name "*.ttcn" -type f` for j in ${LIST_TTCN_FILES} do BN=`basename $j` s1=`sha256sum -b $j | cut -d' ' -f1` s2=`sha256sum -b ${TTCN_3_DST_PATH}/$i/ttcn/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${TTCN_3_DST_PATH}/$i/ttcn/${BN} ${VAGRANT_DIR} fi done # Other files if [ -f ${SRC_ITS_PATH}/docs/$i/o2.cfg ] then s1=`sha256sum -b ${PATH_DEV_ITS}/src/$i/docs/o2.cfg | cut -d' ' -f1` s2=`sha256sum -b ${SRC_ITS_PATH}/docs/$i/o2.cfg | cut -d' ' -f1` if [ ${s1} != ${s2} ] then mkdir -p ${VAGRANT_DIR}/docs/$i cp ${PATH_DEV_ITS}/src/$i/docs/o2.cfg ${VAGRANT_DIR}/docs/$i fi fi if [ -f ${SRC_ITS_PATH}/etc/$i/ITSTS.cfg ] then s1=`sha256sum -b ${PATH_DEV_ITS}/src/$i/etc/ITSTS.cfg | cut -d' ' -f1` s2=`sha256sum -b ${SRC_ITS_PATH}/etc/$i/ITSTS.cfg | cut -d' ' -f1` if [ ${s1} != ${s2} ] then mkdir -p ${VAGRANT_DIR}/etc/$i cp ${PATH_DEV_ITS}/src/$i/etc/ITSTS.cfg ${VAGRANT_DIR}/etc/$i fi fi done TTCN_3_LIB_LIST='Common BTP CAM DENM GeoNetworking Ipv6OverGeoNetworking Security' for i in ${TTCN_3_LIB_LIST} do LIST_TTCN_FILES=`find ${TTCN_3_ORG_PATH}/LibIts/$i -name "*.ttcn" -type f` for j in ${LIST_TTCN_FILES} do BN=`basename $j` s1=`sha256sum -b $j | cut -d' ' -f1` s2=`sha256sum -b ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} ${VAGRANT_DIR} rm ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN}~ fi done # FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/src/LibIts/$i/include -name "*.h*" -type f` # FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/src/LibIts/$i/src -name "*.c*" -type f` # for j in ${FWK_DIR_LIST_HH} # do # BN=`basename $j` # s1=`sha256sum -b $j | cut -d' ' -f1` # s2=`sha256sum -b ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} | cut -d' ' -f1` # if [ ${s1} != ${s2} ] # then # cp ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} ${VAGRANT_DIR} # rm ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN}~ # fi # done # for j in ${FWK_DIR_LIST_CC} # do # BN=`basename $j` # s1=`sha256sum -b $j | cut -d' ' -f1` # s2=`sha256sum -b ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} | cut -d' ' -f1` # if [ ${s1} != ${s2} ] # then # cp ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} ${VAGRANT_DIR} # rm ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN}~ # fi # done done LIST_FILES=`find ${PATH_DEV_ITS} -name "*~" -type f` for i in ${LIST_FILES} do BN=$i BN=${BN:: -1} # Remove the last character cp ${BN} ${VAGRANT_DIR} rm $i done chmod -R 664 ${VAGRANT_DIR} exit 0 scripts/run_all.bash 0 → 100644 +47 −0 Original line number Diff line number Diff line #!/bin/bash #set -e #set -vx clear export LD_LIBRARY_PATH=/home/vagrant/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH if ! [[ $1 =~ "^[0-9]+$" ]] then COUNTER=$1 else COUNTER=1 fi CURPWD=`pwd` if [ ! "${PWD##*/}" == "objs" ] then cd ../objs if [ ! $? == 0 ] then echo "Please move to PROJECT/obj directory" exit 1 fi fi rm ../logs/merged.log.* for i in $(seq 1 1 $COUNTER) do LD_LIBRARY_PATH=/home/vagrant/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH ../bin/run_mtc.bash & LD_LIBRARY_PATH=/home/vagrant/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH ../bin/run_ptcs.bash $2 dup=$(ps -ef | grep "$0" | grep -v grep | wc -l) while [ ${dup} -eq 3 ] do sleep 1 dup=$(ps -ef | grep "$0" | grep -v grep | wc -l) done sleep 1 mv ../logs/merged.log ../logs/merged.log.`date +'%Y%m%d%S'` done exit 0 scripts/run_mtc.bash 0 → 100644 +55 −0 Original line number Diff line number Diff line #!/bin/bash #set -evx clear CURPWD=`pwd` if [ ! "${PWD##*/}" == "objs" ] then cd ../objs if [ ! $? == 0 ] then echo "Please move to PROJECT/obj directory" exit 1 fi fi TITAN_LOG_DIR=../logs if [ ! -d ${TITAN_LOG_DIR} ] then mkdir ${TITAN_LOG_DIR} else rm -f ${TITAN_LOG_DIR}/*.log fi CFG_FILES=`find ../etc -name '*.cfg'` #LOG_FILES=`find ${TITAN_LOG_DIR} -name '*.log'` #mv ${LOG_FILES} ../logs #if [ "${OSTYPE}" == "cygwin" ] #then # # Remove dll # rm ./*.dll # ## Copy the new ones # cp ~/lib/libhelper.dll . # cp ~/lib/libconverter.dll . # cp ~/lib/liblogger.dll . # cp ~/lib/libttcn3_tri.dll . # cp ~/lib/libcomm.dll . #fi echo "> cmtc: to create the MTC server" echo "> smtc [module_name[[.control]|.testcase_name|.*]: when MyExample is connected, run the TCs in [EXECUTE] section" echo "> emtc: Terminate MTC." mctr ${CFG_FILES} LOG_FILES=`find ${TITAN_LOG_DIR} -name '*.log'` if [ "${TITAN_LOG_DIR}" != "" ] then ttcn3_logmerge -o ${TITAN_LOG_DIR}/merged.log ${LOG_FILES} ttcn3_logformat -o ${TITAN_LOG_DIR}/merged_formated.log ${TITAN_LOG_DIR}/merged.log mv ${TITAN_LOG_DIR}/merged_formated.log ${TITAN_LOG_DIR}/merged.log echo "log files were merged into ${TITAN_LOG_DIR}/merged.log" fi cd ${CURPWD} Loading
README.md +5 −3 Original line number Diff line number Diff line Loading @@ -76,16 +76,18 @@ $ vagrant ssh - Switch to the next clause (Usage) NOTE The user password is vagrant. ### Using Docbox ### Using Docker Pre-requisites on your host machine: - Install Virtualbox - Install Docbox - Install Docker Procedure for a Windows host machine: - On your host machine, open a the Docker Quickstart Terminal - On your host machine, clone the ETSI ITS protocols project. NOTE that only Docbox folder and .jenkins.sh script file are required - On your host machine, clone the ETSI ITS protocols project. NOTE that only Docker folder and .jenkins.sh script file are required - From the ETSI ITS protocols project root directory, execute the following commands: ```sh Loading
docker/Dockerfile +11 −7 Original line number Diff line number Diff line Loading @@ -67,13 +67,14 @@ RUN echo "docker-titan-STF525" > /etc/hostname \ && useradd --create-home --shell /bin/bash etsi \ && echo "etsi:etsi" | chpasswd \ && adduser etsi sudo \ && echo "" >> /etc/profile \ && echo "export HOME=/home/etsi" >> /etc/profile \ && echo "export LD_LIBRARY_PATH=/home/etsi/TriesAndDelete/etsi_its/lib:$LD_LIBRARY_PATH" >> /etc/profile \ && echo "export PATH=/home/etsi/bin:$PATH" >> /etc/profile \ && echo "cd /home/etsi" >> /etc/profile \ && echo ". ./devenv.bash" >> /etc/profile \ && cd /home/etsi \ && echo "" >> /home/etsi/.bashrc \ && echo "export HOME=/home/etsi" >> /home/etsi/.bashrc \ && echo "export LD_LIBRARY_PATH=/home/etsi/dev/etsi_its/lib:$LD_LIBRARY_PATH" >> /home/etsi/.bashrc \ && echo "export PATH=/home/etsi/bin:$PATH" >> /home/etsi/.bashrc \ && echo "cd /home/etsi" >> /home/etsi/.bashrc \ && echo ". ./devenv.bash" >> /home/etsi/.bashrc \ && . /home/etsi/.bashrc \ && mkdir -p .ssh bin lib include tmp frameworks docs man dev \ && chown etsi:etsi .ssh bin lib include tmp frameworks docs man dev Loading Loading @@ -103,7 +104,10 @@ RUN cd /home/etsi/dev \ && cd /home/etsi/dev/STF525_Its/scripts \ && ./build_titan.bash \ && . /home/etsi/devenv.bash \ && ./update_its_project.bash && ./update_its_project.bash \ && cd ${HOME}/dev/etsi_its/src/TestCodec/objs \ && ../bin/testcodec_generate_makefile.bash \ && ../bin/run_all.bash CMD ["/bin/bash"] Loading
scripts/merge_its_project.bash 0 → 100644 +270 −0 Original line number Diff line number Diff line #!/bin/bash # Debug mode #set -evx # Usage: sudo ./merge_ite_project.bash # TODO Use git clone in temporary directory OLDPWD=`pwd` # Storing path VAGRANT_DIR=/vagrant if [ ! -d ${VAGRANT_DIR} ] then exit -1 else VAGRANT_DIR=/vagrant/to_be_merged if [ -d ${VAGRANT_DIR} ] then rm -f ${VAGRANT_DIR}/* else mkdir ${VAGRANT_DIR} fi fi # Execution path RUN_PATH="${0%/*}" UNAME=`uname -n` if [ "${UNAME}" == "Ubuntu64" ] then SRC_ITS_PATH=/media/sf_F_DRIVE/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src elif [ "${UNAME}" == "ubuntu-xenial" ] || [ "${UNAME}" == "vagrant" ] then SRC_ITS_PATH=/media/sf_F_DRIVE/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src elif [ "${UNAME}" == "vagrant-prov" ] then SRC_ITS_PATH=~/tmp/STF525 else # Cygwin SRC_ITS_PATH=/cygdrive/f/FSCOM/ETSI/ITS/STF525_Auto_Interop/workspace_titan/STF525_Auto_Interop/src fi if [ "${PATH_DEV_ITS}" == "" ] then PATH_DEV_ITS=`pwd`/../etsi_its fi # Update ETSI Framework files echo 'Merging ETSI Framework files' FWK_SRC_PATH=${SRC_ITS_PATH}/ccsrc FWK_DST_PATH=${PATH_DEV_ITS}/framework FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Protocols/ -name "*.h*" -type f` for i in ${FWK_DIR_LIST_HH} do BN=`basename $i` if [ "${BN}" != "BTPPort.hh" ] then s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/include/${BN}~ ] then rm ${FWK_DST_PATH}/include/${BN}~ fi fi fi done FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Protocols/ -name "*.c*" -type f` for i in ${FWK_DIR_LIST_CC} do BN=`basename $i` if [ ${BN} != BTPPort.cc ] then s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi fi done FWK_DIR_LIST_Y=`find ${FWK_SRC_PATH}/Protocols/ -name "*.y" -type f` for i in ${FWK_DIR_LIST_Y} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ "${s1}" != "${s2}" ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done FWK_DIR_LIST_L=`find ${FWK_SRC_PATH}/Protocols/ -name "*.l" -type f` for i in ${FWK_DIR_LIST_L} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ "${s1}" != "${s2}" ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/Framework/ -name "*.h*" -type f` FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/Framework/ -name "*.c*" -type f` for i in ${FWK_DIR_LIST_HH} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/include/${BN}~ ] then rm ${FWK_DST_PATH}/include/${BN}~ fi fi done for i in ${FWK_DIR_LIST_CC} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/loggers/ -name "*.h*" -type f` for i in ${FWK_DIR_LIST_HH} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/include/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/include/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/include/${BN}~ ] then rm ${FWK_DST_PATH}/include/${BN}~ fi fi done FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/loggers/ -name "*.c*" -type f` for i in ${FWK_DIR_LIST_CC} do BN=`basename $i` s1=`sha256sum -b $i | cut -d' ' -f1` s2=`sha256sum -b ${FWK_DST_PATH}/src/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${FWK_DST_PATH}/src/${BN} ${VAGRANT_DIR} if [ -f ${FWK_DST_PATH}/src/${BN}~ ] then rm ${FWK_DST_PATH}/src/${BN}~ fi fi done # Update ATS TTCN-3 files echo 'Update TTCN-3 files' TTCN_3_ORG_PATH=${SRC_ITS_PATH}/ttcn TTCN_3_DST_PATH=${PATH_DEV_ITS}/src TTCN_3_ATS_LIST='AtsAutoInterop AtsCAM AtsDENM AtsBTP AtsGeoNetworking AtsSecurity LibCommon TestCodec' for i in ${TTCN_3_ATS_LIST} do LIST_TTCN_FILES=`find ${TTCN_3_ORG_PATH}/$i -name "*.ttcn" -type f` for j in ${LIST_TTCN_FILES} do BN=`basename $j` s1=`sha256sum -b $j | cut -d' ' -f1` s2=`sha256sum -b ${TTCN_3_DST_PATH}/$i/ttcn/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${TTCN_3_DST_PATH}/$i/ttcn/${BN} ${VAGRANT_DIR} fi done # Other files if [ -f ${SRC_ITS_PATH}/docs/$i/o2.cfg ] then s1=`sha256sum -b ${PATH_DEV_ITS}/src/$i/docs/o2.cfg | cut -d' ' -f1` s2=`sha256sum -b ${SRC_ITS_PATH}/docs/$i/o2.cfg | cut -d' ' -f1` if [ ${s1} != ${s2} ] then mkdir -p ${VAGRANT_DIR}/docs/$i cp ${PATH_DEV_ITS}/src/$i/docs/o2.cfg ${VAGRANT_DIR}/docs/$i fi fi if [ -f ${SRC_ITS_PATH}/etc/$i/ITSTS.cfg ] then s1=`sha256sum -b ${PATH_DEV_ITS}/src/$i/etc/ITSTS.cfg | cut -d' ' -f1` s2=`sha256sum -b ${SRC_ITS_PATH}/etc/$i/ITSTS.cfg | cut -d' ' -f1` if [ ${s1} != ${s2} ] then mkdir -p ${VAGRANT_DIR}/etc/$i cp ${PATH_DEV_ITS}/src/$i/etc/ITSTS.cfg ${VAGRANT_DIR}/etc/$i fi fi done TTCN_3_LIB_LIST='Common BTP CAM DENM GeoNetworking Ipv6OverGeoNetworking Security' for i in ${TTCN_3_LIB_LIST} do LIST_TTCN_FILES=`find ${TTCN_3_ORG_PATH}/LibIts/$i -name "*.ttcn" -type f` for j in ${LIST_TTCN_FILES} do BN=`basename $j` s1=`sha256sum -b $j | cut -d' ' -f1` s2=`sha256sum -b ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} | cut -d' ' -f1` if [ ${s1} != ${s2} ] then cp ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN} ${VAGRANT_DIR} rm ${TTCN_3_DST_PATH}/LibIts/$i/ttcn/${BN}~ fi done # FWK_DIR_LIST_HH=`find ${FWK_SRC_PATH}/src/LibIts/$i/include -name "*.h*" -type f` # FWK_DIR_LIST_CC=`find ${FWK_SRC_PATH}/src/LibIts/$i/src -name "*.c*" -type f` # for j in ${FWK_DIR_LIST_HH} # do # BN=`basename $j` # s1=`sha256sum -b $j | cut -d' ' -f1` # s2=`sha256sum -b ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} | cut -d' ' -f1` # if [ ${s1} != ${s2} ] # then # cp ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN} ${VAGRANT_DIR} # rm ${PATH_DEV_ITS}/src/LibIts/$i/include/${BN}~ # fi # done # for j in ${FWK_DIR_LIST_CC} # do # BN=`basename $j` # s1=`sha256sum -b $j | cut -d' ' -f1` # s2=`sha256sum -b ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} | cut -d' ' -f1` # if [ ${s1} != ${s2} ] # then # cp ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN} ${VAGRANT_DIR} # rm ${PATH_DEV_ITS}/src/LibIts/$i/src/${BN}~ # fi # done done LIST_FILES=`find ${PATH_DEV_ITS} -name "*~" -type f` for i in ${LIST_FILES} do BN=$i BN=${BN:: -1} # Remove the last character cp ${BN} ${VAGRANT_DIR} rm $i done chmod -R 664 ${VAGRANT_DIR} exit 0
scripts/run_all.bash 0 → 100644 +47 −0 Original line number Diff line number Diff line #!/bin/bash #set -e #set -vx clear export LD_LIBRARY_PATH=/home/vagrant/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH if ! [[ $1 =~ "^[0-9]+$" ]] then COUNTER=$1 else COUNTER=1 fi CURPWD=`pwd` if [ ! "${PWD##*/}" == "objs" ] then cd ../objs if [ ! $? == 0 ] then echo "Please move to PROJECT/obj directory" exit 1 fi fi rm ../logs/merged.log.* for i in $(seq 1 1 $COUNTER) do LD_LIBRARY_PATH=/home/vagrant/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH ../bin/run_mtc.bash & LD_LIBRARY_PATH=/home/vagrant/frameworks/osip/src/osipparser2/.libs:$LD_LIBRARY_PATH ../bin/run_ptcs.bash $2 dup=$(ps -ef | grep "$0" | grep -v grep | wc -l) while [ ${dup} -eq 3 ] do sleep 1 dup=$(ps -ef | grep "$0" | grep -v grep | wc -l) done sleep 1 mv ../logs/merged.log ../logs/merged.log.`date +'%Y%m%d%S'` done exit 0
scripts/run_mtc.bash 0 → 100644 +55 −0 Original line number Diff line number Diff line #!/bin/bash #set -evx clear CURPWD=`pwd` if [ ! "${PWD##*/}" == "objs" ] then cd ../objs if [ ! $? == 0 ] then echo "Please move to PROJECT/obj directory" exit 1 fi fi TITAN_LOG_DIR=../logs if [ ! -d ${TITAN_LOG_DIR} ] then mkdir ${TITAN_LOG_DIR} else rm -f ${TITAN_LOG_DIR}/*.log fi CFG_FILES=`find ../etc -name '*.cfg'` #LOG_FILES=`find ${TITAN_LOG_DIR} -name '*.log'` #mv ${LOG_FILES} ../logs #if [ "${OSTYPE}" == "cygwin" ] #then # # Remove dll # rm ./*.dll # ## Copy the new ones # cp ~/lib/libhelper.dll . # cp ~/lib/libconverter.dll . # cp ~/lib/liblogger.dll . # cp ~/lib/libttcn3_tri.dll . # cp ~/lib/libcomm.dll . #fi echo "> cmtc: to create the MTC server" echo "> smtc [module_name[[.control]|.testcase_name|.*]: when MyExample is connected, run the TCs in [EXECUTE] section" echo "> emtc: Terminate MTC." mctr ${CFG_FILES} LOG_FILES=`find ${TITAN_LOG_DIR} -name '*.log'` if [ "${TITAN_LOG_DIR}" != "" ] then ttcn3_logmerge -o ${TITAN_LOG_DIR}/merged.log ${LOG_FILES} ttcn3_logformat -o ${TITAN_LOG_DIR}/merged_formated.log ${TITAN_LOG_DIR}/merged.log mv ${TITAN_LOG_DIR}/merged_formated.log ${TITAN_LOG_DIR}/merged.log echo "log files were merged into ${TITAN_LOG_DIR}/merged.log" fi cd ${CURPWD}