From bedcf2d7baafb39fc1a48eefcd84f02d7cb16204 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 7 May 2019 02:39:04 -0700 Subject: [PATCH] Create project structure --- scripts/devenv.bash.ubuntu | 2 + scripts/mec_generate_makefile.bash | 19 -------- scripts/testcodec_generate_makefile.bash | 43 ++++--------------- scripts/update_mec_project.bash | 7 ++- .../patch_lib_http/LibItsHttp_TestSystem.ttcn | 35 +++++++++++++++ 5 files changed, 50 insertions(+), 56 deletions(-) create mode 100644 ttcn/patch_lib_http/LibItsHttp_TestSystem.ttcn diff --git a/scripts/devenv.bash.ubuntu b/scripts/devenv.bash.ubuntu index 30ae0f2..06d2da6 100755 --- a/scripts/devenv.bash.ubuntu +++ b/scripts/devenv.bash.ubuntu @@ -62,6 +62,8 @@ then export PATH_DEV_ITS=${HOME}/dev/etsi_its # Emergency Communication support export PATH_DEV_EMCOM=${HOME}/dev/etsi_emcom + # Mobile-Edge Computing support + export PATH_DEV_MEC=${HOME}/dev/etsi_mec # Validation folder export VALIDATION_DIR=${HOME} fi diff --git a/scripts/mec_generate_makefile.bash b/scripts/mec_generate_makefile.bash index 9db4c05..a889025 100755 --- a/scripts/mec_generate_makefile.bash +++ b/scripts/mec_generate_makefile.bash @@ -52,25 +52,6 @@ find .. -type f -name "*.bak" -exec rm {} \; find .. -type f -name "*.log" -exec rm {} \; # Build JSON files if any and put them in objs directory -#JSON_PATH=${PATH_DEV_MEC}/src/LibSip/json -JSON_PATH=${PATH_DEV_MEC}/null # Do not use json2ttcn for now, need to fix issues first -if [ -d ${JSON_PATH} ] -then - JSON_FILES=`find ${JSON_PATH} -name '*.json'` - - if [ "${OSTYPE}" == "cygwin" ] - then - json2ttcn.exe ${JSON_FILES} - else - json2ttcn ${JSON_FILES} - fi - if [ "$?" != "0" ] - then - f_exit "Failed to generate JSON source code" 2 - fi - JSON_FILES=`find . -name '*.ttcn'` -fi - REFERENCES="LibCommon LibHttp LibMec LibMec/LocationAPI" for i in ${REFERENCES} do diff --git a/scripts/testcodec_generate_makefile.bash b/scripts/testcodec_generate_makefile.bash index 16db4f1..c7dd254 100755 --- a/scripts/testcodec_generate_makefile.bash +++ b/scripts/testcodec_generate_makefile.bash @@ -51,36 +51,16 @@ find .. -type f -name "*~" -exec rm {} \; find .. -type f -name "*.bak" -exec rm {} \; find .. -type f -name "*.log" -exec rm {} \; -# Build XSD files if any and put them in objs directory -#XSD_PATH=${PATH_DEV_EMCOM}/xsd -XSD_PATH=${PATH_DEV_EMCOM}/null # Do not use xsd2ttcn for now, need to fix issues first -if [ -d ${XSD_PATH} ] -then - XSD_FILES=`find ${XSD_PATH} -name '*.xsd'` - - if [ "${OSTYPE}" == "cygwin" ] - then - xsd2ttcn.exe ${XSD_FILES} - else - xsd2ttcn ${XSD_FILES} - fi - if [ "$?" != "0" ] - then - f_exit "Failed to generate XSD source code" 2 - fi - XSD_FILES=`find . -name '*.ttcn'` -fi - -REFERENCES="LibCommon LibHttp LibEmcom/LibNg112 LibSip LibIms" +REFERENCES="LibCommon LibHttp LibMec LibMec/LocationAPI" for i in ${REFERENCES} do # TTCN code - for j in `find ${PATH_DEV_EMCOM}/src/$i/ttcn -type f -name "*.ttcn"`; + for j in `find ${PATH_DEV_MEC}/src/$i/ttcn -type f -name "*.ttcn"`; do ln -sf $j ../ttcn/`basename $j` done # Include source code - files=`find ${PATH_DEV_EMCOM}/src/$i/include -type f` + files=`find ${PATH_DEV_MEC}/src/$i/include -type f` if [ "${files}" != " " ] then for j in ${files}; @@ -89,7 +69,7 @@ do done fi # CC source code - files=`find ${PATH_DEV_EMCOM}/src/$i/src -type f` + files=`find ${PATH_DEV_MEC}/src/$i/src -type f` if [ "${files}" != " " ] then for j in ${files}; @@ -106,13 +86,13 @@ TTCN_FILES=`find .. -name '*.ttcn*'` if [ "${OSTYPE}" == "cygwin" ] then rm ../bin/*.exe ../lib/*.dll - compiler.exe -e -f -g -l -L -M -n -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log + compiler.exe -b -e -f -g -l -L -M -n -O -t -r -R -U none -X ${TTCN_FILES} 2>&1 3>&1 | tee build.log if [ "$?" == "1" ] then f_exit "Failed to compile ATS" 4 fi else - compiler -e -f -g -l -L -M -n -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log + compiler -b -e -f -g -l -L -M -n -O -t -r -R -U none -X ${TTCN_FILES} 2>&1 3>&1 | tee build.log if [ "$?" == "1" ] then f_exit "Failed to generate ATS source code" 6 @@ -122,7 +102,7 @@ fi # Sart ATS generation - Step 2 # Create working variables CC_FILES=`find ../src -name '*.c*'` -FWK_FILES=`find ${PATH_DEV_EMCOM}/framework/ -name '*.c*'` +FWK_FILES=`find ${PATH_DEV_MEC}/framework/ -name '*.c*'` CFG_FILES=`find ../etc -name '*.cfg'` # Sart ATS generation - Step 3 @@ -141,13 +121,6 @@ else fi fi -# Bug xsd2ttcn -for i in ${XSD_FILES} -do - VARIANT='s/ variant (\[\-\]) ;//g' - sed --in-place "${VARIANT}" $i -done - # Remove port skeletons to use src/ for i in `ls ../include/*.hh` do @@ -192,7 +165,7 @@ else fi LDFLAGS_DEBUG_MODE='s/LDFLAGS = /LDFLAGS = -g -pthread -fPIC -fstack-check -fstack-protector -fsanitize=address -fno-omit-frame-pointer -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g' fi -ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_EMCOM)/include -I$(PATH_DEV_EMCOM)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibNg112/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.' +ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_MEC)/include -I$(PATH_DEV_MEC)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibNg112/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.' ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lpcap -lstdc++fs -lssl -L\$\(HOME_FRAMEWORKS\)\/osip\/src\/osipparser2\/\.libs -losipparser2/g' sed --in-place "${CXXFLAGS_DEBUG_MODE}" ./Makefile sed --in-place "${LDFLAGS_DEBUG_MODE}" ./Makefile diff --git a/scripts/update_mec_project.bash b/scripts/update_mec_project.bash index 093f323..b9ac364 100755 --- a/scripts/update_mec_project.bash +++ b/scripts/update_mec_project.bash @@ -49,7 +49,6 @@ echo 'Updating JSON files' JSON_SRC_PATH=${SRC_MEC_PATH}/json JSON_DST_PATH=${PATH_DEV_MEC}/json cp ${JSON_SRC_PATH}/*.json ${JSON_DST_PATH} -cp ${JSON_SRC_PATH}/*.dtd ${JSON_DST_PATH} # Update ETSI Framework files echo 'Updating ETSI Framework files' @@ -135,7 +134,11 @@ do fi cp ${TTCN_3_ORG_PATH}/$i/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn # Update files - if [ "$i" == "LibMec/LocationAPI" ] + if [ "$i" == "LibMec" ] + then + cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn + cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json + elif [ "$i" == "LibMec/LocationAPI" ] then cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json diff --git a/ttcn/patch_lib_http/LibItsHttp_TestSystem.ttcn b/ttcn/patch_lib_http/LibItsHttp_TestSystem.ttcn new file mode 100644 index 0000000..b94479b --- /dev/null +++ b/ttcn/patch_lib_http/LibItsHttp_TestSystem.ttcn @@ -0,0 +1,35 @@ +/** + * @author ETSI / STF545 + * @version $URL$ + * $ID:$ + * @desc This module provides the test system used by ITS HTTP based protocols. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * @see ETSI TS 103 478 + */ +module LibItsHttp_TestSystem { + + // LibCommon + import from LibCommon_Sync all; + import from LibCommon_Time all; + + // LibItsHttp + import from LibItsHttp_TypesAndValues all; + + type port HttpPort message { + inout HttpMessage; + } + + type component HttpComponent extends SelfSyncComp { // FIXME To be rename into HttpTest + port HttpPort httpPort; + timer tc_ac := PX_TAC; + timer tc_noac := PX_TNOAC; + } // End of component HttpComponent + + type component HttpTestAdapter { // FIXME To be rename into HttpTestSystem + port HttpPort httpPort; + } // End of component TestAdapter + +} // End of module LibItsHttp_TestSystem -- GitLab