From 323dd7c7ca844dbb4b5c063f1c76e5831d231412 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 4 Dec 2024 15:50:17 +0100 Subject: [PATCH 01/54] Bug fixed in virtualization/docker-dev/ scripts --- gs032p3-ttcn-test-suite.code-workspace | 3 ++ install.sh | 2 +- virtualization/docker-dev/Dockerfile | 6 +-- virtualization/docker-dev/build.sh | 4 +- .../docker-dev/home/etc/init.d/20-eclipse.sh | 26 ---------- .../docker-dev/home/etc/init.d/40-ttf_t027.sh | 48 ------------------- virtualization/docker/Dockerfile | 2 +- 7 files changed, 10 insertions(+), 81 deletions(-) delete mode 100755 virtualization/docker-dev/home/etc/init.d/20-eclipse.sh delete mode 100755 virtualization/docker-dev/home/etc/init.d/40-ttf_t027.sh diff --git a/gs032p3-ttcn-test-suite.code-workspace b/gs032p3-ttcn-test-suite.code-workspace index 5d03749..6b71a12 100644 --- a/gs032p3-ttcn-test-suite.code-workspace +++ b/gs032p3-ttcn-test-suite.code-workspace @@ -11,6 +11,9 @@ }, { "path": "../gs032p3-robot-test-suite" + }, + { + "path": "../mec.pipeline-scripts" } ], "settings": { diff --git a/install.sh b/install.sh index c8048c9..c777e49 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,7 @@ set -vx BASE_PATH=`pwd` -git submodule update --init --recursive --remote +#git submodule update --init --recursive --remote if [ ! -d ./titan-test-system-framework ] then diff --git a/virtualization/docker-dev/Dockerfile b/virtualization/docker-dev/Dockerfile index 37c7b15..6c31c8a 100644 --- a/virtualization/docker-dev/Dockerfile +++ b/virtualization/docker-dev/Dockerfile @@ -1,12 +1,12 @@ FROM stfubuntu:20.04 -MAINTAINER ETSI TTF T027 +MAINTAINER ETSI TTF T043 -LABEL description="TTF_T027_Mec Docker Image" +LABEL description="TTF_T043_Mec Docker Image" ENV TERM=linux \ HOME=/home/etsi \ - HOSTNAME=docker-titan-TTF_T027 + HOSTNAME=docker-titan-TTF_T043 COPY home /home/etsi diff --git a/virtualization/docker-dev/build.sh b/virtualization/docker-dev/build.sh index 2eb0390..efb5091 100755 --- a/virtualization/docker-dev/build.sh +++ b/virtualization/docker-dev/build.sh @@ -16,10 +16,10 @@ if [ -z `docker images -q stfubuntu` ]; then docker build --no-cache --tag stfubuntu:20.04 -f Dockerfile.stfubuntu --force-rm . || exit 1 fi -docker build --no-cache --tag mec_devel --force-rm . || ( echo "Docker build failed: $?"; exit 1 ) +docker build --no-cache --tag etsiforge/etsi-mec-phase3 --force-rm . || ( echo "Docker build failed: $?"; exit 1 ) docker images -docker inspect mec_devel:latest || ( echo "Docker inspect failed: $?"; exit 1 ) +docker inspect etsiforge/etsi-mec-phase3:latest || ( echo "Docker inspect failed: $?"; exit 1 ) # That's all Floks exit 0 diff --git a/virtualization/docker-dev/home/etc/init.d/20-eclipse.sh b/virtualization/docker-dev/home/etc/init.d/20-eclipse.sh deleted file mode 100755 index ab90df6..0000000 --- a/virtualization/docker-dev/home/etc/init.d/20-eclipse.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -ECLIPSE_URL='https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz&r=1' -TITAN_URL='https://www.eclipse.org/downloads/download.php?file=/titan/TITAN_Designer_and_Executor_Plugin_7.1.0.zip&r=1' - -#set -e -set -vx - -echo -e "*****************************\n* Install eclipse\n*****************************\n" - -mkdir -p ${HOME}/frameworks -cd ${HOME}/frameworks || exit 1 -wget --progress=dot:mega 'http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2024-03/R/eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz' -Oeclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz || exit 1 -tar -zxvf ./eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz || exit 1 -ln -sf ${HOME}/frameworks/eclipse/eclipse ${HOME}/bin/eclipse -rm -f ./eclipse-cpp-2024-03-R-linux-gtk-x86_64.tar.gz - -if wget --progress=dot:mega 'https://www.eclipse.org/downloads/download.php?file=/titan/TITAN_Designer_and_Executor_plugin-8.1.0.zip' -OTITAN_Designer_and_Executor_plugin.zip; then - eclipse/eclipse -noSplash -application org.eclipse.equinox.p2.director \ - -destination /home/etsi/frameworks/eclipse \ - -repository 'jar:file:///home/etsi/frameworks/TITAN_Designer_and_Executor_plugin.zip!/' \ - -installIU TITAN_Designer.feature.group,TITAN_Executor.feature.group,TITAN_Log_Viewer.feature.group,Titan_external_dependencies.feature.group,Titanium.feature.group,Titanium_external_dependencies.feature.group - rm -f TITAN_Designer_and_Executor_plugin.zip -fi - -cd ${HOME} diff --git a/virtualization/docker-dev/home/etc/init.d/40-ttf_t027.sh b/virtualization/docker-dev/home/etc/init.d/40-ttf_t027.sh deleted file mode 100755 index 7bedfab..0000000 --- a/virtualization/docker-dev/home/etc/init.d/40-ttf_t027.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -#set -e -set -vx - -echo -e "*****************************\n* Checkout mec_devel sources\n*****************************\n" -mkdir -p ${HOME}/dev && cd ${HOME}/dev || exit 1 - -git clone --recurse-submodules --branch TTF_T027 https://forge.etsi.org/rep/mec/gs032p3-ttcn-test-suite.git mec_devel -cd ${HOME}/dev/mec_devel/titan-test-system-framework -git checkout devel -cd ${HOME}/dev/mec_devel/ttcn -git clone https://forge.etsi.org/gitlab/LIBS/LibCommon.git ./LibCommon - -echo -e "*****************************\n* Set up environment\n*****************************\n" -cd ${HOME}/dev/mec_devel/scripts -ln -sf ${HOME}/dev/mec_devel/scripts/devenv.bash.ubuntu ${HOME}/devenv.bash -. ${HOME}/devenv.bash - -echo -e "*****************************\n* Apply patched \n*****************************\n" -cd ${HOME}/dev/mec_devel - -cd ./ttcn/LibCommon -ln -sf ${HOME}/dev/mec_devel/ttcn/patch_lib_common_titan/module.mk module.mk -cd - -cd ./titan-test-system-framework/ttcn/LibHttp -ln -sf module_mec.mk module.mk -cd - - -echo -e "*****************************\n* Build Mec test suite\n*****************************\n" -cd ${HOME}/dev/mec_devel -export ATS_LIST="AtsMec_Location AtsMec_Rnis AtsMec_TrafficManagement AtsMec_UEidentity AtsMec_WlanInformation AtsMec_V2XInformationService" -for i in ${ATS_LIST} -do - export ATS=$i - make || exit 1 -done -rm -fr ./build || exit 1 - -cd ./etc/AtsMec_Location -ln -sf AtsMec_Sandbox.cf_ AtsMec_Location.cfg - -echo -e "*****************************\n* Change sudo in command line\n*****************************\n" -cd ${HOME}/dev/mec_devel/scripts -sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_mtc.bash -sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_ptcs.bash - -cd ${HOME}/dev/mec_devel diff --git a/virtualization/docker/Dockerfile b/virtualization/docker/Dockerfile index 456149a..74d5b52 100644 --- a/virtualization/docker/Dockerfile +++ b/virtualization/docker/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:latest # Install dependencies RUN apk update && \ - apk add --no-cache sudo make git g++ diffutils expect openssl-dev libxml2-dev libxml2-utils libxslt-dev libtool ncurses-dev jsoncpp-dev readline-dev flex bison perl bash libedit libedit-dev lksctp-tools lksctp-tools-dev libpcap-dev + apk add --no-cache autoconf automake sudo make git g++ diffutils expect openssl-dev libxml2-dev libxml2-utils libxslt-dev libtool ncurses-dev jsoncpp-dev readline-dev flex bison perl libexecinfo-dev bash libedit libedit-dev lksctp-tools lksctp-tools-dev libpcap-dev zlib-dev curl # Create user and sudouser RUN \ -- GitLab From 142ad5f37c57cf610e970ef4c3b344931a44d764 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 4 Dec 2024 16:34:15 +0100 Subject: [PATCH 02/54] Add missing file --- .../docker-dev/home/etc/init.d/40-ttf_t043.sh | 36 +++++++++++++++++++ .../docker-dev/home/etc/init.d/50-doxygen.sh | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 virtualization/docker-dev/home/etc/init.d/40-ttf_t043.sh diff --git a/virtualization/docker-dev/home/etc/init.d/40-ttf_t043.sh b/virtualization/docker-dev/home/etc/init.d/40-ttf_t043.sh new file mode 100755 index 0000000..282df6c --- /dev/null +++ b/virtualization/docker-dev/home/etc/init.d/40-ttf_t043.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +#set -e +set -vx + +echo -e "*****************************\n* Checkout mec_devel sources\n*****************************\n" +mkdir -p ${HOME}/dev && cd ${HOME}/dev || exit 1 + +git clone --recurse-submodules --branch TTF_T043 https://forge.etsi.org/rep/mec/gs032p3-ttcn-test-suite.git mec_devel || exit 1 +cd ${HOME}/dev/mec_devel/ || exit 1 +./install.sh || exit 1 + +echo -e "*****************************\n* Set up environment\n*****************************\n" +cd ${HOME}/dev/mec_devel/scripts +ln -sf ${HOME}/dev/mec_devel/scripts/devenv.bash.ubuntu ${HOME}/devenv.bash +. ${HOME}/devenv.bash + +echo -e "*****************************\n* Build Mec test suite\n*****************************\n" +cd ${HOME}/dev/mec_devel +export ATS_LIST="AtsMec_Location AtsMec_Rnis AtsMec_TrafficManagement AtsMec_UEidentity AtsMec_WlanInformation AtsMec_V2XInformationService" +for i in ${ATS_LIST} +do + export ATS=$i + make || exit 1 +done +rm -fr ./build || exit 1 + +cd ./etc/AtsMec_Location +ln -sf AtsMec_Sandbox.cf_ AtsMec_Location.cfg + +echo -e "*****************************\n* Change sudo in command line\n*****************************\n" +cd ${HOME}/dev/mec_devel/scripts +sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_mtc.bash +sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_ptcs.bash + +cd ${HOME}/dev/mec_devel diff --git a/virtualization/docker-dev/home/etc/init.d/50-doxygen.sh b/virtualization/docker-dev/home/etc/init.d/50-doxygen.sh index 19c9522..68c1955 100755 --- a/virtualization/docker-dev/home/etc/init.d/50-doxygen.sh +++ b/virtualization/docker-dev/home/etc/init.d/50-doxygen.sh @@ -4,7 +4,7 @@ set -vx echo -e "*****************************\n* Build docs \n*****************************\n" -. /home/etsi/devenv.bash +. ${HOME}/devenv.bash cd ${HOME}/dev/mec_devel/docs || exit 1 doxygen ./o2.cfg || exit 1 -- GitLab From e722c352c82f0f6b3290459902c931fcdb04bb6b Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 23 Jan 2025 15:55:47 +0100 Subject: [PATCH 03/54] Add Skeletons for MEC 045 & MEC 04 --- STF569_Mec.tpd | 245 --------------- titan-test-system-framework | 2 +- ...ormApplicationEnablementAPI_TestCases.ttcn | 2 +- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 21 ++ .../AtsMec_QoSMeasurementAPI_TestControl.ttcn | 7 + ttcn/AtsMec_QoSMeasurementAPI/module.mk | 40 +++ .../AtsMec_SensorsSharingService.ttcn | 21 ++ ...Mec_SensorsSharingService_TestControl.ttcn | 7 + ttcn/AtsMec_SensorsSharingService/module.mk | 40 +++ ...plicationEnablementAPI_TypesAndValues.ttcn | 290 ++++++++++++++++++ ttcn/LibMec/QoSMeasurementAPI/module.mk | 6 + .../ttcn/QoSMeasurementAPI_Functions.ttcn | 3 + .../ttcn/QoSMeasurementAPI_Pics.ttcn | 3 + .../ttcn/QoSMeasurementAPI_Pixits.ttcn | 3 + .../ttcn/QoSMeasurementAPI_Templates.ttcn | 3 + .../QoSMeasurementAPI_TypesAndValues.ttcn | 3 + ttcn/LibMec/SensorsSharingService/module.mk | 6 + .../QoSMeasurementAPI_TypesAndValues.ttcn | 3 + .../ttcn/SensorsSharingService_Functions.ttcn | 3 + .../ttcn/SensorsSharingService_Pics.ttcn | 3 + .../ttcn/SensorsSharingService_Pixits.ttcn | 3 + .../ttcn/SensorsSharingService_Templates.ttcn | 3 + 22 files changed, 470 insertions(+), 247 deletions(-) delete mode 100644 STF569_Mec.tpd create mode 100644 ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn create mode 100644 ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn create mode 100644 ttcn/AtsMec_QoSMeasurementAPI/module.mk create mode 100644 ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn create mode 100644 ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn create mode 100644 ttcn/AtsMec_SensorsSharingService/module.mk create mode 100644 ttcn/LibMec/QoSMeasurementAPI/module.mk create mode 100644 ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn create mode 100644 ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn create mode 100644 ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn create mode 100644 ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn create mode 100644 ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn create mode 100644 ttcn/LibMec/SensorsSharingService/module.mk create mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn create mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn create mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn create mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn create mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn diff --git a/STF569_Mec.tpd b/STF569_Mec.tpd deleted file mode 100644 index 5da647f..0000000 --- a/STF569_Mec.tpd +++ /dev/null @@ -1,245 +0,0 @@ - - - STF569_Mec - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - true - bin/STF569_Mec - true - true - true - true - true - true - true - true - true - true - - pcap - - - - bin - - - - - src/ccsrc/EncDec/LibMec/LocationAPI/LibMec_EncDec.cc - - true - - - - src/ttcn/LibCommon/ttcn/LibCommon_Sync.ttcn - - true - - - - src/ttcn/LibIts/ttcn/Http/LibItsHttp_BinaryMessageBodyTypes.ttcn - - true - - - - src/ttcn/LibIts/ttcn/Http/LibItsHttp_BinaryTemplates.ttcn - - true - - - - src/ttcn/LibIts/ttcn/Http/LibItsHttp_BinaryTypes.ttcn - - true - - - - src/ttcn/LibIts/ttcn/Http/LibItsHttp_JsonMessageBodyTypes.ttcn - - true - - - - src/ttcn/LibIts/ttcn/Http/LibItsHttp_JsonTemplates.ttcn - - true - - - - src/ttcn/LibIts/ttcn/Http/LibItsHttp_TestSystem.ttcn - - true - - - - - - \ No newline at end of file diff --git a/titan-test-system-framework b/titan-test-system-framework index a8db2ae..fffe402 160000 --- a/titan-test-system-framework +++ b/titan-test-system-framework @@ -1 +1 @@ -Subproject commit a8db2aefc860cdfec0b76ae767f5c91fe7ec042f +Subproject commit fffe402b8aa3986bdab4b4bcced277c8b334a1ec diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 29b7d54..8f57f82 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -881,7 +881,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_APP_REG_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & PX_NON_EXISTENT_SERVICE_NAME, + PICS_ROOT_API & PX_ME_APP_REG_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_NON_EXISTENT_SERVICE_NAME)), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn new file mode 100644 index 0000000..2be0bfe --- /dev/null +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -0,0 +1,21 @@ +module AtsMec_QoSMeasurementAPI_TestCases { + + // Libcommon + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/LibMec_ApplicationPackageLifecycleAndOperationGrantingAPI + import from ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues all; + import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all; + import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits all; + + // LibMec/EdgePlatformApplicationEnablementAPI + import from EdgePlatformApplicationEnablementAPI_Templates all; + +} // End of module AtsMec_QoSMeasurementAPI_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn new file mode 100644 index 0000000..179537f --- /dev/null +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn @@ -0,0 +1,7 @@ +module AtsMec_QoSMeasurementAPI_TestControl { + + control { + + } + +} // End of module AtsMec_QoSMeasurementAPI_TestControl \ No newline at end of file diff --git a/ttcn/AtsMec_QoSMeasurementAPI/module.mk b/ttcn/AtsMec_QoSMeasurementAPI/module.mk new file mode 100644 index 0000000..78e83d6 --- /dev/null +++ b/ttcn/AtsMec_QoSMeasurementAPI/module.mk @@ -0,0 +1,40 @@ +suite := AtsMec_QoSMeasurementAPI + +sources := \ + AtsMec_QoSMeasurementAPI_TestCases.ttcn \ + AtsMec_QoSMeasurementAPI_TestControl.ttcn + +modules := ../LibCommon \ + ../../titan-test-system-framework/ttcn/LibHelpers \ + ../../titan-test-system-framework/ttcn/LibHttp \ + ../../titan-test-system-framework/ttcn/LibXsd \ + ../../titan-test-system-framework/ttcn/LibJson \ + ../patch_lib_http \ + ../LibMec \ + ../LibMec/LocationAPI \ + ../LibMec/EdgePlatformApplicationEnablementAPI \ + ../LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI \ + ../LibMec/TrafficManagementAPI \ + ../LibMec/UEAppInterfaceAPI \ + ../LibMec/UEidentityAPI \ + ../LibMec/V2XInformationServiceAPI \ + ../LibMec/DeviceApplicationInterfaceAPI \ + ../LibMec/WlanInformationAPI \ + ../LibMec/FixedAccessInformationServiceAPI \ + ../LibMec/ApplicationMobilityServiceAPI \ + ../LibMec/IoTAPI \ + ../LibMec/FederationEnablementAPI \ + ../LibMec/AtsMec_QoSMeasurementAPI \ + ../../titan-test-system-framework/ccsrc/Framework \ + ../../titan-test-system-framework/ccsrc/loggers \ + ../../titan-test-system-framework/ccsrc/Protocols/Http \ + ../../titan-test-system-framework/ccsrc/Protocols/Tcp \ + ../../titan-test-system-framework/ccsrc/Protocols/Xml \ + ../../titan-test-system-framework/ccsrc/Helpers \ + ../../ccsrc/Ports/LibHttp \ + ../../ccsrc/EncDec/LibMec \ + ../../ccsrc/externals \ + ../../ccsrc/Protocols/Http \ + ../../ccsrc/Protocols/Json \ + ../modules/titan.TestPorts.Common_Components.Abstract_Socket \ + diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn new file mode 100644 index 0000000..b64e130 --- /dev/null +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn @@ -0,0 +1,21 @@ +module AtsMec_SensorsSharingService_TestCases { + + // Libcommon + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/LibMec_ApplicationPackageLifecycleAndOperationGrantingAPI + import from ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues all; + import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all; + import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits all; + + // LibMec/EdgePlatformApplicationEnablementAPI + import from EdgePlatformApplicationEnablementAPI_Templates all; + +} // End of module AtsMec_SensorsSharingService_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn new file mode 100644 index 0000000..733a16f --- /dev/null +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn @@ -0,0 +1,7 @@ +module AtsMec_SensorsSharingService_TestControl { + + control { + + } + +} // End of module AtsMec_SensorsSharingService_TestControl \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/module.mk b/ttcn/AtsMec_SensorsSharingService/module.mk new file mode 100644 index 0000000..9bd1147 --- /dev/null +++ b/ttcn/AtsMec_SensorsSharingService/module.mk @@ -0,0 +1,40 @@ +suite := AtsMec_SensorsSharingService + +sources := \ + AtsMec_SensorsSharingService_TestCases.ttcn \ + AtsMec_SensorsSharingService_TestControl.ttcn + +modules := ../LibCommon \ + ../../titan-test-system-framework/ttcn/LibHelpers \ + ../../titan-test-system-framework/ttcn/LibHttp \ + ../../titan-test-system-framework/ttcn/LibXsd \ + ../../titan-test-system-framework/ttcn/LibJson \ + ../patch_lib_http \ + ../LibMec \ + ../LibMec/LocationAPI \ + ../LibMec/EdgePlatformApplicationEnablementAPI \ + ../LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI \ + ../LibMec/TrafficManagementAPI \ + ../LibMec/UEAppInterfaceAPI \ + ../LibMec/UEidentityAPI \ + ../LibMec/V2XInformationServiceAPI \ + ../LibMec/DeviceApplicationInterfaceAPI \ + ../LibMec/WlanInformationAPI \ + ../LibMec/FixedAccessInformationServiceAPI \ + ../LibMec/ApplicationMobilityServiceAPI \ + ../LibMec/IoTAPI \ + ../LibMec/FederationEnablementAPI \ + ../LibMec/SensorsSharingService \ + ../../titan-test-system-framework/ccsrc/Framework \ + ../../titan-test-system-framework/ccsrc/loggers \ + ../../titan-test-system-framework/ccsrc/Protocols/Http \ + ../../titan-test-system-framework/ccsrc/Protocols/Tcp \ + ../../titan-test-system-framework/ccsrc/Protocols/Xml \ + ../../titan-test-system-framework/ccsrc/Helpers \ + ../../ccsrc/Ports/LibHttp \ + ../../ccsrc/EncDec/LibMec \ + ../../ccsrc/externals \ + ../../ccsrc/Protocols/Http \ + ../../ccsrc/Protocols/Json \ + ../modules/titan.TestPorts.Common_Components.Abstract_Socket \ + diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index ad62b1c..8517df4 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -1020,6 +1020,296 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { TunnelInfo_TunnelSrcAddress tunnelSrcAddress optional } + /** + * @desc This type represents the structured data types to be used in resource representations of the CAPIF_Discover_Service_API. + * @member serviceAPIDescriptions Description of the service API as published by the service + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.1.4.2.2-1: Definition of type DiscoveredAPIs + */ + type record DiscoveredAPIs { + ServiceAPIDescription serviceAPIDescriptions optional + } + + /** + * @desc This type represents the structured data types to be used in resource representations of the CAPIF_Publish_Service_API + * @member apiName API name, it is set as {apiName} part of the URI structure + * @member apiId API identifier assigned by the CCF to the published service API + * @member apiStatus Indicates the API status + * @member aefProfiles AEF profile information, which includes the exposed API details (e.g. protocol) + * @member description Text description of the API + * @member supportedFeatures The supported optional features of the CAPIF API + * @member serviceAPICategory The service API category to which the service API belongs to + * @member ccfId CCF identifier which can be contacted further for discovering the details of service API information + * @member apiSuppFeats Provided by the consumer to indicate the features supported by the service API + * @member pubApiPath It contains the published API path within the same CAPIF provider domain + * @member apiProvName Represents the API provider name + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.2-1: Definition of type ServiceAPIDescription + */ + type record ServiceAPIDescription { + Json.String apiName, + Json.String apiId optional, + ApiStatus apiStatus optional, + AefProfiles aefProfiles optional, + Json.String description optional, + SupportedFeatures supportedFeatures optional, + Json.String serviceAPICategory optional, + Json.String ccfId optional, + SupportedFeatures apiSuppFeats optional, + PublishedApiPath pubApiPath optional, + Json.String apiProvName optional + } + type record length (1 .. infinity) of ServiceAPIDescription ServiceAPIDescriptions; + + /** + * @desc This type represents the API status + * @member serviceAPIDescriptions Indicates the list of AEF ID(s) where the API is active + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.12-1: Definition of type ApiStatus + */ + type record ApiStatus { + record of Json.String aefIds optional + } + + /** + * @desc This type represents the AEF profile information + * @member aefId AEF identifier + * @member versions API version + * @member protocol Protocol used by the API + * @member dataFormat Data format used by the API + * @member securityMethods Security methods supported by the AEF for all interfaces + * @member domainName Contains the domain name information used to construct the “apiRoot” variable of the API URI + * @member interfaceDescriptions Interface details + * @member aefLocation The location information (e.g. civic address, GPS coordinates, data center ID) where the AEF providing the service API is located + * @member serviceKpis Contains information about the service characteristics provided by the service API + * @member ueIpRange The list of public IP ranges of UEs + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.4-1: Definition of type AefProfile + */ + type record AefProfile { + Json.String aefId, + Versions versions, + Protocol protocol optional, + DataFormat dataFormat optional, + SecurityMethods securityMethods optional, + Json.String domainName optional, + InterfaceDescriptions interfaceDescriptions optional, + AefLocation aefLocation optional, + ServiceKpis serviceKpis optional, + IpAddrRange ueIpRange optional + } + type record length (1 .. infinity) of AefProfile AefProfiles; + + /** + * @desc + * @see ETSI TS 129 222 V18.6.0 (2024-07) + */ + type record SupportedFeature { + + } + type record length (1 .. infinity) of SupportedFeature SupportedFeatures; + + /** + * @desc + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.9-1: Definition of type PublishedApiPath + */ + type record PublishedApiPath { + record of Json.String ccfIds optional + } + + /** + * @desc This type represents the API version + * @member apiVersion API major version in URI + * @member expiry Expiry date and time of the AEF service + * @member resources Resources supported by the API + * @member custOperations Custom operations without resource association + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.5-1: Definition of type Version + */ + type record Version { + Json.String apiVersion, + DateTime expiry optional, + Resources resources optional, + CustOperations custOperations optional + } + type record of Version Versions; + type record length (1 .. infinity) of Json.String Resources; + + /** + * @desc This type represents the Protocol used by the API + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.3.3-1: Enumeration Protocol + */ + type enumerated Protocol { + HTTP_1_1, + HTTP_2, + MQTT, + WEBSOCKET + } + + /** + * @desc This type represents the Data format used by the API + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.3.4-1: Enumeration DataFormat + */ + type enumerated DataFormat { + JSON, + XML, + PROTOBUF3, + WEBSOCKET + } + + /** + * @desc This type represents the security method used by the API + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.3.6-1: Enumeration SecurityMethod + */ + type enumerated SecurityMethod { + PSK, + PKI, + OAUTH + } + type record of SecurityMethod SecurityMethods; + + /** + * @desc This type represents an interface details + * @param ipv4Addr String identifying an IPv4 address + * @param ipv6Addr String identifying an IPv6 address + * @param fqdn String containing a Fully Qualified Domain Name. + * @param port_ Port number + * @param apiPrefix A string representing an optional deployment specific string (API prefix) + * @param securityMethods Security methods supported by the interface + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.3-1: Definition of type InterfaceDescription + */ + type record InterfaceDescription { + Ipv4Addr ipv4Addr optional, + Ipv6Addr ipv6Addr optional, + Fqdn fqdn optional, + Port port_ optional, + Json.String apiPrefix optional, + SecurityMethods securityMethods optional + } with { + variant (port_) "name as 'port'"; + } + type record length (1 .. infinity) of InterfaceDescription InterfaceDescriptions; + + /** + * @desc This type represents the location information + * @param civicAddr Identifies the civic address where the AEF providing the service API is located + * @param geoArea Identifies the geographic area where the AEF providing the service API is located + * @param dcId Identifies the data center where the AEF providing the service API is located + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.10-1: Definition of type AefLocation + */ + type record AefLocation { + CivicAddress civicAddr optional, + GeographicArea geoArea optional, + Json.String dcId optional + } + + /** + * @desc This type represents the information about the service characteristics provided by the service API + * @param maxReqRate Contains the maximum request rate (i.e.,number of requests per second) from the API Invoker that is supported by any service producer of the service API + * @param maxRestime Contains the maximum response time (expressed in seconds) supported for the API Invoker's service requests + * @param availability Contains the advertised percentage of time any service producer of the service API is available for the API Invoker's use + * @param avalComp Contains the maximum compute resource available for the API Invoker + * @param avalGraComp Contains the maximum graphical compute resource available for the API Invoker + * @param avalMem Contains the maximum memory resource available for the API Invoker + * @param avalStor Contains the maximum storage resource available for the API Invoker + * @param conBand Contains the connection bandwidth (expressed in kbps) advertised for the API Invoker's use + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.13-1: Definition of type ServiceKpis + */ + type record ServiceKpi { + Json.UInteger maxReqRate optional, + DurationSec maxRestime optional, + Json.UInteger availability optional, + Json.String avalComp optional, + Json.String avalGraComp optional, + Json.String avalMem optional, + Json.String avalStor optional, + Json.UInteger conBand optional + } + type record length (1 .. infinity) of ServiceKpi ServiceKpis; + + /** + * @desc This type represents the information about the service characteristics provided by the service API + * @param commType Communication type used by the custom operation + * @param custOpName It is set as {custOpName} part of the URI structure for a custom operation without resource association + * @param operations Supported HTTP methods for the custom operation + * @param description Text description of the custom operation + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.7-1: Definition of type CustomOperation + */ + type record CustomOperation { + CommunicationType commType, + Json.String custOpName, + Operations operations, + Json.String description optional + } + type record length (1 .. infinity) of CustomOperation CustOperations; + + /** + * @desc This type represents the information about the service characteristics provided by the service API + * @param ueIpv4AddrRanges Represents the IPv4 Address ranges of the UE(s) + * @param ueIpv6AddrRanges Represents the IPv6 Address ranges of the UE(s) + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.14-1: Definition of type IpAddrRange + */ + type record IpAddrRange { + Ipv4AddressRanges ueIpv4AddrRanges optional, + Ipv6AddressRanges ueIpv6AddrRanges optional + } + + /** + * @desc This type represents the communication type + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.3.5-1: Enumeration CommunicationType + */ + type enumerated CommunicationType { + REQUEST_RESPONSE, + SUBSCRIBE_NOTIFY + } + + /** + * @desc This type represents the HTTP methods + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.3.7-1: Enumeration Operation + */ + type enumerated Operation { + GET, + POST, + PUT, + PATCH, + DELETE + } + type record length (1 .. infinity) of Operation Operations; + + // FIXME See ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.1-2: Re-used Data Types + type record Fqdn { + + } + + type Json.UInteger Port; + + type record CivicAddress { + + } + + type record GeographicArea { + + } + + type record DateTime { + + } + + type Json.Number DurationSec; + + type record Ipv4AddressRange { + + } + type record length (1 .. infinity) of Ipv4AddressRange Ipv4AddressRanges; + + type record Ipv6AddressRange { + + } + type record length (1 .. infinity) of Ipv6AddressRange Ipv6AddressRanges; + + type record Ipv4Addr { + + } + + type record Ipv6Addr { + + } + } with { encode "JSON" } // End of module EdgePlatformApplicationEnablementAPI_TypesAndValues diff --git a/ttcn/LibMec/QoSMeasurementAPI/module.mk b/ttcn/LibMec/QoSMeasurementAPI/module.mk new file mode 100644 index 0000000..a5da7e5 --- /dev/null +++ b/ttcn/LibMec/QoSMeasurementAPI/module.mk @@ -0,0 +1,6 @@ +sources := \ + ttcn/QoSMeasurementAPI_Pics.ttcn \ + ttcn/QoSMeasurementAPI_Pixits.ttcn \ + ttcn/QoSMeasurementAPI_Templates.ttcn \ + ttcn/QoSMeasurementAPI_Functions.ttcn \ + ttcn/QoSMeasurementAPI_TypesAndValues.ttcn diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn new file mode 100644 index 0000000..3324e24 --- /dev/null +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Functions { + +} // End of module QoSMeasurementAPI_Functions diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn new file mode 100644 index 0000000..1cb0e19 --- /dev/null +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Pics { + +} // End of module QoSMeasurementAPI_Pics diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn new file mode 100644 index 0000000..68e5021 --- /dev/null +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Pixits { + +} // End of module QoSMeasurementAPI_Pixits diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn new file mode 100644 index 0000000..aa631b4 --- /dev/null +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Templates { + +} // End of module QoSMeasurementAPI_Templates diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn new file mode 100644 index 0000000..80b9532 --- /dev/null +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_TypesAndValues { + +} // End of module QoSMeasurementAPI_TypesAndValues diff --git a/ttcn/LibMec/SensorsSharingService/module.mk b/ttcn/LibMec/SensorsSharingService/module.mk new file mode 100644 index 0000000..497f187 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/module.mk @@ -0,0 +1,6 @@ +sources := \ + ttcn/SensorsSharingService_Pics.ttcn \ + ttcn/SensorsSharingService_Pixits.ttcn \ + ttcn/SensorsSharingService_Templates.ttcn \ + ttcn/SensorsSharingService_Functions.ttcn \ + ttcn/SensorsSharingService_TypesAndValues.ttcn diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn new file mode 100644 index 0000000..80b9532 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_TypesAndValues { + +} // End of module QoSMeasurementAPI_TypesAndValues diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn new file mode 100644 index 0000000..3324e24 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Functions { + +} // End of module QoSMeasurementAPI_Functions diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn new file mode 100644 index 0000000..1cb0e19 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Pics { + +} // End of module QoSMeasurementAPI_Pics diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn new file mode 100644 index 0000000..68e5021 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Pixits { + +} // End of module QoSMeasurementAPI_Pixits diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn new file mode 100644 index 0000000..aa631b4 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn @@ -0,0 +1,3 @@ +module QoSMeasurementAPI_Templates { + +} // End of module QoSMeasurementAPI_Templates -- GitLab From a36001dff93b47eecf7547297e81d5494e7b9c89 Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 26 Jan 2025 12:24:21 +0100 Subject: [PATCH 04/54] Add typing for AtsMec_QoSMeasurementAPI --- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 9 +- ttcn/AtsMec_QoSMeasurementAPI/module.mk | 2 +- .../ttcn/QoSMeasurementAPI_Templates.ttcn | 19 + .../QoSMeasurementAPI_TypesAndValues.ttcn | 384 +++++++++++++++++- 4 files changed, 405 insertions(+), 9 deletions(-) diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn index 2be0bfe..a0df67d 100644 --- a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -10,12 +10,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { import from LibHttp_JsonTemplates all; import from LibHttp_TestSystem all; - // LibMec/LibMec_ApplicationPackageLifecycleAndOperationGrantingAPI - import from ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues all; - import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all; - import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits all; - - // LibMec/EdgePlatformApplicationEnablementAPI - import from EdgePlatformApplicationEnablementAPI_Templates all; + // LibMec/QoSMeasurementAPI + import from QoSMeasurementAPI_Templates all; } // End of module AtsMec_QoSMeasurementAPI_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_QoSMeasurementAPI/module.mk b/ttcn/AtsMec_QoSMeasurementAPI/module.mk index 78e83d6..f5c3d0f 100644 --- a/ttcn/AtsMec_QoSMeasurementAPI/module.mk +++ b/ttcn/AtsMec_QoSMeasurementAPI/module.mk @@ -24,7 +24,7 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ - ../LibMec/AtsMec_QoSMeasurementAPI \ + ../LibMec/QoSMeasurementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn index aa631b4..12358a5 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -1,3 +1,22 @@ module QoSMeasurementAPI_Templates { + // Lib QoSMeasurementAPI + import from QoSMeasurementAPI_TypesAndValues all; + + template (omit) NotificationSubscriptionList m_notification_subscription_list( + in template (value) LinkType p_resourceURL, + in template (omit) Subscription p_subscription := omit + ) := { + subscription := p_subscription, + resourceURL := p_resourceURL + } // End of template m_notification_subscription_list + + template (present) NotificationSubscriptionList mw_notification_subscription_list( + template (present) LinkType p_resourceURL := ?, + template Subscription p_subscription := * + ) := { + subscription := p_subscription, + resourceURL := p_resourceURL + } // End of template mw_notification_subscription_list + } // End of module QoSMeasurementAPI_Templates diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn index 80b9532..dfb91e3 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn @@ -1,3 +1,385 @@ module QoSMeasurementAPI_TypesAndValues { - + + // JSON + import from Json all; + + // LibMec + import from LibMec_TypesAndValues all; + + /** + * @desc This type contains a list of subscriptions + * @param subscription The URI referring to the subscription + * @param resourceURL Self-referring URL + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.1-1: Definition of type NotificationSubscriptionList + */ + type record NotificationSubscriptionList { + Subscription subscription optional, + LinkType resourceURL + } + + /** + * @desc This type represents a subscription to the notifications from QMS about QoS measurement + * @param subscriptionType Shall be set to "QoSMeasureSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param users Address of user (e.g. 'sip' URI, 'tel' URI, 'acr'URI) + * @param flowInfo The information of the measured flows + * @param numberOfReports If not present, the subscription is active until it is actively terminated via HTTP DELETE + * @param reportingInterval The reportingInterval determines the interval between two contiguous reports. + * @param measuringPeriod It determines measuring frequency. + * @param measuringArea Area constraint for the measuring task + * @param measuringTime Time constraint for the measuring task + * @param metricType The expected measuring result type + * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription + */ + type record QoSMeasureSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + Users users optional, + FlowInfos flowInfo optional, + Json.UInteger numberOfReports optional, + Json.UInteger reportingInterval optional, + Json.UInteger measuringPeriod, + MeasuringAreas measuringArea optional, + MeasuringTimes measuringTime optional, + MetricTypes metricType, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + type record of Json.AnyURI Users; + + /** + * @desc This type represents a subscription to the notifications from QMS about QoS measurement + * @param samplingRate he sampling rate determines the proportion of flows that meet the flowFilter to be measured + * @param flowFilter Traffic flow filtering criteria + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription + */ + type record FlowInfo { + Json.UInteger samplingRate optional, + FlowFilter flowFilter + } + type record of FlowInfo FlowInfos; + + /** + * @desc Traffic flow filtering criteria + * @param sourceIp Source address identity of measured flow + * @param sourcePort Source port identity of measured flow + * @param dstIp Destination address identity of measured flow + * @param dstPort Destination port identity of measured flow + * @param protocol Protocol number + * @param dscp DSCP in the IPv4 header or Traffic Class in the IPv6 header + * @param flowlabel Flow Label in the IPv6 header, applicable only if the flow is IPv6 + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription + */ + type record FlowFilter { + Json.String sourceIp optional, + Ports sourcePort optional, + Json.String dstIp optional, + Ports dstPort optional, + Json.UInteger protocol optional, + Json.UInteger dscp optional, + Json.UInteger flowlabel optional + } + type record of FlowFilter FlowFilters; + + /** + * @desc Area constraint for the measuring task. Traffic of users entering the area will be measured + * @param areaInfo It describes the measured area + * @param accessPointId The identity of the access point the user is currently on + * @param zoneId The identity of the zone the user is currently within + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription + */ + type record MeasuringArea { + AreaInfo areaInfo optional, + Json.String accessPointId optional, + Json.String zoneId optional + } + type record of MeasuringArea MeasuringAreas; + + /** + * @desc Time constraint for the measuring task + * @param startTime The format is a string representing the hour, and the minute in a day + * @param endTime The format is a string representing the hour, and the minute in a day + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.2-1: Definition of type QoSMeasureSubscription + */ + type record MeasuringTime { + Json.String startTime, + Json.String endTime + } + type record of MeasuringTime MeasuringTimes; + + /** + * @desc This type represents QoS measuring result type + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.6.3-1: Enumeration MetricType + */ + type enumerated MetricType { + LATENCY, + JITTER, + THROUGHPUT, + LOSS_RATE, + ERROR_RATE + } + type record of MetricType MetricTypes; + + /** + * @desc This type represents a subscription to the notifications from QMS about QoS events, e.g. some metrics regarding network performance has achieved the alarm threshold + * @param subscriptionType Shall be set to "QoSEventSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications + * @param links Hyperlink related to the resource + * @param flowFilter Traffic flow filtering criteria. If the flowFilter field is included, at least one of its subfields shall be included + * @param reportTrigger The trigger leading to the notification + * @param reportingCtrl Provides parameters that ctrl the reporting + * @param measuringPeriod It determines measuring frequency + * @param monitoringArea Area constraint for the monitoring task + * @param monitoringTime Time in a day for the monitoring task + * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription + */ + type record QoSEventSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + FlowFilters flowFilter optional, + ReportTriggers reportTrigger optional, + ReportingCtrl reportingCtrl optional, + Json.UInteger measuringPeriod, + MonitoringAreas monitoringArea optional, + MonitoringTimes monitoringTime optional, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc The trigger leading to the notification + * @param metricType The monitoring metric type + * @param upperThreshold Threshold which if crossed upward shall cause a notification + * @param lowerThreshold Threshold which if crossed downward shall cause a notification + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription + */ + type record ReportTrigger { + MetricType metricType, + Json.UInteger upperThreshold optional, + Json.UInteger lowerThreshold optional + } + type record length (1 .. infinity) of ReportTrigger ReportTriggers; + + /** + * @desc Area constraint for the monitoring task + * @param areaInfo It describes the measured area + * @param accessPointId The identity of the access point the user is currently on + * @param zoneId The identity of the zone the user is currently within + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription + */ + type record MonitoringArea { + AreaInfo areaInfo optional, + Json.String accessPointId optional, + Json.String zoneId optional + } + type record of MonitoringArea MonitoringAreas; + + /** + * @desc Time in a day for the monitoring task + * @param startTime The format is a string representing the hour, and the minute in a day + * @param endTime The format is a string representing the hour, and the minute in a day + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.3-1: Definition of type QoSEventSubscription + */ + type record MonitoringTime { + Json.String startTime, + Json.String endTime + } + type record of MonitoringTime MonitoringTimes; + + /** + * @desc This type represents a test notification from a location server to determine if the Websocket method is to be utilized for the location server to issue notifications for a subscription + * @member notificationType Shall be set to "TestNotification" + * @member links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.1-1: Attributes of the TestNotification + */ + type record TestNotification { + Json.String notificationType, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a notification from QMS with regards to QoS measurement + * @member notificationType Shall be set to "QoSMeasureNotification" + * @member timeStamp Time stamp + * @member subscriptionState It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise + * @member qoSMeasureResult The QoS measuring result + * @member links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification + */ + type record QoSMeasureNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + SubscriptionState subscriptionState optional, + QoSMeasureResults qoSMeasureResult optional, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification + */ + type enumerated SubscriptionState { + ACTIVE, + FINISHED + } + + /** + * @desc The QoS measuring result + * @member user Address of user (e.g. 'sip' URI, 'tel' URI, 'acr' URI) + * @member flow Flow information + * @member measuringArea The area information for measurement reporting + * @member measuringTime The time section for measurement reporting + * @member latency The Unit is millisecond + * @member jitter The Unit is millisecond + * @member throughput The Unit is kbit/s + * @member loss_rate The integer represents percent + * @member error_rate The integer represents percent + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification + */ + type record QoSMeasureResult { + Json.AnyURI user optional, + FlowFilter flow, + MeasuringArea measuringArea optional, + MeasuringTime measuringTime optional, + Json.UInteger latency optional, + Json.UInteger jitter optional, + Json.UInteger throughput optional, + Json.UInteger loss_rate optional, + Json.UInteger error_rate optional + } + type record of QoSMeasureResult QoSMeasureResults; + + /** + * @desc This type represents a notification from QMS with regards to QoS event + * @member notificationType Shall be set to "QoSEventNotification"" + * @member timeStamp Time stamp + * @member subscriptionState It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise + * @member qoSMeasureResult The QoS measuring result + * @member links Object containing hyperlinks related to the resource + * @member flow Flow information + * @member metricType The monitoring metric type + * @member qosEvent The reporting event + * @member measuringArea The area information for event reporting + * @member + * @member + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.3-1: Attributes of the QoSEventNotification + */ + type record QoSEventNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + SubscriptionState subscriptionState optional, + Json.AnyURI user optional, + FlowFilters flow, + MetricType metricType, + QoSEvent qosEvent, + MeasuringArea measuringArea optional, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents the parameters that describe an area + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.6.4-1: Enumeration QoSEvent + */ + type enumerated AreaInfo { + CIRCLE, + POLYGON + } + + /** + * @desc This type represents the geographical location of a point + * @param latitude Location latitude, expressed in the range -90° to +90° + * @param longitude Location longitude, expressed in the range -180° to +180° + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.5.4-1: Attributes of type Point + */ + type record Point { + Json.Number latitude, + Json.Number longitude + } + + /** + * @desc This type represents the parameters that control the report times and frequency + * @param minimumInterval Location latitude, expressed in the range -90° to +90° + * @param maximumFrequency Maximum frequency (in seconds) of notifications per subscription + * @param maximumCount Maximum number of notifications + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.5.6-1: Attributes of type ReportingCtrl + */ + type record ReportingCtrl { + Json.UInteger minimumInterval optional, + Json.UInteger maximumFrequency optional, + Json.UInteger maximumCount optional + } + + /** + * @desc It shall be absent if the related subscription has no numberOfReports attribute, and shall be present otherwise + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.6.4-1: Enumeration QoSEvent + */ + type enumerated QoSEvent { + ABOVE_UPPER_THRESHOLD, + BELOW_LOWER_THRESHOLD + } + + /** + * @desc The service consumer's subscriptions + * @member href The URI referring to the subscription + * @member subscriptionType Type of the subscription + * @see ETSI GS MEC 045 V3.1.1 (2024-03) 6.3.1 Type: NotificationSubscriptionList + */ + type record Subscription { + Json.AnyURI href, + Json.String subscriptionType + } + + /** + * @desc This type represents a type of link + * @member href URI referring to a resource + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.6.2 Type: LinkType + */ + type record LinkType { + Json.AnyURI href + } + + /** + * @desc Hyperlink related to the resource + * @member subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.1-1: Attributes of the TestNotification + */ + type record Links { + LinkType subscription + } + + /** + * @desc This type represents configuration for the delivery of subscription notifications over Websockets + * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications + * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested + * @see ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.5.2 Type: WebsockNotifConfig + */ + type record WebsockNotifConfig { + Json.AnyURI websocketUri optional, + Json.Bool requestWebsocketUri optional + } + + type record of Json.UInteger Ports; +} with { + encode "JSON" } // End of module QoSMeasurementAPI_TypesAndValues -- GitLab From 5e37f3a18745395ee26cdd3dc24dca45ca7a106f Mon Sep 17 00:00:00 2001 From: garciay Date: Sun, 26 Jan 2025 18:12:49 +0100 Subject: [PATCH 05/54] Add templates for AtsMec_QoSMeasurementAPI & AtsMec_SensorsSharingService_TestCases --- .../AtsMec_SensorsSharingService.ttcn | 21 - ...tsMec_SensorsSharingService_TestCases.ttcn | 16 + ...Mec_SensorsSharingService_TestControl.ttcn | 2 + .../ttcn/QoSMeasurementAPI_Templates.ttcn | 460 +++++++++++++++++- .../QoSMeasurementAPI_TypesAndValues.ttcn | 7 +- .../QoSMeasurementAPI_TypesAndValues.ttcn | 3 - .../ttcn/SensorsSharingService_Functions.ttcn | 4 +- .../ttcn/SensorsSharingService_Pics.ttcn | 4 +- .../ttcn/SensorsSharingService_Pixits.ttcn | 4 +- .../ttcn/SensorsSharingService_Templates.ttcn | 429 +++++++++++++++- .../SensorsSharingService_TypesAndValues.ttcn | 360 ++++++++++++++ 11 files changed, 1274 insertions(+), 36 deletions(-) delete mode 100644 ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn create mode 100644 ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn delete mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn create mode 100644 ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn deleted file mode 100644 index b64e130..0000000 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.ttcn +++ /dev/null @@ -1,21 +0,0 @@ -module AtsMec_SensorsSharingService_TestCases { - - // Libcommon - import from LibCommon_Sync all; - - // LibHttp - import from LibHttp_TypesAndValues all; - import from LibHttp_Functions all; - import from LibHttp_Templates all; - import from LibHttp_JsonTemplates all; - import from LibHttp_TestSystem all; - - // LibMec/LibMec_ApplicationPackageLifecycleAndOperationGrantingAPI - import from ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues all; - import from ApplicationPackageLifecycleAndOperationGrantingAPI_Templates all; - import from ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits all; - - // LibMec/EdgePlatformApplicationEnablementAPI - import from EdgePlatformApplicationEnablementAPI_Templates all; - -} // End of module AtsMec_SensorsSharingService_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn new file mode 100644 index 0000000..434c895 --- /dev/null +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -0,0 +1,16 @@ +module AtsMec_SensorsSharingService_TestCases { + + // Libcommon + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/SensorsSharingService + import from SensorsSharingService_Templates all; + +} // End of module AtsMec_SensorsSharingService_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn index 733a16f..2c201fb 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn @@ -1,5 +1,7 @@ module AtsMec_SensorsSharingService_TestControl { + import from AtsMec_SensorsSharingService_TestCases all; + control { } diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn index 12358a5..935a6fe 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -1,5 +1,11 @@ module QoSMeasurementAPI_Templates { - + + // JSON + import from Json all; + + // LibMec + import from LibMec_TypesAndValues all; + // Lib QoSMeasurementAPI import from QoSMeasurementAPI_TypesAndValues all; @@ -19,4 +25,456 @@ module QoSMeasurementAPI_Templates { resourceURL := p_resourceURL } // End of template mw_notification_subscription_list + template (omit) QoSMeasureSubscription m_qo_s_measure_subscription( + in template (value) MetricTypes p_metricType, + in Json.AnyURI p_callbackReference, + in Json.UInteger p_measuringPeriod, + in template (omit) Links p_links := omit, + in template (omit) Users p_users := omit, + in template (omit) FlowInfos p_flowInfo := omit, + in template (omit) Json.UInteger p_numberOfReports := omit, + in template (omit) Json.UInteger p_reportingInterval := omit, + in template (omit) MeasuringAreas p_measuringArea := omit, + in template (omit) MeasuringTimes p_measuringTime := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "QoSMeasureSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + users := p_users, + flowInfo := p_flowInfo, + numberOfReports := p_numberOfReports, + reportingInterval := p_reportingInterval, + measuringPeriod := p_measuringPeriod, + measuringArea := p_measuringArea, + measuringTime := p_measuringTime, + metricType := p_metricType, + expiryDeadline := p_expiryDeadline + } // End of template m_qo_s_measure_subscription + + template (present) QoSMeasureSubscription mw_qo_s_measure_subscription( + template (present) MetricTypes p_metricType := ?, + template (present) Json.AnyURI p_callbackReference := ?, + template (present) Json.UInteger p_measuringPeriod := ?, + template Links p_links := *, + template Users p_users := *, + template FlowInfos p_flowInfo := *, + template Json.UInteger p_numberOfReports := *, + template Json.UInteger p_reportingInterval := *, + template MeasuringAreas p_measuringArea := *, + template MeasuringTimes p_measuringTime := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := "QoSMeasureSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + users := p_users, + flowInfo := p_flowInfo, + numberOfReports := p_numberOfReports, + reportingInterval := p_reportingInterval, + measuringPeriod := p_measuringPeriod, + measuringArea := p_measuringArea, + measuringTime := p_measuringTime, + metricType := p_metricType, + expiryDeadline := p_expiryDeadline + } // End of template mw_qo_s_measure_subscription + + template (omit) FlowInfo m_flow_info( + in template (value) FlowFilter p_flowFilter, + in template (omit) Json.UInteger p_samplingRate := omit + ) := { + samplingRate := p_samplingRate, + flowFilter := p_flowFilter + } // End of template m_flow_info + + template (present) FlowInfo mw_flow_info( + template (present) FlowFilter p_flowFilter := ?, + template Json.UInteger p_samplingRate := * + ) := { + samplingRate := p_samplingRate, + flowFilter := p_flowFilter + } // End of template mw_flow_info + + template (omit) FlowFilter m_flow_filter( + in template (omit) Json.String p_sourceIp := omit, + in template (omit) Ports p_sourcePort := omit, + in template (omit) Json.String p_dstIp := omit, + in template (omit) Ports p_dstPort := omit, + in template (omit) Json.UInteger p_protocol := omit, + in template (omit) Json.UInteger p_dscp := omit, + in template (omit) Json.UInteger p_flowlabel := omit + ) := { + sourceIp := p_sourceIp, + sourcePort := p_sourcePort, + dstIp := p_dstIp, + dstPort := p_dstPort, + protocol := p_protocol, + dscp := p_dscp, + flowlabel := p_flowlabel + } // End of template m_flow_filter + + template FlowFilter mw_flow_filter( + template Json.String p_sourceIp := *, + template Ports p_sourcePort := *, + template Json.String p_dstIp := *, + template Ports p_dstPort := *, + template Json.UInteger p_protocol := *, + template Json.UInteger p_dscp := *, + template Json.UInteger p_flowlabel := * + ) := { + sourceIp := p_sourceIp, + sourcePort := p_sourcePort, + dstIp := p_dstIp, + dstPort := p_dstPort, + protocol := p_protocol, + dscp := p_dscp, + flowlabel := p_flowlabel + } // End of template mw_flow_filter + + template (omit) MeasuringArea m_measuring_area( + in template (omit) AreaInfo p_areaInfo := omit, + in template (omit) Json.String p_accessPointId := omit, + in template (omit) Json.String p_zoneId := omit + ) := { + areaInfo := p_areaInfo, + accessPointId := p_accessPointId, + zoneId := p_zoneId + } // End of template m_measuring_area + + template MeasuringArea mw_measuring_area( + template AreaInfo p_areaInfo := *, + template Json.String p_accessPointId := *, + template Json.String p_zoneId := * + ) := { + areaInfo := p_areaInfo, + accessPointId := p_accessPointId, + zoneId := p_zoneId + } // End of template mw_measuring_area + + template (value) MeasuringTime m_measuring_time( + in Json.String p_startTime, + in Json.String p_endTime + ) := { + startTime := p_startTime, + endTime := p_endTime + } // End of template m_measuring_time + + template (present) MeasuringTime mw_measuring_time( + template (present) Json.String p_startTime := ?, + template (present) Json.String p_endTime := ? + ) := { + startTime := p_startTime, + endTime := p_endTime + } // End of template mw_measuring_time + + template (omit) QoSEventSubscription m_qo_s_event_subscription( + in Json.AnyURI p_callbackReference, + in Json.UInteger p_measuringPeriod, + in template (omit) Links p_links := omit, + in template (omit) FlowFilters p_flowFilter := omit, + in template (omit) ReportTriggers p_reportTrigger := omit, + in template (omit) ReportingCtrl p_reportingCtrl := omit, + in template (omit) MonitoringAreas p_monitoringArea := omit, + in template (omit) MonitoringTimes p_monitoringTime := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "QoSEventSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + flowFilter := p_flowFilter, + reportTrigger := p_reportTrigger, + reportingCtrl := p_reportingCtrl, + measuringPeriod := p_measuringPeriod, + monitoringArea := p_monitoringArea, + monitoringTime := p_monitoringTime, + expiryDeadline := p_expiryDeadline + } // End of template m_qo_s_event_subscription + + template (present) QoSEventSubscription mw_qo_s_event_subscription( + template (present) Json.AnyURI p_callbackReference := ?, + template (present) Json.UInteger p_measuringPeriod := ?, + template Links p_links := *, + template FlowFilters p_flowFilter := *, + template ReportTriggers p_reportTrigger := *, + template ReportingCtrl p_reportingCtrl := *, + template MonitoringAreas p_monitoringArea := *, + template MonitoringTimes p_monitoringTime := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := "QoSEventSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + flowFilter := p_flowFilter, + reportTrigger := p_reportTrigger, + reportingCtrl := p_reportingCtrl, + measuringPeriod := p_measuringPeriod, + monitoringArea := p_monitoringArea, + monitoringTime := p_monitoringTime, + expiryDeadline := p_expiryDeadline + } // End of template mw_qo_s_event_subscription + + template (omit) ReportTrigger m_report_trigger( + in template (value) MetricType p_metricType, + in template (omit) Json.UInteger p_upperThreshold := omit, + in template (omit) Json.UInteger p_lowerThreshold := omit + ) := { + metricType := p_metricType, + upperThreshold := p_upperThreshold, + lowerThreshold := p_lowerThreshold + } // End of template m_report_trigger + + template (present) ReportTrigger mw_report_trigger( + template (present) MetricType p_metricType := ?, + template Json.UInteger p_upperThreshold := *, + template Json.UInteger p_lowerThreshold := * + ) := { + metricType := p_metricType, + upperThreshold := p_upperThreshold, + lowerThreshold := p_lowerThreshold + } // End of template mw_report_trigger + + template (omit) MonitoringArea m_monitoring_area( + in template (omit) AreaInfo p_areaInfo := omit, + in template (omit) Json.String p_accessPointId := omit, + in template (omit) Json.String p_zoneId := omit + ) := { + areaInfo := p_areaInfo, + accessPointId := p_accessPointId, + zoneId := p_zoneId + } // End of template m_monitoring_area + + template MonitoringArea mw_monitoring_area( + template AreaInfo p_areaInfo := *, + template Json.String p_accessPointId := *, + template Json.String p_zoneId := * + ) := { + areaInfo := p_areaInfo, + accessPointId := p_accessPointId, + zoneId := p_zoneId + } // End of template mw_monitoring_area + + template (value) MonitoringTime m_monitoring_time( + in Json.String p_startTime, + in Json.String p_endTime + ) := { + startTime := p_startTime, + endTime := p_endTime + } // End of template m_monitoring_time + + template (present) MonitoringTime mw_monitoring_time( + template (present) Json.String p_startTime := ?, + template (present) Json.String p_endTime := ? + ) := { + startTime := p_startTime, + endTime := p_endTime + } // End of template mw_monitoring_time + + template (value) TestNotification m_test_notification( + in Json.String p_notificationType, + in template (value) Links p_links + ) := { + notificationType := p_notificationType, + links := p_links + } // End of template m_test_notification + + template (present) TestNotification mw_test_notification( + template (present) Json.String p_notificationType := ?, + template (present) Links p_links := ? + ) := { + notificationType := p_notificationType, + links := p_links + } // End of template mw_test_notification + + template (omit) QoSMeasureNotification m_qo_s_measure_notification( + in template (value) Links p_links, + in template (omit) SubscriptionState p_subscriptionState := omit, + in template (omit) QoSMeasureResults p_qoSMeasureResult := omit, + in template (omit) TimeStamp p_timeStamp := omit + ) := { + notificationType := "QoSMeasureNotification", + timeStamp := p_timeStamp, + subscriptionState := p_subscriptionState, + qoSMeasureResult := p_qoSMeasureResult, + links := p_links + } // End of template m_qo_s_measure_notification + + template (present) QoSMeasureNotification mw_qo_s_measure_notification( + template (present) Links p_links := ?, + template SubscriptionState p_subscriptionState := *, + template QoSMeasureResults p_qoSMeasureResult := *, + template TimeStamp p_timeStamp := * + ) := { + notificationType := "QoSMeasureNotification", + timeStamp := p_timeStamp, + subscriptionState := p_subscriptionState, + qoSMeasureResult := p_qoSMeasureResult, + links := p_links + } // End of template mw_qo_s_measure_notification + + template (omit) QoSMeasureResult m_qo_s_measure_result( + in template (value) FlowFilter p_flow, + in template (omit) Json.AnyURI p_user := omit, + in template (omit) MeasuringArea p_measuringArea := omit, + in template (omit) MeasuringTime p_measuringTime := omit, + in template (omit) Json.UInteger p_latency := omit, + in template (omit) Json.UInteger p_jitter := omit, + in template (omit) Json.UInteger p_throughput := omit, + in template (omit) Json.UInteger p_loss_rate := omit, + in template (omit) Json.UInteger p_error_rate := omit + ) := { + user := p_user, + flow := p_flow, + measuringArea := p_measuringArea, + measuringTime := p_measuringTime, + latency := p_latency, + jitter := p_jitter, + throughput := p_throughput, + loss_rate := p_loss_rate, + error_rate := p_error_rate + } // End of template m_qo_s_measure_result + + template (present) QoSMeasureResult mw_qo_s_measure_result( + template (present) FlowFilter p_flow := ?, + template Json.AnyURI p_user := *, + template MeasuringArea p_measuringArea := *, + template MeasuringTime p_measuringTime := *, + template Json.UInteger p_latency := *, + template Json.UInteger p_jitter := *, + template Json.UInteger p_throughput := *, + template Json.UInteger p_loss_rate := *, + template Json.UInteger p_error_rate := * + ) := { + user := p_user, + flow := p_flow, + measuringArea := p_measuringArea, + measuringTime := p_measuringTime, + latency := p_latency, + jitter := p_jitter, + throughput := p_throughput, + loss_rate := p_loss_rate, + error_rate := p_error_rate + } // End of template mw_qo_s_measure_result + + template (omit) QoSEventNotification m_qo_s_event_notification( + in template (value) Links p_links, + in template (value) FlowFilters p_flow, + in template (value) MetricType p_metricType, + in template (value) QoSEvent p_qosEvent, + in template (omit) SubscriptionState p_subscriptionState := omit, + in template (omit) Json.AnyURI p_user := omit, + in template (omit) MeasuringArea p_measuringArea := omit, + in template (omit) TimeStamp p_timeStamp := omit + ) := { + notificationType := "QoSEventNotification", + timeStamp := p_timeStamp, + subscriptionState := p_subscriptionState, + user := p_user, + flow := p_flow, + metricType := p_metricType, + qosEvent := p_qosEvent, + measuringArea := p_measuringArea, + links := p_links + } // End of template m_qo_s_event_notification + + template (present) QoSEventNotification mw_qo_s_event_notification( + template (present) Links p_links := ?, + template (present) FlowFilters p_flow := ?, + template (present) MetricType p_metricType := ?, + template (present) QoSEvent p_qosEvent := ?, + template SubscriptionState p_subscriptionState := *, + template Json.AnyURI p_user := *, + template MeasuringArea p_measuringArea := *, + template TimeStamp p_timeStamp := * + ) := { + notificationType := "QoSEventNotification", + timeStamp := p_timeStamp, + subscriptionState := p_subscriptionState, + user := p_user, + flow := p_flow, + metricType := p_metricType, + qosEvent := p_qosEvent, + measuringArea := p_measuringArea, + links := p_links + } // End of template mw_qo_s_event_notification + + template (value) Point m_point( + in Json.Number p_latitude, + in Json.Number p_longitude + ) := { + latitude := p_latitude, + longitude := p_longitude + } // End of template m_point + + template (present) Point mw_point( + template (present) Json.Number p_latitude := ?, + template (present) Json.Number p_longitude := ? + ) := { + latitude := p_latitude, + longitude := p_longitude + } // End of template mw_point + + template (omit) ReportingCtrl m_reporting_ctrl( + in template (omit) Json.UInteger p_minimumInterval := omit, + in template (omit) Json.UInteger p_maximumFrequency := omit, + in template (omit) Json.UInteger p_maximumCount := omit + ) := { + minimumInterval := p_minimumInterval, + maximumFrequency := p_maximumFrequency, + maximumCount := p_maximumCount + } // End of template m_reporting_ctrl + + template ReportingCtrl mw_reporting_ctrl( + template Json.UInteger p_minimumInterval := *, + template Json.UInteger p_maximumFrequency := *, + template Json.UInteger p_maximumCount := * + ) := { + minimumInterval := p_minimumInterval, + maximumFrequency := p_maximumFrequency, + maximumCount := p_maximumCount + } // End of template mw_reporting_ctrl + + template (value) Subscription m_subscription( + in Json.AnyURI p_href, + in Json.String p_subscriptionType + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template m_subscription + + template (present) Subscription mw_subscription( + template (present) Json.AnyURI p_href := ?, + template (present) Json.String p_subscriptionType := ? + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template mw_subscription + + template (value) Links m_links( + in template (value) LinkType p_subscription + ) :={ + subscription := p_subscription + } // End of template m_links + + template (present) Links mw_links( + template (present) LinkType p_subscription := ? + ) :={ + subscription := p_subscription + } // End of template mw_links + } // End of module QoSMeasurementAPI_Templates diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn index dfb91e3..f54706a 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn @@ -63,7 +63,7 @@ module QoSMeasurementAPI_TypesAndValues { */ type record FlowInfo { Json.UInteger samplingRate optional, - FlowFilter flowFilter + FlowFilter flowFilter } type record of FlowInfo FlowInfos; @@ -256,8 +256,8 @@ module QoSMeasurementAPI_TypesAndValues { * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.4.2-1: Attributes of the QoSMeasureNotification */ type record QoSMeasureResult { - Json.AnyURI user optional, - FlowFilter flow, + Json.AnyURI user optional, + FlowFilter flow, MeasuringArea measuringArea optional, MeasuringTime measuringTime optional, Json.UInteger latency optional, @@ -380,6 +380,7 @@ module QoSMeasurementAPI_TypesAndValues { } type record of Json.UInteger Ports; + } with { encode "JSON" } // End of module QoSMeasurementAPI_TypesAndValues diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn deleted file mode 100644 index 80b9532..0000000 --- a/ttcn/LibMec/SensorsSharingService/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn +++ /dev/null @@ -1,3 +0,0 @@ -module QoSMeasurementAPI_TypesAndValues { - -} // End of module QoSMeasurementAPI_TypesAndValues diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn index 3324e24..ca30deb 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn @@ -1,3 +1,3 @@ -module QoSMeasurementAPI_Functions { +module SensorsSharingService_Functions { -} // End of module QoSMeasurementAPI_Functions +} // End of module SensorsSharingService_Functions diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn index 1cb0e19..5c4643c 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn @@ -1,3 +1,3 @@ -module QoSMeasurementAPI_Pics { +module SensorsSharingService_Pics { -} // End of module QoSMeasurementAPI_Pics +} // End of module SensorsSharingService_Pics diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn index 68e5021..bbe32ee 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn @@ -1,3 +1,3 @@ -module QoSMeasurementAPI_Pixits { +module SensorsSharingService_Pixits { -} // End of module QoSMeasurementAPI_Pixits +} // End of module SensorsSharingService_Pixits diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn index aa631b4..24a63c9 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn @@ -1,3 +1,428 @@ -module QoSMeasurementAPI_Templates { +module SensorsSharingService_Templates { + + // JSON + import from Json all; + + // LibMec + import from LibMec_TypesAndValues all; + + // Lib/SensorsSharingService + import from SensorsSharingService_TypesAndValues all; + + template (omit) SensorDiscoveryInfo m_sensor_discovery_info( + in Json.String p_sensorIdentifier, + in Json.String p_sensorType, + in template (value) SensorPropertyList p_sensorPropertyList, + in template (value) Point p_sensorPosition, + in template (omit) SensorCharacteristics p_sensorCharacteristicList := omit + ) := { + sensorIdentifier := p_sensorIdentifier, + sensorType := p_sensorType, + sensorPropertyList := p_sensorPropertyList, + sensorCharacteristicList := p_sensorCharacteristicList, + sensorPosition := p_sensorPosition + } // End of template m_sensor_discovery_info + + template (present) SensorDiscoveryInfo mw_sensor_discovery_info( + template (present) Json.String p_sensorIdentifier := ?, + template (present) Json.String p_sensorType := ?, + template (present) SensorPropertyList p_sensorPropertyList := ?, + template (present) Point p_sensorPosition := ?, + template SensorCharacteristics p_sensorCharacteristicList := * + ) := { + sensorIdentifier := p_sensorIdentifier, + sensorType := p_sensorType, + sensorPropertyList := p_sensorPropertyList, + sensorCharacteristicList := p_sensorCharacteristicList, + sensorPosition := p_sensorPosition + } // End of template mw_sensor_discovery_info + + template (value) SensorStatusInfo m_sensor_status_info( + in Json.String p_sensorIdentifier, + in template (value) SensorStatusType p_sensorStatusType + ) := { + sensorIdentifier := p_sensorIdentifier, + sensorStatusType := p_sensorStatusType + } // End of template m_sensor_status_info + + template (present) SensorStatusInfo mw_sensor_status_info( + template (present) Json.String p_sensorIdentifier := ?, + template (present) SensorStatusType p_sensorStatusType := ? + ) := { + sensorIdentifier := p_sensorIdentifier, + sensorStatusType := p_sensorStatusType + } // End of template mw_sensor_status_info + + template (omit) SensorData m_sensor_data( + in Json.String p_sensorIdentifier, + in Json.String p_data, + in Json.String p_dataFormat, + in Json.String p_dataUnitOfMeasure, + in template (omit) TimeStamp p_dataTimestamp := omit + ) := { + sensorIdentifier := p_sensorIdentifier, + data := p_data, + dataFormat := p_dataFormat, + dataUnitOfMeasure := p_dataUnitOfMeasure, + dataTimestamp := p_dataTimestamp + } // End of template m_sensor_data + + template (present) SensorData mw_sensor_data( + template (present) Json.String p_sensorIdentifier := ?, + template (present) Json.String p_data := ?, + template (present) Json.String p_dataFormat := ?, + template (present) Json.String p_dataUnitOfMeasure := ?, + template TimeStamp p_dataTimestamp := omit + ) := { + sensorIdentifier := p_sensorIdentifier, + data := p_data, + dataFormat := p_dataFormat, + dataUnitOfMeasure := p_dataUnitOfMeasure, + dataTimestamp := p_dataTimestamp + } // End of template mw_sensor_data + + template (omit) SensorDiscoveryEventSubscription m_sensor_discovery_event_subscription( + in Json.String p_subscriptionType, + in Json.AnyURI p_callbackReference, + in template (omit) Links p_links := omit, + in template (omit) SensorInfos p_sensorInfo := omit, + in template (omit) AreaInfos p_geographicalArea := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := p_subscriptionType, + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + sensorInfo := p_sensorInfo, + geographicalArea := p_geographicalArea, + expiryDeadline := p_expiryDeadline + } // End of template m_sensor_discovery_event_subscription + + template (present) SensorDiscoveryEventSubscription mw_sensor_discovery_event_subscription( + template (present) Json.String p_subscriptionType := ?, + template (present) Json.AnyURI p_callbackReference := ?, + template Links p_links := *, + template SensorInfos p_sensorInfo := *, + template AreaInfos p_geographicalArea := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := p_subscriptionType, + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + sensorInfo := p_sensorInfo, + geographicalArea := p_geographicalArea, + expiryDeadline := p_expiryDeadline + } // End of template mw_sensor_discovery_event_subscription + + template (omit) SensorCharacteristicInfo m_sensor_characteristic_info( + in Json.String p_sensorIdentifier, + in template (omit) SensorCharacteristics p_sensorCharacteristicList := omit + ) := { + sensorIdentifier := p_sensorIdentifier, + sensorCharacteristicList := p_sensorCharacteristicList + } // End of template m_sensor_characteristic_info + + template (present) SensorCharacteristicInfo mw_sensor_characteristic_info( + template (present) Json.String p_sensorIdentifier := ?, + template SensorCharacteristics p_sensorCharacteristicList := * + ) := { + sensorIdentifier := p_sensorIdentifier, + sensorCharacteristicList := p_sensorCharacteristicList + } // End of template mw_sensor_characteristic_info + + template (omit) SensorStatusSubscription m_sensor_status_subscription( + in Json.AnyURI p_callbackReference, + in template (omit) Links p_links := omit, + in template (omit) SensorIdentifierList p_sensorIdentifierList := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "SensorStatusSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + sensorIdentifierList := p_sensorIdentifierList, + expiryDeadline := p_expiryDeadline + } // End of template m_sensor_status_subscription + + template (present) SensorStatusSubscription mw_sensor_status_subscription( + template (present) Json.AnyURI p_callbackReference := ?, + template Links p_links := *, + template SensorIdentifierList p_sensorIdentifierList := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := "SensorStatusSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + sensorIdentifierList := p_sensorIdentifierList, + expiryDeadline := p_expiryDeadline + } // End of template mw_sensor_status_subscription + + template (omit) SensorDataSubscription m_sensor_data_subscription( + in Json.AnyURI p_callbackReference, + in template (omit) Links p_links := omit, + in template (omit) SensorIdentifierList p_sensorIdentifierList := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "SensorDataSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + sensorIdentifierList := p_sensorIdentifierList, + expiryDeadline := p_expiryDeadline + } // End of template m_sensor_data_subscription + + template (present) SensorDataSubscription mw_sensor_data_subscription( + template (present) Json.AnyURI p_callbackReference := ?, + template Links p_links := *, + template SensorIdentifierList p_sensorIdentifierList := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := "SensorDataSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + sensorIdentifierList := p_sensorIdentifierList, + expiryDeadline := p_expiryDeadline + } // End of template mw_sensor_data_subscription + + template (value) SubscriptionLinkList m_subscription_link_list( + in template (value) Links p_links + ) := { + links := p_links + } // End of template m_subscription_link_list + + template (present) SubscriptionLinkList mw_subscription_link_list( + template (present) Links p_links := ? + ) := { + links := p_links + } // End of template mw_subscription_link_list + + template (value) TestNotification m_test_notification( + in Json.String p_notificationType, + in template (value) Links p_links + ) := { + notificationType := p_notificationType, + links := p_links + } // End of template m_test_notification + + template (present) TestNotification mw_test_notification( + template (present) Json.String p_notificationType := ?, + template (present) Links p_links := ? + ) := { + notificationType := p_notificationType, + links := p_links + } // End of template mw_test_notification + + template (omit) SensorInfo m_sensor_info( + in Json.String p_type_, + in template (omit) SensorPropertyList p_sensorPropertyList := omit, + in template (omit) SensorCharacteristics p_sensorCharacteristicList := omit + ):= { + type_ := p_type_, + sensorPropertyList := p_sensorPropertyList, + sensorCharacteristicList := p_sensorCharacteristicList + } // End of template m_sensor_info + + template (present) SensorInfo mw_sensor_info( + template (present) Json.String p_type_ := ?, + template SensorPropertyList p_sensorPropertyList := *, + template SensorCharacteristics p_sensorCharacteristicList := * + ):= { + type_ := p_type_, + sensorPropertyList := p_sensorPropertyList, + sensorCharacteristicList := p_sensorCharacteristicList + } // End of template mw_sensor_info + + template (omit) SensorDiscoveryEventNotification m_sensor_discovery_event_notification( + in template (value) SensorDiscoveryEventType p_sensorDiscoveryEventType, + in template (value) SensorDiscoveryInfos p_sensorDiscoveryInfo, + in template (value) Links p_links, + in template (omit) TimeStamp p_timeStamp := omit + ) := { + notificationType := "SensorDiscoveryEventNotification", + timeStamp := p_timeStamp, + sensorDiscoveryEventType := p_sensorDiscoveryEventType, + sensorDiscoveryInfo := p_sensorDiscoveryInfo, + links := p_links + } // End of template m_sensor_discovery_event_notification + + template (present) SensorDiscoveryEventNotification mw_sensor_discovery_event_notification( + template (present) SensorDiscoveryEventType p_sensorDiscoveryEventType := ?, + template (present) SensorDiscoveryInfos p_sensorDiscoveryInfo := ?, + template (present) Links p_links := ?, + template TimeStamp p_timeStamp := * + ) := { + notificationType := "SensorDiscoveryEventNotification", + timeStamp := p_timeStamp, + sensorDiscoveryEventType := p_sensorDiscoveryEventType, + sensorDiscoveryInfo := p_sensorDiscoveryInfo, + links := p_links + } // End of template mw_sensor_discovery_event_notification + + template (omit) SensorStatusNotification m_sensor_status_notification( + in template (value) SensorStatusInfos p_sensorStatusInfo, + in template (value) Links p_links, + in template (omit) TimeStamp p_timeStamp := omit + ) := { + notificationType := "SensorStatusNotification", + timeStamp := p_timeStamp, + sensorStatusInfo := p_sensorStatusInfo, + links := p_links + } // End of template m_sensor_status_notification + + template (present) SensorStatusNotification mw_sensor_status_notification( + template (present) SensorStatusInfos p_sensorStatusInfo := ?, + template (present) Links p_links := ?, + template TimeStamp p_timeStamp := * + ) := { + notificationType := "SensorStatusNotification", + timeStamp := p_timeStamp, + sensorStatusInfo := p_sensorStatusInfo, + links := p_links + } // End of template mw_sensor_status_notification -} // End of module QoSMeasurementAPI_Templates + template (omit) SensorDataNotification m_sensor_data_notification( + in template (value) SensorDatas p_sensorData, + in template (value) Links p_links, + in template (omit) TimeStamp p_timeStamp := omit + ) := { + notificationType := "SensorDataNotification", + timeStamp := p_timeStamp, + sensorData := p_sensorData, + links := p_links + } // End of template m_sensor_data_notification + + template (present) SensorDataNotification mw_sensor_data_notification( + template (present) SensorDatas p_sensorData := ?, + template (present) Links p_links := ?, + template TimeStamp p_timeStamp := * + ) := { + notificationType := "SensorDataNotification", + timeStamp := p_timeStamp, + sensorData := p_sensorData, + links := p_links + } // End of template mw_sensor_data_notification + + template (omit) ExpiryNotification m_expiry_notification( + in template (value) Links p_links, + in template (omit) TimeStamp p_timeStamp := omit + ) := { + notificationType := "ExpiryNotification", + timeStamp := p_timeStamp, + links := p_links + } // End of template m_expiry_notification + + template (present) ExpiryNotification mw_expiry_notification( + template (present) Links p_links := ?, + template TimeStamp p_timeStamp := * + ) := { + notificationType := "ExpiryNotification", + timeStamp := p_timeStamp, + links := p_links + } // End of template mw_expiry_notification + + template (omit) AreaInfo m_area_info( + in template (value) Shape p_shape, + in template (value) Points p_points, + in template (omit) Json.UInteger p_radius := omit + ) := { + shape := p_shape, + points := p_points, + radius := p_radius + } // End of template m_area_info + + template (present) AreaInfo mw_area_info( + template (present) Shape p_shape := ?, + template (present) Points p_points := ?, + template Json.UInteger p_radius := * + ) := { + shape := p_shape, + points := p_points, + radius := p_radius + } // End of template mw_area_info + + template (value) Point m_point( + in Json.Number p_latitude, + in Json.Number p_longitude + ) := { + latitude := p_latitude, + longitude := p_longitude + } // End of template m_point + + template (present) Point mw_point( + template (present) Json.Number p_latitude := ?, + template (present) Json.Number p_longitude := ? + ) := { + latitude := p_latitude, + longitude := p_longitude + } // End of template mw_point + + template (omit) SensorCharacteristic m_sensor_characteristic( + in Json.String p_characteristicName, + in Json.String p_characteristicValue, + in template (omit) Json.String p_characteristicUnitOfMeasure := omit + ) := { + characteristicName := p_characteristicName, + characteristicValue := p_characteristicValue, + characteristicUnitOfMeasure := p_characteristicUnitOfMeasure + } // End of template m_sensor_characteristic + + template (present) SensorCharacteristic mw_sensor_characteristic( + template (present) Json.String p_characteristicName := ?, + template (present) Json.String p_characteristicValue := ?, + template Json.String p_characteristicUnitOfMeasure := * + ) := { + characteristicName := p_characteristicName, + characteristicValue := p_characteristicValue, + characteristicUnitOfMeasure := p_characteristicUnitOfMeasure + } // End of template mw_sensor_characteristic + + template (value) Subscription m_subscription( + in Json.AnyURI p_href, + in Json.String p_subscriptionType + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template m_subscription + + template (present) Subscription mw_subscription( + template (present) Json.AnyURI p_href := ?, + template (present) Json.String p_subscriptionType := ? + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template mw_subscription + + template (value) Links m_links( + in template (value) LinkType p_subscription + ) :={ + subscription := p_subscription + } // End of template m_links + + template (present) Links mw_links( + template (present) LinkType p_subscription := ? + ) :={ + subscription := p_subscription + } // End of template mw_links + +} // End of module SensorsSharingService_Templates diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn new file mode 100644 index 0000000..9975287 --- /dev/null +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn @@ -0,0 +1,360 @@ +module SensorsSharingService_TypesAndValues { + + // JSON + import from Json all; + + // LibMec + import from LibMec_TypesAndValues all; + + /** + * @desc This type represents the information about type, properties and characteristics that are related to a sensor + * @param sensorIdentifier Unique identifier of the sensor + * @param sensorType Type of the sensor + * @param sensorPropertyList It indicates the list of properties that the sensor can sense + * @param sensorCharacteristicList The sensor' characteristics + * @param sensorPosition Geographical position of the sensor + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.2.1-1: Definition of type SensorDiscoveryInfo + */ + type record SensorDiscoveryInfo { + Json.String sensorIdentifier, + Json.String sensorType, + SensorPropertyList sensorPropertyList, + SensorCharacteristics sensorCharacteristicList optional, + Point sensorPosition + } + type record of SensorDiscoveryInfo SensorDiscoveryInfos; + type record length (1 .. infinity) of Json.String SensorPropertyList; + + /** + * @desc This type represents the information related to the status of a sensor + * @param sensorIdentifier Unique identifier of the sensor + * @param sensorStatusType The status of the sensor + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.2.2-1: Definition of type SensorStatusInfo + */ + type record SensorStatusInfo { + Json.String sensorIdentifier, + SensorStatusType sensorStatusType + } + type record of SensorStatusInfo SensorStatusInfos; + + /** + * @desc The status of the sensor + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.2.2-1: Definition of type SensorStatusInfo + */ + type enumerated SensorStatusType { + ERROR, + ONLINE, + OFFLINE + } + + /** + * @desc This type represents the data that are gathered from a sensor with the related information + * @param sensorIdentifier Unique identifier of the sensor + * @param data Data measurement provided by the sensor + * @param dataFormat Format of the data + * @param dataUnitOfMeasure Unit of Measure of the data + * @param dataTimestamp Time instant at which the data have been collected + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.2.3-1: Definition of type SensorData + */ + type record SensorData { + Json.String sensorIdentifier, + Json.String data, + Json.String dataFormat, + Json.String dataUnitOfMeasure, + TimeStamp dataTimestamp optional + } + type record of SensorData SensorDatas; + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param subscriptionType Shall be set to "SensorDiscoveryEventSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param sensorInfo Object containing the characteristics of the sensor(s) to be selected for the subscription + * @param geographicalArea The parameters describing the area to subscribe + * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.1-1: Definition of type SensorDiscoveryEventSubscription + */ + type record SensorDiscoveryEventSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + SensorInfos sensorInfo optional, + AreaInfos geographicalArea optional, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents the characteristics of a sensor + * @param sensorIdentifier Unique identifier of the sensor + * @param sensorCharacteristicList The sensor' characteristics + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.2.4-1: Definition of type SensorCharacteristicInfo + */ + type record SensorCharacteristicInfo { + Json.String sensorIdentifier, + SensorCharacteristics sensorCharacteristicList optional + } + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param subscriptionType Shall be set to "SensorStatusSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param sensorIdentifierList Unique identifiers of the sensors + * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.2-1: Definition of type SensorStatusSubscription + */ + type record SensorStatusSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + SensorIdentifierList sensorIdentifierList optional, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + type record length (1 .. infinity) of Json.String SensorIdentifierList; + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param subscriptionType Shall be set to "SensorDataSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param sensorIdentifierList Unique identifiers of the sensors + * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.3-1: Definition of type SensorDataSubscription + */ + type record SensorDataSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + SensorIdentifierList sensorIdentifierList optional, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a list of links related to currently existing subscriptions for the MEC application + * @param _links List of hyperlinks related to the resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.4-1: Attributes of the SubscriptionLinkList + */ + type record SubscriptionLinkList { + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a test notification from a location server to determine if the Websocket method is to be utilized for the location server to issue notifications for a subscription + * @member notificationType Shall be set to "TestNotification" + * @member links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table ??? + */ + type record TestNotification { + Json.String notificationType, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc Object containing the characteristics of the sensor(s) to be selected for the subscription + * @param type_ Type of the sensor + * @param sensorPropertyList It indicates the list of properties that the sensor can sense + * @param sensorCharacteristicList The sensor' characteristics to be matched + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.1-1: Definition of type SensorDiscoveryEventSubscription + */ + type record SensorInfo { + Json.String type_, + SensorPropertyList sensorPropertyList optional, + SensorCharacteristics sensorCharacteristicList optional + } with { + variant (type_) "name as 'type'"; + } + type record of SensorInfo SensorInfos; + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param notificationType Shall be set to "SensorDiscoveryEventNotification" + * @param timeStamp Time stamp + * @param sensorDiscoveryEventType The specific event triggering this notification + * @param sensorDiscoveryInfo The information about the sensor(s) that are related to this discovery event notification + * @param _links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.1-1: Attributes of the SensorDiscoveryEventNotification + */ + type record SensorDiscoveryEventNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + SensorDiscoveryEventType sensorDiscoveryEventType, + SensorDiscoveryInfos sensorDiscoveryInfo, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param notificationType Shall be set to "SensorStatusNotification" + * @param timeStamp Time stamp + * @param sensorStatusInfo The data gathered from the sensor(s) and related information + * @param _links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.2-1: Attributes of the SensorStatusNotification + */ + type record SensorStatusNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + SensorStatusInfos sensorStatusInfo, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param notificationType Shall be set to "SensorDataNotification" + * @param timeStamp Time stamp + * @param sensorData The data gathered from the sensor(s) and related information + * @param _links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of the SensorDataNotification + */ + type record SensorDataNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + SensorDatas sensorData, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information + * @param notificationType Shall be set to "ExpiryNotification" + * @param timeStamp Time stamp + * @param _links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.4-1: Attributes of the ExpiryNotification + */ + type record ExpiryNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents the parameters that describe an area + * @param shape The shape of the area monitored + * @param points Shall include one point if the shape is CIRCLE + * @param radius Shall be present if the shape is CIRCLE + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.5.1-1: Attributes of type AreaInfo + */ + type record AreaInfo { + Shape shape, + Points points, + Json.UInteger radius optional + } + type record of AreaInfo AreaInfos; + + /** + * @desc The shape of the area monitored + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.5.1-1: Attributes of type AreaInfo + */ + type enumerated Shape { + CIRCLE, + POLYGON + } + + /** + * @desc This type represents the geographical location of a point + * @param latitude Location latitude, expressed in the range -90° to +90° + * @param longitude Location longitude, expressed in the range -180° to +180° + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.5.2-1: Attributes of type Point + */ + type record Point { + Json.Number latitude, + Json.Number longitude + } + type record length (1 .. infinity) of Point Points; + + /** + * @desc This type represents a sensor' characteristic which details the type of sensor and its working functionalities, such as the model of the sensor, the sampling frequency, the operating range, the accuracy + * @param characteristicName The name of the characteristic + * @param characteristicValue The value of the characteristic + * @param characteristicValue characteristicUnitOfMeasure The unit of measure of the characteristic + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.5.4-1: Attributes of type SensorCharacteristic + */ + type record SensorCharacteristic { + Json.String characteristicName, + Json.String characteristicValue, + Json.String characteristicUnitOfMeasure optional + } + type record of SensorCharacteristic SensorCharacteristics; + + /** + * @desc This type represents specified event types for sensor discovery report + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.6.2-1: Enumeration SensorDiscoveryEventType + */ + type enumerated SensorDiscoveryEventType { + NEW_SENSOR, + SENSOR_REMOVED, + SENSOR_UPDATE + } + + /** + * @desc The service consumer's subscriptions + * @member href The URI referring to the subscription + * @member subscriptionType Type of the subscription + * @see ETSI GS MEC 046 V3.1.1 (2024-04) 6.3.1 Type: NotificationSubscriptionList + */ + type record Subscription { + Json.AnyURI href, + Json.String subscriptionType + } + + /** + * @desc This type represents a type of link + * @member href URI referring to a resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.6.1-1: Definition of type LinkType + */ + type record LinkType { + Json.AnyURI href + } + + /** + * @desc Hyperlink related to the resource + * @member subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.1-1: Attributes of the TestNotification + */ + type record Links { + LinkType subscription + } + + /** + * @desc This type represents configuration for the delivery of subscription notifications over Websockets + * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications + * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.5.2 Type: WebsockNotifConfig + */ + type record WebsockNotifConfig { + Json.AnyURI websocketUri optional, + Json.Bool requestWebsocketUri optional + } + +} with { + encode "JSON" +} // End of module SensorsSharingService_TypesAndValues -- GitLab From e301aee6f932e9ae5b3a26516214bceb6a4866ee Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 27 Jan 2025 08:08:53 +0100 Subject: [PATCH 06/54] Review MEC 013 --- ...ormApplicationEnablementAPI_TestCases.ttcn | 2 +- ...plicationEnablementAPI_TypesAndValues.ttcn | 58 +++++++------- .../ttcn/LocationAPI_TypesAndValues.ttcn | 80 +++++++++---------- 3 files changed, 70 insertions(+), 70 deletions(-) diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 8f57f82..5a3f0f3 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 003, Draft ETSI GS MEC 011 V3.2.1 + * @see ETSI GS MEC 003, Draft ETSI GS MEC 011 V3.3.1 */ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index 8517df4..e0e5179 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -36,7 +36,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member operationAction Operation that is being performed on the MEC application instance * @member maxGracefulTimeout Maximum non-zero timeout value in seconds for graceful termination or graceful stop of an application instance * @member links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.4.2-1: Attributes of AppTerminationNotification + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.4.2-1: Attributes of AppTerminationNotification */ type record AppTerminationNotification { NotificationType notificationType, @@ -52,7 +52,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * that the application has completed its application level related terminate/stop actions, e.g. retention of application state * in the case of stop. * @member operationAction Operation that is being performed on the MEC application instance - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.4.3-1: Attributes of AppTerminationConfirmation + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.4.3-1: Attributes of AppTerminationConfirmation */ type record AppTerminationConfirmation { OperationAction operationAction @@ -61,7 +61,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents the information that the MEC application instance indicates to the MEC platform that it is up and running * @member indication Indication about the MEC application instance - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.4.4-1: Attributes of AppReadyConfirmation + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.4.4-1: Attributes of AppReadyConfirmation */ type record AppReadyConfirmation { Json.String indication @@ -79,7 +79,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member callbackReference URI selected by the MEC application instance to receive notifications on the subscribed MEC application instance management information * @member links Object containing hyperlinks related to the resource * @member appInstanceId It is used as the filtering criterion for the subscribed events - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.3.2-1: Attributes of AppTerminationNotificationSubscription + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.3.2-1: Attributes of AppTerminationNotificationSubscription */ type record AppTerminationNotificationSubscription { SubscriptionType subscriptionType, @@ -102,7 +102,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc Represents possible states of a MEC service instance - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.6.6-1: Enumeration ServiceState + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.6.6-1: Enumeration ServiceState */ type enumerated ServiceState { ACTIVE (0), @@ -116,7 +116,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member state Liveness state of the MEC service instance * @member timeStamp The time when the last "heartbeat" message was received by MEC platform * @member interval The interval (in seconds) between two consecutive "heartbeat" messages (see clause 8.2.10.3.3) that MEC platform has determined. - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.2.4-1: Attributes of ServiceLivenessInfo + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.2.4-1: Attributes of ServiceLivenessInfo */ type record ServiceLivenessInfo { ServiceState state, @@ -127,7 +127,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents changes to the liveness information of a MEC service instance * @member state Update to the state of the MEC service instance to indicate that the service is still alive. - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.2.5-1: Attributes of ServiceLivenessUpdate + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.2.5-1: Attributes of ServiceLivenessUpdate */ type record ServiceLivenessUpdate { ServiceState state @@ -166,7 +166,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc Platform Time Source status. 1 = TRACEABLE - time source is locked to the UTC time source. 2 = NONTRACEABLE - time source is not locked to the UTC time source. - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.2.5-1: Attributes of CurrentTime + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.5-1: Attributes of CurrentTime */ type enumerated TimeSourceStatus { TRACEABLE (1), @@ -178,7 +178,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member seconds The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC. * @member nanoSeconds The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC. * @member timeSourceStatus Platform Time Source status. 1 = TRACEABLE - time source is locked to the UTC time source. 2 = NONTRACEABLE - time source is not locked to the UTC time source. - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.2.5-1: Attributes of CurrentTime + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.5-1: Attributes of CurrentTime */ type record CurrentTime { Seconds seconds, @@ -200,7 +200,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member appFeatureOptional Describes features a MEC application may use if available * @member isInsByMec Indicate whether the application instance is instantiated by the MEC Management * @member appProfile Can be mapped to EAS profile as defined in ETSI TS 129 558 [19] - * @see ETSI GS MEC 011 V3.2.1 7.1.2.6-1: Attributes of AppInfo + * @see ETSI GS MEC 011 V3.3.1 7.1.2.6-1: Attributes of AppInfo */ type record AppInfo { Json.String appName, @@ -252,7 +252,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * member srcMacAddress If the interface type is "MAC", source address identifies the MAC address of the interface * member dstMacAddress If the interface type is "MAC", destination address identifies the MAC address of the interface * member dstIpAddress If the interface type is "IP", destination address identifies the IP address of the remote destination - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.5.3-1: Attributes of DestinationInterface + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.5.3-1: Attributes of DestinationInterface */ type record DestinationInterface { InterfaceType interfaceType, @@ -308,7 +308,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * member ipAddress IP address associated with the FQDN resolved by the DNS rule * member ttl Time to live value, in seconds. * member state Contains the DNS rule state: ACTIVE, INACTIVE - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.2.3-1: Attributes of DnsRule + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.3-1: Attributes of DnsRule */ type record DnsRule { DnsRule_Id dnsRuleId, @@ -370,7 +370,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents a type of link and may be referenced from data structures. * @member href URI referring to a resource - * @see ETSI GS MEC 011 V3.2.1 Table 6.3.2-1: Attributes of the LinkType + * @see ETSI GS MEC 011 V3.3.1 Table 6.3.2-1: Attributes of the LinkType */ type record LinkType { Href href @@ -421,7 +421,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @desc This type represents a list of links related to currently existing subscriptions for a MEC application instance. * @member self_ Self-referring URI * @member subscriptions The MEC application instance's subscriptions - * @see ETSI GS MEC 011 V3.2.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 011 V3.3.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList */ type record Links { LinkType self_, @@ -433,7 +433,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents a list of links related to currently existing subscriptions for a MEC application instance. * @member links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 011 V3.2.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 011 V3.3.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinkList { Links links @@ -445,7 +445,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @desc The MEC application instance's subscriptions * @member href URI referring to the subscription * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 011 V3.2.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 011 V3.3.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList */ type record Subscription_ { Json.AnyURI href, @@ -479,7 +479,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents security information related to a transport. - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.5.4-1: Attributes of SecurityInfo + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.5.4-1: Attributes of SecurityInfo */ type record SecurityInfo { OAuth2Info oAuth2Info optional, @@ -524,7 +524,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member serCategories Categories of services about which to report events * @member states States of the services about which to report events * @member isLocal Restrict event reporting to whether the service is local to the MEC platform where the subscription is managed - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.3.2-1: Attributes of SerAvailabilityNotificationSubscription + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.3.2-1: Attributes of SerAvailabilityNotificationSubscription */ type record FilteringCriteria { SerInstanceIdList serInstanceIds optional, @@ -545,7 +545,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc The enumeration SerializerTypes represents types of serializers. - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.6.3-1: Enumeration SerializerType + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.6.3-1: Enumeration SerializerType */ type enumerated SerializerType { JSON, @@ -580,7 +580,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc Contains the types of locality. - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.6.5-1: Enumeration LocalityType + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.6.5-1: Enumeration LocalityType */ type enumerated LocalityType { MEC_SYSTEM, @@ -625,7 +625,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member isLocal Indicate whether the service is located in the same locality (as defined by scopeOfLocality) as the consuming MEC application (TRUE) or not (FALSE) * @member livenessInterval Interval (in seconds) between two consecutive "heartbeat" messages * @member links Links to resources related to this resource - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.2.2-1: Attributes of ServiceInfo + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.2.2-1: Attributes of ServiceInfo */ type record ServiceInfo { SerInstanceId serInstanceId optional, @@ -719,7 +719,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member localPriority NTP server local priority * @member authenticationOption NTP authentication option * @member authenticationKeyNum Authentication key number - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.2.4-1: Attributes of TimingCaps + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.4-1: Attributes of TimingCaps */ type record NtpServers { NtpServerAddrType ntpServerAddrType, @@ -747,7 +747,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member timeStamp * @member ntpServers Number of available NTP servers * @member ptpMasters Number of available PTP Servers (referred to as "masters" in IEEE 1588-2019™ [i.2]) - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.2.4-1: Attributes of TimingCaps + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.4-1: Attributes of TimingCaps */ type record TimingCaps { TimeStamp timeStamp optional, @@ -821,7 +821,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member qCI Used to match all packets that have the same QCI * @member dSCP Used to match all IPv4 packets that have the same DSCP * @member tC Used to match all IPv6 packets that have the same TC - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.5.2-1: Attributes of TrafficFilter + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.5.2-1: Attributes of TrafficFilter */ type record TrafficFilter { TrafficFilter_AddressList srcAddress optional, @@ -887,7 +887,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * member action The action of the MEC host data plane when a packet matches the trafficFilter * member dstInterface Describes the destination interface information * member state Contains the traffic rule state: ACTIVE, INACTIVE - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.2.2-1: Attributes of TrafficRule + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.2-1: Attributes of TrafficRule */ type record TrafficRule { TrafficRule_Id trafficRuleId, @@ -938,7 +938,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member fqdn Fully Qualified Domain Name of the service * @member addresses Entry point information of the service as one or more pairs of IP address and port * @member alternativeEntry point information of the service in a format defined by an implementation, or in an external specification - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.5.3-1: Attributes of EndPointInfo + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.5.3-1: Attributes of EndPointInfo */ type record EndPointInfo { EndPointInfo_UriList uris optional, @@ -958,7 +958,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member endpoint Information about the endpoint to access the transport * @member security Information about the security used by the transport * @member implSpecificInfo Additional implementation specific details of the transport - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.2.3-1: Attributes of TransportInfo + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.2.3-1: Attributes of TransportInfo */ type record TransportInfo { TransportInfo_Id id, @@ -977,7 +977,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc The enumeration TransportType represents types of transports. - * @see ETSI GS MEC 011 V3.2.1 Table 8.1.6.4-1: Enumeration TransportType + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.6.4-1: Enumeration TransportType */ type enumerated TransportType { REST_HTTP, @@ -1012,7 +1012,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member tunnelType Type of the tunnel, e.g. GTP_U, GRE, etc * @member tunnelDstAddress Destination address of the tunnel * @member tunnelSrcAddress Source address of the tunnel - * @see ETSI GS MEC 011 V3.2.1 Table 7.1.5.4-1: Attributes of TunnelInfo + * @see ETSI GS MEC 011 V3.3.1 Table 7.1.5.4-1: Attributes of TunnelInfo */ type record TunnelInfo { TunnelInfo_TunnelType tunnelType, diff --git a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn index e7f86e4..33b44ca 100644 --- a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn @@ -20,7 +20,7 @@ module LocationAPI_TypesAndValues { * @desc This type represents a list of UserInfo. * @member user Collection of the user location information list. * @member resourceURL Self referring URL. - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.5 Type: UserList + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.5 Type: UserList */ type record UserList { UserInfos user optional, @@ -32,7 +32,7 @@ module LocationAPI_TypesAndValues { * @desc This type represents configuration for the delivery of subscription notifications over Websockets * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.5.4 Type: WebsockNotifConfig + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.5.4 Type: WebsockNotifConfig */ type record WebsockNotifConfig { Json.AnyURI websocketUri optional, @@ -44,7 +44,7 @@ module LocationAPI_TypesAndValues { * @member accessPointList One or more access points forming a monitoring area that could be any shape * @member zoneId Identifier of zone (e.g. zone001) to monitor * @member occurrenceInfo One time only report indication - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.5.5 Type: UserEventPara + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.5.5 Type: UserEventPara */ type record UserEventPara { Json.Bool reportingLocationReq optional, @@ -68,7 +68,7 @@ module LocationAPI_TypesAndValues { * @member minimumInterval Minimum interval between reports in case frequently reporting. Unit is second. * @member maximumFrequency Maximum frequency (in seconds) of notifications per subscription * @member maximumCount Maximum number of notifications. For no maximum, either do not include this element or specify a value of zero. Default value is 0 - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.5.6 Type: ReportingCtrl + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.5.6 Type: ReportingCtrl */ type record ReportingCtrl { Json.UInteger minimumInterval optional, @@ -81,7 +81,7 @@ module LocationAPI_TypesAndValues { * @member shape The shape of the area monitored * @member points Shall include one point if the shape is CIRCLE * @member radius - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.5.7 Type: AreaInfo + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.5.7 Type: AreaInfo */ type record AreaInfo { Shape shape, @@ -103,7 +103,7 @@ module LocationAPI_TypesAndValues { * @desc This type represents the geographical location of a point * @member latitude Location latitude, expressed in the range -90° to +90° * @member longitude Location longitude, expressed in the range -180° to +180° - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.5.8 Type: Point + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.5.8 Type: Point */ type record Point { Json.Number latitude, @@ -127,7 +127,7 @@ module LocationAPI_TypesAndValues { * @member includedAngle Present only if \"shape\" equals 6 * @member shape Shape information, as detailed in [14], associated with the reported location coordinate * @member velocity Structure with attributes relating to the target entity’s velocity, as defined in [14] - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.5.3 Type: LocationInfo + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.5.3 Type: LocationInfo */ type record LocationInfo { Latitude latitude, @@ -151,7 +151,7 @@ module LocationAPI_TypesAndValues { /** * @desc Shape information, as detailed in [14], associated with the reported location coordinate - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Table 6.5.3-1: Definition of type LocationInfo + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Table 6.5.3-1: Definition of type LocationInfo */ type enumerated Shape { ELLIPSOID_ARC (1), @@ -167,7 +167,7 @@ module LocationAPI_TypesAndValues { /** * @desc Velocity information, as detailed in [14], associated with the reported location coordinate - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Table 6.5.3-1: Definition of type LocationInfo + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Table 6.5.3-1: Definition of type LocationInfo */ type enumerated VelocityType { HORIZONTAL (1), @@ -189,7 +189,7 @@ module LocationAPI_TypesAndValues { * @member uncertainty Horizontal uncertainty * @member verticalSpeed Vertical speed, expressed in km/h * @member verticalUncertainty Vertical uncertainty - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Table 6.5.3-1: Definition of type LocationInfo + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Table 6.5.3-1: Definition of type LocationInfo */ type record Velocity { VelocityType velocityType, @@ -202,7 +202,7 @@ module LocationAPI_TypesAndValues { /** * @desc Identifier of access point, (reference ETSI TS 129 171). Where the E-CGI is made up of the PLMN and Cell Identity (28 bit string). Then the PLMN is made up of the 3 digit MCC & 2 or 3 digit MNC. The Cell Portion is an optional element - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.6.1 accessPointId + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.6.1 accessPointId */ type Json.String AccessPointId; @@ -214,7 +214,7 @@ module LocationAPI_TypesAndValues { * @member numberOfUsers The number of users currently on the access point. * @member resourceURL Self referring URL. * @see OMA-TS-REST_NetAPI_ZonalPresence-V1_0-20160308-C Clause 5.2.2.2 Type: ZoneInfo - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.1 Zonal presence data types + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.1 Zonal presence data types */ type record ZoneInfo { ZoneId zoneId, @@ -230,7 +230,7 @@ module LocationAPI_TypesAndValues { * @member zone Collection of the zone information list. * @member resourceURL Self referring URL. * @see OMA-TS-REST_NetAPI_ZonalPresence-V1_0-20160308-C Clause 5.2.2.1 Type: ZoneList - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.1 Zonal presence data types + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.1 Zonal presence data types */ type record ZoneList { ZoneInfos zone optional, @@ -249,7 +249,7 @@ module LocationAPI_TypesAndValues { * @member timezone Time zone of access point * @member resourceURL Self referring URL. * @see OMA-TS-REST_NetAPI_ZonalPresence-V1_0-20160308-C Clause 5.2.2.4 Type: AccessPointInfo - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.1 Zonal presence data types + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.1 Zonal presence data types */ type record AccessPointInfo { AccessPointId accessPointId, @@ -273,7 +273,7 @@ module LocationAPI_TypesAndValues { * @member accessPoint Collection of the access point information list. * @member resourceURL Self referring URL * @see OMA-TS-REST_NetAPI_ZonalPresence-V1_0-20160308-C Clause 5.2.2.3 Type: AccessPointList - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.1 Zonal presence data types + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.1 Zonal presence data types */ type record AccessPointList { ZoneId zoneId, @@ -309,7 +309,7 @@ module LocationAPI_TypesAndValues { * @member Wimax Access point provides a Wimax® connection * @member FiveG_NR Access point provides a 5G NR connection * @member UNKNOWN Access point connection type is unknown - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.7.5 Enumeration: ConnectionType + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.7.5 Enumeration: ConnectionType */ type enumerated ConnectionType { LTE, @@ -546,7 +546,7 @@ module LocationAPI_TypesAndValues { * @member civicInfo Contextual information of a user location * @member contextLocationInfo Contextual information of a user location (e.g. aisle, floor, room number, etc.). * @member ancillaryInfo Reserved for future use - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.2 Type: UserInfo + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.2 Type: UserInfo */ type record UserInfo { Address address_, @@ -569,7 +569,7 @@ module LocationAPI_TypesAndValues { * @member X Indicates the value (in the unit of meters) on x-axis of the relative location in the Cartesian system * @member Y Indicates the value (in the unit of meters) on y-axis of the relative location in the Cartesian system * @member Z Indicates the value (in the unit of meters) on z-axis of the relative location in the Cartesian system for a 3D-Point - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.3 + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.3 */ type record RelativeLocationInfo { MapInfo mapInfo, @@ -583,7 +583,7 @@ module LocationAPI_TypesAndValues { * @member latitude Location latitude, expressed in the range -90° to +90° * @member longitude Location longitude, expressed in the range -180° to +180° * @member Location altitude relative to the WGS84 ellipsoid surface - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.4 + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.4 */ type record MapInfoOrigin { Json.Number latitude, @@ -596,7 +596,7 @@ module LocationAPI_TypesAndValues { * @member mapId Indicates the ID of the map * @member Indicates the location of the map origin in the local Cartesian coordinate system * @member ancillaryMapInfo Ancillary map information may be used to convert coordinates between different coordinate systems - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.4 + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.4 */ type record MapInfo { Json.String mapId, @@ -651,7 +651,7 @@ module LocationAPI_TypesAndValues { * @member currentLocation Location of terminal * @member errorInformation Used to indicate a notification termination or cancellation * @see OMA-TS-REST_NetAPI_TerminalLocation-V1_0_1-20151029-A Clause 5.2.2.1 Type: TerminalLocation - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.1A Terminal location data types + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.1A Terminal location data types */ type record TerminalLocation { Address address_, @@ -669,7 +669,7 @@ module LocationAPI_TypesAndValues { * @member text Message text, with replacement variables marked with %n, where n is an index into the list of elements, starting at 1 * @member variables Variables to substitute into text string * @see OMA-TS-REST_NetAPI_Common-V1_0-20180116-A Clause B.1.4 Type: ServiceError - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.2.1A Terminal location data types + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.2.1A Terminal location data types */ type record ServiceError { Json.String messageId, @@ -681,7 +681,7 @@ module LocationAPI_TypesAndValues { * @desc This type contains a list of subscriptions * @member href The URI referring to the subscription * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.3 Type: NotificationSubscriptionList + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.3 Type: NotificationSubscriptionList */ type record Subscription { Json.AnyURI href optional, @@ -693,7 +693,7 @@ module LocationAPI_TypesAndValues { * @desc This type contains a list of subscriptions * @member subscription Subscription elements * @member resourceURL Self-referring URL - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.3 Type: NotificationSubscriptionList + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.3 Type: NotificationSubscriptionList */ type record NotificationSubscriptionList { Subscriptions subscription optional, @@ -712,7 +712,7 @@ module LocationAPI_TypesAndValues { * @member userEventPara Requirements for user event reporting. * @member locationEventCriteria List of user event values to generate notifications for (these apply to address specified). * @member expiryDeadline The expiration time of the subscription determined by the UE Location Subscribe Service - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.4 Type: UserLocationEventSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.4 Type: UserLocationEventSubscription */ type record UserLocationEventSubscription { Json.String subscriptionType, @@ -741,7 +741,7 @@ module LocationAPI_TypesAndValues { * @member address_ Address of user (e.g. 'sip' URI, 'tel' URI, 'acr' URI) to monitor * @member periodicEventInfo Information for periodic event reporting * @member expiryDeadline The expiration time of the subscription determined by the UE Location Subscribe Service - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.5 Type: UserLocationPeriodicSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.5 Type: UserLocationPeriodicSubscription */ type record UserLocationPeriodicSubscription{ Json.String subscriptionType, @@ -796,7 +796,7 @@ module LocationAPI_TypesAndValues { * @member zoneId Identifier of zone (e.g. zone001) to monitor * @member reportingCtrl Provides parameters that ctrl the reporting * @member expiryDeadline The expiration time of the subscription determined by the UE Location Subscribe Service - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.6 Type: ZoneLocationEventSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.6 Type: ZoneLocationEventSubscription */ type record ZoneLocationEventSubscription { Json.String subscriptionType, @@ -829,7 +829,7 @@ module LocationAPI_TypesAndValues { * @member operationStatus List of operation status values to generate notifications for (these apply to all access points within a zone) * @member reportingCtrl Provides parameters that ctrl the reporting * @member expiryDeadline The expiration time of the subscription determined by the UE Location Subscribe Service - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.7 Type: ZoneStatusSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.7 Type: ZoneStatusSubscription */ type record ZoneStatusSubscription { Json.String subscriptionType, @@ -865,7 +865,7 @@ module LocationAPI_TypesAndValues { * @member locationEventCriteria List of user event values to generate notifications for (these apply to address specified) * @member reportingLocationReq This IE shall be set to true if a location estimate is required for each event report * @member expiryDeadline The expiration time of the subscription determined by the UE Location Subscribe Service - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.8 Type: UserAreaSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.8 Type: UserAreaSubscription */ type record UserAreaSubscription { Json.String subscriptionType, @@ -887,7 +887,7 @@ module LocationAPI_TypesAndValues { /** * @desc List of the users to be monitored - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.8 Type: UserAreaSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.8 Type: UserAreaSubscription */ type set of Json.AnyURI AddressList; @@ -908,7 +908,7 @@ module LocationAPI_TypesAndValues { * @member reportingCtrl Provides parameters that ctrl the reporting * @member locationEventCriteria List of user event values to generate notifications for (these apply to address specified) * @member expiryDeadline The expiration time of the subscription determined by the UE Location Subscribe Service - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.3.9 Type: UserDistanceSubscription + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.3.9 Type: UserDistanceSubscription */ type record UserDistanceSubscription { Json.String subscriptionType, @@ -933,7 +933,7 @@ module LocationAPI_TypesAndValues { * @desc This type represents a test notification from a location server to determine if the Websocket method is to be utilized for the location server to issue notifications for a subscription, as defined in clause 6.12a of ETSI GS MEC 009 [4] * @member notificationType Shall be set to "TestNotification" * @member _links Hyperlink related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.3 Type: TestNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.3 Type: TestNotification */ type record TestNotification { Json.String notificationType, @@ -945,8 +945,8 @@ module LocationAPI_TypesAndValues { /** * @desc Hyperlink related to the resource * @member Identifying the subscription for the test notification - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.3 Type: TestNotification - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.4 Type: UserLocationEventNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.3 Type: TestNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.4 Type: UserLocationEventNotification */ type record LinksSubscription { LinkType subscription @@ -964,7 +964,7 @@ module LocationAPI_TypesAndValues { * @member zoneId The identity of the zone * @member accessPointId The identity of the access point * @member _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.4 Type: UserLocationEventNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.4 Type: UserLocationEventNotification */ type record UserLocationEventNotification { Json.String notificationType, @@ -995,7 +995,7 @@ module LocationAPI_TypesAndValues { * @member accessPointId The identity of the access point * @member isFinalNotification Shall be set to true if it is a final notification * @member _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.5 Type: UserLocationPeriodicNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.5 Type: UserLocationPeriodicNotification */ type record UserLocationPeriodicNotification { Json.String notificationType, @@ -1022,7 +1022,7 @@ module LocationAPI_TypesAndValues { * @member userLocationEvent The specific event triggering this notification * @member zoneId The identity of the zone * @member _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.6 Type: ZoneLocationEventNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.6 Type: ZoneLocationEventNotification */ type record ZoneLocationEventNotification { Json.String notificationType, @@ -1045,7 +1045,7 @@ module LocationAPI_TypesAndValues { * @member zoneId The identity of the zone * @member accessPointId The identity of the access point * @member _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.7 Type: ZoneStatusNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.7 Type: ZoneStatusNotification */ type record ZoneStatusNotification { Json.String notificationType, @@ -1078,7 +1078,7 @@ module LocationAPI_TypesAndValues { * @member relativeLocationInfo The relative location in a reference system * @member userLocationEvent The specific event triggering this notification * @member _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.8 Type: UserAreaNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.8 Type: UserAreaNotification */ type record UserAreaNotification { Json.String notificationType, @@ -1101,7 +1101,7 @@ module LocationAPI_TypesAndValues { * @member monitoredUsers Indicates the location information related to monitored users * @member distanceEvent Indicates the distance event triggering the notification * @member _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 013 V3.1.1 (2023-01) Clause 6.4.9 Type: UserDistanceNotification + * @see ETSI GS MEC 013 V3.2.1 (2024-11) Clause 6.4.9 Type: UserDistanceNotification */ type record UserDistanceNotification { Json.String notificationType, -- GitLab From a3bec823f60be248665d7cf1808b1f22939800d5 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 3 Feb 2025 09:38:11 +0100 Subject: [PATCH 07/54] Implement QoSLookup TPs --- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 507 ++++++++++++++++++ .../AtsMec_QoSMeasurementAPI_TestControl.ttcn | 23 + .../ttcn/QoSMeasurementAPI_Pics.ttcn | 5 + .../ttcn/QoSMeasurementAPI_Pixits.ttcn | 11 + .../ttcn/QoSMeasurementAPI_Templates.ttcn | 132 ++--- .../QoSMeasurementAPI_TypesAndValues.ttcn | 25 +- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 13 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 47 +- 9 files changed, 681 insertions(+), 84 deletions(-) diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn index a0df67d..03284d2 100644 --- a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -11,6 +11,513 @@ module AtsMec_QoSMeasurementAPI_TestCases { import from LibHttp_TestSystem all; // LibMec/QoSMeasurementAPI + import from QoSMeasurementAPI_TypesAndValues all; import from QoSMeasurementAPI_Templates all; + import from QoSMeasurementAPI_Pics all; + import from QoSMeasurementAPI_Pixits all; + + // LibMec + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + group qos { + + group qos_lookup { + + /** + * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_notification_subscription_list( + mw_notification_subscription_list + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/?subscriptionType=UnknownType", // Wrong URL structure: Invalid URI query parameters supported + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR2 + + /** + * @desc Check that the IUT responds with an error when no subscription are created + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF + + /** + * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionId + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qo_s_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionId=" & oct2char(unichar2oct(v_qo_s_measure_subscription.subscriptionType, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_notification_subscription_list( + mw_notification_subscription_list( + { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS }, + superset( + mw_subscription( + v_qo_s_measure_subscription.links.subscription.href, + v_qo_s_measure_subscription.subscriptionType + )))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 + + /** + * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionType + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qo_s_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(v_qo_s_measure_subscription.subscriptionType, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_notification_subscription_list( + mw_notification_subscription_list( + { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS }, + superset( + mw_subscription( + v_qo_s_measure_subscription.links.subscription.href, + v_qo_s_measure_subscription.subscriptionType + )))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 + + /** + * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionType + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qo_s_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_TYPE, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 + + /** + * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionId + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qo_s_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionId=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 + + /** + * @desc Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + v_qos_measure_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a QoS measurement subscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF + + } // End of group qos_lookup + + } // End of group qos } // End of module AtsMec_QoSMeasurementAPI_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn index 179537f..bd4af47 100644 --- a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn @@ -1,7 +1,30 @@ module AtsMec_QoSMeasurementAPI_TestControl { + // LibMec/QoSMeasurementAPI + import from QoSMeasurementAPI_Pics all; + + // LibMec + import from LibMec_Pics all; + + // AtsMec_QoSMeasurementAPI + import from AtsMec_QoSMeasurementAPI_TestCases all; + control { + if (PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED) { + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK()); + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR()); + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF()); + + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01()); + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02()); + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01()); + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02()); + + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK()); + execute(TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF()); + + } } } // End of module AtsMec_QoSMeasurementAPI_TestControl \ No newline at end of file diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn index 1cb0e19..81d6694 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pics.ttcn @@ -1,3 +1,8 @@ module QoSMeasurementAPI_Pics { + /** + * @desc Does the IUT support MEC QoS Measurment API? + */ + modulepar boolean PICS_QOS_API_SUPPORTED := true; + } // End of module QoSMeasurementAPI_Pics diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn index 68e5021..727ff4a 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn @@ -1,3 +1,14 @@ module QoSMeasurementAPI_Pixits { + + // JSON + import from Json all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "UnknownSubId"; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_TYPE := "UnknownSubType"; + } // End of module QoSMeasurementAPI_Pixits diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn index 935a6fe..c3db3c5 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -11,7 +11,7 @@ module QoSMeasurementAPI_Templates { template (omit) NotificationSubscriptionList m_notification_subscription_list( in template (value) LinkType p_resourceURL, - in template (omit) Subscription p_subscription := omit + in template (omit) Subscriptions p_subscription := omit ) := { subscription := p_subscription, resourceURL := p_resourceURL @@ -19,27 +19,27 @@ module QoSMeasurementAPI_Templates { template (present) NotificationSubscriptionList mw_notification_subscription_list( template (present) LinkType p_resourceURL := ?, - template Subscription p_subscription := * + template Subscriptions p_subscription := * ) := { subscription := p_subscription, resourceURL := p_resourceURL } // End of template mw_notification_subscription_list - template (omit) QoSMeasureSubscription m_qo_s_measure_subscription( - in template (value) MetricTypes p_metricType, - in Json.AnyURI p_callbackReference, - in Json.UInteger p_measuringPeriod, - in template (omit) Links p_links := omit, - in template (omit) Users p_users := omit, - in template (omit) FlowInfos p_flowInfo := omit, - in template (omit) Json.UInteger p_numberOfReports := omit, - in template (omit) Json.UInteger p_reportingInterval := omit, - in template (omit) MeasuringAreas p_measuringArea := omit, - in template (omit) MeasuringTimes p_measuringTime := omit, - in template (omit) Json.Bool p_requestTestNotification := omit, - in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, - in template (omit) TimeStamp p_expiryDeadline := omit - ) := { + template (omit) QoSMeasureSubscription m_qos_measure_subscription( + in template (value) MetricTypes p_metricType, + in Json.AnyURI p_callbackReference, + in Json.UInteger p_measuringPeriod, + in template (omit) Links p_links := omit, + in template (omit) Users p_users := omit, + in template (omit) FlowInfos p_flowInfo := omit, + in template (omit) Json.UInteger p_numberOfReports := omit, + in template (omit) Json.UInteger p_reportingInterval := omit, + in template (omit) MeasuringAreas p_measuringArea := omit, + in template (omit) MeasuringTimes p_measuringTime := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { subscriptionType := "QoSMeasureSubscription", callbackReference := p_callbackReference, requestTestNotification := p_requestTestNotification, @@ -56,21 +56,21 @@ module QoSMeasurementAPI_Templates { expiryDeadline := p_expiryDeadline } // End of template m_qo_s_measure_subscription - template (present) QoSMeasureSubscription mw_qo_s_measure_subscription( - template (present) MetricTypes p_metricType := ?, - template (present) Json.AnyURI p_callbackReference := ?, - template (present) Json.UInteger p_measuringPeriod := ?, - template Links p_links := *, - template Users p_users := *, - template FlowInfos p_flowInfo := *, - template Json.UInteger p_numberOfReports := *, - template Json.UInteger p_reportingInterval := *, - template MeasuringAreas p_measuringArea := *, - template MeasuringTimes p_measuringTime := *, - template Json.Bool p_requestTestNotification := *, - template WebsockNotifConfig p_websockNotifConfig := *, - template TimeStamp p_expiryDeadline := * - ) := { + template (present) QoSMeasureSubscription mw_qos_measure_subscription( + template (present) MetricTypes p_metricType := ?, + template (present) Json.AnyURI p_callbackReference := ?, + template (present) Json.UInteger p_measuringPeriod := ?, + template Links p_links := *, + template Users p_users := *, + template FlowInfos p_flowInfo := *, + template Json.UInteger p_numberOfReports := *, + template Json.UInteger p_reportingInterval := *, + template MeasuringAreas p_measuringArea := *, + template MeasuringTimes p_measuringTime := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { subscriptionType := "QoSMeasureSubscription", callbackReference := p_callbackReference, requestTestNotification := p_requestTestNotification, @@ -85,7 +85,7 @@ module QoSMeasurementAPI_Templates { measuringTime := p_measuringTime, metricType := p_metricType, expiryDeadline := p_expiryDeadline - } // End of template mw_qo_s_measure_subscription + } // End of template mw_qos_measure_subscription template (omit) FlowInfo m_flow_info( in template (value) FlowFilter p_flowFilter, @@ -175,19 +175,19 @@ module QoSMeasurementAPI_Templates { endTime := p_endTime } // End of template mw_measuring_time - template (omit) QoSEventSubscription m_qo_s_event_subscription( - in Json.AnyURI p_callbackReference, - in Json.UInteger p_measuringPeriod, - in template (omit) Links p_links := omit, - in template (omit) FlowFilters p_flowFilter := omit, - in template (omit) ReportTriggers p_reportTrigger := omit, - in template (omit) ReportingCtrl p_reportingCtrl := omit, - in template (omit) MonitoringAreas p_monitoringArea := omit, - in template (omit) MonitoringTimes p_monitoringTime := omit, - in template (omit) Json.Bool p_requestTestNotification := omit, - in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, - in template (omit) TimeStamp p_expiryDeadline := omit - ) := { + template (omit) QoSEventSubscription m_qos_event_subscription( + in Json.AnyURI p_callbackReference, + in Json.UInteger p_measuringPeriod, + in template (omit) Links p_links := omit, + in template (omit) FlowFilters p_flowFilter := omit, + in template (omit) ReportTriggers p_reportTrigger := omit, + in template (omit) ReportingCtrl p_reportingCtrl := omit, + in template (omit) MonitoringAreas p_monitoringArea := omit, + in template (omit) MonitoringTimes p_monitoringTime := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { subscriptionType := "QoSEventSubscription", callbackReference := p_callbackReference, requestTestNotification := p_requestTestNotification, @@ -200,21 +200,21 @@ module QoSMeasurementAPI_Templates { monitoringArea := p_monitoringArea, monitoringTime := p_monitoringTime, expiryDeadline := p_expiryDeadline - } // End of template m_qo_s_event_subscription - - template (present) QoSEventSubscription mw_qo_s_event_subscription( - template (present) Json.AnyURI p_callbackReference := ?, - template (present) Json.UInteger p_measuringPeriod := ?, - template Links p_links := *, - template FlowFilters p_flowFilter := *, - template ReportTriggers p_reportTrigger := *, - template ReportingCtrl p_reportingCtrl := *, - template MonitoringAreas p_monitoringArea := *, - template MonitoringTimes p_monitoringTime := *, - template Json.Bool p_requestTestNotification := *, - template WebsockNotifConfig p_websockNotifConfig := *, - template TimeStamp p_expiryDeadline := * - ) := { + } // End of template m_qos_event_subscription + + template (present) QoSEventSubscription mw_qos_event_subscription( + template (present) Json.AnyURI p_callbackReference := ?, + template (present) Json.UInteger p_measuringPeriod := ?, + template Links p_links := *, + template FlowFilters p_flowFilter := *, + template ReportTriggers p_reportTrigger := *, + template ReportingCtrl p_reportingCtrl := *, + template MonitoringAreas p_monitoringArea := *, + template MonitoringTimes p_monitoringTime := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template TimeStamp p_expiryDeadline := * + ) := { subscriptionType := "QoSEventSubscription", callbackReference := p_callbackReference, requestTestNotification := p_requestTestNotification, @@ -227,7 +227,7 @@ module QoSMeasurementAPI_Templates { monitoringArea := p_monitoringArea, monitoringTime := p_monitoringTime, expiryDeadline := p_expiryDeadline - } // End of template mw_qo_s_event_subscription + } // End of template mw_q_s_event_subscription template (omit) ReportTrigger m_report_trigger( in template (value) MetricType p_metricType, @@ -466,14 +466,14 @@ module QoSMeasurementAPI_Templates { } // End of template mw_subscription template (value) Links m_links( - in template (value) LinkType p_subscription - ) :={ + in template (value) LinkType p_subscription + ) :={ subscription := p_subscription } // End of template m_links template (present) Links mw_links( - template (present) LinkType p_subscription := ? - ) :={ + template (present) LinkType p_subscription := ? + ) :={ subscription := p_subscription } // End of template mw_links diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn index f54706a..a7dff58 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn @@ -13,8 +13,8 @@ module QoSMeasurementAPI_TypesAndValues { * @see ETSI GS MEC 045 V3.1.1 (2024-03) Table 6.3.1-1: Definition of type NotificationSubscriptionList */ type record NotificationSubscriptionList { - Subscription subscription optional, - LinkType resourceURL + Subscriptions subscription optional, + LinkType resourceURL } /** @@ -53,7 +53,7 @@ module QoSMeasurementAPI_TypesAndValues { } with { variant (links) "name as '_links'"; } - type record of Json.AnyURI Users; + type set of Json.AnyURI Users; /** * @desc This type represents a subscription to the notifications from QMS about QoS measurement @@ -65,7 +65,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.UInteger samplingRate optional, FlowFilter flowFilter } - type record of FlowInfo FlowInfos; + type set of FlowInfo FlowInfos; /** * @desc Traffic flow filtering criteria @@ -87,7 +87,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.UInteger dscp optional, Json.UInteger flowlabel optional } - type record of FlowFilter FlowFilters; + type set of FlowFilter FlowFilters; /** * @desc Area constraint for the measuring task. Traffic of users entering the area will be measured @@ -101,7 +101,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.String accessPointId optional, Json.String zoneId optional } - type record of MeasuringArea MeasuringAreas; + type set of MeasuringArea MeasuringAreas; /** * @desc Time constraint for the measuring task @@ -113,7 +113,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.String startTime, Json.String endTime } - type record of MeasuringTime MeasuringTimes; + type set of MeasuringTime MeasuringTimes; /** * @desc This type represents QoS measuring result type @@ -126,7 +126,7 @@ module QoSMeasurementAPI_TypesAndValues { LOSS_RATE, ERROR_RATE } - type record of MetricType MetricTypes; + type set of MetricType MetricTypes; /** * @desc This type represents a subscription to the notifications from QMS about QoS events, e.g. some metrics regarding network performance has achieved the alarm threshold @@ -187,7 +187,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.String accessPointId optional, Json.String zoneId optional } - type record of MonitoringArea MonitoringAreas; + type set of MonitoringArea MonitoringAreas; /** * @desc Time in a day for the monitoring task @@ -199,7 +199,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.String startTime, Json.String endTime } - type record of MonitoringTime MonitoringTimes; + type set of MonitoringTime MonitoringTimes; /** * @desc This type represents a test notification from a location server to determine if the Websocket method is to be utilized for the location server to issue notifications for a subscription @@ -266,7 +266,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.UInteger loss_rate optional, Json.UInteger error_rate optional } - type record of QoSMeasureResult QoSMeasureResults; + type set of QoSMeasureResult QoSMeasureResults; /** * @desc This type represents a notification from QMS with regards to QoS event @@ -349,6 +349,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.AnyURI href, Json.String subscriptionType } + type set of Subscription Subscriptions; /** * @desc This type represents a type of link @@ -379,7 +380,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.Bool requestWebsocketUri optional } - type record of Json.UInteger Ports; + type set of Json.UInteger Ports; } with { encode "JSON" diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index fee2d65..702716e 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -110,4 +110,6 @@ module LibMec_Pixits { modulepar charstring PX_IOT_API_LIST_PLTF_SUB := "iots/v1/registered_iot_platforms"; + modulepar charstring PX_QOS_API_LIST_SUBS := "qms/v1/subscriptions"; + } // End of module LibMec_Pixits diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 332f676..23c8625 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -30,6 +30,8 @@ module LibHttp_JsonMessageBodyTypes { import from IoTAPI_TypesAndValues all; // LibMec/FixedAccessInformationServiceAPI import from FederationEnablementAPI_TypesAndValues all; + // LibMec/FixedAccessInformationServiceAPI + import from QoSMeasurementAPI_TypesAndValues all; /** * This file volontary contains a trivial declaration of the type JsonBody. @@ -43,7 +45,7 @@ module LibHttp_JsonMessageBodyTypes { LocationAPI_TypesAndValues.ZoneInfo zoneInfo, // ETSI GS MEC 013 V3.1.1 Clause 6.2.1 Zonal presence data types AccessPointList accessPointList, // ETSI GS MEC 013 V3.1.1 Clause 6.2.1 Zonal presence data types AccessPointInfo accessPointInfo, // ETSI GS MEC 013 V3.1.1 Clause 6.2.1 Zonal presence data types - NotificationSubscriptionList notificationSubscriptionList, // ETSI GS MEC 013 V3.1.1 Clause 6.3.3 Type: NotificationSubscriptionList + LocationAPI_TypesAndValues.NotificationSubscriptionList notificationSubscriptionList, // ETSI GS MEC 013 V3.1.1 Clause 6.3.3 Type: NotificationSubscriptionList UserLocationEventSubscription userLocationEventSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.4 Type: UserLocationEventSubscription UserLocationPeriodicSubscription userLocationPeriodicSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.5 Type: UserLocationPeriodicSubscription ZoneLocationEventSubscription zoneLocationEventSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.6 Type: ZoneLocationEventSubscription @@ -129,8 +131,8 @@ module LibHttp_JsonMessageBodyTypes { AppTerminationConfirmation appTerminationConfirmation, AppReadyConfirmation appReadyConfirmation, ServiceLivenessInfo serviceLivenessInfo, - ServiceLivenessUpdate serviceLivenessUpdate, - DnsRuleList dnsRuleList, + ServiceLivenessUpdate serviceLivenessUpdate, + DnsRuleList dnsRuleList, DnsRule dnsRule, SerAvailabilityNotificationSubscription serAvailabilityNotificationSubscription, TimingCaps timingCaps, @@ -177,7 +179,10 @@ module LibHttp_JsonMessageBodyTypes { IoTAPI_TypesAndValues.DeviceInfoList deviceInfoList_iot, // ETSI GS MEC 033 V3.1.1 Clause 6.2.2 Type: DeviceInfo IotPlatformInfoList iotPlatformInfoList, // ETSI GS MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo IotPlatformInfo iotPlatformInfo, // ETSI GS MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo - // TODO Add here your custom variants + QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList notification_subscription_list, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.1 Type: NotificationSubscriptionList + QoSMeasureSubscription qos_measure_subscription, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.2 Type: QoSMeasureSubscription + QoSEventSubscription qos_event_subscription, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.3 Type: QoSEventSubscription + // TODO Add here your custom variants universal charstring raw } with { variant "" diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index fabd6e5..32b5dde 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -55,6 +55,9 @@ module LibHttp_JsonTemplates { // LibMec/FixedAccessInformationServiceAPI import from FederationEnablementAPI_TypesAndValues all; + // LibMec/FQoSMeasurementServiceAPI + import from QoSMeasurementAPI_TypesAndValues all; + template (value) JsonBody m_json_body_raw( in template (value) charstring p_raw ) := { @@ -511,13 +514,13 @@ module LibHttp_JsonTemplates { } // End of template mw_body_json_access_point_info template (value) JsonBody m_body_json_notification_subscription_list( - in template (value) NotificationSubscriptionList p_notification_subscription_list + in template (value) LocationAPI_TypesAndValues.NotificationSubscriptionList p_notification_subscription_list ) := { notificationSubscriptionList := p_notification_subscription_list } // End of template m_body_json_notification_subscription_list template (present) JsonBody mw_body_json_notification_subscription_list( - template (present) NotificationSubscriptionList p_notification_subscription_list := ? + template (present) LocationAPI_TypesAndValues.NotificationSubscriptionList p_notification_subscription_list := ? ) := { notificationSubscriptionList := p_notification_subscription_list } // End of template mw_body_json_notification_subscription_list @@ -1712,4 +1715,44 @@ module LibHttp_JsonTemplates { } // End of group federation + group qos_meas { + + template (value) JsonBody m_body_json_qos_notification_subscription_list( + in template (value) QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList p_notification_subscription_list + ) := { + notification_subscription_list := p_notification_subscription_list + } // End of template m_body_json_qos_notification_subscription_list + + template (present) JsonBody mw_body_json_qos_notification_subscription_list( + template (present) QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList p_notification_subscription_list := ? + ) := { + notification_subscription_list := p_notification_subscription_list + } // End of template mw_body_json_qos_notification_subscription_list + + template (value) JsonBody m_body_json_qos_measure_subscription( + in template (value) QoSMeasureSubscription p_qos_measure_subscription + ) := { + qos_measure_subscription := p_qos_measure_subscription + } // End of template m_body_json_qos_measure_subscription + + template (present) JsonBody mw_body_json_qos_measure_subscription( + template (present) QoSMeasureSubscription p_qos_measure_subscription := ? + ) := { + qos_measure_subscription := p_qos_measure_subscription + } // End of template mw_body_json_qos_measure_subscription + + template (value) JsonBody m_body_json_qos_event_subscription( + in template (value) QoSEventSubscription p_qos_event_subscription + ) := { + qos_event_subscription := p_qos_event_subscription + } // End of template m_body_json_qos_event_subscription + + template (present) JsonBody mw_body_json_qos_event_subscription( + template (present) QoSEventSubscription p_qos_event_subscription := ? + ) := { + qos_event_subscription := p_qos_event_subscription + } // End of template mw_body_json_qos_event_subscription + + } // End of group qos_meas + } // End of module LibHttp_JsonTemplates -- GitLab From f619062c468c68d758215ad5721e9d67e88db974 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Mon, 3 Feb 2025 16:38:59 +0500 Subject: [PATCH 08/54] update MEC014 description version from v3.1.1 to v3.2.1 --- .../AtsMec_UEidentityAPI_TestCases.ttcn | 2 +- .../ttcn/UEidentityAPI_TypesAndValues.ttcn | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn index 7c4418c..7a85b02 100644 --- a/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 003, ETSI GS MEC 014 V3.1.1 + * @see ETSI GS MEC 003, ETSI GS MEC 014 V3.2.1 */ module AtsMec_UEidentityAPI_TestCases { diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn index e7fe2cd..d3589d9 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn @@ -2,7 +2,7 @@ * @author ETSI / STF569 / TTF T027 * @version $URL$ * $Id$ - * @desc Module containing types and values for ETSI GS MEC 014 V3.1.1 (2023-06) + * @desc Module containing types and values for ETSI GS MEC 014 V3.2.1 (2024-02) * @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. @@ -16,7 +16,7 @@ module UEidentityAPI_TypesAndValues { /** * @desc Information of UE identity tag used in UE Identity feature * @member ueIdentityTags 1 to N tags presented by a ME Application instance to a ME Platform - * @see ETSI GS MEC 014 V3.1.1 (2023-06) Table 6.2.2-1: Definition of type UeIdentityTagInfo + * @see ETSI GS MEC 014 V3.2.1 (2024-02) Table 6.2.2-1: Definition of type UeIdentityTagInfo */ type record UeIdentityTagInfo { UeIdentityTags ueIdentityTags @@ -24,13 +24,13 @@ module UEidentityAPI_TypesAndValues { /** * @desc Specific tag presented by a ME Application instance to a ME Platform - * @see ETSI GS MEC 014 V3.1.1 (2023-06) Table 6.2.2-1: Definition of type UeIdentityTagInfo + * @see ETSI GS MEC 014 V3.2.1 (2024-02) Table 6.2.2-1: Definition of type UeIdentityTagInfo */ type Json.String UeIdentityTag; /** * @desc Status of the resource ueIdentityTagInfo - * @see ETSI GS MEC 014 V3.1.1 (2023-06) Table 6.2.2-1: Definition of type UeIdentityTagInfo + * @see ETSI GS MEC 014 V3.2.1 (2023-02) Table 6.2.2-1: Definition of type UeIdentityTagInfo */ type enumerated State { UNREGISTERED, @@ -42,7 +42,7 @@ module UEidentityAPI_TypesAndValues { * @desc ME Application instance to a ME Platform * @member ueIdentityTag Specific tag presented by a ME Application instance to a ME Platform * @member state Status of the resource ueIdentityTagInfo - * @see ETSI GS MEC 014 V3.1.1 (2023-06) Table 6.2.2-1: Definition of type UeIdentityTagInfo + * @see ETSI GS MEC 014 V3.2.1 (2024-02) Table 6.2.2-1: Definition of type UeIdentityTagInfo */ type record UeIdentityTagItem { Json.String ueIdentityTag, @@ -51,7 +51,7 @@ module UEidentityAPI_TypesAndValues { /** * @desc 1 to N tags presented by a ME Application instance to a ME Platform - * @see ETSI GS MEC 014 V3.1.1 (2023-06) Table 6.2.2-1: Definition of type UeIdentityTagInfo + * @see ETSI GS MEC 014 V3.2.1 (2024-02) Table 6.2.2-1: Definition of type UeIdentityTagInfo */ type set of UeIdentityTagItem UeIdentityTags; -- GitLab From db330b1eae273d7c11962edfe3a0a07779f1f1c1 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 3 Feb 2025 13:32:45 +0100 Subject: [PATCH 09/54] Implement QoS Measurements Sub/Not TPs --- titan-test-system-framework | 2 +- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 2282 +++++++++++++---- .../AtsMec_QoSMeasurementAPI_TestControl.ttcn | 22 + .../ttcn/QoSMeasurementAPI_Functions.ttcn | 129 +- .../ttcn/QoSMeasurementAPI_Pixits.ttcn | 31 +- .../ttcn/QoSMeasurementAPI_Templates.ttcn | 22 +- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 1 + .../ttcn/LibHttp_JsonTemplates.ttcn | 14 +- 8 files changed, 2003 insertions(+), 500 deletions(-) diff --git a/titan-test-system-framework b/titan-test-system-framework index fffe402..e7f13cc 160000 --- a/titan-test-system-framework +++ b/titan-test-system-framework @@ -1 +1 @@ -Subproject commit fffe402b8aa3986bdab4b4bcced277c8b334a1ec +Subproject commit e7f13cca244490ee6f5fc6e80c6836384b562568 diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn index 03284d2..a300cc6 100644 --- a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -15,509 +15,1805 @@ module AtsMec_QoSMeasurementAPI_TestCases { import from QoSMeasurementAPI_Templates all; import from QoSMeasurementAPI_Pics all; import from QoSMeasurementAPI_Pixits all; + import from QoSMeasurementAPI_Functions all; // LibMec import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pixits all; - group qos { - - group qos_lookup { - - /** - * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS, - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_qos_notification_subscription_list( - mw_notification_subscription_list - ))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK - - /** - * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/?subscriptionType=UnknownType", // Wrong URL structure: Invalid URI query parameters supported - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_400_bad_request - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR2 - - /** - * @desc Check that the IUT responds with an error when no subscription are created - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS, - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF - - /** - * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionId - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var QoSMeasureSubscription v_qo_s_measure_subscription; - var charstring v_subscription_id; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionId=" & oct2char(unichar2oct(v_qo_s_measure_subscription.subscriptionType, "UTF-8")), - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_qos_notification_subscription_list( - mw_notification_subscription_list( - { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS }, - superset( - mw_subscription( - v_qo_s_measure_subscription.links.subscription.href, - v_qo_s_measure_subscription.subscriptionType - )))))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 - - /** - * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionType - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var QoSMeasureSubscription v_qo_s_measure_subscription; - var charstring v_subscription_id; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(v_qo_s_measure_subscription.subscriptionType, "UTF-8")), - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_qos_notification_subscription_list( - mw_notification_subscription_list( - { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS }, - superset( - mw_subscription( - v_qo_s_measure_subscription.links.subscription.href, - v_qo_s_measure_subscription.subscriptionType - )))))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 - - /** - * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionType - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var QoSMeasureSubscription v_qo_s_measure_subscription; - var charstring v_subscription_id; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_TYPE, "UTF-8")), - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 - - /** - * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionId - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var QoSMeasureSubscription v_qo_s_measure_subscription; - var charstring v_subscription_id; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionId=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 - - /** - * @desc Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var QoSMeasureSubscription v_qos_measure_subscription; - var charstring v_subscription_id; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_qos_measure_subscription( - v_qos_measure_subscription - ))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a QoS measurement subscription ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + group qos_lookup { + + /** + * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_notification_subscription_list( + mw_notification_subscription_list + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/?subscriptionType=UnknownType", // Wrong URL structure: Invalid URI query parameters supported + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR2 + + /** + * @desc Check that the IUT responds with an error when no subscription are created + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF + + /** + * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionId + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionId=" & oct2char(unichar2oct(v_qos_measure_subscription.subscriptionType, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_notification_subscription_list( + mw_notification_subscription_list( + { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS }, + superset( + mw_subscription( + v_qos_measure_subscription.links.subscription.href, + v_qos_measure_subscription.subscriptionType + )))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 + + /** + * @desc Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionType + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(v_qos_measure_subscription.subscriptionType, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_notification_subscription_list( + mw_notification_subscription_list( + { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS }, + superset( + mw_subscription( + v_qos_measure_subscription.links.subscription.href, + v_qos_measure_subscription.subscriptionType + )))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Notification subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 + + /** + * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionType + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_TYPE, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 + + /** + * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionId + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionId=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 + + /** + * @desc Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + v_qos_measure_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a QoS measurement subscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF + + } // End of group qos_lookup + + group qos_meas_sub_not { + + /** + * @desc Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_info( + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK - - /** - * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application - */ - testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK_NF() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), - v_headers - ))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSMeasureSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 + + /** + * @desc Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with reportingInterval + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + -, + PX_REPORTING_INTERVAL + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_info( + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + -, + PX_REPORTING_INTERVAL + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSMeasureSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 + + /** + * @desc Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with numberOfReports + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + PX_NUMBER_OF_REPORTS, + PX_REPORTING_INTERVAL + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_info( + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + PX_NUMBER_OF_REPORTS, + PX_REPORTING_INTERVAL + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSMeasureSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription_wrong( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01 - } // End of group qos_lookup + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + omit, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + -, -, -, -, -, + { websocketUri := PX_QOS_MEAS_SUB_WEB_SOCKET, requestWebsocketUri := omit } + + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - users not present (Note 2) + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + -, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - flowInfo not present (Note 2) + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER } + + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid flowFilter + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { } + + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on reportingInterval/measuringPeriod + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD + PX_REPORTING_INTERVAL + 1, // measuringPeriod shall be <= reportingInterval + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + -, + PX_REPORTING_INTERVAL + + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on measuringArea + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD + PX_REPORTING_INTERVAL + 1, // measuringPeriod shall be <= reportingInterval + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + -, -, + { + m_measuring_area( + -, + PX_ACCESS_POINT_ID, + PX_ZONE_ID + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 + + /** + * @desc Check that the IUT acknowledges the changes of an existing QoS measurement subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {JITTER}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {JITTER}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_info( + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated qoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK + + /** + * @desc Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {JITTER}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF + + /** + * @desc Check that the IUT acknowledges the cancellation of QoS measurement subscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully cancels the qoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully cancels the qoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links + )))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id, true); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_qos_test_notification + )))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 + + /** + * @desc Check that the IUT terminates notifications when the expiry timer expires + */ + testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSMeasureSubscription v_qos_measure_subscription; + var charstring v_subscription_id; + var timer v_expiry_timer; + var boolean v_no_more_notif_expected := false; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id, -, PX_EXPIRY_DEADLINE); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + v_expiry_timer.start(int2float(PX_EXPIRY_DEADLINE.seconds)); + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links + )))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + if (v_no_more_notif_expected == false) { + tc_wait.start; + repeat; + } else { + log("*** " & testcasename() & ": FAIL: New notif received after expiry timer ended ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] v_expiry_timer.timeout { + v_no_more_notif_expected := true; + log("*** " & testcasename() & ": INFO: expiry timer ended ***"); + repeat; + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": PASS: No notif received after expiry timer ended ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_measure_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK - } // End of group qos + } // End of group qos_meas_sub_not } // End of module AtsMec_QoSMeasurementAPI_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn index bd4af47..4e43e02 100644 --- a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn @@ -24,7 +24,29 @@ module AtsMec_QoSMeasurementAPI_TestControl { execute(TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK()); execute(TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08()); + + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF()); + + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF()); + + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01()); + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02()); } + + execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK()); } } // End of module AtsMec_QoSMeasurementAPI_TestControl \ No newline at end of file diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn index 3324e24..f19891d 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn @@ -1,3 +1,130 @@ module QoSMeasurementAPI_Functions { - + + // JSON + import from Json all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/QoSMeasurementAPI + import from QoSMeasurementAPI_TypesAndValues all; + import from QoSMeasurementAPI_Templates all; + import from QoSMeasurementAPI_Pics all; + import from QoSMeasurementAPI_Pixits all; + + // LibMec + import from LibMec_TypesAndValues all; + import from LibMec_Templates all; + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + + function f_create_qos_measure_subscription( + out QoSMeasureSubscription p_qos_measure_subscription, + out charstring p_subscription_id, + in template (omit) boolean p_test_notification := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_measure_subscription( + m_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_info( + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + )) + }, + -, -, -, -, + p_test_notification, + -, + p_expiryDeadline + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_measure_subscription( + mw_qos_measure_subscription( + {LATENCY, JITTER, THROUGHPUT}, + PX_QOS_MEAS_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links + )))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); + p_qos_measure_subscription := v_response.response.body.json_body.qos_measure_subscription; + log("f_create_qos_measure_subscription: INFO: IUT successfully responds to the subscription: ", p_qos_measure_subscription); + log("f_create_qos_measure_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_qos_measure_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_qos_measure_subscription + + function f_delete_qos_measure_subscription( + in charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & p_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("f_delete_qos_measure_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_delete_qos_measure_subscription + } // End of module QoSMeasurementAPI_Functions diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn index 727ff4a..6717c22 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn @@ -1,14 +1,41 @@ module QoSMeasurementAPI_Pixits { - - + // JSON import from Json all; // LibCommon import from LibCommon_BasicTypesAndValues all; + // LibMec/QoSMeasurementAPI + import from QoSMeasurementAPI_TypesAndValues all; + + // LibMec + import from LibMec_TypesAndValues all; + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "UnknownSubId"; modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_TYPE := "UnknownSubType"; + modulepar Json.AnyURI PX_QOS_MEAS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + + modulepar Json.String PX_USER := "10.100.0.1"; + + modulepar Json.String PX_SOURCE_IP := "10.100.0.20"; + + modulepar Json.UInteger PX_SOURCE_PORT := 12345; + + modulepar Json.UInteger PX_MEASURING_PERIOD := 30; + + modulepar Json.UInteger PX_NUMBER_OF_REPORTS := 10; + + modulepar Json.UInteger PX_REPORTING_INTERVAL := 30; + + modulepar Json.AnyURI PX_QOS_MEAS_SUB_WEB_SOCKET := "ws://clientApp.example.com/location_notifications/123456"; + + modulepar Json.String PX_ACCESS_POINT_ID := "5g-small-cell-2"; + + modulepar Json.String PX_ZONE_ID := "zone01"; + + modulepar TimeStamp PX_EXPIRY_DEADLINE := { seconds := 30, nanoSeconds := 0 }; + } // End of module QoSMeasurementAPI_Pixits diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn index c3db3c5..1f4999c 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -26,8 +26,8 @@ module QoSMeasurementAPI_Templates { } // End of template mw_notification_subscription_list template (omit) QoSMeasureSubscription m_qos_measure_subscription( - in template (value) MetricTypes p_metricType, - in Json.AnyURI p_callbackReference, + in MetricTypes p_metricType, + in template (omit) Json.AnyURI p_callbackReference, in Json.UInteger p_measuringPeriod, in template (omit) Links p_links := omit, in template (omit) Users p_users := omit, @@ -56,6 +56,24 @@ module QoSMeasurementAPI_Templates { expiryDeadline := p_expiryDeadline } // End of template m_qo_s_measure_subscription + template (omit) QoSMeasureSubscription m_qos_measure_subscription_wrong( + in MetricTypes p_metricType, + in template (omit) Json.AnyURI p_callbackReference, + in Json.UInteger p_measuringPeriod, + in template (omit) Links p_links := omit, + in template (omit) Users p_users := omit, + in template (omit) FlowInfos p_flowInfo := omit, + in template (omit) Json.UInteger p_numberOfReports := omit, + in template (omit) Json.UInteger p_reportingInterval := omit, + in template (omit) MeasuringAreas p_measuringArea := omit, + in template (omit) MeasuringTimes p_measuringTime := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "QoSMeasureSub" + } // End of template m_qos_measure_subscription_wrong + template (present) QoSMeasureSubscription mw_qos_measure_subscription( template (present) MetricTypes p_metricType := ?, template (present) Json.AnyURI p_callbackReference := ?, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 23c8625..7d9aa5b 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -182,6 +182,7 @@ module LibHttp_JsonMessageBodyTypes { QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList notification_subscription_list, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.1 Type: NotificationSubscriptionList QoSMeasureSubscription qos_measure_subscription, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.2 Type: QoSMeasureSubscription QoSEventSubscription qos_event_subscription, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.3 Type: QoSEventSubscription + QoSMeasurementAPI_TypesAndValues.TestNotification qos_test_notification, // TODO Add here your custom variants universal charstring raw } with { diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 32b5dde..3542129 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1742,7 +1742,7 @@ module LibHttp_JsonTemplates { } // End of template mw_body_json_qos_measure_subscription template (value) JsonBody m_body_json_qos_event_subscription( - in template (value) QoSEventSubscription p_qos_event_subscription + in template (value) QoSEventSubscription p_qos_event_subscription ) := { qos_event_subscription := p_qos_event_subscription } // End of template m_body_json_qos_event_subscription @@ -1753,6 +1753,18 @@ module LibHttp_JsonTemplates { qos_event_subscription := p_qos_event_subscription } // End of template mw_body_json_qos_event_subscription + template (value) JsonBody m_body_json_qos_test_notification( + in template (value) QoSMeasurementAPI_TypesAndValues.TestNotification p_test_notification + ) := { + qos_test_notification := p_test_notification + } // End of template m_body_json_qos_test_notification + + template (present) JsonBody mw_body_json_qos_test_notification( + template (present) QoSMeasurementAPI_TypesAndValues.TestNotification p_test_notification := ? + ) := { + qos_test_notification := p_test_notification + } // End of template mw_body_json_qos_test_notification + } // End of group qos_meas } // End of module LibHttp_JsonTemplates -- GitLab From 74bfb9ab022a0266e789f1f64ed7e718fe457a6f Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 3 Feb 2025 13:34:12 +0100 Subject: [PATCH 10/54] Add config file for AtsMec_QoSMeasurementAPI --- .../AtsMec_QoSMeasurementAPI.cf_ | 89 +++++++++++++++++++ .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 0 .../AtsMec_QoSMeasurementAPI_TestControl.ttcn | 0 .../module.mk | 0 4 files changed, 89 insertions(+) create mode 100644 etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ rename ttcn/{AtsMec_QoSMeasurementAPI => AtsMec_QoSMeasurement}/AtsMec_QoSMeasurementAPI_TestCases.ttcn (100%) rename ttcn/{AtsMec_QoSMeasurementAPI => AtsMec_QoSMeasurement}/AtsMec_QoSMeasurementAPI_TestControl.ttcn (100%) rename ttcn/{AtsMec_QoSMeasurementAPI => AtsMec_QoSMeasurement}/module.mk (100%) diff --git a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ new file mode 100644 index 0000000..e4de28d --- /dev/null +++ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ @@ -0,0 +1,89 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" #"192.168.1.39" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' + +LibMec_Pics.PICS_MEC_PLAT := true + +# 5g-small-cell-1 +V2XInformationServiceAPI_Pixits.PX_V2X_ECGI := "268804901557" +V2XInformationServiceAPI_Pixits.PX_V2X_CELL_ID := "101010101" +V2XInformationServiceAPI_Pixits.PX_V2X_ECGI_LAT := 43.730846 +V2XInformationServiceAPI_Pixits.PX_V2X_ECGI_LONG := 7.415385 + +# Callbacks +V2XInformationServiceAPI_Pixits.PX_PROV_UU_UNI_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/" +V2XInformationServiceAPI_Pixits.PX_PROV_V2X_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/" + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_QoSMeasurement/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_QoSMeasurementAPI_TestControl.control + + + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn similarity index 100% rename from ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestCases.ttcn rename to ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn diff --git a/ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestControl.ttcn similarity index 100% rename from ttcn/AtsMec_QoSMeasurementAPI/AtsMec_QoSMeasurementAPI_TestControl.ttcn rename to ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestControl.ttcn diff --git a/ttcn/AtsMec_QoSMeasurementAPI/module.mk b/ttcn/AtsMec_QoSMeasurement/module.mk similarity index 100% rename from ttcn/AtsMec_QoSMeasurementAPI/module.mk rename to ttcn/AtsMec_QoSMeasurement/module.mk -- GitLab From 742e80a33906675676cce953d5a18d6376064ff7 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 3 Feb 2025 13:45:57 +0100 Subject: [PATCH 11/54] Update config file for AtsMec_QoSMeasurementAPI --- .../AtsMec_QoSMeasurementAPI.cf_ | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ index e4de28d..a22f36a 100644 --- a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ +++ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ @@ -72,7 +72,60 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1 # In this section you can specify what parts of your test suite you want to execute. #AtsMec_QoSMeasurementAPI_TestControl.control - +# Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application +AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR +# Check that the IUT responds with an error when no subscription are created +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF +# Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionId +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 +# Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionType +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 +# Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionType +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 +# Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionId +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 +# Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF +# Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 +# Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with reportingInterval +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 +# Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with numberOfReports +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - users not present (Note 2) +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - flowInfo not present (Note 2) +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid flowFilter +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on reportingInterval/measuringPeriod +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on measuringArea +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 +# Check that the IUT acknowledges the changes of an existing QoS measurement subscription request when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK +# Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF +# Check that the IUT acknowledges the cancellation of QoS measurement subscription when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 +# Check that the IUT terminates notifications when the expiry timer expires +#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the -- GitLab From e39b8de8cb702a3a4bcd6afc6de4da4faf615101 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 3 Feb 2025 15:14:54 +0100 Subject: [PATCH 12/54] Implement QoS Events Sub/Not TPs --- .../AtsMec_QoSMeasurementAPI.cf_ | 86 +- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 1213 ++++++++++++++++- .../AtsMec_QoSMeasurementAPI_TestControl.ttcn | 24 +- .../ttcn/QoSMeasurementAPI_Functions.ttcn | 79 +- .../ttcn/QoSMeasurementAPI_Pixits.ttcn | 6 + .../ttcn/QoSMeasurementAPI_Templates.ttcn | 25 +- .../QoSMeasurementAPI_TypesAndValues.ttcn | 1 + 7 files changed, 1381 insertions(+), 53 deletions(-) diff --git a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ index a22f36a..dfec9ce 100644 --- a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ +++ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ @@ -73,59 +73,91 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1 #AtsMec_QoSMeasurementAPI_TestControl.control # Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application -AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK +AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR # Check that the IUT responds with an error when no subscription are created -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF # Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionId -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 # Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 # Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 # Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionId -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 # Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF # Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 # Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with reportingInterval -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 # Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with numberOfReports -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - users not present (Note 2) -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - flowInfo not present (Note 2) -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid flowFilter -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on reportingInterval/measuringPeriod -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on measuringArea -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 # Check that the IUT acknowledges the changes of an existing QoS measurement subscription request when commanded by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK # Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF # Check that the IUT acknowledges the cancellation of QoS measurement subscription when commanded by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 # Check that the IUT terminates notifications when the expiry timer expires -#AtsMec_QoSMeasurementAPI_TestControl.testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK +# Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 +# Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application - With thresholds +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid SubscritionType +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_03 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - users not present (Note 2) +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_04 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - flowFilter not present (Note 2) +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_05 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid flowFilter +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_06 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on monitoringArea +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_07 +# Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_OK +# Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_NF +# Check that the IUT acknowledges the cancellation of QoS event subscription when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_OK +# Check that the IUT acknowledges the cancellation of QoS event subscription when commanded by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_NF +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01 +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02 +# Check that the IUT terminates notifications when the expiry timer expires +#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_005_OK [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the diff --git a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn index a300cc6..534de42 100644 --- a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -78,7 +78,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK @@ -191,7 +191,8 @@ module AtsMec_QoSMeasurementAPI_TestCases { // Local variables var Headers v_headers; var QoSMeasureSubscription v_qos_measure_subscription; - var charstring v_subscription_id; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_qos_measure_subscription_id, v_qos_event_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { @@ -206,7 +207,8 @@ module AtsMec_QoSMeasurementAPI_TestCases { // Test adapter configuration // Preamble - f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_create_qos_measure_subscription(v_qos_measure_subscription, v_qos_measure_subscription_id); + f_create_qos_event_subscription(v_qos_event_subscription, v_qos_event_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -243,7 +245,8 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_qos_measure_subscription_id); + f_delete_qos_subscription(v_qos_event_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 @@ -254,7 +257,8 @@ module AtsMec_QoSMeasurementAPI_TestCases { // Local variables var Headers v_headers; var QoSMeasureSubscription v_qos_measure_subscription; - var charstring v_subscription_id; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_qos_measure_subscription_id, v_qos_event_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { @@ -269,11 +273,12 @@ module AtsMec_QoSMeasurementAPI_TestCases { // Test adapter configuration // Preamble - f_create_qos_measure_subscription(v_qos_measure_subscription, v_subscription_id); + f_create_qos_measure_subscription(v_qos_measure_subscription, v_qos_measure_subscription_id); + f_create_qos_event_subscription(v_qos_event_subscription, v_qos_event_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_get( + m_http_request_get( PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "?subscriptionType=" & oct2char(unichar2oct(v_qos_measure_subscription.subscriptionType, "UTF-8")), v_headers ))); @@ -306,7 +311,8 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_qos_measure_subscription_id); + f_delete_qos_subscription(v_qos_event_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 @@ -470,7 +476,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK @@ -622,7 +628,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 @@ -723,7 +729,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 @@ -824,7 +830,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 @@ -1433,7 +1439,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK @@ -1503,7 +1509,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF @@ -1558,7 +1564,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK @@ -1613,7 +1619,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF @@ -1676,7 +1682,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 @@ -1734,7 +1740,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 @@ -1810,10 +1816,1179 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_qos_measure_subscription(v_subscription_id); + f_delete_qos_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK } // End of group qos_meas_sub_not + group qos_event_sub_not { + + /** + * @desc Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_event_subscription( + mw_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + mw_report_trigger( + JITTER + ) + } + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSEventSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSEventSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 + + /** + * @desc Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application - With thresholds + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER, + PX_JITTER_THRESHOLD_HIGH, + PX_JITTER_THRESHOLD_LOW + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_event_subscription( + mw_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + mw_report_trigger( + JITTER, + PX_JITTER_THRESHOLD_HIGH, + PX_JITTER_THRESHOLD_LOW + ) + } + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSEventSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSEventSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid SubscritionType + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription_wrong( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_01 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + omit, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + }, + -, -, -, -, + { websocketUri := PX_QOS_MEAS_SUB_WEB_SOCKET, requestWebsocketUri := omit } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_03 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - users not present (Note 2) + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_04() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + omit, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_04 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - flowFilter not present (Note 2) + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_05() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + omit, + { + m_report_trigger( + JITTER + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_05 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid flowFilter + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_06() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + {}, + { + m_report_trigger( + JITTER + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_06 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on monitoringArea + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_07() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + }, + -, + { + m_monitoring_area( + -, + PX_ACCESS_POINT_ID, + PX_ZONE_ID + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_07 + + /** + * @desc Check that the IUT acknowledges the changes of QoS event subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + LATENCY + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_qos_event_subscription( + mw_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links, + { PX_USER }, + { + mw_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + mw_report_trigger( + LATENCY + ) + } + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSEventSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_OK + + /** + * @desc Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + LATENCY + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_NF + + /** + * @desc Check that the IUT acknowledges the cancellation of QoS event subscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully cancels the qoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_OK + + /** + * @desc Check that the IUT acknowledges the cancellation of QoS event subscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_NF + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_qos_event_subscription( + mw_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links + )))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01 + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id, true); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_qos_test_notification + )))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02 + + /** + * @desc Check that the IUT terminates notifications when the expiry timer expires + */ + testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var QoSEventSubscription v_qos_event_subscription; + var charstring v_subscription_id; + var timer v_expiry_timer; + var boolean v_no_more_notif_expected := false; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_QOS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_QOS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_qos_event_subscription(v_qos_event_subscription, v_subscription_id, -, PX_EXPIRY_DEADLINE); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + v_expiry_timer.start(int2float(PX_EXPIRY_DEADLINE.seconds)); + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_qos_event_subscription( + mw_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links + )))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + if (v_no_more_notif_expected == false) { + tc_wait.start; + repeat; + } else { + log("*** " & testcasename() & ": FAIL: New notif received after expiry timer ended ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] v_expiry_timer.timeout { + v_no_more_notif_expected := true; + log("*** " & testcasename() & ": INFO: expiry timer ended ***"); + repeat; + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": PASS: No notif received after expiry timer ended ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } // End of 'alt' statement + + // Postamble + f_delete_qos_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK + + } // End of group qos_event_sub_not + } // End of module AtsMec_QoSMeasurementAPI_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestControl.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestControl.ttcn index 4e43e02..0e6ec58 100644 --- a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestControl.ttcn @@ -44,9 +44,31 @@ module AtsMec_QoSMeasurementAPI_TestControl { execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01()); execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02()); - } execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK()); + + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_02()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_02()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_03()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_04()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_05()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_06()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_07()); + + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_OK()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_002_NF()); + + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_OK()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_NF()); + + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01()); + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02()); + + execute(TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_005_OK()); + } + } } // End of module AtsMec_QoSMeasurementAPI_TestControl \ No newline at end of file diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn index f19891d..b19cae8 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn @@ -29,7 +29,6 @@ module QoSMeasurementAPI_Functions { import from LibMec_Pics all; import from LibMec_Pixits all; - function f_create_qos_measure_subscription( out QoSMeasureSubscription p_qos_measure_subscription, out charstring p_subscription_id, @@ -100,7 +99,79 @@ module QoSMeasurementAPI_Functions { } // End of function f_create_qos_measure_subscription - function f_delete_qos_measure_subscription( + function f_create_qos_event_subscription( + out QoSEventSubscription p_qos_event_subscription, + out charstring p_subscription_id, + in template (omit) boolean p_test_notification := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_QOS_API_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_qos_event_subscription( + m_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + -, + { PX_USER }, + { + m_flow_filter( + PX_SOURCE_IP, + {PX_SOURCE_PORT} + ) + }, + { + m_report_trigger( + JITTER + ) + }, + -, -, -, + p_test_notification, + -, + p_expiryDeadline + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_qos_event_subscription( + mw_qos_event_subscription( + PX_QOS_EVENT_SUB_CALLBACK_URI, + PX_MEASURING_PERIOD, + mw_links + )))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_QOS_API_LIST_SUBS & "/(?*)", + 0 + ); + p_qos_event_subscription := v_response.response.body.json_body.qos_event_subscription; + log("f_create_qos_event_subscription: INFO: IUT successfully responds to the subscription: ", p_qos_event_subscription); + log("f_create_qos_event_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_qos_event_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_qos_event_subscription + + function f_delete_qos_subscription( in charstring p_subscription_id ) runs on HttpComponent { var Headers v_headers; @@ -121,10 +192,10 @@ module QoSMeasurementAPI_Functions { tc_ac.stop; } [] tc_ac.timeout { - log("f_delete_qos_measure_subscription: INCONC: Expected message not received"); + log("f_delete_qos_subscription: INCONC: Expected message not received"); } } // End of 'alt' statement - } // End of function f_delete_qos_measure_subscription + } // End of function f_delete_qos_subscription } // End of module QoSMeasurementAPI_Functions diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn index 6717c22..3ea8ed1 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Pixits.ttcn @@ -18,6 +18,8 @@ module QoSMeasurementAPI_Pixits { modulepar Json.AnyURI PX_QOS_MEAS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + modulepar Json.AnyURI PX_QOS_EVENT_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + modulepar Json.String PX_USER := "10.100.0.1"; modulepar Json.String PX_SOURCE_IP := "10.100.0.20"; @@ -38,4 +40,8 @@ module QoSMeasurementAPI_Pixits { modulepar TimeStamp PX_EXPIRY_DEADLINE := { seconds := 30, nanoSeconds := 0 }; + modulepar Json.UInteger PX_JITTER_THRESHOLD_HIGH := 10; + + modulepar Json.UInteger PX_JITTER_THRESHOLD_LOW := 5; + } // End of module QoSMeasurementAPI_Pixits diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn index 1f4999c..f2da8f9 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -70,7 +70,7 @@ module QoSMeasurementAPI_Templates { in template (omit) Json.Bool p_requestTestNotification := omit, in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, in template (omit) TimeStamp p_expiryDeadline := omit - ) := { + ) modifies m_qos_measure_subscription := { subscriptionType := "QoSMeasureSub" } // End of template m_qos_measure_subscription_wrong @@ -194,9 +194,10 @@ module QoSMeasurementAPI_Templates { } // End of template mw_measuring_time template (omit) QoSEventSubscription m_qos_event_subscription( - in Json.AnyURI p_callbackReference, + in template (omit) Json.AnyURI p_callbackReference, in Json.UInteger p_measuringPeriod, in template (omit) Links p_links := omit, + in template (omit) Users p_users := omit, in template (omit) FlowFilters p_flowFilter := omit, in template (omit) ReportTriggers p_reportTrigger := omit, in template (omit) ReportingCtrl p_reportingCtrl := omit, @@ -211,6 +212,7 @@ module QoSMeasurementAPI_Templates { requestTestNotification := p_requestTestNotification, websockNotifConfig := p_websockNotifConfig, links := p_links, + users := p_users, flowFilter := p_flowFilter, reportTrigger := p_reportTrigger, reportingCtrl := p_reportingCtrl, @@ -220,10 +222,28 @@ module QoSMeasurementAPI_Templates { expiryDeadline := p_expiryDeadline } // End of template m_qos_event_subscription + template (omit) QoSEventSubscription m_qos_event_subscription_wrong( + in template (omit) Json.AnyURI p_callbackReference, + in Json.UInteger p_measuringPeriod, + in template (omit) Links p_links := omit, + in template (omit) Users p_users := omit, + in template (omit) FlowFilters p_flowFilter := omit, + in template (omit) ReportTriggers p_reportTrigger := omit, + in template (omit) ReportingCtrl p_reportingCtrl := omit, + in template (omit) MonitoringAreas p_monitoringArea := omit, + in template (omit) MonitoringTimes p_monitoringTime := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) modifies m_qos_event_subscription := { + subscriptionType := "QoSEventSub" + } // End of template m_qos_event_subscription_wrong + template (present) QoSEventSubscription mw_qos_event_subscription( template (present) Json.AnyURI p_callbackReference := ?, template (present) Json.UInteger p_measuringPeriod := ?, template Links p_links := *, + template Users p_users := *, template FlowFilters p_flowFilter := *, template ReportTriggers p_reportTrigger := *, template ReportingCtrl p_reportingCtrl := *, @@ -238,6 +258,7 @@ module QoSMeasurementAPI_Templates { requestTestNotification := p_requestTestNotification, websockNotifConfig := p_websockNotifConfig, links := p_links, + users := p_users, flowFilter := p_flowFilter, reportTrigger := p_reportTrigger, reportingCtrl := p_reportingCtrl, diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn index a7dff58..1c6c044 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_TypesAndValues.ttcn @@ -150,6 +150,7 @@ module QoSMeasurementAPI_TypesAndValues { Json.Bool requestTestNotification optional, WebsockNotifConfig websockNotifConfig optional, Links links optional, + Users users optional, FlowFilters flowFilter optional, ReportTriggers reportTrigger optional, ReportingCtrl reportingCtrl optional, -- GitLab From 774709bd02d5c8d7219f464c7e544b5f3a3bea36 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Tue, 4 Feb 2025 10:26:38 +0500 Subject: [PATCH 13/54] update MEC015 description version from v2.2.1 to v3.1.1 --- ..._MultiAccessSteeringInfoAPI_TestCases.ttcn | 2 +- ...AtsMec_TrafficManagementAPI_TestCases.ttcn | 2 +- .../TrafficManagementAPI_TypesAndValues.ttcn | 62 +++++++++---------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn index 1026770..091c223 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 015, Draft ETSI GS MEC 015 V2.1.1 (2020-06) + * @see ETSI GS MEC 015, ETSI GS MEC 015, Draft ETSI GS MEC 015 V3.1.1 (2024-04) */ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn index f3b601d..50d2114 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 015, Draft ETSI GS MEC 015 V2.2.1 (2020-06) + * @see ETSI GS MEC 015, Draft ETSI GS MEC 015 V3.1.1 (2024-04) */ module AtsMec_TrafficManagementAPI_TestCases { diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index f9d5380..5225ad5 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -16,7 +16,7 @@ module TrafficManagementAPI_TypesAndValues { * @member fixedBWPriority Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document * @member fixedAllocation Size of requested fixed BW allocation in [bps] * @member allocationDirection The direction of the requested BW allocation - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type record BwInfo { AllocationId allocationId optional, @@ -40,7 +40,7 @@ module TrafficManagementAPI_TypesAndValues { * @member fixedBWPriority Indicates the allocation priority when dealing with several applications or sessions in parallel * @member fixedAllocation Size of requested fixed BW allocation in [bps] * @member allocationDirection The direction of the requested BW allocation - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.3 Type: BwInfoDeltas + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.3 Type: BwInfoDeltas */ type record BwInfoDeltas { Json.String allocationId, @@ -54,19 +54,19 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Bandwidth allocation instance identifier - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.String AllocationId; /** * @desc Application instance identifier - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.String AppInsId; /** * @desc Numeric value (0 - 255) corresponding to specific type of consumer - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type enumerated BwRequestType { APPLICATION_SPECIFIC_BW_ALLOCATION (0), @@ -77,7 +77,7 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Numeric value (0 - 255) corresponding to specific type of consumer - * @see ETSI GS MEC 015 V2.2.1 (2022-12) 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) 7.2.5 Type: MtsSessionInfo */ type enumerated MtsRequestType { APPLICATION_SPECIFIC_MTS_SESSION (0), @@ -88,7 +88,7 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type set of SessionFilterItem SessionFilter; /** @@ -98,7 +98,7 @@ module TrafficManagementAPI_TypesAndValues { * @member dstAddress Destination address identity of session (including range) * @member dstPort Destination port identity of session * @member protocol Protocol number - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type record SessionFilterItem { SourceIp sourceIp optional, @@ -110,7 +110,7 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Indicates the allocation priority when dealing with several applications or sessions in parallel. - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type enumerated FixedBWPriority { reserved @@ -118,26 +118,26 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Size of requested fixed BW allocation in [bps] - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.String FixedAllocation; /** * @desc The seconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.UInteger Seconds; /** * @desc The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.UInteger NanoSeconds; /** * @desc The direction of the requested BW allocation - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type enumerated AllocationDirection { Downlink, @@ -147,31 +147,31 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Source address identity of session (including range) - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.String SourceIp; /** * @desc Source port identity of session - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.UInteger SourcePort; /** * @desc Destination address identity of session (including range) - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.String DstAddress; /** * @desc Destination port identity of session - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.UInteger DstPort; /** * @desc Protocol number - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.2 Type: BwInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ type Json.String Protocol; @@ -180,7 +180,7 @@ module TrafficManagementAPI_TypesAndValues { * @member timeStamp Time stamp to indicate when the corresponding information elements are sent * @member mtsAccessInfo The information on access network connection as defined below * @member mtsMode Numeric value corresponding to a specific MTS operation supported by the TMS - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.4 Type: MtsCapabilityInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.4 Type: MtsCapabilityInfo */ type record MtsCapabilityInfo { TimeStamp timeStamp optional, @@ -190,7 +190,7 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc The information on access network connection as defined below - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.4 Type: MtsCapabilityInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.4 Type: MtsCapabilityInfo */ type enumerated MtsMode { LowCost (0), @@ -208,7 +208,7 @@ module TrafficManagementAPI_TypesAndValues { * @member accessId Unique identifier for the access network connection * @member accessType Numeric value (0-255) corresponding to specific type of access network * @member metered Numeric value (0-255) - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.4 Type: MtsCapabilityInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.4 Type: MtsCapabilityInfo */ type record MtsAccessInfo { AccessId accessId, @@ -219,13 +219,13 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Unique identifier for the access network connection - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.4 Type: MtsCapabilityInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.4 Type: MtsCapabilityInfo */ type Json.UInteger AccessId; /** * @desc Numeric value (0-255) corresponding to specific type of access network - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.4 Type: MtsCapabilityInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.4 Type: MtsCapabilityInfo */ type enumerated AccessType { Unknown (0), @@ -246,7 +246,7 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc Numeric value (0-255) - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.4 Type: MtsCapabilityInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.4 Type: MtsCapabilityInfo */ type enumerated Metered { CxNotMetered (0), @@ -267,7 +267,7 @@ module TrafficManagementAPI_TypesAndValues { * @member qosD QoS requirement description of the MTS session * @member mtsMode Numeric value corresponding to a specific MTS operation * @member trafficDirection The direction of the requested MTS session supported by the TMS - * @see ETSI GS MEC 015 V2.2.1 (2022-12) 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) 7.2.5 Type: MtsSessionInfo */ type record MtsSessionInfo { SessionId sessionId optional, @@ -284,7 +284,7 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc MTS session instance identifier - * @see ETSI GS MEC 015 V2.2.1 (2022-12) 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) 7.2.5 Type: MtsSessionInfo */ type Json.String SessionId; @@ -297,7 +297,7 @@ module TrafficManagementAPI_TypesAndValues { * @member protocol Protocol number * @member dscp DSCP in the IPv4 header or Traffic Class in the IPv6 header * @member flowlabel Flow Label in the IPv6 header, applicable only if the flow is IPv6 - * @see ETSI GS MEC 015 V2.2.1 (2022-12) 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) 7.2.5 Type: MtsSessionInfo */ type record FlowFilterItem { SourceIp sourceIp optional, @@ -312,19 +312,19 @@ module TrafficManagementAPI_TypesAndValues { /** * @desc The direction of the requested MTS session supported by the TMS - * @see ETSI GS MEC 015 V2.2.1 (2022-12) 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) 7.2.5 Type: MtsSessionInfo */ type AllocationDirection TrafficDirection; /** * @desc DSCP in the IPv4 header or Traffic Class in the IPv6 header - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.5 Type: MtsSessionInfo */ type Json.UInteger Dscp; /** * @desc Flow Label in the IPv6 header, applicable only if the flow is IPv6 - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.5 Type: MtsSessionInfo */ type Json.UInteger Flowlabel; @@ -335,7 +335,7 @@ module TrafficManagementAPI_TypesAndValues { * @member maxLoss Tolerable packet loss rate in [1/10^x] * @member maxJitter Tolerable jitter in [10 nanoseconds] * @member priority numeric value (0 - 255) corresponding to the traffic priority - * @see ETSI GS MEC 015 V2.2.1 (2022-12) Clause 7.2.5 Type: MtsSessionInfo + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.5 Type: MtsSessionInfo */ type record QosD { Json.UInteger minTpt optional, -- GitLab From 2d36339848ffb8cde7d083d526dc9a5fca924edf Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 4 Feb 2025 14:46:24 +0100 Subject: [PATCH 14/54] Initiating implementation of MEC 046 TPs --- .../AtsMec_QoSMeasurementAPI.cf_ | 82 ++-- .../AtsMec_SensorsSharingService.cf_ | 105 +++++ .../AtsMec_SensorsSharingService.cfg | 1 + ttcn/AtsMec_IoT/module.mk | 2 + ...tsMec_SensorsSharingService_TestCases.ttcn | 429 ++++++++++++++++++ ...Mec_SensorsSharingService_TestControl.ttcn | 21 +- ttcn/AtsMec_SensorsSharingService/module.mk | 1 + .../ttcn/SensorsSharingService_Pics.ttcn | 5 + .../ttcn/SensorsSharingService_Pixits.ttcn | 24 + ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 10 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 13 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 33 +- 12 files changed, 673 insertions(+), 53 deletions(-) create mode 100644 etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ create mode 120000 etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cfg diff --git a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ index dfec9ce..00fdce7 100644 --- a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ +++ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ @@ -12,21 +12,9 @@ LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true -#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" -LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' - -LibMec_Pics.PICS_MEC_PLAT := true - -# 5g-small-cell-1 -V2XInformationServiceAPI_Pixits.PX_V2X_ECGI := "268804901557" -V2XInformationServiceAPI_Pixits.PX_V2X_CELL_ID := "101010101" -V2XInformationServiceAPI_Pixits.PX_V2X_ECGI_LAT := 43.730846 -V2XInformationServiceAPI_Pixits.PX_V2X_ECGI_LONG := 7.415385 - -# Callbacks -V2XInformationServiceAPI_Pixits.PX_PROV_UU_UNI_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/" -V2XInformationServiceAPI_Pixits.PX_PROV_V2X_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/" +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -73,65 +61,65 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1 #AtsMec_QoSMeasurementAPI_TestControl.control # Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application -AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK +AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_001_BR # Check that the IUT responds with an error when no subscription are created -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_001_NF # Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionId -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_01 # Check that the IUT responds with the list of QoS measurement subscriptions when queried by a MEC Application - Filter on subscriptionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_002_OK_02 # Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_01 # Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscriptionId -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_002_NF_02 # Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF # Check that the IUT responds with a QoS measurement subscription when queried by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01 # Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with reportingInterval -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02 # Check that the IUT acknowledges the creation of QoS measurement subscription request when commanded by a MEC Application - with numberOfReports -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - users not present (Note 2) -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - flowInfo not present (Note 2) -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid flowFilter -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on reportingInterval/measuringPeriod -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid condition on measuringArea -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 # Check that the IUT acknowledges the changes of an existing QoS measurement subscription request when commanded by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK # Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF # Check that the IUT acknowledges the cancellation of QoS measurement subscription when commanded by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01 # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02 # Check that the IUT terminates notifications when the expiry timer expires -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK # Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 # Check that the IUT acknowledges the creation of QoS event subscription request when commanded by a MEC Application - With thresholds -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid SubscritionType -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_OK_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided #AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_001_BR_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided @@ -153,11 +141,11 @@ AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK # Check that the IUT acknowledges the cancellation of QoS event subscription when commanded by a MEC Application #AtsMec_QoSMeasurementAPI_TestControl.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_003_NF # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01 # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02 +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02 # Check that the IUT terminates notifications when the expiry timer expires -#AtsMec_QoSMeasurementAPI_TestControl.testcase.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_005_OK +#AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_005_OK [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ new file mode 100644 index 0000000..4c24211 --- /dev/null +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ @@ -0,0 +1,105 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" #"192.168.1.39" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' + +SensorsSharingService_Pixits.PX_SENS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; +SensorsSharingService_Pixits.PX_SENS_DISCOVERY_TYPE := "" +SensorsSharingService_Pixits.PX_SENS_DISCOVERY_PROPERTY_LIST := "" # Could be [], string or [string1 string2] +SensorsSharingService_Pixits.PX_SENSOR_IDENTIFIER := "" + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_SensorsSharingService/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_SensorsSharingService_TestControl.control + +# Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application +AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 +# Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application - Using type filter +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid filter +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_BR +# Check that the IUT responds with an error when the IUT does not have sensor(s) +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_NF +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_01 +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_002_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF + + + + + + + + + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cfg b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cfg new file mode 120000 index 0000000..1555082 --- /dev/null +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cfg @@ -0,0 +1 @@ +AtsMec_SensorsSharingService.cf_ \ No newline at end of file diff --git a/ttcn/AtsMec_IoT/module.mk b/ttcn/AtsMec_IoT/module.mk index 36152a9..ff1e030 100644 --- a/ttcn/AtsMec_IoT/module.mk +++ b/ttcn/AtsMec_IoT/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 434c895..6a0f690 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -11,6 +11,435 @@ module AtsMec_SensorsSharingService_TestCases { import from LibHttp_TestSystem all; // LibMec/SensorsSharingService + import from SensorsSharingService_TypesAndValues all; import from SensorsSharingService_Templates all; + import from SensorsSharingService_Pics all; + import from SensorsSharingService_Pixits all; + import from SensorsSharingService_Functions all; + + // LibMec + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + group discovery { + + /** + * @desc Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DISCOVERY, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_discovery_infos + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list sensors info ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 + + /** + * @desc Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application - Using type filter + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DISCOVERY & "?type=" & PX_SENS_DISCOVERY_TYPE & "&sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, + v_headers + ))); //curl -X GET "https://mec-platform.etsi.org/sbxykqjr17/mep1/sens/v1/queries/sensor_discovery?type=string&sensorPropertyList=string1,string2&sensorCharacteristicList=[object Object]&geographicalArea=[object Object]" -H "accept: application/json" + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_discovery_infos + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list sensors info ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid filter + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DISCOVERY & "&sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, // type omitted + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_BR + + /** + * @desc Check that the IUT responds with an error when the IUT does not have sensor(s) + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DISCOVERY & "?type=" & PX_SENS_DISCOVERY_UNKNOWN_TYPE & "&sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_001_NF + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_01 + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "?sensorIdentifier=" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "?sensorId=" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_BR + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "?sensorIdentifier=" & PX_UNKNOWN_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF + + } // End of group discovery } // End of module AtsMec_SensorsSharingService_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn index 2c201fb..9448ef2 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn @@ -1,9 +1,28 @@ module AtsMec_SensorsSharingService_TestControl { + // LibMec/SensorsSharingService + import from SensorsSharingService_Pics all; + + // LibMec + import from LibMec_Pics all; + + // AtsMec_SensorsSharingService import from AtsMec_SensorsSharingService_TestCases all; control { - } + if (PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED) { + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_001_BR()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_001_NF()); + + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_BR()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF()); + } + + } // End of 'alt' statement } // End of module AtsMec_SensorsSharingService_TestControl \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/module.mk b/ttcn/AtsMec_SensorsSharingService/module.mk index 9bd1147..2f3383d 100644 --- a/ttcn/AtsMec_SensorsSharingService/module.mk +++ b/ttcn/AtsMec_SensorsSharingService/module.mk @@ -24,6 +24,7 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ + ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn index 5c4643c..2604384 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pics.ttcn @@ -1,3 +1,8 @@ module SensorsSharingService_Pics { + /** + * @desc Does the IUT support MEC Sensors-Sharing Service API? + */ + modulepar boolean PICS_SENS_API_SUPPORTED := true; + } // End of module SensorsSharingService_Pics diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn index bbe32ee..2a18cdb 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn @@ -1,3 +1,27 @@ module SensorsSharingService_Pixits { + + // JSON + import from Json all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + // LibMec/SensorsSharingService + import from SensorsSharingService_TypesAndValues all; + + // LibMec + import from LibMec_TypesAndValues all; + + modulepar Json.AnyURI PX_SENS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + + modulepar charstring PX_SENS_DISCOVERY_TYPE := ""; + + modulepar charstring PX_SENS_DISCOVERY_UNKNOWN_TYPE := "UNKNOWN_TYPE"; + + modulepar charstring PX_SENS_DISCOVERY_PROPERTY_LIST := ""; // Could be [], string or [string1 string2] + + modulepar charstring PX_SENSOR_IDENTIFIER := ""; + + modulepar charstring PX_UNKNOWN_SENSOR_IDENTIFIER := "UNKNOWN_SENSOR_IDENTIFIER"; + } // End of module SensorsSharingService_Pixits diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 702716e..353f655 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -112,4 +112,14 @@ module LibMec_Pixits { modulepar charstring PX_QOS_API_LIST_SUBS := "qms/v1/subscriptions"; + modulepar charstring PX_SENS_DISCOVERY := "sens/v1/queries/sensor_discovery"; + + modulepar charstring PX_SENS_LIST_SUBS_DISCOVERY := "sens/v1/subscriptions/sensor_discovery"; + + modulepar charstring PX_SENS_LIST_SUBS_STATUS := "sens/v1/subscriptions/sensor_status"; + + modulepar charstring PX_SENS_LIST_SUBS_DATA := "sens/v1/subscriptions/sensor_data"; + + modulepar charstring PX_SENS_MGMT := "sens/v1/sensor_management"; + } // End of module LibMec_Pixits diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 7d9aa5b..6a66ec3 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -32,6 +32,8 @@ module LibHttp_JsonMessageBodyTypes { import from FederationEnablementAPI_TypesAndValues all; // LibMec/FixedAccessInformationServiceAPI import from QoSMeasurementAPI_TypesAndValues all; + // LibMec/SensorsSharingService + import from SensorsSharingService_TypesAndValues all; /** * This file volontary contains a trivial declaration of the type JsonBody. @@ -179,10 +181,13 @@ module LibHttp_JsonMessageBodyTypes { IoTAPI_TypesAndValues.DeviceInfoList deviceInfoList_iot, // ETSI GS MEC 033 V3.1.1 Clause 6.2.2 Type: DeviceInfo IotPlatformInfoList iotPlatformInfoList, // ETSI GS MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo IotPlatformInfo iotPlatformInfo, // ETSI GS MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo - QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList notification_subscription_list, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.1 Type: NotificationSubscriptionList - QoSMeasureSubscription qos_measure_subscription, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.2 Type: QoSMeasureSubscription - QoSEventSubscription qos_event_subscription, //ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.3 Type: QoSEventSubscription - QoSMeasurementAPI_TypesAndValues.TestNotification qos_test_notification, + QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList notification_subscription_list, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.1 Type: NotificationSubscriptionList + QoSMeasureSubscription qos_measure_subscription, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.2 Type: QoSMeasureSubscription + QoSEventSubscription qos_event_subscription, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.3 Type: QoSEventSubscription + QoSMeasurementAPI_TypesAndValues.TestNotification qos_test_notification, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.4.1 Type: TestNotification + SensorDiscoveryInfos sensor_discovery_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.1 Type: SensorDiscoveryInfo + SensorDiscoveryInfo sensor_discovery_info, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.1 Type: SensorDiscoveryInfo + SensorsSharingService_TypesAndValues.SubscriptionLinkList subscription_link_list_sss, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.4 Type: SubscriptionLinkList // TODO Add here your custom variants universal charstring raw } with { diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 3542129..e7b9f44 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -55,9 +55,12 @@ module LibHttp_JsonTemplates { // LibMec/FixedAccessInformationServiceAPI import from FederationEnablementAPI_TypesAndValues all; - // LibMec/FQoSMeasurementServiceAPI + // LibMec/QoSMeasurementServiceAPI import from QoSMeasurementAPI_TypesAndValues all; + // LibMec/SensorsSharingService + import from SensorsSharingService_TypesAndValues all; + template (value) JsonBody m_json_body_raw( in template (value) charstring p_raw ) := { @@ -1767,4 +1770,32 @@ module LibHttp_JsonTemplates { } // End of group qos_meas + group sens { + + template (value) JsonBody m_body_json_sensor_discovery_infos( + in template (value) SensorDiscoveryInfos p_sensor_discovery_infos + ) := { + sensor_discovery_infos := p_sensor_discovery_infos + } // End of template m_body_json_sensor_discovery_infos + + template (present) JsonBody mw_body_json_sensor_discovery_infos( + template (present) SensorDiscoveryInfos p_sensor_discovery_infos := ? + ) := { + sensor_discovery_infos := p_sensor_discovery_infos + } // End of template mw_body_json_sensor_discovery_infos + + template (value) JsonBody m_body_json_subscription_link_list_sss( + in template (value) SensorsSharingService_TypesAndValues.SubscriptionLinkList p_subscription_link_list + ) := { + subscription_link_list_sss := p_subscription_link_list + } // End of template m_body_json_subscription_link_list_sss + + template (present) JsonBody mw_body_json_subscription_link_list_sss( + template (present) SensorsSharingService_TypesAndValues.SubscriptionLinkList p_subscription_link_list := ? + ) := { + subscription_link_list_sss := p_subscription_link_list + } // End of template mw_body_json_subscription_link_list_sss + + } // End of group sens + } // End of module LibHttp_JsonTemplates -- GitLab From a04a86dd1129d92edb7b7e179f7ec278f532ee31 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 5 Feb 2025 11:38:51 +0100 Subject: [PATCH 15/54] Continue implementation of MEC 046 TPs --- .../AtsMec_SensorsSharingService.cf_ | 43 + ...tsMec_SensorsSharingService_TestCases.ttcn | 1111 +++++++++++++++++ ...Mec_SensorsSharingService_TestControl.ttcn | 28 + .../ttcn/SensorsSharingService_Pixits.ttcn | 6 + .../ttcn/SensorsSharingService_Templates.ttcn | 6 +- .../SensorsSharingService_TypesAndValues.ttcn | 13 +- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 7 + .../ttcn/LibHttp_JsonTemplates.ttcn | 84 ++ 9 files changed, 1290 insertions(+), 10 deletions(-) diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ index 4c24211..98f7023 100644 --- a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ @@ -81,6 +81,49 @@ AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_002_BR # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF +# Check that the IUT responds with a SensorDiscoveryEventSubscription when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_003_OK +# Check that the IUT responds with a SensorDiscoveryEventSubscription when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_003_NF +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_01 +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_02 +# Check that the IUT responds with an error when the IUT does not have SensorStatus subscriptions registered +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_001_NF +# Check that the IUT responds with the list of SensorStatusSubscription when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_002_OK +# Check that the IUT responds with an error when the IUT does not have sensor(s) +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_002_NF +# Check that the IUT responds with the list of SensorData when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR +# Check that the IUT responds with an error when the IUT does not have sensor(s) +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_NF +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_01 +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_004_BR +# Check that the IUT responds with an error when the IUT does not have SensorData subscriptions registered +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_004_NF +# Check that the IUT responds with the a SensorDataSubscriptions when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_005_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_005_NF +# Check that the IUT responds with the list of SensorCharacteristic when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_006_OK +# Check that the IUT acknowledges the change of the characteristics of one or more sensors when queried by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_007_OK +# Check that the IUT responds with an error when the a sensor does not have a characteristic +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_007_NF + + + + + diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 6a0f690..1f418a6 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -440,6 +440,1117 @@ module AtsMec_SensorsSharingService_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF + /** + * @desc Check that the IUT responds with a SensorDiscoveryEventSubscription when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; + var charstring v_subscriptiopn_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscriptiopn_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_discovery_event_subscription( + v_sensor_discovery_event_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_003_OK + + /** + * @desc Check that the IUT responds with a SensorDiscoveryEventSubscription when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; + var charstring v_subscriptiopn_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & PX_UNKNOW_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_003_NF + } // End of group discovery + group sensor_lookup { + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_01 + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "?sensorIdentifier=" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "?sensorId=" & PX_SENSOR_IDENTIFIER, // Wrong query parameter + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_BR + + /** + * @desc Check that the IUT responds with an error when the IUT does not have SensorStatus subscriptions registered + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "?sensorIdentifier=" & PX_UNKNOWN_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_NF + + /** + * @desc Check that the IUT responds with the list of SensorStatusSubscription when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_status_subscription( + v_sensor_status_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_002_OK + + /** + * @desc Check that the IUT responds with an error when the IUT does not have sensor(s) + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOW_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_002_NF + + /** + * @desc Check that the IUT responds with the list of SensorData when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DATA & "?" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_datas( + superset( + mw_sensor_data( + PX_SENSOR_IDENTIFIER + ))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SensorData ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DATA, // Query parameters is required + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR + + /** + * @desc Check that the IUT responds with an error when the IUT does not have sensor(s) + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DATA & "?" & PX_UNKNOWN_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_003_NF + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_01 + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA & "?sensorIdentifier=" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & "?sensorId=" & PX_SENSOR_IDENTIFIER, // Wrong query parameter + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_BR + + /** + * @desc Check that the IUT responds with an error when the IUT does not have SensorData subscriptions registered + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & "?sensorIdentifier=" & PX_UNKNOWN_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_004_NF + + /** + * @desc Check that the IUT responds with the a SensorDataSubscriptions when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA & "/" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_data_subscription( + v_sensor_data_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SensorDataSubscritption ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_005_OK + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_005_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA & "/" & PX_UNKNOWN_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_005_NF + + /** + * @desc Check that the IUT responds with the list of SensorCharacteristic when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_006_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_MGMT & "?sensorIdentifier=" & PX_SENSOR_IDENTIFIER, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_characteristics + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SensorDataSubscritption ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_006_OK + + /** + * @desc Check that the IUT acknowledges the change of the characteristics of one or more sensors when queried by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_007_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_MGMT, + v_headers, + m_http_message_body_json( + m_body_json_sensor_characteristic_infos( + { + m_sensor_characteristic_info( + PX_SENSOR_IDENTIFIER, + { + m_sensor_characteristic( + PX_CHARACTERISTIC_NAME, + PX_CHARACTERISTIC_VALUE + ) + } + ) + } + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_characteristic_infos( + superset( + mw_sensor_characteristic_info( + PX_SENSOR_IDENTIFIER, + { + mw_sensor_characteristic( + PX_CHARACTERISTIC_NAME, + PX_CHARACTERISTIC_VALUE + ) + } + ))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SensorCharacteristicList ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_007_OK + + /** + * @desc Check that the IUT responds with an error when the a sensor does not have a characteristic + */ + testcase TC_MEC_MEC046_SRV_SENSLOOKUP_007_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_MGMT, + v_headers, + m_http_message_body_json( + m_body_json_sensor_characteristic_infos( + { + m_sensor_characteristic_info( + PX_UNKNOWN_SENSOR_IDENTIFIER, + { + m_sensor_characteristic( + PX_CHARACTERISTIC_NAME, + PX_CHARACTERISTIC_VALUE + ) + } + ) + } + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_007_NF + + } // End of group sensor_lookup + } // End of module AtsMec_SensorsSharingService_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn index 9448ef2..b26caf6 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn @@ -21,6 +21,34 @@ module AtsMec_SensorsSharingService_TestControl { execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02()); execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_BR()); execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF()); + + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_003_OK()); + execute(TC_MEC_MEC046_SRV_SENSDISCOVERY_003_NF()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_001_BR()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_001_NF()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_002_OK()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_002_NF()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_003_NF()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_004_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_004_BR()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_004_NF()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_005_OK()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_005_NF()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_006_OK()); + + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_007_OK()); + execute(TC_MEC_MEC046_SRV_SENSLOOKUP_007_NF()); } } // End of 'alt' statement diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn index 2a18cdb..d0ffe39 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn @@ -24,4 +24,10 @@ module SensorsSharingService_Pixits { modulepar charstring PX_UNKNOWN_SENSOR_IDENTIFIER := "UNKNOWN_SENSOR_IDENTIFIER"; + modulepar charstring PX_UNKNOW_SUBSCRIPTION_ID := "UNKNOW_SUBSCRIPTION_ID"; + + modulepar Json.String PX_CHARACTERISTIC_NAME := ""; + + modulepar Json.String PX_CHARACTERISTIC_VALUE := ""; + } // End of module SensorsSharingService_Pixits diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn index 24a63c9..4adb40b 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn @@ -82,7 +82,6 @@ module SensorsSharingService_Templates { } // End of template mw_sensor_data template (omit) SensorDiscoveryEventSubscription m_sensor_discovery_event_subscription( - in Json.String p_subscriptionType, in Json.AnyURI p_callbackReference, in template (omit) Links p_links := omit, in template (omit) SensorInfos p_sensorInfo := omit, @@ -91,7 +90,7 @@ module SensorsSharingService_Templates { in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, in template (omit) TimeStamp p_expiryDeadline := omit ) := { - subscriptionType := p_subscriptionType, + subscriptionType := "SensorDiscoveryEventSubscription", callbackReference := p_callbackReference, requestTestNotification := p_requestTestNotification, websockNotifConfig := p_websockNotifConfig, @@ -102,7 +101,6 @@ module SensorsSharingService_Templates { } // End of template m_sensor_discovery_event_subscription template (present) SensorDiscoveryEventSubscription mw_sensor_discovery_event_subscription( - template (present) Json.String p_subscriptionType := ?, template (present) Json.AnyURI p_callbackReference := ?, template Links p_links := *, template SensorInfos p_sensorInfo := *, @@ -111,7 +109,7 @@ module SensorsSharingService_Templates { template WebsockNotifConfig p_websockNotifConfig := *, template TimeStamp p_expiryDeadline := * ) := { - subscriptionType := p_subscriptionType, + subscriptionType := "SensorDiscoveryEventSubscription", callbackReference := p_callbackReference, requestTestNotification := p_requestTestNotification, websockNotifConfig := p_websockNotifConfig, diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn index 9975287..0dfe3b6 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn @@ -22,7 +22,7 @@ module SensorsSharingService_TypesAndValues { SensorCharacteristics sensorCharacteristicList optional, Point sensorPosition } - type record of SensorDiscoveryInfo SensorDiscoveryInfos; + type set of SensorDiscoveryInfo SensorDiscoveryInfos; type record length (1 .. infinity) of Json.String SensorPropertyList; /** @@ -35,7 +35,7 @@ module SensorsSharingService_TypesAndValues { Json.String sensorIdentifier, SensorStatusType sensorStatusType } - type record of SensorStatusInfo SensorStatusInfos; + type set of SensorStatusInfo SensorStatusInfos; /** * @desc The status of the sensor @@ -63,7 +63,7 @@ module SensorsSharingService_TypesAndValues { Json.String dataUnitOfMeasure, TimeStamp dataTimestamp optional } - type record of SensorData SensorDatas; + type set of SensorData SensorDatas; /** * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information @@ -100,6 +100,7 @@ module SensorsSharingService_TypesAndValues { Json.String sensorIdentifier, SensorCharacteristics sensorCharacteristicList optional } + type set of SensorCharacteristicInfo SensorCharacteristicInfos; /** * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information @@ -186,7 +187,7 @@ module SensorsSharingService_TypesAndValues { } with { variant (type_) "name as 'type'"; } - type record of SensorInfo SensorInfos; + type set of SensorInfo SensorInfos; /** * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information @@ -268,7 +269,7 @@ module SensorsSharingService_TypesAndValues { Points points, Json.UInteger radius optional } - type record of AreaInfo AreaInfos; + type set of AreaInfo AreaInfos; /** * @desc The shape of the area monitored @@ -303,7 +304,7 @@ module SensorsSharingService_TypesAndValues { Json.String characteristicValue, Json.String characteristicUnitOfMeasure optional } - type record of SensorCharacteristic SensorCharacteristics; + type set of SensorCharacteristic SensorCharacteristics; /** * @desc This type represents specified event types for sensor discovery report diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 353f655..11c0d9f 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -114,6 +114,8 @@ module LibMec_Pixits { modulepar charstring PX_SENS_DISCOVERY := "sens/v1/queries/sensor_discovery"; + modulepar charstring PX_SENS_DATA := "sens/v1/queries/sensor_data"; + modulepar charstring PX_SENS_LIST_SUBS_DISCOVERY := "sens/v1/subscriptions/sensor_discovery"; modulepar charstring PX_SENS_LIST_SUBS_STATUS := "sens/v1/subscriptions/sensor_status"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 6a66ec3..d84f7d6 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -188,6 +188,13 @@ module LibHttp_JsonMessageBodyTypes { SensorDiscoveryInfos sensor_discovery_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.1 Type: SensorDiscoveryInfo SensorDiscoveryInfo sensor_discovery_info, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.1 Type: SensorDiscoveryInfo SensorsSharingService_TypesAndValues.SubscriptionLinkList subscription_link_list_sss, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.4 Type: SubscriptionLinkList + SensorDiscoveryEventSubscription sensor_discovery_event_subscription, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.1 Type: SensorDiscoveryEventSubscription + SensorStatusSubscription sensor_status_subscription, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.2 Type: SensorStatusSubscription + SensorDataSubscription sensor_data_subscription, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.3 Type: SensorDataSubscription + SensorDatas sensor_datas, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.3 Type: SensorData + SensorData sensor_data, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.3 Type: SensorData + SensorCharacteristics sensor_characteristics, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.5.4 Type: SensorCharacteristic + SensorCharacteristicInfos sensor_characteristic_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause // TODO Add here your custom variants universal charstring raw } with { diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index e7b9f44..9c37f11 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1796,6 +1796,90 @@ module LibHttp_JsonTemplates { subscription_link_list_sss := p_subscription_link_list } // End of template mw_body_json_subscription_link_list_sss + template (value) JsonBody m_body_json_sensor_discovery_event_subscription( + in template (value) SensorDiscoveryEventSubscription p_sensor_discovery_event_subscription + ) := { + sensor_discovery_event_subscription := p_sensor_discovery_event_subscription + } // End of template m_body_json_sensor_discovery_event_subscription + + template (present) JsonBody mw_body_json_sensor_discovery_event_subscription( + template (present) SensorDiscoveryEventSubscription p_sensor_discovery_event_subscription := ? + ) := { + sensor_discovery_event_subscription := p_sensor_discovery_event_subscription + } // End of template mw_body_json_sensor_discovery_event_subscription + + template (value) JsonBody m_body_json_sensor_status_subscription( + in template (value) SensorStatusSubscription p_sensor_status_subscription + ) := { + sensor_status_subscription := p_sensor_status_subscription + } // End of template m_body_json_sensor_status_subscription + + template (present) JsonBody mw_body_json_sensor_status_subscription( + template (present) SensorStatusSubscription p_sensor_status_subscription := ? + ) := { + sensor_status_subscription := p_sensor_status_subscription + } // End of template mw_body_json_sensor_status_subscription + + template (value) JsonBody m_body_json_sensor_data_subscription( + in template (value) SensorDataSubscription p_sensor_data_subscription + ) := { + sensor_data_subscription := p_sensor_data_subscription + } // End of template m_body_json_sensor_data_subscription + + template (present) JsonBody mw_body_json_sensor_data_subscription( + template (present) SensorDataSubscription p_sensor_data_subscription := ? + ) := { + sensor_data_subscription := p_sensor_data_subscription + } // End of template mw_body_json_sensor_data_subscription + + template (value) JsonBody m_body_json_sensor_datas( + in template (value) SensorDatas p_sensor_datas + ) := { + sensor_datas := p_sensor_datas + } // End of template m_body_json_sensor_datas + + template (present) JsonBody mw_body_json_sensor_datas( + template (present) SensorDatas p_sensor_datas := ? + ) := { + sensor_datas := p_sensor_datas + } // End of template mw_body_json_sensor_datas + + template (value) JsonBody m_body_json_sensor_data( + in template (value) SensorData p_sensor_data + ) := { + sensor_data := p_sensor_data + } // End of template m_body_json_sensor_data + + template (present) JsonBody mw_body_json_sensor_data( + template (present) SensorData p_sensor_data := ? + ) := { + sensor_data := p_sensor_data + } // End of template mw_body_json_sensor_data + + template (value) JsonBody m_body_json_sensor_characteristics( + in template (value) SensorCharacteristics p_sensor_characteristics + ) := { + sensor_characteristics := p_sensor_characteristics + } // End of template m_body_json_sensor_characteristics + + template (present) JsonBody mw_body_json_sensor_characteristics( + template (present) SensorCharacteristics p_sensor_characteristics := ? + ) := { + sensor_characteristics := p_sensor_characteristics + } // End of template mw_body_json_sensor_characteristics + + template (value) JsonBody m_body_json_sensor_characteristic_infos( + in template (value) SensorCharacteristicInfos p_sensor_characteristic_infos + ) := { + sensor_characteristic_infos := p_sensor_characteristic_infos + } // End of template m_body_json_sensor_characteristic_infos + + template (present) JsonBody mw_body_json_sensor_characteristic_infos( + template (present) SensorCharacteristicInfos p_sensor_characteristic_infos := ? + ) := { + sensor_characteristic_infos := p_sensor_characteristic_infos + } // End of template mw_body_json_sensor_characteristic_infos + } // End of group sens } // End of module LibHttp_JsonTemplates -- GitLab From 3883c28346a576c2c098775ada9c3248b8cf6eb4 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Thu, 13 Feb 2025 12:38:07 +0500 Subject: [PATCH 16/54] update MEC015 testcases as per version v3.1.1 --- ccsrc/Protocols/Json/json_codec.cc | 13 + ..._BandwidthChangeEventSubAPI_TestCases.ttcn | 1031 +++++++++++++++++ ...sMec_TrafficManagementAPI_TestControl.ttcn | 17 + ttcn/AtsMec_TrafficManagement/module.mk | 1 + .../ttcn/TrafficManagementAPI_Functions.ttcn | 86 ++ .../ttcn/TrafficManagementAPI_Pics.ttcn | 5 + .../ttcn/TrafficManagementAPI_Pixits.ttcn | 10 + .../ttcn/TrafficManagementAPI_Templates.ttcn | 69 ++ .../TrafficManagementAPI_TypesAndValues.ttcn | 85 ++ ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 2 + .../ttcn/LibHttp_JsonTemplates.ttcn | 18 + 12 files changed, 1339 insertions(+) create mode 100644 ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index 012788d..956701e 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -32,6 +32,10 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo(); bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ATL_bwchgeventsubscription)) { + const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription& bw_chg_event_subscription = msg.bwInfo(); + bw_info.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) { const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); @@ -153,6 +157,15 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.bwInfo() = bw_info; } + } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList + TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList() = subscription_link_list; + } else if ((it->second.find("\"bwchgeventsubscription\"") != std::string::npos) { + TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwchgeventsubscription() = bw_chg_event_subscription; } else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) { TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn new file mode 100644 index 0000000..3832ba4 --- /dev/null +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn @@ -0,0 +1,1031 @@ +/** + * @author ETSI / STF569 + * @version $URL:$ + * $ID:$ + * @desc This module provides the MEC test cases. + * @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 GS MEC 015, Draft ETSI GS MEC 015 V3.1.1 (2024-04) + */ +module AtsMec_BandwidthChangeEventSubAPI_TestCases { + + // JSON + import from Json all; + + // Libcommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/TrafficManagementAPI + import from TrafficManagementAPI_TypesAndValues all; + import from TrafficManagementAPI_Templates all; + import from TrafficManagementAPI_Functions all; + import from TrafficManagementAPI_Pics all; + import from TrafficManagementAPI_Pixits all; + + // LibMec + import from LibMec_Templates all; + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + + group BWSUBLOOKUP{ + + /** + * @desc Check that the IUT responds with a list of BWM change event susbsciption when queried by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_bw_subscription_link_list( + mw_subscription_link_list( + { href := pattern "http?+" & PICS_ROOT_API & PX_ME_BWM_SUB_URI }, + superset( + mw_subscription( + v_bw_chg_event_subscription.links.self_.href, + "BwChgEventSubscription" + ) + ))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_BR() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/?subscriptionType=UnknownType", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK + + /** + * @desc Check that the IUT responds with an error when no subscription are created + */ + testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_NF() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK + + /** + * @desc Check that the IUT responds with a list of subscriptions for notifications on services availability when queried by a MEC Application - Filter on subscription_type + */ + testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "?" & "subscription_type=bw_chg", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_bw_subscription_link_list( + mw_subscription_link_list( + { href := pattern "http?+" & PICS_ROOT_API & PX_ME_BWM_SUB_URI }, + superset( + mw_subscription( + v_bw_chg_event_subscription.links.self_.href, + "BwChgEventSubscription" + ) + ))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_002_OK + + /** + * @desc Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscription_type + */ + testcase TP_MEC_MEC015_SRV_BWSUBLOOKUP_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "?subscription_type=" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_TYPE, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TP_MEC_MEC015_SRV_BWSUBLOOKUP_002_NF + + + /** + * @desc Check that the IUT responds with a individual BWM change event susbsciption when queried by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_bw_chg_event_subscription( + mw_bw_chg_event_subscription( + v_bw_chg_event_subscription.subscriptionType, + v_bw_chg_event_subscription.callbackReference, + -, + mw_links( + v_bw_chg_event_subscription.links.self.href + ), + mw_filter_criteria( + v_bw_chg_event_subscription.filterCriteria.appInsId + ) + + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_OK + + /** + * @desc Check that the IUT responds with a individual BWM change event susbsciption when queried by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF + + } + + group BW_SUB { + + /** + * @desc Check that the IUT acknowledges the creation of BWM change event subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_BW_Subcription_type, + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_bw_chg_event_subscription( + mw_bw_chg_event_subscription( + PX_BW_Subcription_type, + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in BwChgEventSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_ME_BWM_SUB_URI & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSMeasureSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK + + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_01() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_UNKNOWN_SUBSCRIPTION_TYPE, + PX_BW_EVENT_SUB_CALLBACK_URI, + m_filter_Criteria + )))))); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + */ + + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_02() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_BW_Subcription_type, + -, + -, + -, + m_filter_criteria + )))))); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided + */ + + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_03() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_BW_Subcription_Type, + PX_BW_EVENT_SUB_CALLBACK_URI, + { websocketUri := PX_BW_SUB_WEB_SOCKET, requestWebsocketUri := omit }, + -, + m_filter_criteria + )))))); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_03 + + /** + * @desc Check that the IUT acknowledges the update of BWM change event subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_002_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_BW_Subcription_Type + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_bw_chg_event_subscription( + mw_bw_chg_event_subscription( + PX_BW_Subcription_Type + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + )))))) -> value v_response { + tc_ac.stop; + + + log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated BwSubscriptionNotification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_002_OK + + /** + * @desc Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_002_NF() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_BW_Subcription_Type + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + )))))); + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_002_OK + + /** + * @desc Check that the IUT acknowledges the cancellation of BWM change event subscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_003_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & v_subscription_id, + v_headers + ))); + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully cancels the BwChgEventSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_003_NF() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var BwChgEventSubscription v_bw_chg_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ))); + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with an error cancelling the BwChgEventSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_003_OK + + /** + * @desc Check that the MEC application receives and processes the BWM information event notification sent by the BWM service + */ + testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_004_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + + // Preamble + f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_response( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_bw_chg_event_subscription( + mw_bw_chg_event_subscription( + PX_BW_Subcription_type, + PX_BW_EVENT_SUB_CALLBACK_URI + )))))) -> value v_response { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_bw_chg_event_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_004_OK + + } + +} \ No newline at end of file diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestControl.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestControl.ttcn index 842fd6f..260f4ce 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestControl.ttcn @@ -41,6 +41,23 @@ module AtsMec_TrafficManagementAPI_TestControl { execute(TC_MEC_MEC015_SRV_TM_006_OK()); execute(TC_MEC_MEC015_SRV_TM_006_NF()); } + + if (PICS_MEC_PLAT and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED) { + execute(TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK()); + execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_BR()); + execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_NF()); + execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_002_OK()); + execute(TP_MEC_MEC015_SRV_BWSUBLOOKUP_002_NF()); + execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_OK()); + execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF()); + + execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK()); + execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_01()); + execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_02()); + execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_03()); + execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_002_OK()); + } + if (PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED) { execute(TC_MEC_MEC015_SRV_MTS_001_OK()); diff --git a/ttcn/AtsMec_TrafficManagement/module.mk b/ttcn/AtsMec_TrafficManagement/module.mk index b24f6e6..e4c759d 100644 --- a/ttcn/AtsMec_TrafficManagement/module.mk +++ b/ttcn/AtsMec_TrafficManagement/module.mk @@ -2,6 +2,7 @@ suite := AtsMec_TrafficManagement sources := \ AtsMec_TrafficManagementAPI_TestCases.ttcn \ + AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn \ AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn \ AtsMec_TrafficManagementAPI_TestControl diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index c678558..9120a93 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -106,6 +106,92 @@ module TrafficManagementAPI_Functions { } // End of 'alt' statement } // End of function f_delete_bw_allocation_resource + function f_create_bw_chg_event_subscription( + out BwChgEventSubscription p_bw_chg_event_subscription, + out charstring p_subscription_id + ) runs on HttpComponent { + + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_SUB_URI, + v_headers, + m_http_message_body_json( + m_body_json_bw_chg_event_subscription( + m_bw_chg_event_subscription( + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_bw_chg_event_subscription( + mw_bw_chg_event_subscription( + PX_BW_Subcription_type, + PX_BW_EVENT_SUB_CALLBACK_URI, + -, + -, + m_filter_criteria + )))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_ME_BWM_SUB_URI & "/(?*)", + 0 + ); + p_bw_chg_event_subscription := v_response.response.body.json_body.m_bw_chg_event_subscription; + log("f_create_bw_chg_event_subscription: INFO: IUT successfully responds to the subscription: ", p_bw_chg_event_subscription); + log("f_create_bw_chg_event_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_qos_measure_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_bw_chg_event_subscription + + function f_delete_bw_chg_event_subscription( + in charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & p_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("f_delete_qos_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_delete_qos_subscription + function f_create_mts_session_info_resource( in Json.String p_app_instance_id, out charstring p_mts_session_id, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pics.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pics.ttcn index 7250495..db215a1 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pics.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pics.ttcn @@ -5,6 +5,11 @@ module TrafficManagementAPI_Pics { */ modulepar boolean PICS_BWMANAGEMENT_API_SUPPORTED := true; + /** + * @desc Does the IUT support TrafficManagementAPI? + */ + modulepar boolean PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED := true; + /** * @desc Does the IUT support Multi-access Traffic Steering API? */ diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn index 02851fd..3abc8a6 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn @@ -29,4 +29,14 @@ module TrafficManagementAPI_Pixits { modulepar ResourceURL PX_RESOURCE_URL := "http://example.com/exampleAPI/location/v2/users?address:acr:192.0.0.1"; + modulepar Json.String PX_BW_Subcription_Type := "BwChgEventSubscription"; + + modulepar Json.String PX_BW_EVENT_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + + modulepar Json.AnyURI PX_BW_SUB_WEB_SOCKET := "ws://clientApp.example.com/location_notifications/123456"; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "UnknownSubId"; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_TYPE := "UnknownSubType"; + } // End of module TrafficManagementAPI_Pixits diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn index 7eb39f0..dec7fe0 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn @@ -119,6 +119,75 @@ module TrafficManagementAPI_Templates { protocol := p_protocol } // End of template mw_session_filter + template (omit) BwChgEventSubscription m_bw_chg_event_subscription( + in template (omit) Json.String p_subscription_type := ?, + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) Links p_links := omit, + in template (value) FlowFilter p_flowfilter := ? + ) := { + subscriptionType := p_subscription_type, + callbackReference := p_callbackReference, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + filterCriteria := p_flowfilter + } + + template (omit) FilterCriteria m_filter_criteria( + in AppInsId p_appInsId := PX_APP_INSTANCE_ID, + in template (omit) Json.String p_ueIp := omit + ) := { + appInsId := p_appInsId, + ueIp := p_ueIp + } // End of template m_flowfilterW + + template (present) BwChgEventSubscription mw_bw_chg_event_subscription( + template (present) Json.String p_subscriptionType := ? + template (present) Json.AnyURI p_callbackReference := ?, + template WebsockNotifConfig p_websockNotifConfig := *, + template Links p_links := *, + template (present) FlowFilter p_flowfilter := ? + ) := { + subscriptionType := p_subscriptionType, + callbackReference := p_callbackReference, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + filterCriteria := p_flowfilter + } + + + template (present) SubscriptionLinkList mw_subscription_link_list( + template (present) Links p_links := ?, + template Subscriptions p_subscription := * + ) := { + links := p_links, + subscription := p_subscription + } // End of template mw_subscription_link_list + + template (present) Links mw_links( + template (value) LinkType p_self + ) :={ + self := p_self + } // End of template m_links + + template (present) Subscription mw_subscription( + template (present) Json.AnyURI p_href := ?, + template (present) Json.String p_subscriptionType := ? + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template mw_subscription + + + + template (present) FilterCriteria mw_filter_criteria( + template Json.String p_appInsId := *, + template Json.String p_ueIp := * + ) := { + appInsId := p_appInsId, + ueIp := p_ueIp + } // End of template m_flowfilterW + template (omit) MtsCapabilityInfo m_mts_capability_info( in template (value) MtsAccessInfos p_mtsAccessInfo, in template (value) MtsModes p_mtsMode, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 5225ad5..43af634 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -175,6 +175,91 @@ module TrafficManagementAPI_TypesAndValues { */ type Json.String Protocol; + /** + * @desc This type represents a subscription to the notifications from BWM service about the bandwidth utility or data volume dispersion information. + * @param subscriptionType Shall be set to "BwChgEventSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param FilterCriteria List of filtering criteria for the BW change event subscription. + * @see ETSI GS MEC 015 V3.1.1 (2024-03) Table 7.3.2: Definition of type BwChgEventSubscription + */ + type record BwChgEventSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + FilterCriteria filterCriteria optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents configuration for the delivery of subscription notifications over Websockets + * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications + * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.5.3 Type: WebsockNotifConfig + */ + type record WebsockNotifConfig { + Json.AnyURI websocketUri optional, + Json.Bool requestWebsocketUri optional + } + + /** + * @desc Filtering criteria for the BW change event subscription + * @param appInsId Application instance identifier + * @param ueIp Source address identity of session + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Table 7.3.2: Attributes of the BwChgEventSubscription + */ + type record FilterCriteria { + Json.String appInsId optional, + Json.String ueIp optional + } + + /** + * @desc List of links related to currently existing subscriptions for the service consumer + * @member links List of hyperlinks related to the resource + * @member subscription + * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList + */ + type record SubscriptionLinkList { + Links links optional, // URI of this resource + Subscription subscriptions optional // List of subscriptions + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc Hyperlink related to the resource + * @see ETSI GS MEC 015 V3.1.1 (2024-03) Table 7.3.2: Attributes of the BwChgEventSubscription + */ + type record Links { + LinkType self_ + } with { + variant (self_) "name as 'self'"; + } + + /** + * @desc Type of link + * @member href URI referring to a resource + * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.5.3 Type: LinkType + */ + type record LinkType { + Json.AnyURI href + } + + /** + * @desc Attributes of SubscriptionLinkList. + * @field href The URI referring to the subscription (mandatory). + * @field subscriptionType Type of the subscription. + * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList + */ + type record Subscription { + Json.AnyURI href // The URI referring to the subscription + Json.String subscriptionType // Type of the subscription + } + type set of Subscription Subscriptions + /** * @desc The information on access network connection * @member timeStamp Time stamp to indicate when the corresponding information elements are sent diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index fee2d65..22d08f6 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -23,6 +23,8 @@ module LibMec_Pixits { modulepar charstring PX_RNIS_QUERIES_URI := "rni/v2/queries"; modulepar charstring PX_ME_BWM_URI := "bwm/v1/bw_allocations"; + + modulepar charstring PX_ME_BWM_SUB_URI := "bwm/v1/subscriptions"; modulepar charstring PX_ME_MTS_INFO_URI := "mts/v1/mts_capability_info"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 332f676..5bc237c 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -77,6 +77,8 @@ module LibHttp_JsonMessageBodyTypes { BwInfoList bwInfoList, BwInfo bwInfo, BwInfoDeltas bwInfoDeltas, + BwChgEventSubscription bwchgeventsubscription, + TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw MtsCapabilityInfo mtsCapabilityInfo, MtsSessionInfo mtsSessionInfo, MtsSessionInfos mtsSessionInfos, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index fabd6e5..d769c6d 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -916,6 +916,24 @@ module LibHttp_JsonTemplates { bwInfoList := p_bwInfoList } // End of template mw_body_json_bw_info_list + template (value) JsonBody m_body_json_bw_chg_event_subscription( + in template (value) BwChgEventSubscription p_bwchgeventsubscription + ) := { + bwchgeventsubscription := p_bwchgeventsubscription + } // End + + template (present) JsonBody mw_body_json_bw_chg_event_subscription( + template (present) BwChgEventSubscription p_bwchgeventsubscription := ? + ) := { + bwchgeventsubscription := p_bwchgeventsubscription + } // End + + template (present) JsonBody mw_body_json_bw_chg_event_subscription( + template (present) TrafficManagementAPI_TypesAndValues.SubscriptionLinkList p_subscriptionlinklist := ? + ) := { + subscriptionLinkList := p_subscriptionlinklist + } // End + template (value) JsonBody m_body_json_mts_capability_info( in template (value) MtsCapabilityInfo p_mtsCapabilityInfo ) := { -- GitLab From 2ebde6af449c6f263e2d2742c8be4353a81ce455 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Thu, 13 Feb 2025 13:51:19 +0500 Subject: [PATCH 17/54] fix minor issue in MEC015 Bandwidth Event Subscription --- .../ttcn/TrafficManagementAPI_TypesAndValues.ttcn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 43af634..8a80c5b 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -211,10 +211,11 @@ module TrafficManagementAPI_TypesAndValues { * @param ueIp Source address identity of session * @see ETSI GS MEC 015 V3.1.1 (2024-04) Table 7.3.2: Attributes of the BwChgEventSubscription */ - type record FilterCriteria { + type record FilterCriteria_ { Json.String appInsId optional, Json.String ueIp optional } + type set of FilterCriteria_ FilterCriteria /** * @desc List of links related to currently existing subscriptions for the service consumer -- GitLab From b530d2d61fb3e622cf9a9427323a42c30cb4516d Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 19 Feb 2025 11:04:21 +0100 Subject: [PATCH 18/54] Bug fixed in AtsMec_QoSMeasurementAPI --- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 17 +-- ttcn/AtsMec_QoSMeasurement/module.mk | 1 + .../ttcn/QoSMeasurementAPI_Functions.ttcn | 4 +- .../ttcn/QoSMeasurementAPI_Templates.ttcn | 132 +++++++++--------- ttcn/patch_lib_http/module.mk | 1 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 8 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 72 ++++++++++ 7 files changed, 158 insertions(+), 77 deletions(-) diff --git a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn index 534de42..25d8d8f 100644 --- a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -2828,11 +2828,9 @@ module AtsMec_QoSMeasurementAPI_TestCases { -, -, mw_http_message_body_json( - mw_body_json_qos_event_subscription( - mw_qos_event_subscription( - PX_QOS_EVENT_SUB_CALLBACK_URI, - PX_MEASURING_PERIOD, - mw_links + mw_body_json_qos_measure_notification( + mw_qos_measure_notification( + mw_links )))))) { tc_wait.stop; @@ -2857,7 +2855,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_01 /** - * @desc Check that the IUT provides a test notification when requested by a MEC Application + * @desc Check that the IUT provides a notification when requested by a MEC Application */ testcase TC_MEC_MEC045_SRV_QOS_EVENT_SUB_NOT_004_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2890,8 +2888,11 @@ module AtsMec_QoSMeasurementAPI_TestCases { -, -, mw_http_message_body_json( - mw_body_json_qos_test_notification - )))) { + mw_body_json_qos_event_notification( + mw_qos_event_notification( + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id} + ))))))) { tc_wait.stop; f_init_default_headers_list(-, -, v_headers); diff --git a/ttcn/AtsMec_QoSMeasurement/module.mk b/ttcn/AtsMec_QoSMeasurement/module.mk index f5c3d0f..aa46c15 100644 --- a/ttcn/AtsMec_QoSMeasurement/module.mk +++ b/ttcn/AtsMec_QoSMeasurement/module.mk @@ -25,6 +25,7 @@ modules := ../LibCommon \ ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn index b19cae8..6552b50 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Functions.ttcn @@ -172,8 +172,8 @@ module QoSMeasurementAPI_Functions { } // End of function f_create_qos_event_subscription function f_delete_qos_subscription( - in charstring p_subscription_id - ) runs on HttpComponent { + in charstring p_subscription_id + ) runs on HttpComponent { var Headers v_headers; f_init_default_headers_list(-, -, v_headers); diff --git a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn index f2da8f9..6de18bf 100644 --- a/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn +++ b/ttcn/LibMec/QoSMeasurementAPI/ttcn/QoSMeasurementAPI_Templates.ttcn @@ -54,7 +54,7 @@ module QoSMeasurementAPI_Templates { measuringTime := p_measuringTime, metricType := p_metricType, expiryDeadline := p_expiryDeadline - } // End of template m_qo_s_measure_subscription + } // End of template m_qos_measure_subscription template (omit) QoSMeasureSubscription m_qos_measure_subscription_wrong( in MetricTypes p_metricType, @@ -340,43 +340,43 @@ module QoSMeasurementAPI_Templates { links := p_links } // End of template mw_test_notification - template (omit) QoSMeasureNotification m_qo_s_measure_notification( - in template (value) Links p_links, - in template (omit) SubscriptionState p_subscriptionState := omit, - in template (omit) QoSMeasureResults p_qoSMeasureResult := omit, - in template (omit) TimeStamp p_timeStamp := omit - ) := { + template (omit) QoSMeasureNotification m_qos_measure_notification( + in template (value) Links p_links, + in template (omit) SubscriptionState p_subscriptionState := omit, + in template (omit) QoSMeasureResults p_qoSMeasureResult := omit, + in template (omit) TimeStamp p_timeStamp := omit + ) := { notificationType := "QoSMeasureNotification", timeStamp := p_timeStamp, subscriptionState := p_subscriptionState, qoSMeasureResult := p_qoSMeasureResult, links := p_links - } // End of template m_qo_s_measure_notification - - template (present) QoSMeasureNotification mw_qo_s_measure_notification( - template (present) Links p_links := ?, - template SubscriptionState p_subscriptionState := *, - template QoSMeasureResults p_qoSMeasureResult := *, - template TimeStamp p_timeStamp := * - ) := { + } // End of template m_qos_measure_notification + + template (present) QoSMeasureNotification mw_qos_measure_notification( + template (present) Links p_links := ?, + template SubscriptionState p_subscriptionState := *, + template QoSMeasureResults p_qoSMeasureResult := *, + template TimeStamp p_timeStamp := * + ) := { notificationType := "QoSMeasureNotification", timeStamp := p_timeStamp, subscriptionState := p_subscriptionState, qoSMeasureResult := p_qoSMeasureResult, links := p_links - } // End of template mw_qo_s_measure_notification - - template (omit) QoSMeasureResult m_qo_s_measure_result( - in template (value) FlowFilter p_flow, - in template (omit) Json.AnyURI p_user := omit, - in template (omit) MeasuringArea p_measuringArea := omit, - in template (omit) MeasuringTime p_measuringTime := omit, - in template (omit) Json.UInteger p_latency := omit, - in template (omit) Json.UInteger p_jitter := omit, - in template (omit) Json.UInteger p_throughput := omit, - in template (omit) Json.UInteger p_loss_rate := omit, - in template (omit) Json.UInteger p_error_rate := omit - ) := { + } // End of template mw_qos_measure_notification + + template (omit) QoSMeasureResult m_qos_measure_result( + in template (value) FlowFilter p_flow, + in template (omit) Json.AnyURI p_user := omit, + in template (omit) MeasuringArea p_measuringArea := omit, + in template (omit) MeasuringTime p_measuringTime := omit, + in template (omit) Json.UInteger p_latency := omit, + in template (omit) Json.UInteger p_jitter := omit, + in template (omit) Json.UInteger p_throughput := omit, + in template (omit) Json.UInteger p_loss_rate := omit, + in template (omit) Json.UInteger p_error_rate := omit + ) := { user := p_user, flow := p_flow, measuringArea := p_measuringArea, @@ -386,19 +386,19 @@ module QoSMeasurementAPI_Templates { throughput := p_throughput, loss_rate := p_loss_rate, error_rate := p_error_rate - } // End of template m_qo_s_measure_result - - template (present) QoSMeasureResult mw_qo_s_measure_result( - template (present) FlowFilter p_flow := ?, - template Json.AnyURI p_user := *, - template MeasuringArea p_measuringArea := *, - template MeasuringTime p_measuringTime := *, - template Json.UInteger p_latency := *, - template Json.UInteger p_jitter := *, - template Json.UInteger p_throughput := *, - template Json.UInteger p_loss_rate := *, - template Json.UInteger p_error_rate := * - ) := { + } // End of template m_qos_measure_result + + template (present) QoSMeasureResult mw_qos_measure_result( + template (present) FlowFilter p_flow := ?, + template Json.AnyURI p_user := *, + template MeasuringArea p_measuringArea := *, + template MeasuringTime p_measuringTime := *, + template Json.UInteger p_latency := *, + template Json.UInteger p_jitter := *, + template Json.UInteger p_throughput := *, + template Json.UInteger p_loss_rate := *, + template Json.UInteger p_error_rate := * + ) := { user := p_user, flow := p_flow, measuringArea := p_measuringArea, @@ -408,18 +408,18 @@ module QoSMeasurementAPI_Templates { throughput := p_throughput, loss_rate := p_loss_rate, error_rate := p_error_rate - } // End of template mw_qo_s_measure_result - - template (omit) QoSEventNotification m_qo_s_event_notification( - in template (value) Links p_links, - in template (value) FlowFilters p_flow, - in template (value) MetricType p_metricType, - in template (value) QoSEvent p_qosEvent, - in template (omit) SubscriptionState p_subscriptionState := omit, - in template (omit) Json.AnyURI p_user := omit, - in template (omit) MeasuringArea p_measuringArea := omit, - in template (omit) TimeStamp p_timeStamp := omit - ) := { + } // End of template mw_qos_measure_result + + template (omit) QoSEventNotification m_qos_event_notification( + in template (value) Links p_links, + in template (value) FlowFilters p_flow, + in template (value) MetricType p_metricType, + in template (value) QoSEvent p_qosEvent, + in template (omit) SubscriptionState p_subscriptionState := omit, + in template (omit) Json.AnyURI p_user := omit, + in template (omit) MeasuringArea p_measuringArea := omit, + in template (omit) TimeStamp p_timeStamp := omit + ) := { notificationType := "QoSEventNotification", timeStamp := p_timeStamp, subscriptionState := p_subscriptionState, @@ -429,18 +429,18 @@ module QoSMeasurementAPI_Templates { qosEvent := p_qosEvent, measuringArea := p_measuringArea, links := p_links - } // End of template m_qo_s_event_notification - - template (present) QoSEventNotification mw_qo_s_event_notification( - template (present) Links p_links := ?, - template (present) FlowFilters p_flow := ?, - template (present) MetricType p_metricType := ?, - template (present) QoSEvent p_qosEvent := ?, - template SubscriptionState p_subscriptionState := *, - template Json.AnyURI p_user := *, - template MeasuringArea p_measuringArea := *, - template TimeStamp p_timeStamp := * - ) := { + } // End of template m_qos_event_notification + + template (present) QoSEventNotification mw_qos_event_notification( + template (present) Links p_links := ?, + template (present) FlowFilters p_flow := ?, + template (present) MetricType p_metricType := ?, + template (present) QoSEvent p_qosEvent := ?, + template SubscriptionState p_subscriptionState := *, + template Json.AnyURI p_user := *, + template MeasuringArea p_measuringArea := *, + template TimeStamp p_timeStamp := * + ) := { notificationType := "QoSEventNotification", timeStamp := p_timeStamp, subscriptionState := p_subscriptionState, @@ -450,7 +450,7 @@ module QoSMeasurementAPI_Templates { qosEvent := p_qosEvent, measuringArea := p_measuringArea, links := p_links - } // End of template mw_qo_s_event_notification + } // End of template mw_qos_event_notification template (value) Point m_point( in Json.Number p_latitude, diff --git a/ttcn/patch_lib_http/module.mk b/ttcn/patch_lib_http/module.mk index 77b6b4c..f1b043f 100644 --- a/ttcn/patch_lib_http/module.mk +++ b/ttcn/patch_lib_http/module.mk @@ -1,3 +1,4 @@ sources := \ ttcn/LibHttp_JsonMessageBodyTypes.ttcn \ ttcn/LibHttp_JsonTemplates.ttcn \ + diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index d84f7d6..146d6ef 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -184,6 +184,8 @@ module LibHttp_JsonMessageBodyTypes { QoSMeasurementAPI_TypesAndValues.NotificationSubscriptionList notification_subscription_list, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.1 Type: NotificationSubscriptionList QoSMeasureSubscription qos_measure_subscription, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.2 Type: QoSMeasureSubscription QoSEventSubscription qos_event_subscription, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.3.3 Type: QoSEventSubscription + QoSMeasureNotification qos_measure_notification, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.4.2 Type: QoSMeasureNotification + QoSEventNotification qos_event_notification, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.4.3 Type: QoSEventNotification QoSMeasurementAPI_TypesAndValues.TestNotification qos_test_notification, // ETSI GS MEC 045 V3.1.1 (2024-03) Clause 6.4.1 Type: TestNotification SensorDiscoveryInfos sensor_discovery_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.1 Type: SensorDiscoveryInfo SensorDiscoveryInfo sensor_discovery_info, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.1 Type: SensorDiscoveryInfo @@ -191,10 +193,14 @@ module LibHttp_JsonMessageBodyTypes { SensorDiscoveryEventSubscription sensor_discovery_event_subscription, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.1 Type: SensorDiscoveryEventSubscription SensorStatusSubscription sensor_status_subscription, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.2 Type: SensorStatusSubscription SensorDataSubscription sensor_data_subscription, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.3.3 Type: SensorDataSubscription + SensorDiscoveryEventNotification sensor_discovery_event_notification, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.4.1 Type: SensorDiscoveryEventNotification + SensorStatusNotification sensor_status_notification, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.4.2 Type: SensorStatusNotification + SensorDataNotification sensor_data_notification, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.4.3 Type: SensorDataNotification SensorDatas sensor_datas, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.3 Type: SensorData SensorData sensor_data, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.2.3 Type: SensorData SensorCharacteristics sensor_characteristics, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.5.4 Type: SensorCharacteristic - SensorCharacteristicInfos sensor_characteristic_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause + SensorCharacteristicInfos sensor_characteristic_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.5.4 Type: SensorCharacteristic + SensorsSharingService_TypesAndValues.TestNotification sens_test_notification, // TODO Add here your custom variants universal charstring raw } with { diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 9c37f11..e95d0df 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1756,6 +1756,30 @@ module LibHttp_JsonTemplates { qos_event_subscription := p_qos_event_subscription } // End of template mw_body_json_qos_event_subscription + template (value) JsonBody m_body_json_qos_measure_notification( + in template (value) QoSMeasureNotification p_qos_measure_notification + ) := { + qos_measure_notification := p_qos_measure_notification + } // End of template m_body_json_qos_measure_notification + + template (present) JsonBody mw_body_json_qos_measure_notification( + template (present) QoSMeasureNotification p_qos_measure_notification := ? + ) := { + qos_measure_notification := p_qos_measure_notification + } // End of template mw_body_json_qos_measure_notification + + template (value) JsonBody m_body_json_qos_event_notification( + in template (value) QoSEventNotification p_qos_event_notification + ) := { + qos_event_notification := p_qos_event_notification + } // End of template m_body_json_qos_event_notification + + template (present) JsonBody mw_body_json_qos_event_notification( + template (present) QoSEventNotification p_qos_event_notification := ? + ) := { + qos_event_notification := p_qos_event_notification + } // End of template mw_body_json_qos_event_notification + template (value) JsonBody m_body_json_qos_test_notification( in template (value) QoSMeasurementAPI_TypesAndValues.TestNotification p_test_notification ) := { @@ -1832,6 +1856,42 @@ module LibHttp_JsonTemplates { sensor_data_subscription := p_sensor_data_subscription } // End of template mw_body_json_sensor_data_subscription + template (value) JsonBody m_body_json_sensor_discovery_event_notification( + in template (value) SensorDiscoveryEventNotification p_sensor_discovery_event_notification + ) := { + sensor_discovery_event_notification := p_sensor_discovery_event_notification + } // End of template m_body_json_sensor_discovery_event_notification + + template (present) JsonBody mw_body_json_sensor_discovery_event_notification( + template (present) SensorDiscoveryEventNotification p_sensor_discovery_event_notification := ? + ) := { + sensor_discovery_event_notification := p_sensor_discovery_event_notification + } // End of template mw_body_json_sensor_discovery_event_notification + + template (value) JsonBody m_body_json_sensor_status_notification( + in template (value) SensorStatusNotification p_sensor_status_notification + ) := { + sensor_status_notification := p_sensor_status_notification + } // End of template m_body_json_sensor_status_notification + + template (present) JsonBody mw_body_json_sensor_status_notification( + template (present) SensorStatusNotification p_sensor_status_notification := ? + ) := { + sensor_status_notification := p_sensor_status_notification + } // End of template mw_body_json_sensor_status_notification + + template (value) JsonBody m_body_json_sensor_data_notification( + in template (value) SensorDataNotification p_sensor_data_notification + ) := { + sensor_data_notification := p_sensor_data_notification + } // End of template m_body_json_sensor_data_notification + + template (present) JsonBody mw_body_json_sensor_data_notification( + template (present) SensorDataNotification p_sensor_data_notification := ? + ) := { + sensor_data_notification := p_sensor_data_notification + } // End of template mw_body_json_sensor_data_notification + template (value) JsonBody m_body_json_sensor_datas( in template (value) SensorDatas p_sensor_datas ) := { @@ -1880,6 +1940,18 @@ module LibHttp_JsonTemplates { sensor_characteristic_infos := p_sensor_characteristic_infos } // End of template mw_body_json_sensor_characteristic_infos + template (value) JsonBody m_body_json_sens_test_notification( + in template (value) SensorsSharingService_TypesAndValues.TestNotification p_test_notification + ) := { + sens_test_notification := p_test_notification + } // End of template m_body_json_sens_test_notification + + template (present) JsonBody mw_body_json_sens_test_notification( + template (present) SensorsSharingService_TypesAndValues.TestNotification p_test_notification := ? + ) := { + sens_test_notification := p_test_notification + } // End of template mw_body_json_sens_test_notification + } // End of group sens } // End of module LibHttp_JsonTemplates -- GitLab From 4576649c097d8f39cfdd38eff33dc716cc8e8d34 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 19 Feb 2025 16:24:48 +0100 Subject: [PATCH 19/54] Implement TPs for Subscription/Notification --- .../AtsMec_QoSMeasurementAPI.cf_ | 2 +- .../AtsMec_SensorsSharingService.cf_ | 73 +- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 2 +- ...tsMec_SensorsSharingService_TestCases.ttcn | 1843 ++++++++++++++++- ...Mec_SensorsSharingService_TestControl.ttcn | 38 + .../ttcn/SensorsSharingService_Functions.ttcn | 271 ++- .../ttcn/SensorsSharingService_Pixits.ttcn | 4 +- .../ttcn/SensorsSharingService_Templates.ttcn | 64 +- 8 files changed, 2271 insertions(+), 26 deletions(-) diff --git a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ index 00fdce7..0f9e309 100644 --- a/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ +++ b/etc/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI.cf_ @@ -102,7 +102,7 @@ AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOSLOOKUP_001_OK #AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08 # Check that the IUT acknowledges the changes of an existing QoS measurement subscription request when commanded by a MEC Application #AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK -# Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application #AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF # Check that the IUT acknowledges the cancellation of QoS measurement subscription when commanded by a MEC Application #AtsMec_QoSMeasurementAPI_TestCases.TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ index 98f7023..9c9c6e2 100644 --- a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ @@ -119,19 +119,66 @@ AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_007_OK # Check that the IUT responds with an error when the a sensor does not have a characteristic #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_007_NF - - - - - - - - - - - - - +# Check that the IUT acknowledges the creation of SensorDiscoveryEventSubscription request when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_01 +# Check that the IUT provides a notification when requested by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_03 +# Check that the IUT acknowledges the creation of SensorDiscoveryEventSubscription request when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_NF +# Check that the IUT acknowledges the cancellation of a SensorDiscoveryEventSubscription when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_NF +# Check that the IUT acknowledges the creation of SensorStatusSubscription request when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_01 +# Check that the IUT provides a notification when requested by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference nor websockNotifConfig provided +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_03 +# Check that the IUT acknowledges the changes of an existing SensorStatusSubscription when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_NF +# Check that the IUT acknowledges the cancellation of an existing SensorStatusSubscription when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_NF +# Check that the IUT acknowledges the creation of SensorDataSubscription request when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK +# Check that the IUT provides a test notification when requested by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_01 +# Check that the IUT provides a notification when requested by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference nor websockNotifConfig provided +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_03 +# Check that the IUT acknowledges the changes of an existing SensorDataSubscription when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_NF +# Check that the IUT acknowledges the cancellation of an existing SensorDataSubscription when commanded by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_NF [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the diff --git a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn index 25d8d8f..56ef4ce 100644 --- a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -1444,7 +1444,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { } // End of testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK /** - * @desc Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 1f418a6..4afc871 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -522,7 +522,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & PX_UNKNOW_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -843,7 +843,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOW_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1553,4 +1553,1843 @@ module AtsMec_SensorsSharingService_TestCases { } // End of group sensor_lookup + group sensor_sub_not { + + /** + * @desc Check that the IUT acknowledges the creation of SensorDiscoveryEventSubscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + m_sensor_discovery_event_subscription( + PX_SENS_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_sensor_discovery_event_subscription( + mw_sensor_discovery_event_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_SENS_LIST_SUBS_DISCOVERY & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a sensorDiscoveryEventSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id, true); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_sens_test_notification( + mw_test_notification( + -, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_01 + + /** + * @desc Check that the IUT provides a notification when requested by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_sensor_discovery_event_notification( + mw_sensor_discovery_event_notification( + -, -, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + m_sensor_discovery_event_subscription_wrong( // Invalid subscriptionType + PX_SENS_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_01 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + m_sensor_discovery_event_subscription_wrong( + omit // Neither callbackReference nor websockNotifConfig provided + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + m_sensor_discovery_event_subscription( + PX_SENS_SUB_CALLBACK_URI, // Both callbackReference and websockNotifConfig provided + -, -, -, -, + m_websock_notif_config( + PX_SENS_SUB_WB_URI + ))))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_03 + + /** + * @desc Check that the IUT acknowledges the creation of SensorDiscoveryEventSubscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + v_sensor_discovery_event_subscription.sensorInfo := valueof({ m_sensor_info("4") }); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + v_sensor_discovery_event_subscription + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_discovery_event_subscription( + v_sensor_discovery_event_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates subscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + v_sensor_discovery_event_subscription.sensorInfo := valueof({ m_sensor_info("4") }); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + v_sensor_discovery_event_subscription + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates subscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_NF + + /** + * @desc Check that the IUT acknowledges the cancellation of a SensorDiscoveryEventSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully cancels subscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_NF + + /** + * @desc Check that the IUT acknowledges the creation of SensorStatusSubscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + m_sensor_status_subscription( + PX_SENS_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_sensor_status_subscription( + mw_sensor_status_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} + ))))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_SENS_LIST_SUBS_STATUS & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a sensorStatusSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id, true); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_sens_test_notification( + mw_test_notification( + -, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_01 + + /** + * @desc Check that the IUT provides a notification when requested by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_sensor_status_notification( + mw_sensor_status_notification( + -, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + m_sensor_status_subscription_wrong( // Invalid subscriptionType + PX_SENS_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_01 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + m_sensor_status_subscription( + omit // Neither callbackReference nor websockNotifConfig provided + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + m_sensor_status_subscription( + PX_SENS_SUB_CALLBACK_URI, // Both callbackReference and websockNotifConfig provided + -, -, -, + m_websock_notif_config( + PX_SENS_SUB_WB_URI + ))))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_03 + + /** + * @desc Check that the IUT acknowledges the changes of an existing SensorStatusSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryInfos v_sensor_discovery_infos; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_sensor_discovery(v_sensor_discovery_infos); + if (lengthof(v_sensor_discovery_infos) == 0) { + log("*** " & testcasename() & ": INCONC: No sensors discovered ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); + v_sensor_status_subscription.sensorIdentifierList := { v_sensor_discovery_infos[0].sensorType } + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + v_sensor_status_subscription + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_status_subscription( + v_sensor_status_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates with a sensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryInfos v_sensor_discovery_infos; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_sensor_discovery(v_sensor_discovery_infos); + if (lengthof(v_sensor_discovery_infos) == 0) { + log("*** " & testcasename() & ": INCONC: No sensors discovered ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); + v_sensor_status_subscription.sensorIdentifierList := { v_sensor_discovery_infos[0].sensorType } + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + v_sensor_status_subscription + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates with a sensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_NF + + /** + * @desc Check that the IUT acknowledges the cancellation of an existing SensorStatusSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully terminates a sensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_NF + + /** + * @desc Check that the IUT acknowledges the creation of SensorDataSubscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + m_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_sensor_data_subscription( + mw_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} + ))))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_SENS_LIST_SUBS_STATUS & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a sensorStatusSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK + + /** + * @desc Check that the IUT provides a test notification when requested by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_data_subscription(v_sensor_data_subscription, v_subscription_id, true); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_sens_test_notification( + mw_test_notification( + -, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_01 + + /** + * @desc Check that the IUT provides a notification when requested by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_data_subscription(v_sensor_data_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_sensor_data_notification( + mw_sensor_data_notification( + -, + mw_links( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + m_sensor_data_subscription_wrong( // Invalid subscriptionType + PX_SENS_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_01 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + m_sensor_data_subscription( + omit // Neither callbackReference nor websockNotifConfig provided + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference nor websockNotifConfig provided + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + m_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI, // Both callbackReference and websockNotifConfig provided + -, -, -, + m_websock_notif_config( + PX_SENS_SUB_WB_URI + ))))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_03 + + /** + * @desc Check that the IUT acknowledges the changes of an existing SensorDataSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryInfos v_sensor_discovery_infos; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_sensor_discovery(v_sensor_discovery_infos); + if (lengthof(v_sensor_discovery_infos) == 0) { + log("*** " & testcasename() & ": INCONC: No sensors discovered ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_create_sensor_data_subscription(v_sensor_data_subscription, v_subscription_id); + v_sensor_data_subscription.sensorIdentifierList := { v_sensor_discovery_infos[0].sensorType } + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + v_sensor_data_subscription + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_data_subscription( + v_sensor_data_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates with a sensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDiscoveryInfos v_sensor_discovery_infos; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_sensor_discovery(v_sensor_discovery_infos); + if (lengthof(v_sensor_discovery_infos) == 0) { + log("*** " & testcasename() & ": INCONC: No sensors discovered ***"); + f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + } + f_create_sensor_data_subscription(v_sensor_data_subscription, v_subscription_id); + v_sensor_data_subscription.sensorIdentifierList := { v_sensor_discovery_infos[0].sensorType } + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + v_sensor_data_subscription + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates with a sensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_NF + + /** + * @desc Check that the IUT acknowledges the cancellation of an existing SensorDataSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_data_subscription(v_sensor_data_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully terminates a sensorStatusSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SensorDataSubscription v_sensor_data_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_sensor_data_subscription(v_sensor_data_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_sensor_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_NF + + } // End of group sensor_sub_not + } // End of module AtsMec_SensorsSharingService_TestCases \ No newline at end of file diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn index b26caf6..3c51f7d 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestControl.ttcn @@ -49,6 +49,44 @@ module AtsMec_SensorsSharingService_TestControl { execute(TC_MEC_MEC046_SRV_SENSLOOKUP_007_OK()); execute(TC_MEC_MEC046_SRV_SENSLOOKUP_007_NF()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_01()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_02()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_NF()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_NF()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_01()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_02()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_BR_03()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_NF()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_NF()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_01()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_02()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_01()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_02()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_BR_03()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_NF()); + + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_OK()); + execute(TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_NF()); } } // End of 'alt' statement diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn index ca30deb..66b7770 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn @@ -1,3 +1,272 @@ module SensorsSharingService_Functions { - + + // JSON + import from Json all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/SensorsSharingService + import from SensorsSharingService_TypesAndValues all; + import from SensorsSharingService_Templates all; + import from SensorsSharingService_Pics all; + import from SensorsSharingService_Pixits all; + + // LibMec + import from LibMec_TypesAndValues all; + import from LibMec_Templates all; + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + function f_sensor_discovery( + out SensorDiscoveryInfos p_sensor_discovery_infos + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_SENS_DISCOVERY, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_discovery_infos + )))) -> value v_response { + tc_ac.stop; + + p_sensor_discovery_infos := v_response.response.body.json_body.sensor_discovery_infos + log("f_sensor_discovery: IUT successfully responds with a list sensors info"); + } + [] tc_ac.timeout { + log("f_sensor_discovery: Expected message not received ***"); + } + } // End of 'alt' statement + + } // End of function f_sensor_discovery + + function f_create_sensor_discovery_subscription( + out SensorDiscoveryEventSubscription p_sensor_discovery_event_subscription, + out charstring p_subscription_id, + in template (omit) boolean p_test_notification := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_discovery_event_subscription( + m_sensor_discovery_event_subscription( + PX_SENS_SUB_CALLBACK_URI, + -, -, -, + p_test_notification, + -, + p_expiryDeadline + + + )))))); + + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_discovery_event_subscription( + mw_sensor_discovery_event_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_SENS_LIST_SUBS_DISCOVERY & "/(?*)", + 0 + ); + p_sensor_discovery_event_subscription := v_response.response.body.json_body.sensor_discovery_event_subscription; + log("f_create_sensor_discovery_subscription: INFO: IUT successfully responds to the subscription: ", p_sensor_discovery_event_subscription); + log("f_create_sensor_discovery_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_sensor_discovery_subscription: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_sensor_discovery_subscription + + function f_create_sensor_status_subscription( + out SensorStatusSubscription p_sensor_status_subscription, + out charstring p_subscription_id, + in template (omit) boolean p_test_notification := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_status_subscription( + m_sensor_status_subscription( + PX_SENS_SUB_CALLBACK_URI, + -, -, + p_test_notification, + -, + p_expiryDeadline + + + )))))); + + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_status_subscription( + mw_sensor_status_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_SENS_LIST_SUBS_STATUS & "/(?*)", + 0 + ); + p_sensor_status_subscription := v_response.response.body.json_body.sensor_status_subscription; + log("f_create_sensor_status_subscription: INFO: IUT successfully responds to the subscription: ", p_sensor_status_subscription); + log("f_create_sensor_status_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_sensor_status_subscription: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_sensor_status_subscription + + function f_create_sensor_data_subscription( + out SensorDataSubscription p_sensor_data_subscription, + out charstring p_subscription_id, + in template (omit) boolean p_test_notification := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + v_headers, + m_http_message_body_json( + m_body_json_sensor_data_subscription( + m_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI, + -, -, + p_test_notification, + -, + p_expiryDeadline + + + )))))); + + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_sensor_data_subscription( + mw_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_SENS_LIST_SUBS_STATUS & "/(?*)", + 0 + ); + p_sensor_data_subscription := v_response.response.body.json_body.sensor_data_subscription; + log("f_create_sensor_data_subscription: INFO: IUT successfully responds to the subscription: ", p_sensor_data_subscription); + log("f_create_sensor_data_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_sensor_data_subscription: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_sensor_data_subscription + + function f_delete_sensor_subscription( + in charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & p_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("f_delete_sensor_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_delete_sensor_subscription + } // End of module SensorsSharingService_Functions diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn index d0ffe39..04f87d0 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Pixits.ttcn @@ -14,6 +14,8 @@ module SensorsSharingService_Pixits { modulepar Json.AnyURI PX_SENS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + modulepar Json.AnyURI PX_SENS_SUB_WB_URI := "ws://clientApp.example.com/"; + modulepar charstring PX_SENS_DISCOVERY_TYPE := ""; modulepar charstring PX_SENS_DISCOVERY_UNKNOWN_TYPE := "UNKNOWN_TYPE"; @@ -24,7 +26,7 @@ module SensorsSharingService_Pixits { modulepar charstring PX_UNKNOWN_SENSOR_IDENTIFIER := "UNKNOWN_SENSOR_IDENTIFIER"; - modulepar charstring PX_UNKNOW_SUBSCRIPTION_ID := "UNKNOW_SUBSCRIPTION_ID"; + modulepar charstring PX_UNKNOWN_SUBSCRIPTION_ID := "UNKNOW_SUBSCRIPTION_ID"; modulepar Json.String PX_CHARACTERISTIC_NAME := ""; diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn index 4adb40b..092e261 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn @@ -82,7 +82,7 @@ module SensorsSharingService_Templates { } // End of template mw_sensor_data template (omit) SensorDiscoveryEventSubscription m_sensor_discovery_event_subscription( - in Json.AnyURI p_callbackReference, + in template (omit) Json.AnyURI p_callbackReference, in template (omit) Links p_links := omit, in template (omit) SensorInfos p_sensorInfo := omit, in template (omit) AreaInfos p_geographicalArea := omit, @@ -100,6 +100,18 @@ module SensorsSharingService_Templates { expiryDeadline := p_expiryDeadline } // End of template m_sensor_discovery_event_subscription + template (omit) SensorDiscoveryEventSubscription m_sensor_discovery_event_subscription_wrong( + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) Links p_links := omit, + in template (omit) SensorInfos p_sensorInfo := omit, + in template (omit) AreaInfos p_geographicalArea := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) modifies m_sensor_discovery_event_subscription := { + subscriptionType := "SensorDiscoveryEventSub" + } // End of template m_sensor_discovery_event_subscription_wrong + template (present) SensorDiscoveryEventSubscription mw_sensor_discovery_event_subscription( template (present) Json.AnyURI p_callbackReference := ?, template Links p_links := *, @@ -136,7 +148,7 @@ module SensorsSharingService_Templates { } // End of template mw_sensor_characteristic_info template (omit) SensorStatusSubscription m_sensor_status_subscription( - in Json.AnyURI p_callbackReference, + in template (omit) Json.AnyURI p_callbackReference, in template (omit) Links p_links := omit, in template (omit) SensorIdentifierList p_sensorIdentifierList := omit, in template (omit) Json.Bool p_requestTestNotification := omit, @@ -152,6 +164,17 @@ module SensorsSharingService_Templates { expiryDeadline := p_expiryDeadline } // End of template m_sensor_status_subscription + template (omit) SensorStatusSubscription m_sensor_status_subscription_wrong( + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) Links p_links := omit, + in template (omit) SensorIdentifierList p_sensorIdentifierList := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) modifies m_sensor_status_subscription := { + subscriptionType := "SensorStatusSub" + } // End of template m_sensor_status_subscription_wrong + template (present) SensorStatusSubscription mw_sensor_status_subscription( template (present) Json.AnyURI p_callbackReference := ?, template Links p_links := *, @@ -170,7 +193,7 @@ module SensorsSharingService_Templates { } // End of template mw_sensor_status_subscription template (omit) SensorDataSubscription m_sensor_data_subscription( - in Json.AnyURI p_callbackReference, + in template (omit) Json.AnyURI p_callbackReference, in template (omit) Links p_links := omit, in template (omit) SensorIdentifierList p_sensorIdentifierList := omit, in template (omit) Json.Bool p_requestTestNotification := omit, @@ -186,6 +209,17 @@ module SensorsSharingService_Templates { expiryDeadline := p_expiryDeadline } // End of template m_sensor_data_subscription + template (omit) SensorDataSubscription m_sensor_data_subscription_wrong( + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) Links p_links := omit, + in template (omit) SensorIdentifierList p_sensorIdentifierList := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) TimeStamp p_expiryDeadline := omit + ) modifies m_sensor_data_subscription := { + subscriptionType := "SensorDataSubs" + } // End of template m_sensor_data_subscription_wrong + template (present) SensorDataSubscription mw_sensor_data_subscription( template (present) Json.AnyURI p_callbackReference := ?, template Links p_links := *, @@ -412,15 +446,31 @@ module SensorsSharingService_Templates { } // End of template mw_subscription template (value) Links m_links( - in template (value) LinkType p_subscription - ) :={ + in template (value) LinkType p_subscription + ) :={ subscription := p_subscription } // End of template m_links template (present) Links mw_links( - template (present) LinkType p_subscription := ? - ) :={ + template (present) LinkType p_subscription := ? + ) :={ subscription := p_subscription } // End of template mw_links + template (omit) WebsockNotifConfig m_websock_notif_config( + in Json.AnyURI p_websocketUri, + in template (omit) Json.Bool p_requestWebsocketUri := omit + ) := { + websocketUri := p_websocketUri, + requestWebsocketUri := p_requestWebsocketUri + } // End of template m_websock_notif_config + + template (present) WebsockNotifConfig mw_websock_notif_config( + template (present) Json.AnyURI p_websocketUri := ?, + template Json.Bool p_requestWebsocketUri := * + ) := { + websocketUri := p_websocketUri, + requestWebsocketUri := p_requestWebsocketUri + } // End of template mw_websock_notif_config + } // End of module SensorsSharingService_Templates -- GitLab From 57699868d57fa917251019c1b07a5650ac92687f Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Thu, 20 Feb 2025 15:16:08 +0500 Subject: [PATCH 20/54] add a testcase and add missing configuration file for MEC015 Traffic Management --- .../AtsMec_TrafficManagement.cfg_ | 195 ++++++++++++++++++ ..._BandwidthChangeEventSubAPI_TestCases.ttcn | 17 +- .../ttcn/TrafficManagementAPI_Functions.ttcn | 6 +- .../ttcn/TrafficManagementAPI_Templates.ttcn | 20 ++ .../TrafficManagementAPI_TypesAndValues.ttcn | 31 +++ .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 1 + .../ttcn/LibHttp_JsonTemplates.ttcn | 12 ++ 7 files changed, 273 insertions(+), 9 deletions(-) create mode 100644 etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ diff --git a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ new file mode 100644 index 0000000..5464190 --- /dev/null +++ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ @@ -0,0 +1,195 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.39" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +# LibMec_Pixits + + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_TrafficManagement/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.12,port=30030,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT responds with the list of configured bandwidth allocations when queried by a MEC Application - none +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_OK_01 +# Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application - app_instance_id +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_OK_02 +# Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application - app_name +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_OK_03 +# Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application - session_id +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_OK_04 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - app_instance_id +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_BR +# Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application - app_instance_id +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_NF_01 +# Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application - app_name +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_NF_02 +# Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application - session_id +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_NF_03 +# Check that the IUT acknowledges a creation of a bandwidthAllocation resource +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR_01 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR_02 +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_OK +#Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_01 +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_01 +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_02 +#Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application +#TC_MEC_MEC015_SRV_TM_005_OK +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR_01 +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR_02 +#Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application +#TC_MEC_MEC015_SRV_TM_005_NF +#Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_OK +#Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_NF + +// Multi-access Traffic Steering information Test Cases +#Check that the IUT responds with the Multi-access Traffic Steering information when queried by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_001_OK +#Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - none +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_OK_01 +#Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - app_instance_id +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_OK_02 +#Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - app_name +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_OK_03 +#Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - sessionId +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_OK_04 +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_BR +#Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_NF +#Check that the IUT creates a MTS session when queried by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_003_OK_01 +#Check that the IUT creates a MTS session when queried by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_003_OK_02 +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_003_BR +#Check that the IUT responds with a configured Multi-access Traffic Steering session when queried by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_004_OK +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_004_BR +#Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_004_NF +#Check that the IUT updates the information about an individual MTS session when commanded by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_005_OK +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_005_BR +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_005_NF +#Check that the IUT deregisters a MTS session when commanded by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_006_OK +#Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application +#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_006_NF + +// BWM change event susbsciption Testcases +#Check that the IUT responds with a list of BWM change event susbsciption when queried by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_BR +#Check that the IUT responds with an error when no subscription are created +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_NF +#Check that the IUT responds with a list of subscriptions for notifications on services availability when queried by a MEC Application - Filter on subscription_type +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWSUBLOOKUP_002_OK +#Check that the IUT responds with with an error when no subscription matches with the filter - Filter on subscription_type +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TP_MEC_MEC015_SRV_BWSUBLOOKUP_002_NF +#Check that the IUT responds with a individual BWM change event susbsciption when queried by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_OK +#Check that the IUT responds with a individual BWM change event susbsciption when queried by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF +#Check that the IUT acknowledges the creation of BWM change event subscription request when commanded by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_01 +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_02 +#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_03 +#Check that the IUT acknowledges the update of BWM change event subscription request when commanded by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_002_OK +#Check that the IUT acknowledges an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_002_NF +#Check that the IUT acknowledges the cancellation of BWM change event subscription request when commanded by a MEC Applications +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_003_OK +#Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_003_NF +#Check that the BWM service sends a notification about a bandwidth utility or the data volume if the BWM service has an associated subscription and the event is generated +#AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BW_SUB_NOT_004_OK + + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn index 3832ba4..0bf8bcf 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn @@ -528,7 +528,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { 0 ); } - log("*** " & testcasename() & ": PASS: IUT successfully responds with a qoSMeasureSubscription, SubscriptionId: ", v_subscription_id," ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a BwChgEventSubscription, SubscriptionId: ", v_subscription_id," ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -965,7 +965,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_003_OK /** - * @desc Check that the MEC application receives and processes the BWM information event notification sent by the BWM service + * @desc Check that the BWM service sends a notification about a bandwidth utility or the data volume if the BWM service has an associated subscription and the event is generated */ testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_004_OK() runs on HttpComponent system HttpTestAdapter { @@ -999,10 +999,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { -, -, mw_http_message_body_json( - mw_body_json_bw_chg_event_subscription( - mw_bw_chg_event_subscription( - PX_BW_Subcription_type, - PX_BW_EVENT_SUB_CALLBACK_URI + mw_body_json__bw_chg_event_notification( + mw_bw_chg_event_notification( + -, + -, + mw_data_vol_dispersion( + 1024,PX_APP_INSTANCE_ID + ), + - + )))))) -> value v_response { tc_wait.stop; diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index 9120a93..e126aac 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -159,7 +159,7 @@ module TrafficManagementAPI_Functions { log("f_create_bw_chg_event_subscription: INFO: p_subscription_id: ", p_subscription_id); } [] tc_ac.timeout { - log("f_create_qos_measure_subscription: INCONC: Expected message not received"); + log("f_create_bw_chg_event_subscription: INCONC: Expected message not received"); } } // End of 'alt' statement @@ -186,11 +186,11 @@ module TrafficManagementAPI_Functions { tc_ac.stop; } [] tc_ac.timeout { - log("f_delete_qos_subscription: INCONC: Expected message not received"); + log("f_delete_bw_chg_event_subscription: INCONC: Expected message not received"); } } // End of 'alt' statement - } // End of function f_delete_qos_subscription + } // End of function f_delete_bw_chg_event_subscription function f_create_mts_session_info_resource( in Json.String p_app_instance_id, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn index dec7fe0..4d0300e 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn @@ -188,6 +188,26 @@ module TrafficManagementAPI_Templates { ueIp := p_ueIp } // End of template m_flowfilterW + template (present) BwChgEventNotification mw_bw_chg_event_notificatipn( + template (present) Json.String p_notificationType := "BwChgEventNotification", + template TimeStamp p_timeStamp := ?, + template DataVolDispersion p_dataVolDispersion := *, + template Links p_links := ?, + ) := { + appInsId := p_appInsId, + ueIp := p_ueIp + } // End of template mw_bw_chg_event_notificatipn + + template (present) DataVolDispersion mw_data_vol_dispersion( + template (value) uint32 p_dataVol, + template (value) Json.String p_appInsId, + template (present) Json.String p_ueIp := ? + ) := { + dataVol := p_dataVol, + appInsId := p_appInsId, + ueIp := p_ueIp + } // End of template mw_data_vol_dispersion + template (omit) MtsCapabilityInfo m_mts_capability_info( in template (value) MtsAccessInfos p_mtsAccessInfo, in template (value) MtsModes p_mtsMode, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 8a80c5b..0d3b625 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -261,6 +261,37 @@ module TrafficManagementAPI_TypesAndValues { } type set of Subscription Subscriptions + /** + * @desc This type represents a notification for bandwidth change events. + * @member notificationType Shall be set to "BwChgEventNotification". + * @member timeStamp Date and time of the generation of the notification (optional). + * @member dataVolDispersion List of data volume dispersion information. + * @member links Object containing hyperlinks related to the resource (optional). + * @see Table 7.4.2: Attributes of the BwChgEventNotification + */ + type record BwChgEventNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + DataVolDispersion dataVolDispersion, + Links links optional + } with { + variant (links) "name as '_links'"; + }; + + /** + * @desc This type represents data volume dispersion information. + * @member dataVol Sum of data volume (UL/DL) exchanged per UE per application. + * @member appInsId Application instance identifier. + * @member ueIp Source address identity of session (optional). + */ + type record DataVolDispersion_ { + UInt32 dataVol, + Json.String appInsId, + Json.String ueIp optional + }; +type set of DataVolDispersion_ DataVolDispersion + + /** * @desc The information on access network connection * @member timeStamp Time stamp to indicate when the corresponding information elements are sent diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 5bc237c..513c1e3 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -79,6 +79,7 @@ module LibHttp_JsonMessageBodyTypes { BwInfoDeltas bwInfoDeltas, BwChgEventSubscription bwchgeventsubscription, TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw + BwChgEventNotification bwChgEventNotification MtsCapabilityInfo mtsCapabilityInfo, MtsSessionInfo mtsSessionInfo, MtsSessionInfos mtsSessionInfos, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index d769c6d..8df7bb8 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -934,6 +934,18 @@ module LibHttp_JsonTemplates { subscriptionLinkList := p_subscriptionlinklist } // End + template (value) JsonBody m_body_json__bw_chg_event_notification( + in template (value) BwChgEventNotification p_bwchgeventnotification + ) := { + mobilityProcedureNotification := p_mobilityProcedureNotification + } // End of template m_body_json__bw_chg_event_notification + + template (present) JsonBody mw_body_json__bw_chg_event_notification( + template (present) BwChgEventNotification p_bwchgeventnotification := ? + ) := { + mobilityProcedureNotification := p_mobilityProcedureNotification + } // End of template mw_body_json__bw_chg_event_notification + template (value) JsonBody m_body_json_mts_capability_info( in template (value) MtsCapabilityInfo p_mtsCapabilityInfo ) := { -- GitLab From dc53a3dad2918fa24179ea245a6c53414346a88a Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Thu, 20 Feb 2025 15:32:43 +0500 Subject: [PATCH 21/54] update MEC 016 Device Application Interface reference version from v2.2.1 to v3.1.1 --- ...viceApplicationInterfaceAPI_TestCases.ttcn | 34 +++++++------- ...pplicationInterfaceAPI_TypesAndValues.ttcn | 44 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn index 904a4d0..eda51f7 100644 --- a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 002, Draft ETSI GS MEC 016 V2.2.1 (2020-04) + * @see ETSI GS MEC 002, Draft ETSI GS MEC 016 V3.1.1 (2024-03) */ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { @@ -44,7 +44,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with the list of user applications when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -102,7 +102,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -157,7 +157,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with the list of user applications when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -215,7 +215,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -270,7 +270,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -325,7 +325,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT acknowledges the creation of the application context when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -404,7 +404,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -473,7 +473,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -542,7 +542,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT acknowledges the creation of the application context when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -616,7 +616,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -688,7 +688,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -757,7 +757,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT deletes the application context when commanded by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -814,7 +814,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -869,7 +869,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -942,7 +942,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1010,7 +1010,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 + * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn index 228478d..72e35ca 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn @@ -2,7 +2,7 @@ * @author ETSI / TTF T012 / TTF T027 * @version $Url$ * $Id$ - * @desc Types ANd Values for ETSI GS MEC 016 V2.2.1 (2020-04) + * @desc Types ANd Values for ETSI GS MEC 016 V3.1.1 (2024-03) * @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. @@ -16,7 +16,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc Information on available applications * @member appList List of user applications available to the device application - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.2 Type: ApplicationList + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.2 Type: ApplicationList */ type record ApplicationList { AppList appList optional @@ -26,7 +26,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @desc Information on available applications * @member appInfo List of user applications available to the device application * @member vendorSpecificExt Extension for vendor specific information - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.2 Type: ApplicationList + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.2 Type: ApplicationList */ type record AppListItem { ApplicationList_AppInfo appInfo, @@ -44,7 +44,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member appDescription Human readable description of the MEC application * @member appLocation Identifies the locations of the MEC application * @member appCharcs Characteristics of the application - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.2 Type: ApplicationList + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.2 Type: ApplicationList */ type record ApplicationList_AppInfo { Json.String appDId, @@ -60,7 +60,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc Extension for vendor specific information * @member vendorId Vendor identifier - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.2 Type: ApplicationList + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.2 Type: ApplicationList */ type record VendorSpecificExt { Json.String vendorId @@ -73,7 +73,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member latency The target round trip time in milliseconds supported by the MEC system for the MEC application instance * @member bandwidth The required connection bandwidth in kbit/s for the use of the MEC application instance * @member serviceCont Required service continuity mode for this application - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.2 Type: ApplicationList + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.2 Type: ApplicationList */ type record AppCharcs { Json.UInteger memory optional, @@ -85,7 +85,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc Required service continuity mode for this application - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.2 Type: ApplicationList + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.2 Type: ApplicationList */ type enumerated ServiceCount { SERVICE_CONTINUITY_NOT_REQUIRED (0), @@ -102,7 +102,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member appLocationUpdates Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation * @member appAutoInstantiation Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request * @member appInfo - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.3 Type: AppContext + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.3 Type: AppContext */ type record AppContext { Json.String contextId optional, @@ -123,7 +123,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member appDescription Human readable description of the MEC application * @member userAppInstanceInfo List of user application instance information * @member appPackageSource URI of the application package - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.3 Type: AppContext + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.3 Type: AppContext */ type record ApplicationContext_AppInfo { Json.String appDId, @@ -141,7 +141,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member appInstanceId Identifier of the user application instance * @member referenceURI Address of the user application instance * @member appLocation Location of the user application instance - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.3 Type: AppContext + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.3 Type: AppContext */ type record UserAppInstanceInfo { Json.String appInstanceId optional, @@ -154,7 +154,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @desc Information on locations available instantiation of new user application instances * @member associateDevAppId Uniquely identifies the device application * @member appInfo - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.4 Type: ApplicationLocationAvailability + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.4 Type: ApplicationLocationAvailability */ type record ApplicationLocationAvailability { Json.String associateDevAppId, @@ -171,7 +171,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member appDescription Human readable description of the MEC application * @member availableLocations MEC application location constraints * @member appPackageSource URI of the application package. Shall be included in the request - * @seeETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.4 Type: ApplicationLocationAvailability + * @seeETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.4 Type: ApplicationLocationAvailability */ type record ApplicationLocationAvailability_AppInfo { Json.String appDId, @@ -187,7 +187,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc * @member appLocation Shall only be included in the response, where it indicates a location constraint available in the MEC system - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.2.4 Type: ApplicationLocationAvailability + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.4 Type: ApplicationLocationAvailability */ type record AvailableLocations { LocationConstraints appLocation optional @@ -200,7 +200,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member contextId Uniquely identifies the application context in the MEC system * @member appInstanceId Identifier of the user application instance * @member referenceURI Address of the user application. Used as the reference URI for the application - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.4.2 Type: AddressChangeNotification + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.4.2 Type: AddressChangeNotification */ type record AddressChangeNotification { Json.String notificationType, @@ -213,7 +213,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @desc Notification from the UALCMP regarding the deletion of an application context by the MEC system * @member notificationType Shall be set to "ApplicationContextDeleteNotification" * @member contextId Uniquely identifies the application context in the MEC system - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.4.3 Type: ApplicationContextDeleteNotification + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.4.3 Type: ApplicationContextDeleteNotification */ type record ApplicationContextDeleteNotification { Json.String notificationType, @@ -225,7 +225,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member notificationType Shall be set to "ApplicationContextUpdateNotification" * @member contextId Uniquely identifies the application context in the MEC system * @member userAppInstanceInfo List of user application instance information - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.4.4 Type: ApplicationContextUpdateNotification + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.4.4 Type: ApplicationContextUpdateNotification */ type record ApplicationContextUpdateNotification { Json.String notificationType, @@ -238,7 +238,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member notificationType Shall be set to "ApplicationLocationAvailabilityNotification" * @member contextId Uniquely identifies the application context in the MEC system * @member availableLocations Locations available to the MEC application - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.4.5 Type: ApplicationLocationAvailabilityNotification + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.4.5 Type: ApplicationLocationAvailabilityNotification */ type record ApplicationLocationAvailabilityNotification { Json.String notificationType, @@ -251,7 +251,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @member countryCode The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the "area" attribute is absent * @member civicAddressElement Zero or more elements comprising the civic address * @member area Geographic area. Shall be absent if the "civicAddressElement" attribute is present - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.5.2 Type: LocationConstraints + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record LocationConstraints { Json.String countryCode optional, @@ -264,7 +264,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @desc Elements comprising the civic address * @member caType Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776 * @member caValue Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776 - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.5.2 Type: LocationConstraints + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record CivicAddressElement { Json.Integer caType, @@ -273,7 +273,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.5.2 Type: LocationConstraints + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record Polygon { Json.String type_, @@ -287,7 +287,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.5.2 Type: LocationConstraints + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record Geometry { Json.String type_, @@ -300,7 +300,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { /** * @desc - * @see ETSI GS MEC 016 V2.2.1 (2020-04) Clause 6.5.2 Type: LocationConstraints + * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record Property { Json.String key, -- GitLab From 5fdd0d5ce32a141cf04680595ef80cb4e410bdb4 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 13 Mar 2025 07:38:41 +0100 Subject: [PATCH 22/54] Review MEC 030 --- ...ec_V2XInformationServiceAPI_TestCases.ttcn | 2 +- ...XInformationServiceAPI_TypesAndValues.ttcn | 120 +++++++++--------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn b/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn index f94289e..0d181df 100644 --- a/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 002, Draft ETSI GS MEC 030 V2.1.1 (2020-04) + * @see ETSI GS MEC 002, Draft ETSI GS MEC 030 V3.3.1 (2024-06) */ module AtsMec_V2XInformationServiceAPI_TestCases { diff --git a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn index 450308e..e90fe1d 100644 --- a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn @@ -2,7 +2,7 @@ * @author ETSI / TTF T012 * @version $Url$ * $Id$ - * @desc Types And Values for ETSI GS MEC 030 V3.1.1 (2023-03) + * @desc Types And Values for ETSI GS MEC 030 V3.3.1 (2024-06) * @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. @@ -20,7 +20,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Provisioning information required for V2X communication over Uu unicast * @member timeStamp_ Time stamp * @member proInfoUuUnicast The provisioning information per location - * @see ETSI GS MEC 030 V3.1.1 (2023-03) V3.1.1 (2023-03) Table 6.2.2-1: Attributes of the UuUnicastProvisioningInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.2-1: Attributes of the UuUnicastProvisioningInfo */ type record UuUnicastProvisioningInfo { TimeStamp timeStamp optional, @@ -32,7 +32,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member neighbourCellInfoThe information of the neighbour cells in a visiting PLMN that support V2X communication over Uu unicast * @member v2xApplicationServer V2X Application Server address (consisting of IP address and UDP port) for unicast - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.2-1: Attributes of the UuUnicastProvisioningInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.2-1: Attributes of the UuUnicastProvisioningInfo */ type record ProInfoUuUnicast { LocationInfo locationInfo, @@ -45,7 +45,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Provisioning information required for V2X communication over Uu MBMS * @member proInfoUuMbms The provisioning information per location as defined below * @member timeStamp_ TimeStamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.3-1: Attributes of the UuMbmsProvisioningInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.3-1: Attributes of the UuMbmsProvisioningInfo */ type record UuMbmsProvisioningInfo { TimeStamp timeStamp optional, @@ -56,12 +56,12 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc The provisioning information per location * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over Uu MBMS - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.3-1: Attributes of the UuMbmsProvisioningInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.3-1: Attributes of the UuMbmsProvisioningInfo */ type record ProInfoUuMbms { LocationInfo locationInfo, - UuMbmsNeighbourCellInfoList neighbourCellInfo optional, - V2xServerUsd v2xServerUsd + V2xServerUsd v2xServerUsd, + UuMbmsNeighbourCellInfoList neighbourCellInfo optional } type set of ProInfoUuMbms ProInfoUuMbmsList; @@ -69,7 +69,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Provisioning information required for V2X communication over PC5 * @member proInfoPc5 The provisioning information per location * @member timeStamp Time stamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.4-1: Attributes of the Pc5ProvisioningInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.4-1: Attributes of the Pc5ProvisioningInfo */ type record Pc5ProvisioningInfo { TimeStamp timeStamp optional, @@ -81,7 +81,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member dstLayer2Id For sidelink communication, the Destination Layer-2 ID is set to the ProSe Layer-2 Group ID or Prose UE ID * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over PC5 - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.4-1: Attributes of the Pc5ProvisioningInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.4-1: Attributes of the Pc5ProvisioningInfo */ type record Pc5ProvisioningInfoProInfoPc5 { LocationInfo locationInfo, @@ -94,7 +94,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc This type represents the information of one or more V2X Message Distribution Servers that is exchanged between the VIS and a service consumer (e.g. a MEC application) to enable a direct interaction among the service consumer and one or multiple V2X Message Distribution Servers * @member v2xMsgDistributionServer Describes the information of the V2X Message Distribution Servers supported by the service consumer for direct communication * @member locationInfo Location information to identify a particular geographical area of interest to the service consumer for receiving V2X messages - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.5-1: Attributes of the V2xMsgDistributionServerInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.5-1: Attributes of the V2xMsgDistributionServerInfo */ type record V2xMsgDistributionServerInfo { V2xMsgDistributionServers v2xMsgDistributionServer, @@ -110,7 +110,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member predictionArea Geographical area including the two ends of the user plane link between two V2X application instances * @member routes Information relating to the potential routes of a vehicular UE * @member qos Predicted QoS at the related time and vehicular UE location - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record PredictedQos { PredictionTarget predictionTarget, @@ -135,7 +135,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member radius Radius of geographical area including the two ends of the user plane link between two V2X application instances. Measured in meters * @member * @member - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record PredictionArea { LocationInfo center, @@ -145,7 +145,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Information relating to the potential routes of a vehicular UE * @member routeinfo Information relating to a specific route - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record Route { RouteInfoList routeinfo @@ -156,7 +156,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Information relating to a specific route * @member location Vehicular UE location * @member time Estimated time at the location - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record RouteInfo { LocationInfo location, @@ -167,7 +167,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Predicted QoS at the related time and vehicular UE location * @member stream Predicted QoS at the related time and vehicular UE location for the specific data stream - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record Qos { StreamList stream @@ -176,7 +176,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Predicted QoS at the related time and vehicular UE location * @member qosKpi This structure contains the prediction for a specific QoS KPI related to a given data stream - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record Stream { QosKpiList qosKpi @@ -188,7 +188,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member kpiName The name of the KPI (e.g. latency, UL bitrate, etc.) * @member kpiValue Information on the predicted value for the specific QoS KPI * @member confidence Confidence of the prediction, as returned by the relevant domain PF - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.6-1: Attributes of the PredictedQos + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record QosKpi { Json.String kpiName, @@ -202,7 +202,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member msgPropertiesValues List of message properties that is associated to the V2X message publication that can be used for filtering messages at the reception of the V2X message * @member msgRepresentationFormat The representation format of the binary V2X message, for example base64 or hexadecimal representation * @member msgType Published V2X message content. Its format is defined by the standardization organization indicated by the attribute stdOrganization of the msgPropertiesValues attribute - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.7-1: Attributes of the V2xMsgPublication + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.7-1: Attributes of the V2xMsgPublication */ type record V2xMsgPublication { V2xMsgPropertiesValues msgPropertiesValues, @@ -219,7 +219,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Time stamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.2-1: Attributes of the ProvChgUuUniSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.2-1: Attributes of the ProvChgUuUniSubscription */ type record ProvChgUuUniSubscription { Json.String subscriptionType, @@ -241,7 +241,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc List of hyperlinks related to the resource * @member self_ URI referring to a resource - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.2-1: Attributes of the ProvChgUuUniSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.2-1: Attributes of the ProvChgUuUniSubscription */ type record Links { LinkType self_ @@ -254,7 +254,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member v2xApplicationServer V2X Application Server address (consisting of IP address and UDP port) for unicast * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over Uu MBMS - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.2-1: Attributes of the ProvChgUuUniSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.2-1: Attributes of the ProvChgUuUniSubscription */ type record ProvChgUuUniSubscriptionFilterCriteria { LocationInfo locationInfo, @@ -271,7 +271,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Time stamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.3-1: Attributes of the ProvChgUuMbmsSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.3-1: Attributes of the ProvChgUuMbmsSubscription */ type record ProvChgUuMbmsSubscription { Json.String subscriptionType, @@ -290,7 +290,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member v2xServerUsd User Service Description for V2X Application Server is used to configure the UE for receiving local V2X Application Server information when it is provided over MBMS * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over Uu MBMS - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.3-1: Attributes of the ProvChgUuMbmsSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.3-1: Attributes of the ProvChgUuMbmsSubscription */ type record ProvChgUuMbmsSubscriptionFilterCriteria { LocationInfo locationInfo, @@ -307,7 +307,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Time stamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.4-1: Attributes of the ProvChgPc5Subscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.4-1: Attributes of the ProvChgPc5Subscription */ type record ProvChgPc5Subscription { Json.String subscriptionType, @@ -326,7 +326,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member dstLayer2Id For sidelink communication, the Destination Layer-2 ID is set to the ProSe Layer-2 Group ID or Prose UE ID * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over PC5 - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Clause 6.3.4 Type: ProvChgPc5Subscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Clause 6.3.4 Type: ProvChgPc5Subscription */ type record FilterCriteria { LocationInfo locationInfo, @@ -343,7 +343,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Time stamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.5-1: Attributes of the V2xMsgSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.5-1: Attributes of the V2xMsgSubscription */ type record V2xMsgSubscription { Json.String subscriptionType, @@ -366,7 +366,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Time stamp - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.6-1: Attributes of the PredQosSubscription + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.6-1: Attributes of the PredQosSubscription */ type record PredQosSubscription { Json.String subscriptionType, @@ -384,7 +384,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc This type represents a list of links related to currently existing subscriptions for the service consumer * @member links Hyperlink related to the resource * @member subscription The service consumer's subscriptions - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.7-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.7-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinkList { SubscriptionLinks links @@ -396,7 +396,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Hyperlink related to the resource * @member self_ URI of this resource. * @member subscription The service consumer's subscriptions - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.7-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.7-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinks { LinkType self_, @@ -409,7 +409,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc A link to a subscription * @member href The URI referring to the subscription. * @member subscriptionType Type of subscription - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.7-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.7-1: Attributes of the SubscriptionLinkList */ type record Subscription_ { Json.AnyURI href, @@ -424,7 +424,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member v2xApplicationServer V2X Application Server address (consisting of IP address and UDP port) for unicast * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over Uu unicast - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.4.2-1: Attributes of the ProvChgUuUniNotification + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.4.2-1: Attributes of the ProvChgUuUniNotification */ type record ProvChgUuUniNotification { Json.String notificationType, @@ -441,7 +441,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member v2xServerUsd User Service Description for V2X Application Server is used to configure the UE for receiving local V2X Application Server information when it is provided over MBMS * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over Uu MBMS - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.4.3-1: Attributes of the ProvChgUuMbmsNotification + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.4.3-1: Attributes of the ProvChgUuMbmsNotification */ type record ProvChgUuMbmsNotification { Json.String notificationType, @@ -458,7 +458,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member locationInfo Location information to identify a cell of a base station or a particular geographical area * @member dstLayer2Id For sidelink communication, the Destination Layer-2 ID is set to the ProSe Layer-2 Group ID or Prose UE ID * @member neighbourCellInfo The information of the neighbour cells in a visiting PLMN that support V2X communication over PC5 - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.4.4-1: Attributes of the ProvChgPc5Notification + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.4.4-1: Attributes of the ProvChgPc5Notification */ type record ProvChgPc5Notification { Json.String notificationType, @@ -476,7 +476,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member msgRepresentationFormat The representation format of the binary V2X message, for example base64 or hexadecimal representation * @member msgContent Published V2X message content. The format of the string is defined by the standardization organization * @member links Link to resources related to this notification - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.4.5-1: Attributes of the V2xMsgNotification + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.4.5-1: Attributes of the V2xMsgNotification */ type record V2xMsgNotification { Json.String notificationType, @@ -492,7 +492,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Link to resources related to this notification * @member subscription A link to the related subscription - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.4.5-1: Attributes of the V2xMsgNotification + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.4.5-1: Attributes of the V2xMsgNotification */ type record Links_Notification { LinkType subscription @@ -502,7 +502,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc This type represents a notification from RNIS with regards to expiry of the existing subscription * @member notificationType Shall be set to "TestNotification" * @member links Hyperlink related to the resource - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.4.6-1: Attributes of the TestNotification + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.4.6-1: Attributes of the TestNotification */ type record TestNotification { Json.String notificationType, @@ -515,7 +515,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Location information * @member ecgi E-UTRAN CelI Global Identifier of the serving cell * @member geoArea Information of a geographical area - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.3-1: Attributes of the LocationInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.3-1: Attributes of the LocationInfo */ type record LocationInfo { Ecgi ecgi, @@ -527,7 +527,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Information of a geographical area * @member latitude Latitude (DATUM = WGS84) -90 to 90 in decimal degree format DDD.ddd * @member longitude Longitude (DATUM = WGS84)-180 to 180 in decimal degree format DDD.ddd - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.3-1: Attributes of the LocationInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.3-1: Attributes of the LocationInfo */ type record LocationInfoGeoArea { Json.Number latitude, @@ -538,7 +538,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc PLMN Identity * @member mcc The Mobile Country Code part of PLMN Identity * @member mnc The Mobile Network Code part of PLMN Identity - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.4-1: Attributes of the Plmn + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.4-1: Attributes of the Plmn */ type record Plmn { Json.String mcc, @@ -549,7 +549,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc E-UTRAN Cell Global Identifier * @member plmn Public Land Mobile Network Identity * @member cellId The E-UTRAN Cell Identity - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.5-1: Attributes of the Ecgi + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.5-1: Attributes of the Ecgi */ type record Ecgi { Plmn plmn, @@ -570,7 +570,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member dlEarfcn Downlink E-UTRA Absolute Radio Frequency Channel Number * @member ulTransmissionBandwidth Uplink Transmission Bandwidth * @member dlTransmissionBandwidth Downlink Transmission Bandwidth - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.6-1: Attributes of the FddInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.6-1: Attributes of the FddInfo */ type record FddInfo { Earfcn ulEarfcn, @@ -605,7 +605,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member earfcn E-UTRA Absolute Radio Frequency Channel Number * @member transmissionBandwidth Transmission Bandwidth * @member subframeAssignment Uplink-downlink subframe configuration information - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.7-1: Attributes of the TddInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.7-1: Attributes of the TddInfo */ type record TddInfo { Earfcn earfcn, @@ -617,7 +617,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc V2X Application Server address (consisting of IP address and UDP port) for unicast * @member ipAddress * @member udpPort - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.8-1: Attributes of the V2xApplicationServer + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.8-1: Attributes of the V2xApplicationServer */ type record V2xApplicationServer { Json.String ipAddress, @@ -631,7 +631,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member pci Physical Cell Identifier * @member fddInfo Information for FDD operation * @member tddInfo Information for TDD operation - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.9-1: Attributes of the UuUniNeighbourCellInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.9-1: Attributes of the UuUniNeighbourCellInfo */ type record UuUniNeighbourCellInfo { Plmn plmn, @@ -647,7 +647,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member tmgi Temporary Mobile Group Identity (TMGI), which is used within MBMS to uniquely identify Multicast and Broadcast bearer services * @member serviceAreaIdentifier A list of service area identifier for the applicable MBMS broadcast area * @member sdpInfo SDP with IP multicast address and port number used for V2X communication via MBMS - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.10-1: Attributes of the V2xServerUsd + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.10-1: Attributes of the V2xServerUsd */ type record V2xServerUsd { Tmgi tmgi, @@ -660,7 +660,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member mbmsServiceId MBMS Service ID consisting of three octets * @member mcc The Mobile Country Code part of PLMN Identity * @member mnc The Mobile Network Code part of PLMN Identity - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.10-1: Attributes of the V2xServerUsd + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.10-1: Attributes of the V2xServerUsd */ type record Tmgi { Json.String mbmsServiceId, @@ -674,7 +674,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc SDP with IP multicast address and port number used for V2X communication via MBMS * @member ipMulticastAddress * @member portNumber - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.10-1: Attributes of the V2xServerUsd + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.10-1: Attributes of the V2xServerUsd */ type record SdpInfo { Json.String ipMulticastAddress, @@ -690,7 +690,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member fddInfo Information for FDD operation * @member tddInfo Information for TDD operation * @member mbmsServiceAreaIdentity Supported MBMS Service Area Identities in the cell - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Clause 6.5.11 Type: UuMbmsNeighbourCellInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Clause 6.5.11 Type: UuMbmsNeighbourCellInfo */ type record UuMbmsNeighbourCellInfo { Plmn plmn, @@ -708,7 +708,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member ecgi E-UTRAN CelI Global Identifier * @member plmn Public Land Mobile Network Identity * @member siV2xConfig V2X sidelink communication configuration, as defined in ETSI TS 136 331 - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.12-1: Attributes of the Pc5NeighbourCellInfo + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.12-1: Attributes of the Pc5NeighbourCellInfo */ type record Pc5NeighbourCellInfo { Plmn plmn, @@ -722,7 +722,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc This type represents a type of link * @member self_ URI referring to a resource - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.13-1: Attributes of the LinkType + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.13-1: Attributes of the LinkType */ type record LinkType { Json.AnyURI href @@ -734,7 +734,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member msgType Published V2X message type. Its value is defined by the standardization organization indicated by the attribute stdOrganization * @member msgProtocolVersion Protocol version of the V2X message (0..255) * @member locationInfo Location information to identify a cell of a base station or a particular geographical area to which the V2X message can be associated - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues */ type record V2xMsgPropertiesValues { StdOrganization stdOrganization, @@ -745,7 +745,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Standardization organization which defines the published V2X message type - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues */ type enumerated StdOrganization { ETSI @@ -753,7 +753,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Published V2X message type. Its value is defined by the standardization organization - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues */ type enumerated MsgType { denm (1), @@ -774,7 +774,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @member msgType Published V2X message type. Its value is defined by the standardization organization indicated by the attribute stdOrganization * @member msgProtocolVersion Protocol version of the V2X message (0..255) * @member locationInfo Location information to identify a cell of a base station or a particular geographical area to which the V2X message can be associated - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.15-1: Attributes of the V2xMsgFilterCriteria + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.15-1: Attributes of the V2xMsgFilterCriteria */ type record V2xMsgFilterCriteria { StdOrganization stdOrganization, @@ -788,7 +788,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc This type represents the information about a V2X Message Distribution Server that can be exchanged between a service consumer (e.g. a MEC application) and the VIS * @member infoProtocol Specifics of the application layer protocol of V2X Message Distribution Server * @member infoConnection Connection information of the V2X Message Distribution Server the service consumer can use for direct connection - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer */ type record V2xMsgDistributionServer { InfoProtocol infoProtocol, @@ -800,7 +800,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Specifics of the application layer protocol of V2X Message Distribution Server * @member msgProtocol Numerical value corresponding to the application layer protocol supported by the service consumer * @member protImplementation Implementation specifics of application layer protocol, e.g. programming language - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer */ type record InfoProtocol { MsgProtocols msgProtocol, @@ -809,7 +809,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Numerical value corresponding to the application layer protocol supported by the service consumer - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer */ type enumerated MsgProtocol { MQTT_v3_1_0 (0), @@ -826,7 +826,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc Connection information of the V2X Message Distribution Server the service consumer can use for direct connection * @member ipAddress IP address of the V2X Message Distribution Server * @member port_number Port number of the V2X Message Distribution Server - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.16-1: Attributes of the V2xMsgDistributionServer */ type record InfoConnection { Json.String ipAddress, @@ -836,7 +836,7 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc This type represents the filter criteria that can be used when performing a subscription to notification of QoS prediction messages * @member streamId The predicted QoS at the related time and vehicular UE location is provided for a specific data stream. In case of 3GPP network, this is mapped to a QoS flow - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.17-1: Attributes of the QosPredFilterCriteria + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.17-1: Attributes of the QosPredFilterCriteria */ type record QosPredFilterCriteria { Json.String streamId optional @@ -846,7 +846,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @desc This type represents configuration for the delivery of subscription notifications over Websockets * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested - * @see ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.5.18-1: Attributes of the WebsockNotifConfig + * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.18-1: Attributes of the WebsockNotifConfig */ type record WebsockNotifConfig { Json.AnyURI websocketUri optional, -- GitLab From be76ffe0dc77bfba7ca10d107c7da2863298e8af Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 13 Mar 2025 15:36:48 +0100 Subject: [PATCH 23/54] Review MEC 040 --- ...Mec_FederationEnablementAPI_TestCases.ttcn | 1612 ++++++++++++++--- ...c_FederationEnablementAPI_TestControl.ttcn | 24 + ttcn/AtsMec_FederationEnablement/module.mk | 2 + ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn | 4 +- .../FederationEnablementAPI_Functions.ttcn | 100 +- .../ttcn/FederationEnablementAPI_Pixits.ttcn | 12 +- .../FederationEnablementAPI_Templates.ttcn | 160 +- ...ederationEnablementAPI_TypesAndValues.ttcn | 161 +- .../ttcn/SensorsSharingService_Functions.ttcn | 24 +- .../SensorsSharingService_TypesAndValues.ttcn | 10 +- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 6 +- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 13 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 36 + 13 files changed, 1847 insertions(+), 317 deletions(-) diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn index 05b2c29..4d44365 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn @@ -1,8 +1,8 @@ module AtsMec_FederationEnablementAPI_TestCases { - + // Libcommon import from LibCommon_Sync all; - + // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Functions all; @@ -12,7 +12,7 @@ module AtsMec_FederationEnablementAPI_TestCases { // LibMec/EdgePlatformApplicationEnablementAPI import from EdgePlatformApplicationEnablementAPI_Templates all; - + // LibMec/FederationEnablementAPI import from FederationEnablementAPI_TypesAndValues all; import from FederationEnablementAPI_Templates all; @@ -33,24 +33,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -61,7 +61,7 @@ module AtsMec_FederationEnablementAPI_TestCases { v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -77,7 +77,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_1 ))))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -86,7 +86,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -98,24 +98,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -126,7 +126,7 @@ module AtsMec_FederationEnablementAPI_TestCases { v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -144,7 +144,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -153,7 +153,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -165,24 +165,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -195,7 +195,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -218,7 +218,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -227,7 +227,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -239,24 +239,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -269,7 +269,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -292,7 +292,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -301,7 +301,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -313,24 +313,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_05() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -343,7 +343,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -361,7 +361,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -370,7 +370,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -382,24 +382,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_06() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -412,7 +412,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -435,7 +435,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -444,7 +444,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -456,24 +456,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_07() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -486,7 +486,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -509,7 +509,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -518,7 +518,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -530,24 +530,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_08() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -560,7 +560,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -578,7 +578,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -587,7 +587,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -599,24 +599,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_09() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -629,7 +629,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -652,7 +652,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -661,7 +661,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -673,24 +673,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_10() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -703,7 +703,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -726,7 +726,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -735,7 +735,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -747,24 +747,24 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_11() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); @@ -777,7 +777,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -800,7 +800,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } ))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -809,7 +809,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -821,19 +821,19 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_NF_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -845,7 +845,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -854,7 +854,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -863,7 +863,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_001_NF_01 @@ -874,19 +874,19 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_NF_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -898,7 +898,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -907,7 +907,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -916,7 +916,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_001_NF_02 @@ -927,19 +927,19 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_NF_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -951,7 +951,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -960,7 +960,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -969,7 +969,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_001_NF_03 @@ -980,19 +980,19 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -1004,7 +1004,7 @@ module AtsMec_FederationEnablementAPI_TestCases { ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1013,7 +1013,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_400_bad_request )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1022,15 +1022,11 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_001_BR - } // End of group lookup - - group subscription { - /** * @desc Check that the IUT creates a new systemInfo when requested by a MEC Orchestrator */ @@ -1038,25 +1034,25 @@ module AtsMec_FederationEnablementAPI_TestCases { // Local variables var Headers v_headers; var HttpMessage v_response; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_FED_API_SUB, + PICS_ROOT_API & PX_FED_API_SYS_INFO, v_headers, m_http_message_body_json( m_body_json_fed_system_info( @@ -1065,7 +1061,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_PROVIDER_1 )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1080,7 +1076,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_1 )))))) -> value v_response { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds the success code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1089,12 +1085,12 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info(v_response.response.body.json_body.systemInfo); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_002_OK - + /** * @desc Check that the IUT responds with an error on creating an existing systemInfo */ @@ -1103,26 +1099,26 @@ module AtsMec_FederationEnablementAPI_TestCases { var Headers v_headers; var HttpMessage v_response; var SystemInfo v_system_info := valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)); - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info(v_system_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_FED_API_SUB, + PICS_ROOT_API & PX_FED_API_SYS_INFO, v_headers, m_http_message_body_json( m_body_json_fed_system_info( @@ -1131,7 +1127,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_PROVIDER_1 )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1140,7 +1136,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_400_bad_request )) -> value v_response { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with yhe correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1149,12 +1145,12 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info(v_system_info); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_002_BR_01 - + /** * @desc Check that the IUT responds with an error on creating an existing systemInfo */ @@ -1163,26 +1159,26 @@ module AtsMec_FederationEnablementAPI_TestCases { var Headers v_headers; var HttpMessage v_response; var SystemInfo v_system_info := valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)); - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info(v_system_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_FED_API_SUB, + PICS_ROOT_API & PX_FED_API_SYS_INFO, v_headers, m_http_message_body_json( m_body_json_fed_system_info( @@ -1192,7 +1188,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_1 // Shall be omitted )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1201,7 +1197,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_400_bad_request )) -> value v_response { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with yhe correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1210,49 +1206,49 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info(v_system_info); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_002_BR_02 - + /** * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator */ testcase TC_MEC_MEC040_SRV_MEF_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1267,7 +1263,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_2 )))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct SystemInfo entry ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1276,7 +1272,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1288,36 +1284,36 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_3, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_3, "UTF-8")), v_headers ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1326,7 +1322,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1335,7 +1331,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1347,36 +1343,36 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_003_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SUB_WRONG & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")), // Inconsistent URI + PICS_ROOT_API & PX_FED_API_SYS_INFO_WRONG & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")), // Inconsistent URI v_headers ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1385,7 +1381,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1394,47 +1390,43 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_003_BR - } // End of group subscription - - group patch { - /** * @desc Check that the IUT updates the systemInfo when requested by a MEC Orchestrator */ testcase TC_MEC_MEC040_SRV_MEF_004_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1444,7 +1436,7 @@ module AtsMec_FederationEnablementAPI_TestCases { { PX_FED_ENDPOINT_URI_1, PX_FED_ENDPOINT_URI_2 } ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1459,7 +1451,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_2 )))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the patched SystemInfo entry ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1468,7 +1460,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1480,31 +1472,31 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1512,7 +1504,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_NAME_1 & "_patched" )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1527,7 +1519,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_2 )))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the patched SystemInfo entry ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1536,7 +1528,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1548,31 +1540,31 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1582,7 +1574,7 @@ module AtsMec_FederationEnablementAPI_TestCases { { PX_FED_ENDPOINT_URI_1, PX_FED_ENDPOINT_URI_2 } ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1597,7 +1589,7 @@ module AtsMec_FederationEnablementAPI_TestCases { PX_FED_SYSTEM_ID_2 )))))) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the patched SystemInfo entry ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1606,7 +1598,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1618,29 +1610,29 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1650,7 +1642,7 @@ module AtsMec_FederationEnablementAPI_TestCases { { PX_FED_ENDPOINT_URI_1, PX_FED_ENDPOINT_URI_2 } ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1659,7 +1651,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1668,7 +1660,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1680,29 +1672,29 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_BR_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SUB_WRONG & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), // v10 instead of v1 + PICS_ROOT_API & PX_FED_API_SYS_INFO_WRONG & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), // v10 instead of v1 v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1712,7 +1704,7 @@ module AtsMec_FederationEnablementAPI_TestCases { { PX_FED_ENDPOINT_URI_1, PX_FED_ENDPOINT_URI_2 } ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1721,7 +1713,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_400_bad_request )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1730,7 +1722,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1742,36 +1734,36 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_BR_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( m_system_info_update // No data provided ))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1780,7 +1772,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_400_bad_request )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1789,51 +1781,47 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_004_BR_02 - } // End of group patch - - group delete { - /** * @desc Check that the IUT deletes the systemInfo when requested by a MEC Orchestrator */ testcase TC_MEC_MEC040_SRV_MEF_005_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), + valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1842,7 +1830,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_204_no_content )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -1851,7 +1839,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); @@ -1863,33 +1851,33 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_005_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { + var SystemInfoList v_system_info_list := { valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) }; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } - + // Test component configuration f_cf_01_http_up(); - + // Test adapter configuration - + // Preamble f_create_system_info_list(v_system_info_list); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { @@ -1898,7 +1886,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_404_not_found )) { tc_ac.stop; - + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); v_system_info_list[1].systemId := omit; f_selfOrClientSyncAndVerdict(c_tbDone, e_success); @@ -1908,12 +1896,1088 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - + // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_005_NF - } // End of group delete + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters + */ + testcase TC_MEC_MEC040_SRV_MEF_006_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_fed( + mw_subscription_link_list_fed( + mw_links_list + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a subscription link list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_OK_01 + + /** + * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemId query parameters + */ + testcase TC_MEC_MEC040_SRV_MEF_006_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "?subscriptionType=system_update_notification_subscription", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_fed( + mw_subscription_link_list_fed( + mw_links_list( + -, + { + mw_subscription_fed( + v_system_update_notification_subscription_1.links.self_.href + ), + mw_subscription_fed( + v_system_update_notification_subscription_2.links.self_.href + ) + } + ))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a subscription link list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_OK_02 + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters + */ + testcase TC_MEC_MEC040_SRV_MEF_006_OK_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1, {PX_SYSTEM_ID_1, PX_SYSTEM_ID_2}); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2, {PX_SYSTEM_ID_1, PX_SYSTEM_ID_2}); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "?systemId=" & oct2char(unichar2oct(v_system_update_notification_subscription_1.systemId[1], "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_fed( + mw_subscription_link_list_fed( + mw_links_list( + -, + { + mw_subscription_fed( + v_system_update_notification_subscription_1.links.self_.href + ) + } + ))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a subscription link list ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_OK_03 + + /** + * @desc Check that the IUT responds with the correct error code when the request is malformed - Wrong query parameters name + */ + testcase TC_MEC_MEC040_SRV_MEF_006_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "?subscription=system_update_notification_subscription", // Wrong query parameters name + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_BR_01 + + /** + * @desc Check that the IUT responds with the correct error code when the request is malformed - Wrong query parameters value + */ + testcase TC_MEC_MEC040_SRV_MEF_006_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "?subscriptionType=system_update", // Wrong query parameters + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_BR_02 + + /** + * @desc Check that the IUT responds with the list of subscriptions when queried by a MEC Application - With query parameters + */ + testcase TC_MEC_MEC040_SRV_MEF_006_BR_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "?system=" & oct2char(unichar2oct(v_system_update_notification_subscription_1.systemId[1], "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_BR_03 + + /** + * @desc Check that the IUT responds with the correct error code when no subscription found - No query parameters + */ + testcase TC_MEC_MEC040_SRV_MEF_006_NF_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_NF_01 + + /** + * @desc Check that the IUT responds with the correct error code when no subscription found - With query parameters + */ + testcase TC_MEC_MEC040_SRV_MEF_006_NF_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "?systemId=unknown" & oct2char(unichar2oct(v_system_update_notification_subscription_1.systemId[1], "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_006_NF_02 + + } // End of group lookup + + group subscription { + + /** + * @desc Check that the IUT acknowledges the creation of SystemUpdateNotificationSubscription request when commanded by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_FED_API_SUB, + v_headers, + m_http_message_body_json( + m_body_json_system_update_notification_subscription( + m_system_update_notification_subscription( + PX_FED_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_system_update_notification_subscription( + mw_system_update_notification_subscription( + PX_FED_SUB_CALLBACK_URI, + mw_links_fed + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in SystemUpdateNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_FED_API_SUB & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemUpdateNotificationSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_OK_01 + + /** + * @desc Check that the IUT provides a notification when requested by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + -, + -, + mw_http_message_body_json( + mw_body_json_system_update_notification( + mw_system_update_notification( + -, + mw_links_sub( + { href := pattern "http?+" & PICS_ROOT_API & PX_FED_API_SUB & "/" & v_subscription_id} + ))))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_OK_02 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_BR_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_FED_API_SUB, + v_headers, + m_http_message_body_json( + m_body_json_system_update_notification_subscription( + m_system_update_notification_subscription_wrong( + PX_FED_SUB_CALLBACK_URI + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_BR_01 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - No callback + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_FED_API_SUB, + v_headers, + m_http_message_body_json( + m_body_json_system_update_notification_subscription( + m_system_update_notification_subscription_wrong + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_BR_02 + + /** + * @desc Check that the IUT responds with the required SystemUpdateNotificationSubscription when queried by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "/" & v_subscription_id_1, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct SystemUpdateNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_002_OK + + /** + * @desc Check that the IUT responds with the correct error code when no subscription found + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_FED_API_SUB & "/" & PX_FED_UNKNOWN_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_system_update_notification_subscription( + v_system_update_notification_subscription_1 + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct SystemUpdateNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_002_NF + + /** + * @desc Check that the IUT acknowledges the changes of an existing SystemUpdateNotificationSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + v_system_update_notification_subscription_1.systemId := { PX_SYSTEM_ID_1, PX_SYSTEM_ID_2 }; + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_FED_API_SUB & "/" & v_subscription_id_1, + v_headers, + m_http_message_body_json( + m_body_json_system_update_notification_subscription( + v_system_update_notification_subscription_1 + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_system_update_notification_subscription( + v_system_update_notification_subscription_1 + + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully acknowledges the changes of an existing SystemUpdateNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription_1, v_system_update_notification_subscription_2; + var charstring v_subscription_id_1, v_subscription_id_2; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription_1, v_subscription_id_1); + f_create_system_update_notification_subscription(v_system_update_notification_subscription_2, v_subscription_id_2); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_FED_API_SUB & "/" & PX_FED_UNKNOWN_SUBSCRIPTION_ID, + v_headers, + m_http_message_body_json( + m_body_json_system_update_notification_subscription( + v_system_update_notification_subscription_1 + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(v_subscription_id_1); + f_delete_subscription(v_subscription_id_2); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_003_NF + + /** + * @desc Check that the IUT acknowledges the changes of an existing SystemUpdateNotificationSubscription when commanded by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_004_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_FED_API_SUB & "/" & v_subscription_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully acknowledges the cancellation of an existing SystemUpdateNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_004_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_004_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SystemUpdateNotificationSubscription v_system_update_notification_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_system_update_notification_subscription(v_system_update_notification_subscription, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_FED_API_SUB & "/" & PX_FED_UNKNOWN_SUBSCRIPTION_ID, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully acknowledges the cancellation of an existing SystemUpdateNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC040_SRV_MEF_SUB_NOT_004_NF + + } // End of group subscription } // End of module AtsMec_FederationEnablementAPI_TestCases diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn index f5634c7..05a6cd4 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn @@ -50,6 +50,30 @@ module AtsMec_FederationEnablementAPI_TestControl { execute(TC_MEC_MEC040_SRV_MEF_005_OK()); execute(TC_MEC_MEC040_SRV_MEF_005_NF()); + + execute(TC_MEC_MEC040_SRV_MEF_006_OK_01()); + execute(TC_MEC_MEC040_SRV_MEF_006_OK_02()); + execute(TC_MEC_MEC040_SRV_MEF_006_OK_03()); + execute(TC_MEC_MEC040_SRV_MEF_006_BR_01()); + execute(TC_MEC_MEC040_SRV_MEF_006_BR_02()); + execute(TC_MEC_MEC040_SRV_MEF_006_BR_03()); + execute(TC_MEC_MEC040_SRV_MEF_006_NF_01()); + execute(TC_MEC_MEC040_SRV_MEF_006_NF_02()); + + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_OK_01()); + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_OK_02()); + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_BR_01()); + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_001_BR_02()); + + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_002_OK()); + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_002_NF()); + + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_003_OK()); + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_003_NF()); + + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_004_OK()); + execute(TC_MEC_MEC040_SRV_MEF_SUB_NOT_004_NF()); + } } diff --git a/ttcn/AtsMec_FederationEnablement/module.mk b/ttcn/AtsMec_FederationEnablement/module.mk index 2310374..ae6c907 100644 --- a/ttcn/AtsMec_FederationEnablement/module.mk +++ b/ttcn/AtsMec_FederationEnablement/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn b/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn index 60301b6..d31071c 100644 --- a/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn +++ b/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn @@ -491,7 +491,7 @@ module AtsMec_IoTAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_IOT_DEVICE_ID_2, "UTF-8")), + PICS_ROOT_API & PX_IOT_API_SUB & "/" & oct2char(unichar2oct(PX_IOT_DEVICE_ID_2, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -557,7 +557,7 @@ module AtsMec_IoTAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(PX_IOT_DEVICE_ID_UNKNOWN, "UTF-8")), + PICS_ROOT_API & PX_IOT_API_SUB & "/" & oct2char(unichar2oct(PX_IOT_DEVICE_ID_UNKNOWN, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn index 1c300b9..0b244a3 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn @@ -16,12 +16,13 @@ module FederationEnablementAPI_Functions { import from LibHttp_JsonTemplates all; import from LibHttp_TestSystem all; - // LibMec/FixedAccessInformationServiceAPI + // LibMec/FederationEnablementAPI import from FederationEnablementAPI_TypesAndValues all; import from FederationEnablementAPI_Templates all; import from FederationEnablementAPI_Pixits all; // LibMec + import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Pics all; @@ -39,7 +40,7 @@ module FederationEnablementAPI_Functions { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_FED_API_SUB, + PICS_ROOT_API & PX_FED_API_SYS_INFO, v_headers, m_http_message_body_json( m_body_json_fed_system_info( @@ -63,7 +64,7 @@ module FederationEnablementAPI_Functions { log("f_create_system_info: INCONC: Expected message not received"); } } // End of 'alt' statement - + } // End of function f_create_system_info function f_delete_system_info( @@ -71,12 +72,12 @@ module FederationEnablementAPI_Functions { ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; - + f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(p_system_info.systemId, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(p_system_info.systemId, "UTF-8")), v_headers ))); tc_ac.start; @@ -91,7 +92,7 @@ module FederationEnablementAPI_Functions { log("f_delete_system_info: INCONC: Expected message not received"); } } // End of 'alt' statement - + } // End of function f_delete_system_info function f_create_system_info_list( @@ -114,4 +115,91 @@ module FederationEnablementAPI_Functions { } } // End of function f_delete_system_info_list + function f_create_system_update_notification_subscription( + out SystemUpdateNotificationSubscription p_system_update_notification_subscription, + out charstring p_subscription_id, + in template (omit) SystemIds p_system_ids := omit, + in template (omit) TimeStamp p_expiry_deadline := omit + ) runs on HttpComponent { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_FED_API_SUB, + v_headers, + m_http_message_body_json( + m_body_json_system_update_notification_subscription( + m_system_update_notification_subscription( + PX_FED_SUB_CALLBACK_URI, + -, + p_system_ids, + p_expiry_deadline + + )))))); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_system_update_notification_subscription( + mw_system_update_notification_subscription( + PX_FED_SUB_CALLBACK_URI, + mw_links_fed + )))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_FED_API_SUB & "/(?*)", + 0 + ); + p_system_update_notification_subscription := v_response.response.body.json_body.systemUpdateNotificationSubscription; + log("f_create_system_update_notification_subscription: INFO: IUT successfully responds to the subscription: ", p_system_update_notification_subscription); + log("f_create_system_update_notification_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of function f_create_system_update_notification_subscription + + function f_delete_subscription( + in charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_FED_API_SUB & "/" & p_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("f_delete_sensor_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_delete_subscription + } // End of modue FederationEnablementAPI_Functions \ No newline at end of file diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn index 2697740..0220a27 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn @@ -1,8 +1,8 @@ module FederationEnablementAPI_Pixits { - + // JSON import from Json all; - + // LibCommon import from LibCommon_BasicTypesAndValues all; @@ -39,4 +39,12 @@ module FederationEnablementAPI_Pixits { modulepar Json.String PX_FED_ENDPOINT_URI_3 := ""; + modulepar charstring PX_FED_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; + + modulepar charstring PX_FED_UNKNOWN_SUBSCRIPTION_ID := "UNKNOWN_SUBSCRIPTION_ID"; + + modulepar charstring PX_SYSTEM_ID_1 := ""; + + modulepar charstring PX_SYSTEM_ID_2 := ""; + } // End of module FederationEnablementAPI_Pixits \ No newline at end of file diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Templates.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Templates.ttcn index a724d4e..8ebb71e 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Templates.ttcn @@ -1,11 +1,14 @@ module FederationEnablementAPI_Templates { - + // JSON import from Json all; // LibCommon import from LibCommon_BasicTypesAndValues all; + // LibMec + import from LibMec_TypesAndValues all; + // LibMec/EdgePlatformApplicationEnablementAPI import from EdgePlatformApplicationEnablementAPI_TypesAndValues all; @@ -48,4 +51,159 @@ module FederationEnablementAPI_Templates { endPoint := p_end_point } // End of template mw_system_info_update + template (value) FedServiceInfo m_fed_service_info( + in template (value) Json.String p_system_id, + in template (value) MecHostInformation p_mec_host_information, + in template (value) ServiceInfo p_service_info + ) := { + systemId := p_system_id, + mecHostInformation := p_mec_host_information, + serviceInfo := p_service_info + } // End of template m_fed_service_info + + template (present) FedServiceInfo mw_fed_service_info( + template (present) Json.String p_system_id := ?, + template (present) MecHostInformation p_mec_host_information := ?, + template (present) ServiceInfo p_service_info := ? + ) := { + systemId := p_system_id, + mecHostInformation := p_mec_host_information, + serviceInfo := p_service_info + } // End of template mw_fed_service_info + + template (omit) MecHostInformation m_mec_host_information( + in template (omit) Json.String p_host_name := omit, + in template (value) KeyValuePairs p_host_id + ) := { + hostName := p_host_name, + hostId := p_host_id + } // End of template m_mec_host_information + + template (present) MecHostInformation mw_mec_host_information( + template Json.String p_host_name := *, + template (present) KeyValuePairs p_host_id := ? + ) := { + hostName := p_host_name, + hostId := p_host_id + } // End of template mw_mec_host_information + + template (omit) SystemUpdateNotificationSubscription m_system_update_notification_subscription( + in template (value) Json.AnyURI p_callback_reference, + in template (omit) FederationEnablementAPI_TypesAndValues.Links p_links := omit, + in template (omit) SystemIds p_system_id := omit, + in template (omit) TimeStamp p_expiry_deadline := omit + ) := { + subscriptionType := "SystemUpdateNotificationSubscription", + callbackReference := p_callback_reference, + links := p_links, + systemId := p_system_id, + expiryDeadline := p_expiry_deadline + } // End of template m_system_update_notification_subscription + + template (omit) SystemUpdateNotificationSubscription m_system_update_notification_subscription_wrong( + in template (omit) Json.AnyURI p_callback_reference := omit, + in template (omit) FederationEnablementAPI_TypesAndValues.Links p_links := omit, + in template (omit) SystemIds p_system_id := omit, + in template (omit) TimeStamp p_expiry_deadline := omit + ) := { + subscriptionType := "SystemUpdateNotificationSub", + callbackReference := p_callback_reference, + links := p_links, + systemId := p_system_id, + expiryDeadline := p_expiry_deadline + } // End of template m_system_update_notification_subscription_wrong( + + template (present) SystemUpdateNotificationSubscription mw_system_update_notification_subscription( + template (present) Json.AnyURI p_callback_reference := ?, + template FederationEnablementAPI_TypesAndValues.Links p_links := *, + template SystemIds p_system_id := *, + template TimeStamp p_expiry_deadline := * + ) := { + subscriptionType := "SystemUpdateNotificationSubscription", + callbackReference := p_callback_reference, + links := p_links, + systemId := p_system_id, + expiryDeadline := p_expiry_deadline + } // End of template mw_system_update_notification_subscription + + template (value) FederationEnablementAPI_TypesAndValues.Links m_links_fed( + in template (value) FederationEnablementAPI_TypesAndValues.LinkType p_self_ + ) := { + self_ := p_self_ + } // End of template m_links_fed + + template (present) FederationEnablementAPI_TypesAndValues.Links mw_links_fed( + template (present) FederationEnablementAPI_TypesAndValues.LinkType p_self_ := ? + ) := { + self_ := p_self_ + } // End of template mw_links_fed + + template (value) FederationEnablementAPI_TypesAndValues.SubscriptionLinkList m_subscription_link_list_fed( + in template (value) LinksList p_links + ) := { + links := p_links + } // End of template m_subscription_link_list_fed + + template (present) FederationEnablementAPI_TypesAndValues.SubscriptionLinkList mw_subscription_link_list_fed( + template (present) LinksList p_links := ? + ) := { + links := p_links + } // End of template mw_subscription_link_list_fed + + template (value) SystemUpdateNotification m_system_update_notification( + in template (value) SystemInfoList p_updated_system_info, + in template (value) LinksSub p_links + ) := { + notificationType := "SystemUpdateNotification", + updatedSystemInfo := p_updated_system_info, + links := p_links + } // End of template m_system_update_notification + + template (present) SystemUpdateNotification mw_system_update_notification( + template (present) SystemInfoList p_updated_system_info := ?, + template (present) LinksSub p_links := ? + ) := { + notificationType := "SystemUpdateNotification", + updatedSystemInfo := p_updated_system_info, + links := p_links + } // End of template mw_system_update_notification + + template (present) LinksSub mw_links_sub( + template (present) FederationEnablementAPI_TypesAndValues.LinkType p_subscription := ? + ) := { + subscription := p_subscription + } // End of template mw_links_sub + + template (value) LinksList m_links_list( + in template (value) FederationEnablementAPI_TypesAndValues.LinkType p_self_, + in template (value) FederationEnablementAPI_TypesAndValues.Subscriptions p_subscription + ) := { + self_ := p_self_, + subscription := p_subscription + } // End of template m_links_list + + template (present) LinksList mw_links_list( + template (present) FederationEnablementAPI_TypesAndValues.LinkType p_self_ := ?, + template (present) FederationEnablementAPI_TypesAndValues.Subscriptions p_subscription := ? + ) := { + self_ := p_self_, + subscription := p_subscription + } // End of template mw_links_list + + template (value) FederationEnablementAPI_TypesAndValues.Subscription m_subscription_fed( + in Json.AnyURI p_href, + in Json.String p_subscription_type := "SystemUpdateNotificationSubscription" + ) := { + href := p_href, + subscriptionType := p_subscription_type + } // End of template m_subscription_fed + + template (present) FederationEnablementAPI_TypesAndValues.Subscription mw_subscription_fed( + template (present) Json.AnyURI p_href := ?, + template (present) Json.String p_subscription_type := "SystemUpdateNotificationSubscription" + ) := { + href := p_href, + subscriptionType := p_subscription_type + } // End of template mw_subscription_fed + } // End of module FederationEnablementAPI_Templates \ No newline at end of file diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn index 77cf613..4723a52 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn @@ -1,23 +1,32 @@ /** - * @desc The ETSI MEC ISG MEC040 Radio Network Information API described using OpenAPI - * @see TODO + * @version $Url$ + * $Id$ + * @desc The ETSI MEC ISG MEC040 Federation enablement API + * @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. */ module FederationEnablementAPI_TypesAndValues { - + // JSON import from Json all; - + // LibCommon import from LibCommon_BasicTypesAndValues all; + // LibMec + import from LibMec_TypesAndValues all; + + // LibMec/EdgePlatformApplicationEnablementAPI import from EdgePlatformApplicationEnablementAPI_TypesAndValues all; - + /** * @desc Information provided by the MEC orchestrator as a part of the "Registration of MEC system to the federation" * @member systemId Identifier of the MEC system * @member systemName The name of the MEC system * @member systemProvider Provider of the MEC system - * @see Draft ETSI GS MEC 040 V3.1.3 (2022-12) Table 6.2.2-1: Attributes of SystemInfo + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.2-1: Attributes of SystemInfo */ type record SystemInfo { Json.String systemId optional, // Shall be absent in POST request @@ -25,18 +34,154 @@ module FederationEnablementAPI_TypesAndValues { Json.String systemProvider } // End of type SystemInfo type set of SystemInfo SystemInfoList; + type set of Json.String SystemIds; /** * @desc information provided by MEC orchestrator as a part of the "Update of MEC system(s) to the federation" * @member systemName The name of the MEC system * @member endpoint Endpoint information (e.g. URI, FQDN, IP address) of MEC federator - * @see Draft ETSI GS MEC 040 V3.1.3 (2022-12) Table 6.2.3-1: Attributes of SystemInfoUpdate + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.3-1: Attributes of SystemInfoUpdate */ type record SystemInfoUpdate { - Json.String systemName optional, + Json.String systemName optional, EdgePlatformApplicationEnablementAPI_TypesAndValues.EndPointInfo endPoint optional } // End of type SystemInfoUpdate + /** + * @desc Information of a MEC service in a MEC federation + * @member systemId Identifier of the MEC system + * @member mecHostInformation Represent the information of the MEC host + * @member serviceInfo Represent the information of a MEC service + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.4-1: Attributes of FedServiceInfo + */ + type record FedServiceInfo { + Json.String systemId, + MecHostInformation mecHostInformation, + ServiceInfo serviceInfo + } // End of type FedServiceInfo + + /** + * @desc The type represents the information of the MEC host + * @member hostName Human-readable name of MEC host + * @member hostId Deployment-specific information to identify a MEC host + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.4-1: Attributes of FedServiceInfo + */ + type record MecHostInformation { + Json.String hostName optional, + KeyValuePairs hostId + } + + /** + * @desc This data type represents a list of key-value pairs + * @member key_name + * @member key_value + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.4-1: Attributes of FedServiceInfo + */ + type record KeyValuePairs { + Json.String key_name, + anytype key_value // FIXME To be refined + } + + /** + * @desc This type represents a subscription to the notifications from the MEC federator related to information update of the MEC systems in the MEC federation. + * @param subscriptionType Shall be set to "SystemUpdateNotificationSubscription" + * @param callbackReference URI selected by the MEC orchestrator to receive notifications on the subscribed MEC system information updates in the MEC federation. + * @param _links Hyperlink related to the resource + * @param systemId Identifier of the MEC system + * @param expiryDeadline The expiration time of the subscription determined by the MEC Federation Enablement Service + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.2-1: Attributes of SystemUpdateNotificationSubscriptionn + */ + type record SystemUpdateNotificationSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, // For error cases + Links links optional, + SystemIds systemId optional, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a list of links related to existing subscriptions for subscription service consumers of the MEC federation + * @param _links List of hyperlinks related to the resource + * @see EETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.3-1: Attributes of SubscriptionLinkList + */ + type record SubscriptionLinkList { + LinksList links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents the information that the MEC federator notifies the subscribed MEC orchestrator about the information update of the MEC systems in the MEC federation + * @param notificationType Shall be set to "SystemUpdateNotification" + * @param updatedSystemInfo Updated information of the MEC system(s) in the MEC federation + * @param _links Object containing hyperlinks related to the resource + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.4.2-1: Attributes of SystemUpdateNotification + */ + type record SystemUpdateNotification { + Json.String notificationType, + SystemInfoList updatedSystemInfo, + LinksSub links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc Object containing hyperlinks related to the resource + * @member subscription A link to the related subscription + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.4.2-1: Attributes of SystemUpdateNotification + */ + type record LinksSub { + LinkType subscription + } + + /** + * @desc List of hyperlinks related to the resource + * @param self_ List of hyperlinks related to the resource + * @param subscription A link to a subscription + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.3-1: Attributes of SubscriptionLinkList + */ + type record LinksList { + LinkType self_, + Subscriptions subscription + } with { + variant (self_) "name as 'self'"; + } + + /** + * @desc A link to a subscription + * @member href The URI referring to the subscription + * @member subscriptionType Type of the subscription + * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.3-1: Attributes of SubscriptionLinkList + */ + type record Subscription { + Json.AnyURI href, + Json.String subscriptionType + } + type set of Subscription Subscriptions; + + /** + * @desc Self-referring URI + * @member href URI referring to a resource + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.6.1-1: Definition of type LinkType + */ + type record LinkType { + Json.AnyURI href + } + + /** + * @desc Hyperlink related to the resource + * @member self_ Self-referring URI + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.1-1: Attributes of the TestNotification + */ + type record Links { + LinkType self_ + } with { + variant (self_) "name as 'self'"; + } + } with { + extension "anytype integer, float, boolean, universal charstring"; encode "JSON" } // End of module FederationEnablementAPI_TypesAndValues \ No newline at end of file diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn index 66b7770..b7249fd 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn @@ -105,18 +105,18 @@ module SensorsSharingService_Functions { )))))) { tc_ac.stop; - // Extract HTTP Location header - var charstring_list v_subscription_id; - f_get_header(v_response.response.header, "Location", v_subscription_id); - // Extract HTTP subssription id - p_subscription_id := regexp( - v_subscription_id[0], - "?+" & PX_SENS_LIST_SUBS_DISCOVERY & "/(?*)", - 0 - ); - p_sensor_discovery_event_subscription := v_response.response.body.json_body.sensor_discovery_event_subscription; - log("f_create_sensor_discovery_subscription: INFO: IUT successfully responds to the subscription: ", p_sensor_discovery_event_subscription); - log("f_create_sensor_discovery_subscription: INFO: p_subscription_id: ", p_subscription_id); + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_SENS_LIST_SUBS_DISCOVERY & "/(?*)", + 0 + ); + p_sensor_discovery_event_subscription := v_response.response.body.json_body.sensor_discovery_event_subscription; + log("f_create_sensor_discovery_subscription: INFO: IUT successfully responds to the subscription: ", p_sensor_discovery_event_subscription); + log("f_create_sensor_discovery_subscription: INFO: p_subscription_id: ", p_subscription_id); } [] tc_ac.timeout { log("f_create_sensor_discovery_subscription: Expected message not received"); diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn index 0dfe3b6..e7324c0 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn @@ -42,7 +42,7 @@ module SensorsSharingService_TypesAndValues { * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.2.2-1: Definition of type SensorStatusInfo */ type enumerated SensorStatusType { - ERROR, + ERROR, ONLINE, OFFLINE } @@ -74,7 +74,7 @@ module SensorsSharingService_TypesAndValues { * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests * @param sensorInfo Object containing the characteristics of the sensor(s) to be selected for the subscription * @param geographicalArea The parameters describing the area to subscribe - * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @param expiryDeadline The expiration time of the subscription * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.1-1: Definition of type SensorDiscoveryEventSubscription */ type record SensorDiscoveryEventSubscription { @@ -100,7 +100,7 @@ module SensorsSharingService_TypesAndValues { Json.String sensorIdentifier, SensorCharacteristics sensorCharacteristicList optional } - type set of SensorCharacteristicInfo SensorCharacteristicInfos; + type set of SensorCharacteristicInfo SensorCharacteristicInfos; /** * @desc This type represents a subscription to notifications from the Sensor-sharing Service regarding events related to changes in sensor information @@ -110,7 +110,7 @@ module SensorsSharingService_TypesAndValues { * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests * @param sensorIdentifierList Unique identifiers of the sensors - * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @param expiryDeadline The expiration time of the subscription * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.2-1: Definition of type SensorStatusSubscription */ type record SensorStatusSubscription { @@ -134,7 +134,7 @@ module SensorsSharingService_TypesAndValues { * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the location server and the service consumer for notifications * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests * @param sensorIdentifierList Unique identifiers of the sensors - * @param expiryDeadline The expiration time of the subscription determined by the QoS Measurement Subscribe Service + * @param expiryDeadline The expiration time of the subscription * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.3-1: Definition of type SensorDataSubscription */ type record SensorDataSubscription { diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 11c0d9f..badb4a6 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -98,9 +98,11 @@ module LibMec_Pixits { modulepar charstring PX_FED_API_LIST_SYSTEM_INFO := "fed_enablement/v1/fed_resources/system_info"; - modulepar charstring PX_FED_API_SUB := "fed_enablement/v1/fed_resources/system_info"; + modulepar charstring PX_FED_API_SYS_INFO := "fed_enablement/v1/fed_resources/system_info"; - modulepar charstring PX_FED_API_SUB_WRONG := "fed_enablement/v10/fed_resources/system_info"; // v10 instead of v1 + modulepar charstring PX_FED_API_SYS_INFO_WRONG := "fed_enablement/v10/fed_resources/system_info"; // v10 instead of v1 + + modulepar charstring PX_FED_API_SUB := "fed_enablement/v1/fed_resources/subscription"; modulepar charstring PX_IOT_API_LIST_DEVICE_INFO := "iots/v1/registered_devices"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 146d6ef..0a6cc8d 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -168,15 +168,18 @@ module LibHttp_JsonMessageBodyTypes { ProvChgUuUniSubscription provChgUuUniSubscription, ProvChgUuMbmsSubscription provChgUuMbmsSubscription, ProvChgPc5Subscription provChgPc5Subscription, - V2xMsgDistributionServerInfo v2xMsgDistributionServerInfo, // ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.2.5-1: Attributes of the V2xMsgDistributionServerInfo + V2xMsgDistributionServerInfo v2xMsgDistributionServerInfo, // ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.5-1: Attributes of the V2xMsgDistributionServerInfo V2xMsgSubscription v2xMsgSubscription, - PredQosSubscription predQosSubscription, // ETSI GS MEC 030 V3.1.1 (2023-03) Table 6.3.6-1: Attributes of the PredQosSubscription + PredQosSubscription predQosSubscription, // ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.6-1: Attributes of the PredQosSubscription ProvChgUuUniNotification provChgUuUniNotification, ProvChgUuMbmsNotification provChgUuMbmsNotification, ProvChgPc5Notification provChgPc5Notification, - SystemInfo systemInfo, // ETSI GS MEC 040 V3.1.1 Clause 6.2.2 Type: SystemInfo - SystemInfoList systemInfoList, // ETSI GS MEC 040 V3.1.1 Clause 6.2.2 Type: SystemInfo - SystemInfoUpdate systemInfoUpdate, // ETSI GS MEC 040 V3.1.1 Clause 6.2.3 Type: SystemInfoUpdate + SystemInfo systemInfo, // ETSI GS MEC 040 V3.2.1 (2024-03) Clause 6.2.2 Type: SystemInfo + SystemInfoList systemInfoList, // ETSI GS MEC 040 V3.2.1 (2024-03) Clause 6.2.2 Type: SystemInfo + SystemInfoUpdate systemInfoUpdate, // ETSI GS MEC 040 V3.2.1 (2024-03) Clause 6.2.3 Type: SystemInfoUpdate + SystemUpdateNotificationSubscription systemUpdateNotificationSubscription, // ETSI GS MEC 040 V3.2.1 (2024-03) Clause 6.3.2 Type: SystemUpdateNotificationSubscription + SystemUpdateNotification systemUpdateNotification, // ETSI GS MEC 040 V3.2.1 (2024-03) Clause 6.4.2 Type: SystemUpdateNotification + FederationEnablementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_fed, IoTAPI_TypesAndValues.DeviceInfo deviceInfo_iot, // ETSI GS MEC 033 V3.1.1 Clause 6.2.2 Type: DeviceInfo IoTAPI_TypesAndValues.DeviceInfoList deviceInfoList_iot, // ETSI GS MEC 033 V3.1.1 Clause 6.2.2 Type: DeviceInfo IotPlatformInfoList iotPlatformInfoList, // ETSI GS MEC 033 V3.1.1 Clause 6.2.3 Type: IotPlatformInfo diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index e95d0df..dd41e8f 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1716,6 +1716,42 @@ module LibHttp_JsonTemplates { systemInfoUpdate := p_systemInfoUpdate } // End of template mw_body_json_fed_system_info_update + template (value) JsonBody m_body_json_system_update_notification_subscription( + in template (value) SystemUpdateNotificationSubscription p_systemUpdateNotificationSubscription + ) := { + systemUpdateNotificationSubscription := p_systemUpdateNotificationSubscription + } // End of template m_body_json_system_update_notification_subscription + + template (present) JsonBody mw_body_json_system_update_notification_subscription( + template (present) SystemUpdateNotificationSubscription p_systemUpdateNotificationSubscription := ? + ) := { + systemUpdateNotificationSubscription := p_systemUpdateNotificationSubscription + } // End of template mw_body_json_system_update_notification_subscription + + template (value) JsonBody m_body_json_system_update_notification( + in template (value) SystemUpdateNotification p_systemUpdateNotification + ) := { + systemUpdateNotification := p_systemUpdateNotification + } // End of template m_body_json_system_update_notification + + template (present) JsonBody mw_body_json_system_update_notification( + template (present) SystemUpdateNotification p_systemUpdateNotification := ? + ) := { + systemUpdateNotification := p_systemUpdateNotification + } // End of template mw_body_json_system_update_notification + + template (value) JsonBody m_body_json_subscription_link_list_fed( + in template (value) FederationEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list_fed + ) := { + subscriptionLinkList_fed := p_subscription_link_list_fed + } // End of template m_body_json_subscription_link_list_fed + + template (present) JsonBody mw_body_json_subscription_link_list_fed( + template (present) FederationEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list_fed := ? + ) := { + subscriptionLinkList_fed := p_subscription_link_list_fed + } // End of template mw_body_json_subscription_link_list_fed + } // End of group federation group qos_meas { -- GitLab From cb13ac43a3b5c6e221bda4fe2c136abc714a480c Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 13 Mar 2025 15:45:34 +0100 Subject: [PATCH 24/54] Editorial changes in AtsMec_SensorsSharingService --- .../AtsMec_SensorsSharingService_TestCases.ttcn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 4afc871..7e11f3d 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -1606,7 +1606,7 @@ module AtsMec_SensorsSharingService_TestCases { // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { - log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + log("*** " & testcasename() & ": FAIL: IUT failed in SensorDiscoveryEventSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; @@ -2206,7 +2206,7 @@ module AtsMec_SensorsSharingService_TestCases { // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { - log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + log("*** " & testcasename() & ": FAIL: IUT failed in SensorStatusSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; @@ -2824,7 +2824,7 @@ module AtsMec_SensorsSharingService_TestCases { // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { - log("*** " & testcasename() & ": FAIL: IUT failed in QoSMeasureSubscription ***"); + log("*** " & testcasename() & ": FAIL: IUT failed in SensorDataSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; @@ -2917,7 +2917,7 @@ module AtsMec_SensorsSharingService_TestCases { testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SensorDataSubscription v_sensor_data_subscription + var SensorDataSubscription v_sensor_data_subscription; var charstring v_subscription_id; // Test control -- GitLab From d6254b012c0f237dcc2c3f1a0718db9785e5e556 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 3 Apr 2025 19:39:07 +0200 Subject: [PATCH 25/54] Partial validation of AtsIoT --- ccsrc/Protocols/Json/json_codec.cc | 5 + .../Json/json_codec_factory_mec033.hh | 46 ++ ccsrc/Protocols/Json/json_codec_mec033.cc | 91 ++++ ccsrc/Protocols/Json/json_codec_mec033.hh | 25 + ccsrc/Protocols/Json/module.mk | 1 + etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ | 8 +- etc/AtsMec_IoT/AtsMec_IoT_Sandbox.cf_ | 134 +++++ ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn | 497 ++++++++++++------ .../AtsMec_IoT/AtsMec_IoTAPI_TestControl.ttcn | 5 +- ...ycleAndOperationGrantingAPI_Templates.ttcn | 68 +-- ...ndOperationGrantingAPI_TypesAndValues.ttcn | 119 +++-- ...ormApplicationEnablementAPI_Templates.ttcn | 16 +- ...plicationEnablementAPI_TypesAndValues.ttcn | 10 +- ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Functions.ttcn | 86 ++- ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Pixits.ttcn | 66 +-- ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Templates.ttcn | 6 +- .../IoTAPI/ttcn/IoTAPI_TypesAndValues.ttcn | 6 +- .../ttcn/LibCommon_Sync.ttcn | 73 +-- 18 files changed, 874 insertions(+), 388 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec033.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec033.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec033.hh create mode 100644 etc/AtsMec_IoT/AtsMec_IoT_Sandbox.cf_ diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index 012788d..b5923db 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -163,6 +163,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.mtsSessionInfo() = mts_session_info; + } else if ((it->second[0] == '[') && (it->second.find("\"iotPlatformId\"") != std::string::npos)) { + IoTAPI__TypesAndValues::IotPlatformInfoList iot_platform_info_list; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + iot_platform_info_list.decode(IoTAPI__TypesAndValues::IotPlatformInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.iotPlatformInfoList() = iot_platform_info_list; } else if (it->second.find("\"detail\"") != std::string::npos) { LibMec__TypesAndValues::ProblemDetails problem_details; problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec033.hh b/ccsrc/Protocols/Json/json_codec_factory_mec033.hh new file mode 100644 index 0000000..0678903 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec033.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec033.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 / TTF T043 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec033.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec033 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec033: public codec_factory { + static json_codec_factory_mec033 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec033 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec033() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec033", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec033(); + }; +}; // End of class json_codec_factory_mec033 diff --git a/ccsrc/Protocols/Json/json_codec_mec033.cc b/ccsrc/Protocols/Json/json_codec_mec033.cc new file mode 100644 index 0000000..740d3bf --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec033.cc @@ -0,0 +1,91 @@ +#include +#include +#include + +#include "json_codec_factory_mec033.hh" + +#include "loggers.hh" + +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec033::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +{ + loggers::get_instance().log_msg(">>> json_codec_mec033::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_iotPlatformInfo)) { + const IoTAPI__TypesAndValues::IotPlatformInfo& iot_platform_info = msg.iotPlatformInfo(); + iot_platform_info.encode(IoTAPI__TypesAndValues::IotPlatformInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_deviceInfo__iot)) { + const IoTAPI__TypesAndValues::DeviceInfo& device_info = msg.deviceInfo__iot(); + device_info.encode(IoTAPI__TypesAndValues::DeviceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec033::encode"); + return 0; +} + +int json_codec_mec033::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +{ + loggers::get_instance().log_msg(">>> json_codec_mec033::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec033::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec033::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec033::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + // ..and create the decoding buffer + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec033::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + + if (it->second.find("\"iotPlatformId\"") != std::string::npos) { + IoTAPI__TypesAndValues::IotPlatformInfo iot_platform_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + iot_platform_info.decode(IoTAPI__TypesAndValues::IotPlatformInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.iotPlatformInfo() = iot_platform_info; + } else if ((it->second[0] == '[') && (it->second.find("\"deviceId\"") != std::string::npos)) { + IoTAPI__TypesAndValues::DeviceInfoList device_info_list; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + device_info_list.decode(IoTAPI__TypesAndValues::DeviceInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.deviceInfoList__iot() = device_info_list; + } else if (it->second.find("\"deviceId\"") != std::string::npos) { + IoTAPI__TypesAndValues::DeviceInfo device_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + device_info.decode(IoTAPI__TypesAndValues::DeviceInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.deviceInfo__iot() = device_info; + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec033::decode: ", (const Base_Type&)msg); + return 0; +} + +json_codec_factory_mec033 json_codec_factory_mec033::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec033.hh b/ccsrc/Protocols/Json/json_codec_mec033.hh new file mode 100644 index 0000000..f7ee71d --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec033.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" + +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec033: public json_codec +{ +public: + explicit json_codec_mec033() : json_codec() { }; + virtual ~json_codec_mec033() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec033 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index 593ce97..c33311a 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -4,6 +4,7 @@ sources := \ json_codec_mec013.cc \ json_codec_mec030.cc \ json_codec_mec028.cc \ + json_codec_mec033.cc \ json_codec_mec040.cc \ diff --git a/etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ b/etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ index a53911e..994c9a1 100644 --- a/etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ +++ b/etc/AtsMec_IoT/AtsMec_IoT_Mockoon.cf_ @@ -35,10 +35,10 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" -#system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, diff --git a/etc/AtsMec_IoT/AtsMec_IoT_Sandbox.cf_ b/etc/AtsMec_IoT/AtsMec_IoT_Sandbox.cf_ new file mode 100644 index 0000000..8ed8b1c --- /dev/null +++ b/etc/AtsMec_IoT/AtsMec_IoT_Sandbox.cf_ @@ -0,0 +1,134 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" #"192.168.1.39" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application' + +# LibMec_Pixits + +# LibMec/IoTAPI +IoTAPI_Pixits.PX_REQUESTED_PLTF_ID := "d0997381-7536-4ded-849e-e2f4eee20e90" # Used to register devices, this is a real IoT platform +IoTAPI_Pixits.PX_MB_TRANSPORTINFO_ID_1 := "9f2bd66e-0dff-11f0-ae86-8b5374b85d18" +IoTAPI_Pixits.PX_MB_TRANSPORTINFO_NAME_1 := "laboai-acme-ic-cse" +IoTAPI_Pixits.PX_MB_TRANSPORTINFO_TYPE_1 := MB_TOPIC_BASED +IoTAPI_Pixits.PX_MB_TRANSPORTINFO_PROTOCOL_1 := "MQTT" +IoTAPI_Pixits.PX_MB_TRANSPORTINFO_VERSION_1 := "3.1" +IoTAPI_Pixits.PX_IOT_ENDPOINT_URI_1 := "mqtt://laboai-acme-ic-cse:1883" + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_IoT/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server_mode=1,use_ssl=0)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec033)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT responds with the list of registered IoT devices when queried by a Service Consumer +AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_001_OK_01 +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_001_OK_02 +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_001_OK_03 +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_001_OK_04 +# Check that the IUT registers the information of an IoT device when requested by a Service Consumer - Using IoT platform identifier +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_002_OK_01 +# Check that the IUT registers the information of an IoT device when requested by a Service Consumer - Using IoT MEC traffic rules +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_002_OK_02 +# Check that the IUT returns an error when Service Consumer request to register an IoT device with incorrect parameters +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_002_BR +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_003_OK +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_003_NF +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_004_OK +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_004_NF +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_004_BR +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_005_OK +# +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_IOTS_IOTDEV_005_NF +# Check that the IUT responds with the list of registered IoT platforms when queried by a Service Consumer +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_001_OK +# Check that the IUT registers the information of a new IoT platform when requested by a Service Consumer +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_002_OK +# Check that the IUT returns an error when Service Consumer request to register an IoT device with incorrect parameters +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_002_BR +# Check that the IUT returns the IoT platform information when requested by Service Consumer specifying the IoT platform identifier +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_003_OK +# Check that the IUT returns error when Service Consumer request to retrieve a not registered IoT platform +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_003_NF +# Check that the IUT updates the information about a registered IoT platform when requested by a Service Consumer +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_004_OK +# Check that the IUT returns an error when a Service Consumer requests to update a not registered IoT platform +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_004_NF +# Check that the IUT deregisters an IoT platform information when requested by a Service Consumer specifying the registered IoT platform identifier +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_005_OK +# Check that the IUT returns an error when a Service Consumer request to deregister an IoT platform using incorrect parameters +#AtsMec_IoTAPI_TestCases.TC_MEC_MEC033_MEX_IOTS_IOTPLAT_005_NF + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn b/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn index d31071c..77185b0 100644 --- a/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn +++ b/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestCases.ttcn @@ -40,11 +40,11 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_IOTS_IOTDEV_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var DeviceInfoList v_device_info_list := { - valueof(m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, PX_IOT_DEVICE_IMSI_1)), - valueof(m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2)), - valueof(m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3)) - }; + var DeviceInfoList v_device_info_list := valueof({ + m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, -, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -82,8 +82,7 @@ module AtsMec_IoTAPI_TestCases { PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, - PX_IOT_DEVICE_SUPI_1, - PX_IOT_DEVICE_IMSI_1 + PX_IOT_DEVICE_SUPI_1 ), mw_device_info( PX_IOT_DEVICE_ID_2, @@ -123,11 +122,11 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_IOTS_IOTDEV_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var DeviceInfoList v_device_info_list := { - valueof(m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, PX_IOT_DEVICE_IMSI_1)), - valueof(m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2)), - valueof(m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3)) - }; + var DeviceInfoList v_device_info_list := valueof({ + m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, -, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -192,11 +191,11 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_IOTS_IOTDEV_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var DeviceInfoList v_device_info_list := { - valueof(m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, PX_IOT_DEVICE_IMSI_1)), - valueof(m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2)), - valueof(m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3)) - }; + var DeviceInfoList v_device_info_list := valueof({ + m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, -, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -261,11 +260,11 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_IOTS_IOTDEV_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var DeviceInfoList v_device_info_list := { - valueof(m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, PX_IOT_DEVICE_IMSI_1)), - valueof(m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2)), - valueof(m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3)) - }; + var DeviceInfoList v_device_info_list := valueof({ + m_device_info(PX_IOT_DEVICE_ID_1, PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, -, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_2, PX_IOT_DEVICE_AUTH_2, -, PX_IOT_DEVICE_SUPI_2, PX_IOT_DEVICE_IMSI_2, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}), + m_device_info(PX_IOT_DEVICE_ID_3, PX_IOT_DEVICE_AUTH_3, -, PX_IOT_DEVICE_SUPI_3, PX_IOT_DEVICE_IMSI_3, PX_REQUESTED_PLTF_ID, { m_traffic_rule_descriptor(PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, {m_traffic_filter({ PX_TRAFFIC_FILTER_SRC_ADDRESS }, { PX_TRAFFIC_FILTER_DST_ADDRESS }, { PX_TRAFFIC_FILTER_SRC_PORT }, { PX_TRAFFIC_FILTER_DST_PORT }, { PX_TRAFFIC_FILTER_PROTOCOL })}, PX_TRAFFIC_RULE_ACTION )}) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -329,12 +328,13 @@ module AtsMec_IoTAPI_TestCases { group subscription { /** - * @desc Check that the IUT registers the information of an IoT device when requested by a Service Consumer + * @desc Check that the IUT registers the information of an IoT device when requested by a Service Consumer - Using IoT platform identifier */ - testcase TC_MEC_MEC033_IOTS_IOTDEV_002_OK() runs on HttpComponent system HttpTestAdapter { + testcase TC_MEC_MEC033_IOTS_IOTDEV_002_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; + var charstring v_resource_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -349,6 +349,7 @@ module AtsMec_IoTAPI_TestCases { // Test adapter configuration // Preamble + action("Check that PX_REQUESTED_PLTF_ID is set with the identifier of a registed IoT platform") f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -362,7 +363,127 @@ module AtsMec_IoTAPI_TestCases { PX_IOT_DEVICE_AUTH_1, -, PX_IOT_DEVICE_SUPI_1, - PX_IOT_DEVICE_IMSI_1 + -, + PX_REQUESTED_PLTF_ID, + { + m_traffic_rule_descriptor( + PX_TRAFFIC_RULE_ID, + PX_TRAFFIC_FILTERTYPE, + PX_TRAFFIC_RULE_PRIORITY, + { + m_traffic_filter( + { PX_TRAFFIC_FILTER_SRC_ADDRESS }, + { PX_TRAFFIC_FILTER_DST_ADDRESS }, + { PX_TRAFFIC_FILTER_SRC_PORT }, + { PX_TRAFFIC_FILTER_DST_PORT }, + { PX_TRAFFIC_FILTER_PROTOCOL } + ) + }, + PX_TRAFFIC_RULE_ACTION + ) + } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_iot_device_info( + mw_device_info( + PX_IOT_DEVICE_ID_1, + PX_IOT_DEVICE_AUTH_1, + true, + PX_IOT_DEVICE_SUPI_1 + )))))) -> value v_response { + tc_ac.stop; + + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_resource_id := regexp( + v_header_location[0], + "?+" & PX_IOT_API_LIST_PLTF_SUB & "/(?*)", + 0 + ); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a DeviceInfo: ", v_resource_id, " ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_device_info(v_response.response.body.json_body.deviceInfo_iot); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC033_IOTS_IOTDEV_002_OK_01 + + /** + * @desc Check that the IUT registers the information of an IoT device when requested by a Service Consumer - Using IoT MEC traffic rules + */ + testcase TC_MEC_MEC033_IOTS_IOTDEV_002_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_resource_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_IOT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + action("Check that PX_REQUESTED_PLTF_ID is set with the identifier of a registed IoT platform") + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_IOT_API_SUB, + v_headers, + m_http_message_body_json( + m_body_json_iot_device_info( + m_device_info( + PX_IOT_DEVICE_ID_1, + PX_IOT_DEVICE_AUTH_1, + -, + PX_IOT_DEVICE_SUPI_1, + PX_IOT_DEVICE_IMSI_1, + -, + { + m_traffic_rule_descriptor( + PX_TRAFFIC_RULE_ID, + PX_TRAFFIC_FILTERTYPE, + PX_TRAFFIC_RULE_PRIORITY, + { + m_traffic_filter( + { PX_TRAFFIC_FILTER_SRC_ADDRESS }, + { PX_TRAFFIC_FILTER_DST_ADDRESS }, + { PX_TRAFFIC_FILTER_SRC_PORT }, + { PX_TRAFFIC_FILTER_DST_PORT }, + { PX_TRAFFIC_FILTER_PROTOCOL } + ) + }, + PX_TRAFFIC_RULE_ACTION + ) + } )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -383,11 +504,20 @@ module AtsMec_IoTAPI_TestCases { )))))) -> value v_response { tc_ac.stop; - if (f_check_headers(valueof(v_response.response.header)) == false) { + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { - log("*** " & testcasename() & ": PASS: IUT successfully create DeviceInfo entry ***"); + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_resource_id := regexp( + v_header_location[0], + "?+" & PX_IOT_API_LIST_PLTF_SUB & "/(?*)", + 0 + ); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a DeviceInfo: ", v_resource_id, " ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } } @@ -400,7 +530,7 @@ module AtsMec_IoTAPI_TestCases { // Postamble f_delete_device_info(v_response.response.body.json_body.deviceInfo_iot); f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC033_IOTS_IOTDEV_002_OK + } // End of testcase TC_MEC_MEC033_IOTS_IOTDEV_002_OK_02 /** * @desc Check that the IUT returns an error when Service Consumer request to register an IoT device with incorrect parameters @@ -606,13 +736,15 @@ module AtsMec_IoTAPI_TestCases { PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, - m_traffic_filter( - PX_TRAFFIC_FILTER_SRC_ADDRESS, - PX_TRAFFIC_FILTER_DST_ADDRESS, - PX_TRAFFIC_FILTER_SRC_PORT, - PX_TRAFFIC_FILTER_DST_PORT, - PX_TRAFFIC_FILTER_PROTOCOL - ), + { + m_traffic_filter( + { PX_TRAFFIC_FILTER_SRC_ADDRESS }, + { PX_TRAFFIC_FILTER_DST_ADDRESS }, + { PX_TRAFFIC_FILTER_SRC_PORT }, + { PX_TRAFFIC_FILTER_DST_PORT }, + { PX_TRAFFIC_FILTER_PROTOCOL } + ) + }, PX_TRAFFIC_RULE_ACTION )); @@ -698,13 +830,15 @@ module AtsMec_IoTAPI_TestCases { PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, - m_traffic_filter( - PX_TRAFFIC_FILTER_SRC_ADDRESS, - PX_TRAFFIC_FILTER_DST_ADDRESS, - PX_TRAFFIC_FILTER_SRC_PORT, - PX_TRAFFIC_FILTER_DST_PORT, - PX_TRAFFIC_FILTER_PROTOCOL - ), + { + m_traffic_filter( + { PX_TRAFFIC_FILTER_SRC_ADDRESS }, + { PX_TRAFFIC_FILTER_DST_ADDRESS }, + { PX_TRAFFIC_FILTER_SRC_PORT }, + { PX_TRAFFIC_FILTER_DST_PORT }, + { PX_TRAFFIC_FILTER_PROTOCOL } + ) + }, PX_TRAFFIC_RULE_ACTION )); @@ -780,13 +914,15 @@ module AtsMec_IoTAPI_TestCases { PX_TRAFFIC_RULE_ID, PX_TRAFFIC_FILTERTYPE, PX_TRAFFIC_RULE_PRIORITY, - m_traffic_filter( - PX_TRAFFIC_FILTER_SRC_ADDRESS, - PX_TRAFFIC_FILTER_DST_ADDRESS, - PX_TRAFFIC_FILTER_SRC_PORT, - PX_TRAFFIC_FILTER_DST_PORT, - PX_TRAFFIC_FILTER_PROTOCOL - ), + { + m_traffic_filter( + { PX_TRAFFIC_FILTER_SRC_ADDRESS }, + { PX_TRAFFIC_FILTER_DST_ADDRESS }, + { PX_TRAFFIC_FILTER_SRC_PORT }, + { PX_TRAFFIC_FILTER_DST_PORT }, + { PX_TRAFFIC_FILTER_PROTOCOL } + ) + }, PX_TRAFFIC_RULE_ACTION )); @@ -981,50 +1117,49 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_MEX_IOTS_IOTPLAT_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var IotPlatformInfoList v_iot_platform_list := { - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_1, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_1, - PX_MB_TRANSPORTINFO_NAME_1, - PX_MB_TRANSPORTINFO_TYPE_1, - PX_MB_TRANSPORTINFO_PROTOCOL_1, - PX_MB_TRANSPORTINFO_VERSION_1, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), - m_security_info, - m_impl_specific_info - ) - } - )), - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_2, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_2, - PX_MB_TRANSPORTINFO_NAME_2, - PX_MB_TRANSPORTINFO_TYPE_2, - PX_MB_TRANSPORTINFO_PROTOCOL_2, - PX_MB_TRANSPORTINFO_VERSION_2, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_2 }), - m_security_info, - m_impl_specific_info - ) - } - )), - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_3, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_3, - PX_MB_TRANSPORTINFO_NAME_3, - PX_MB_TRANSPORTINFO_TYPE_3, - PX_MB_TRANSPORTINFO_PROTOCOL_3, - PX_MB_TRANSPORTINFO_VERSION_3, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_3 }), - m_security_info, - m_impl_specific_info - ) - } - )) - }; + var IotPlatformInfoList v_iot_platform_list := valueof( + { + m_iot_platform_info( + PX_IOT_PLTF_ID_1, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_1, + PX_MB_TRANSPORTINFO_NAME_1, + PX_MB_TRANSPORTINFO_TYPE_1, + PX_MB_TRANSPORTINFO_PROTOCOL_1, + PX_MB_TRANSPORTINFO_VERSION_1, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), + m_security_info, + m_impl_specific_info + ) + }), + m_iot_platform_info( + PX_IOT_PLTF_ID_2, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_2, + PX_MB_TRANSPORTINFO_NAME_2, + PX_MB_TRANSPORTINFO_TYPE_2, + PX_MB_TRANSPORTINFO_PROTOCOL_2, + PX_MB_TRANSPORTINFO_VERSION_2, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_2 }), + m_security_info, + m_impl_specific_info + ) + }), + m_iot_platform_info( + PX_IOT_PLTF_ID_3, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_3, + PX_MB_TRANSPORTINFO_NAME_3, + PX_MB_TRANSPORTINFO_TYPE_3, + PX_MB_TRANSPORTINFO_PROTOCOL_3, + PX_MB_TRANSPORTINFO_VERSION_3, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_3 }), + m_security_info, + m_impl_specific_info + )})}); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -1085,7 +1220,8 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_MEX_IOTS_IOTPLAT_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var HttpMessage v_response + var HttpMessage v_response; + var charstring v_resource_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -1150,8 +1286,21 @@ module AtsMec_IoTAPI_TestCases { )))))) -> value v_response { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a IotPlatformInfoList ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_resource_id := regexp( + v_header_location[0], + "?+" & PX_IOT_API_LIST_PLTF_SUB & "/(?*)", + 0 + ); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a IotPlatformInfoList: ", v_resource_id, " ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); @@ -1225,36 +1374,38 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_MEX_IOTS_IOTPLAT_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var IotPlatformInfoList v_iot_platform_list := { - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_1, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_1, - PX_MB_TRANSPORTINFO_NAME_1, - PX_MB_TRANSPORTINFO_TYPE_1, - PX_MB_TRANSPORTINFO_PROTOCOL_1, - PX_MB_TRANSPORTINFO_VERSION_1, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), - m_security_info, - m_impl_specific_info - ) - } - )), - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_2, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_2, - PX_MB_TRANSPORTINFO_NAME_2, - PX_MB_TRANSPORTINFO_TYPE_2, - PX_MB_TRANSPORTINFO_PROTOCOL_2, - PX_MB_TRANSPORTINFO_VERSION_2, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_2 }), - m_security_info, - m_impl_specific_info - ) - } - )), - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_3, + var IotPlatformInfoList v_iot_platform_list := valueof( + { + m_iot_platform_info( + PX_IOT_PLTF_ID_1, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_1, + PX_MB_TRANSPORTINFO_NAME_1, + PX_MB_TRANSPORTINFO_TYPE_1, + PX_MB_TRANSPORTINFO_PROTOCOL_1, + PX_MB_TRANSPORTINFO_VERSION_1, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), + m_security_info, + m_impl_specific_info + ) + }), + m_iot_platform_info( + PX_IOT_PLTF_ID_2, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_2, + PX_MB_TRANSPORTINFO_NAME_2, + PX_MB_TRANSPORTINFO_TYPE_2, + PX_MB_TRANSPORTINFO_PROTOCOL_2, + PX_MB_TRANSPORTINFO_VERSION_2, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_2 }), + m_security_info, + m_impl_specific_info + ) + }), + m_iot_platform_info( + PX_IOT_PLTF_ID_3, { m_mb_transport_info( PX_MB_TRANSPORTINFO_ID_3, @@ -1265,10 +1416,7 @@ module AtsMec_IoTAPI_TestCases { m_end_point_uris({ PX_IOT_ENDPOINT_URI_3 }), m_security_info, m_impl_specific_info - ) - } - )) - }; + )})}); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -1439,50 +1587,49 @@ module AtsMec_IoTAPI_TestCases { testcase TC_MEC_MEC033_MEX_IOTS_IOTPLAT_004_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var IotPlatformInfoList v_iot_platform_list := { - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_1, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_1, - PX_MB_TRANSPORTINFO_NAME_1, - PX_MB_TRANSPORTINFO_TYPE_1, - PX_MB_TRANSPORTINFO_PROTOCOL_1, - PX_MB_TRANSPORTINFO_VERSION_1, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), - m_security_info, - m_impl_specific_info - ) - } - )), - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_2, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_2, - PX_MB_TRANSPORTINFO_NAME_2, - PX_MB_TRANSPORTINFO_TYPE_2, - PX_MB_TRANSPORTINFO_PROTOCOL_2, - PX_MB_TRANSPORTINFO_VERSION_2, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_2 }), - m_security_info, - m_impl_specific_info - ) - } - )), - valueof(m_iot_platform_info(PX_IOT_PLTF_ID_3, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_3, - PX_MB_TRANSPORTINFO_NAME_3, - PX_MB_TRANSPORTINFO_TYPE_3, - PX_MB_TRANSPORTINFO_PROTOCOL_3, - PX_MB_TRANSPORTINFO_VERSION_3, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_3 }), - m_security_info, - m_impl_specific_info - ) - } - )) - }; + var IotPlatformInfoList v_iot_platform_list := valueof( + { + m_iot_platform_info( + PX_IOT_PLTF_ID_1, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_1, + PX_MB_TRANSPORTINFO_NAME_1, + PX_MB_TRANSPORTINFO_TYPE_1, + PX_MB_TRANSPORTINFO_PROTOCOL_1, + PX_MB_TRANSPORTINFO_VERSION_1, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), + m_security_info, + m_impl_specific_info + ) + }), + m_iot_platform_info( + PX_IOT_PLTF_ID_2, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_2, + PX_MB_TRANSPORTINFO_NAME_2, + PX_MB_TRANSPORTINFO_TYPE_2, + PX_MB_TRANSPORTINFO_PROTOCOL_2, + PX_MB_TRANSPORTINFO_VERSION_2, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_2 }), + m_security_info, + m_impl_specific_info + ) + }), + m_iot_platform_info( + PX_IOT_PLTF_ID_3, + { + m_mb_transport_info( + PX_MB_TRANSPORTINFO_ID_3, + PX_MB_TRANSPORTINFO_NAME_3, + PX_MB_TRANSPORTINFO_TYPE_3, + PX_MB_TRANSPORTINFO_PROTOCOL_3, + PX_MB_TRANSPORTINFO_VERSION_3, + m_end_point_uris({ PX_IOT_ENDPOINT_URI_3 }), + m_security_info, + m_impl_specific_info + )})}); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_IOT_API_SUPPORTED)) { @@ -1507,7 +1654,7 @@ module AtsMec_IoTAPI_TestCases { m_http_message_body_json( m_body_json_iot_iot_platform_info( m_iot_platform_info( - PX_IOT_PLTF_ID_1, + PX_IOT_PLTF_ID_2, { m_mb_transport_info( PX_MB_TRANSPORTINFO_ID_1, diff --git a/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestControl.ttcn b/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestControl.ttcn index 70941a0..659f1a5 100644 --- a/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestControl.ttcn +++ b/ttcn/AtsMec_IoT/AtsMec_IoTAPI_TestControl.ttcn @@ -19,8 +19,9 @@ module AtsMec_IoTAPI_TestControl { execute(TC_MEC_MEC033_IOTS_IOTDEV_001_OK_03()); execute(TC_MEC_MEC033_IOTS_IOTDEV_001_OK_04()); - execute(TC_MEC_MEC033_IOTS_IOTDEV_002_OK()); - execute(TC_MEC_MEC033_IOTS_IOTDEV_002_BR()); + execute(TC_MEC_MEC033_IOTS_IOTDEV_002_OK_01()); + execute(TC_MEC_MEC033_IOTS_IOTDEV_002_OK_02()); + execute(TC_MEC_MEC033_IOTS_IOTDEV_002_BR()); execute(TC_MEC_MEC033_IOTS_IOTDEV_003_OK()); execute(TC_MEC_MEC033_IOTS_IOTDEV_003_NF()); diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn index b914cc0..4657a71 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn @@ -578,7 +578,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { in template (value) Json.String p_trafficRuleId, in template (value) FilterType p_filterType, in template (value) Json.Integer p_priority, - in template (value) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter p_trafficFilter, + in template (value) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilterList p_trafficFilter, in template (value) Action p_action, in template (omit) InterfaceDescriptor p_dstInterface := omit ) := { @@ -594,7 +594,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { template (present) Json.String p_trafficRuleId := ?, template (present) FilterType p_filterType := ?, template (present) Json.Integer p_priority := ?, - template (present) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter p_trafficFilter := ?, + template (present) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilterList p_trafficFilter := ?, template (present) Action p_action := ?, template InterfaceDescriptor p_dstInterface := * ) := { @@ -607,22 +607,22 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { } // End of template mw_traffic_rule_descriptor template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter m_traffic_filter( - in template (omit) Json.String p_srcAddress := omit, - in template (omit) Json.String p_dstAddress := omit, - in template (omit) Json.String p_srcPort := omit, - in template (omit) Json.String p_dstPort := omit, - in template (omit) Json.String p_protocol := omit, - in template (omit) Json.String p_tag := omit, - in template (omit) Json.String p_uri := omit, - in template (omit) Json.String p_packetLabel := omit, - in template (omit) Json.String p_srcTunnelAddress := omit, - in template (omit) Json.String p_tgtTunnelAddress := omit, - in template (omit) Json.String p_srcTunnelPort := omit, - in template (omit) Json.String p_dstTunnelPort := omit, - in template (omit) Json.Integer p_qCI := omit, - in template (omit) Json.Integer p_dSCP := omit, - in template (omit) Json.Integer p_tC := omit - ) :={ + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_AddressList p_srcAddress := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_AddressList p_dstAddress := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_PortList p_srcPort := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_PortList p_dstPort := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_ProtocolList p_protocol := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TagList p_tag := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_UriList p_uri := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_PacketLabelList p_packetLabel := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelAddressList p_srcTunnelAddress := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelAddressList p_tgtTunnelAddress := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelPortList p_srcTunnelPort := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelPortList p_dstTunnelPort := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_QCI p_qCI := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_DSCP p_dSCP := omit, + in template (omit) ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TC p_tC := omit + ) :={ srcAddress := p_srcAddress, dstAddress := p_dstAddress, srcPort := p_srcPort, @@ -641,22 +641,22 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { } // End of template m_traffic_filter template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter mw_traffic_filter( - template Json.String p_srcAddress := *, - template Json.String p_dstAddress := *, - template Json.String p_srcPort := *, - template Json.String p_dstPort := *, - template Json.String p_protocol := *, - template Json.String p_tag := *, - template Json.String p_uri := *, - template Json.String p_packetLabel := *, - template Json.String p_srcTunnelAddress := *, - template Json.String p_tgtTunnelAddress := *, - template Json.String p_srcTunnelPort := *, - template Json.String p_dstTunnelPort := *, - template Json.Integer p_qCI := *, - template Json.Integer p_dSCP := *, - template Json.Integer p_tC := * - ) :={ + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_AddressList p_srcAddress := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_AddressList p_dstAddress := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_PortList p_srcPort := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_PortList p_dstPort := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_ProtocolList p_protocol := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TagList p_tag := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_UriList p_uri := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_PacketLabelList p_packetLabel := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelAddressList p_srcTunnelAddress := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelAddressList p_tgtTunnelAddress := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelPortList p_srcTunnelPort := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TunnelPortList p_dstTunnelPort := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_QCI p_qCI := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_DSCP p_dSCP := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilter_TC p_tC := * + ) :={ srcAddress := p_srcAddress, dstAddress := p_dstAddress, srcPort := p_srcPort, diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn index 1a94526..d6402aa 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn @@ -214,7 +214,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues { Json.String trafficRuleId, FilterType filterType, Json.Integer priority, - TrafficFilter trafficFilter, + ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.TrafficFilterList trafficFilter, Action action_, InterfaceDescriptor dstInterface optional } with { @@ -228,8 +228,6 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues { type enumerated FilterType { FLOW, PACKET - } with { - variant "JSON: as number" } /** @@ -242,45 +240,90 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues { PASSTHROUGH (3), DUPLICATED_DECAPSULATED (4), DUPLICATE_ENCAPSULATED (5) - } with { - variant "JSON: as number" } /** - * @desc The TrafficFilter data type supports the specification of MEC application requirements related to traffic rules - * @member srcAddress An IP address or a range of IP addresses - * @member dstAddress A IP address or a range of IP addresses - * @member srcPort A port or a range of ports - * @member dstPort A port or a range of ports - * @member protocol Specify the protocol of the traffic filter - * @member tag Used for tag based traffic rule - * @member uri An URI label, in application layer - * @member packetLabel A customized packet label in network layer, as defined by the owner of the MEC platform, is used to filter the traffic - * @member srcTunnelAddressUsed for GTP tunnel based traffic rule - * @member tgtTunnelAddress Used for GTP tunnel based traffic rule - * @member srcTunnelPort Used for GTP tunnel based traffic rule - * @member qCI Used to match all packets that have the same QCI - * @member dSCP Used to match all IPv4 packets that have the same DSCP - * @member tC Used to match all IPv6 packets that have the same TC - * @see ETSI GS MEC 010-2 Clause 6.2.1.10 Type: TrafficFilter - */ + * @desc Identify the traffic ip address. + */ + type Json.String TrafficFilter_Address; + type set of TrafficFilter_Address TrafficFilter_AddressList; + + /** + * @desc Used to match all IPv4 packets that have the same Differentiated Services Code Point (DSCP). + */ + type Json.UInteger TrafficFilter_DSCP; + + /** + * @desc Identify the traffic ip address. + */ + type Json.String TrafficFilter_Port; + type record length(1..infinity) of TrafficFilter_Port TrafficFilter_PortList; + + /** + * @desc Protocol of the traffic filter. + */ + type Json.String TrafficFilter_Protocol; + type set of TrafficFilter_Protocol TrafficFilter_ProtocolList; + + /** + * @desc Used to match all packets that have the same Quality Class Indicator (QCI). + */ + type Json.UInteger TrafficFilter_QCI; + + /** + * @desc Used to match all IPv6 packets that have the same Traffic Class. + */ + type Json.UInteger TrafficFilter_TC; + + /** + * @desc Used for tag based traffic rule. + */ + type Json.String TrafficFilter_Tag; + type set of TrafficFilter_Tag TrafficFilter_TagList; + + /** + * @desc Used for uri based traffic rule. + */ + type Json.String TrafficFilter_Uri; + type set of TrafficFilter_Uri TrafficFilter_UriList; + + /** + * @desc Used for packetLabel based traffic rule. + */ + type Json.String TrafficFilter_PacketLabel; + type set of TrafficFilter_PacketLabel TrafficFilter_PacketLabelList; + + + /** + * @desc Used for GTP tunnel based traffic rule. + */ + type Json.String TrafficFilter_TunnelAddress; + type set of TrafficFilter_TunnelAddress TrafficFilter_TunnelAddressList; + + /** + * @desc Used for GTP tunnel based traffic rule. + */ + type Json.String TrafficFilter_TunnelPort; + type set of TrafficFilter_TunnelPort TrafficFilter_TunnelPortList; + type record TrafficFilter { - Json.String srcAddress optional, - Json.String dstAddress optional, - Json.String srcPort optional, - Json.String dstPort optional, - Json.String protocol optional, - Json.String tag optional, - Json.String uri optional, - Json.String packetLabel optional, - Json.String srcTunnelAddress optional, - Json.String tgtTunnelAddress optional, - Json.String srcTunnelPort optional, - Json.String dstTunnelPort optional, - Json.Integer qCI optional, - Json.Integer dSCP optional, - Json.Integer tC optional - } + TrafficFilter_AddressList srcAddress optional, + TrafficFilter_AddressList dstAddress optional, + TrafficFilter_PortList srcPort optional, + TrafficFilter_PortList dstPort optional, + TrafficFilter_ProtocolList protocol optional, + TrafficFilter_TagList tag optional, + TrafficFilter_UriList uri optional, + TrafficFilter_PacketLabelList packetLabel optional, + TrafficFilter_TunnelAddressList srcTunnelAddress optional, + TrafficFilter_TunnelAddressList tgtTunnelAddress optional, + TrafficFilter_TunnelPortList srcTunnelPort optional, + TrafficFilter_TunnelPortList dstTunnelPort optional, + TrafficFilter_QCI qCI optional, + TrafficFilter_DSCP dSCP optional, + TrafficFilter_TC tC optional + } + type set of TrafficFilter TrafficFilterList; /** * @desc The InterfaceDescriptor data type describes an interface of a MEC application diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn index 74c1915..8811d3d 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn @@ -20,9 +20,9 @@ module EdgePlatformApplicationEnablementAPI_Templates { import from EdgePlatformApplicationEnablementAPI_Pixits all; template (value) EdgePlatformApplicationEnablementAPI_TypesAndValues.SecurityInfo m_security_info( - in GrantTypesList p_grantTypes := { OAUTH2_CLIENT_CREDENTIALS }, - in TokenEndpoint p_tokenEndpoint := "/mecSerMgmtApi/security/MyTokenEndPoint" - ) := { + in GrantTypesList p_grantTypes := { OAUTH2_CLIENT_CREDENTIALS }, + in TokenEndpoint p_tokenEndpoint := "/mecSerMgmtApi/security/MyTokenEndPoint" + ) := { oAuth2Info := { grantTypes := p_grantTypes, tokenEndpoint := p_tokenEndpoint @@ -31,9 +31,9 @@ module EdgePlatformApplicationEnablementAPI_Templates { } // End of template m_security_info template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.SecurityInfo mw_security_info( - template (present) GrantTypesList p_grantTypes := ?, - template (present) TokenEndpoint p_tokenEndpoint := ? - ) := { + template (present) GrantTypesList p_grantTypes := ?, + template (present) TokenEndpoint p_tokenEndpoint := ? + ) := { oAuth2Info := { grantTypes := p_grantTypes, tokenEndpoint := p_tokenEndpoint @@ -430,7 +430,7 @@ module EdgePlatformApplicationEnablementAPI_Templates { in TrafficRule_Id p_trafficRuleId, in TrafficRule_FilterType p_filterType := FLOW, in TrafficRule_Priority p_priority := 1, - in TrafficFilterList p_trafficFilter := {}, + in EdgePlatformApplicationEnablementAPI_TypesAndValues.TrafficFilterList p_trafficFilter := {}, in TrafficRule_Action p_action_ := FORWARD_ENCAPSULATED, in TrafficRule_State p_state := ACTIVE ) := { @@ -447,7 +447,7 @@ module EdgePlatformApplicationEnablementAPI_Templates { template (present) TrafficRule_Id p_trafficRuleId := ?, template (present) TrafficRule_FilterType p_filterType := ?, template (present) TrafficRule_Priority p_priority := ?, - template (present) TrafficFilterList p_trafficFilter := ?, + template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.TrafficFilterList p_trafficFilter := ?, template (present) TrafficRule_Action p_action_ := ?, template (present) TrafficRule_State p_state := ? ) := { diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index e0e5179..43f146a 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -800,6 +800,12 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { type Json.String TrafficFilter_TunnelAddress; type set of TrafficFilter_TunnelAddress TrafficFilter_TunnelAddressList; + type Json.String TrafficFilter_Uri; + type set of TrafficFilter_Uri TrafficFilter_UriList; + + type Json.String TrafficFilter_PacketLabel; + type set of TrafficFilter_PacketLabel TrafficFilter_PacketLabelList; + /** * @desc Used for GTP tunnel based traffic rule. */ @@ -823,7 +829,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member tC Used to match all IPv6 packets that have the same TC * @see ETSI GS MEC 011 V3.3.1 Table 7.1.5.2-1: Attributes of TrafficFilter */ - type record TrafficFilter { + type record TrafficFilter { // FIXME FSCOM Need to duplicate to prevent C++ incomplete type error TrafficFilter_AddressList srcAddress optional, TrafficFilter_AddressList dstAddress optional, TrafficFilter_PortList srcPort optional, @@ -893,7 +899,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { TrafficRule_Id trafficRuleId, TrafficRule_FilterType filterType, TrafficRule_Priority priority, - TrafficFilterList trafficFilter, + EdgePlatformApplicationEnablementAPI_TypesAndValues.TrafficFilterList trafficFilter, TrafficRule_Action action_, DestinationInterfaceList dstInterface optional, TrafficRule_State state diff --git a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Functions.ttcn b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Functions.ttcn index b338fce..77cf995 100644 --- a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Functions.ttcn +++ b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Functions.ttcn @@ -31,7 +31,8 @@ module IoTAPI_Functions { import from LibMec_Pixits all; function f_create_device_info( - out DeviceInfo p_device_info + in DeviceInfo p_device_info, + out charstring p_resource_id ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; @@ -44,13 +45,8 @@ module IoTAPI_Functions { v_headers, m_http_message_body_json( m_body_json_iot_device_info( - m_device_info( - PX_IOT_DEVICE_ID_1, - PX_IOT_DEVICE_AUTH_1, - false, - PX_IOT_DEVICE_SUPI_1, - PX_IOT_DEVICE_IMSI_1 - )))))); + p_device_info + ))))); tc_ac.start; alt { [] httpPort.receive( @@ -58,15 +54,19 @@ module IoTAPI_Functions { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_iot_device_info( - mw_device_info( - PX_IOT_DEVICE_ID_1, - PX_IOT_DEVICE_AUTH_1, - false, - PX_IOT_DEVICE_SUPI_1, - PX_IOT_DEVICE_IMSI_1 - )))))) -> value v_response { + p_device_info + ))))) -> value v_response { tc_ac.stop; + // Extract HTTP Location header + var charstring_list v_resource_id; + f_get_header(v_response.response.header, "Location", v_resource_id); + // Extract HTTP subssription id + p_resource_id := regexp( + v_resource_id[0], + "?+" & PX_IOT_API_SUB & "/(?*)", + 0 + ); p_device_info := v_response.response.body.json_body.deviceInfo_iot; log("f_create_device_info: INFO: IUT successfully responds to the subscription: ", p_device_info); } @@ -106,10 +106,11 @@ module IoTAPI_Functions { } // End of function f_delete_device_info function f_create_device_info_list( - out DeviceInfoList p_device_info_list + in DeviceInfoList p_device_info_list ) runs on HttpComponent { for (var integer i := 0; i < lengthof(p_device_info_list); i := i + 1) { - f_create_device_info(p_device_info_list[i]); + var charstring v_resource_id; + f_create_device_info(p_device_info_list[i], v_resource_id); } } // End of function f_create_device_info_list @@ -124,7 +125,8 @@ module IoTAPI_Functions { } // End of function f_delete_device_info_list function f_create_iot_platform_info( - out IotPlatformInfo p_iot_platform_info + inout IotPlatformInfo p_iot_platform_info, + out charstring p_resource_id ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; @@ -137,21 +139,8 @@ module IoTAPI_Functions { v_headers, m_http_message_body_json( m_body_json_iot_iot_platform_info( - m_iot_platform_info( - PX_IOT_PLTF_ID_1, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_1, - PX_MB_TRANSPORTINFO_NAME_1, - PX_MB_TRANSPORTINFO_TYPE_1, - PX_MB_TRANSPORTINFO_PROTOCOL_1, - PX_MB_TRANSPORTINFO_VERSION_1, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), - m_security_info, - m_impl_specific_info - ) - } - )))))); + p_iot_platform_info + ))))); tc_ac.start; alt { [] httpPort.receive( @@ -159,23 +148,19 @@ module IoTAPI_Functions { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_iot_iot_platform_info( - mw_iot_platform_info( - PX_IOT_PLTF_ID_1, - { - m_mb_transport_info( - PX_MB_TRANSPORTINFO_ID_1, - PX_MB_TRANSPORTINFO_NAME_1, - PX_MB_TRANSPORTINFO_TYPE_1, - PX_MB_TRANSPORTINFO_PROTOCOL_1, - PX_MB_TRANSPORTINFO_VERSION_1, - m_end_point_uris({ PX_IOT_ENDPOINT_URI_1 }), - m_security_info, - m_impl_specific_info - ) - } - )))))) -> value v_response { + p_iot_platform_info + ))))) -> value v_response { tc_ac.stop; + // Extract HTTP Location header + var charstring_list v_resource_id; + f_get_header(v_response.response.header, "Location", v_resource_id); + // Extract HTTP subssription id + p_resource_id := regexp( + v_resource_id[0], + "?+" & PX_IOT_API_LIST_PLTF_SUB & "/(?*)", + 0 + ); p_iot_platform_info := v_response.response.body.json_body.iotPlatformInfo; log("f_create_iot_platform_info: INFO: IUT successfully responds to the subscription: ", p_iot_platform_info); } @@ -215,10 +200,11 @@ module IoTAPI_Functions { } // End of function f_delete_iot_platform_info function f_create_iot_platform_info_list( - out IotPlatformInfoList p_iot_platform_info_list + inout IotPlatformInfoList p_iot_platform_info_list ) runs on HttpComponent { for (var integer i := 0; i < lengthof(p_iot_platform_info_list); i := i + 1) { - f_create_iot_platform_info(p_iot_platform_info_list[i]); + var charstring v_resource_id; + f_create_iot_platform_info(p_iot_platform_info_list[i], v_resource_id); } } // End of function f_create_iot_platform_info_list diff --git a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Pixits.ttcn b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Pixits.ttcn index 1d9f8ed..abefb44 100644 --- a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Pixits.ttcn +++ b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Pixits.ttcn @@ -9,79 +9,79 @@ module IoTAPI_Pixits { // LibMec/EdgePlatformApplicationEnablementAPI import from EdgePlatformApplicationEnablementAPI_TypesAndValues all; - modulepar Json.String PX_IOT_DEVICE_ID_1 := ""; + modulepar Json.String PX_IOT_DEVICE_ID_1 := "c33bb020-0e03-11f0-be75-87e8cfed7b5d"; - modulepar Json.String PX_IOT_DEVICE_SUPI_1 := ""; + modulepar Json.String PX_IOT_DEVICE_SUPI_1 := "000d0100f110f0ff00001000503054"; - modulepar Json.String PX_IOT_DEVICE_IMSI_1 := ""; + modulepar Json.String PX_IOT_DEVICE_IMSI_1 := "310170845466094"; modulepar Json.String PX_IOT_DEVICE_AUTH_1 := ""; - modulepar Json.String PX_IOT_DEVICE_ID_2 := ""; + modulepar Json.String PX_IOT_DEVICE_ID_2 := "c806310c-0e03-11f0-afd1-3f0b93d224c6"; - modulepar Json.String PX_IOT_DEVICE_SUPI_2 := ""; + modulepar Json.String PX_IOT_DEVICE_SUPI_2 := "000d0100f110f0ff00001000503055"; - modulepar Json.String PX_IOT_DEVICE_IMSI_2 := ""; + modulepar Json.String PX_IOT_DEVICE_IMSI_2 := "470040123456789"; modulepar Json.String PX_IOT_DEVICE_AUTH_2 := ""; - modulepar Json.String PX_IOT_DEVICE_ID_3 := ""; + modulepar Json.String PX_IOT_DEVICE_ID_3 := "cc9e276a-0e03-11f0-8184-b3b4628a9ed7"; - modulepar Json.String PX_IOT_DEVICE_SUPI_3 := ""; + modulepar Json.String PX_IOT_DEVICE_SUPI_3 := "000d0100f110f0ff00001000503056"; - modulepar Json.String PX_IOT_DEVICE_IMSI_3 := ""; + modulepar Json.String PX_IOT_DEVICE_IMSI_3 := "502130123456789"; modulepar Json.String PX_IOT_DEVICE_AUTH_3 := ""; - modulepar Json.String PX_IOT_DEVICE_ID_UNKNOWN := ""; + modulepar Json.String PX_IOT_DEVICE_ID_UNKNOWN := "IOT_DEVICE_ID_UNKNOWN"; - modulepar Json.String PX_IOT_ENDPOINT_URI_1 := ""; + modulepar Json.String PX_IOT_ENDPOINT_URI_1 := "http://www.example1.org"; - modulepar Json.String PX_IOT_ENDPOINT_URI_2 := ""; + modulepar Json.String PX_IOT_ENDPOINT_URI_2 := "http://www.example2.org"; - modulepar Json.String PX_IOT_ENDPOINT_URI_3 := ""; + modulepar Json.String PX_IOT_ENDPOINT_URI_3 := "http://www.example3.org"; - modulepar Json.String PX_REQUESTED_PLTF_ID := ""; + modulepar Json.String PX_REQUESTED_PLTF_ID := "8b1807a6-0dff-11f0-8bd0-e30e57baed12"; - modulepar Json.String PX_IOT_PLTF_ID_1 := ""; + modulepar Json.String PX_IOT_PLTF_ID_1 := "8b1807a6-0dff-11f0-8bd0-e30e57baed12"; - modulepar Json.String PX_IOT_PLTF_ID_2 := ""; + modulepar Json.String PX_IOT_PLTF_ID_2 := "942f71bc-0dff-11f0-a4b6-530955284a2c"; - modulepar Json.String PX_IOT_PLTF_ID_3 := ""; + modulepar Json.String PX_IOT_PLTF_ID_3 := "99d59790-0dff-11f0-aca2-d33261fd0cc1"; - modulepar Json.String PX_MB_TRANSPORTINFO_ID_1 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_ID_1 := "9f2bd66e-0dff-11f0-ae86-8b5374b85d18"; - modulepar Json.String PX_MB_TRANSPORTINFO_NAME_1 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_NAME_1 := "TranportInfo1"; modulepar EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportType PX_MB_TRANSPORTINFO_TYPE_1 - := REST_HTTP; + := MB_TOPIC_BASED; - modulepar Json.String PX_MB_TRANSPORTINFO_PROTOCOL_1 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_PROTOCOL_1 := "MQTT"; - modulepar Json.String PX_MB_TRANSPORTINFO_VERSION_1 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_VERSION_1 := "3.1"; - modulepar Json.String PX_MB_TRANSPORTINFO_ID_2 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_ID_2 := "b9719a72-0dff-11f0-b0cc-f3e45e5b1f38"; - modulepar Json.String PX_MB_TRANSPORTINFO_NAME_2 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_NAME_2 := "TranportInfo2"; modulepar EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportType PX_MB_TRANSPORTINFO_TYPE_2 - := REST_HTTP; + := MB_TOPIC_BASED; - modulepar Json.String PX_MB_TRANSPORTINFO_PROTOCOL_2 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_PROTOCOL_2 := "MQTT"; - modulepar Json.String PX_MB_TRANSPORTINFO_VERSION_2 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_VERSION_2 := "3.1"; - modulepar Json.String PX_MB_TRANSPORTINFO_ID_3 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_ID_3 := "de1bcb5e-0dff-11f0-ac6a-a3e46bfe4bb6"; - modulepar Json.String PX_MB_TRANSPORTINFO_NAME_3 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_NAME_3 := "TranportInfo3"; modulepar EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportType PX_MB_TRANSPORTINFO_TYPE_3 - := REST_HTTP; + := MB_TOPIC_BASED; - modulepar Json.String PX_MB_TRANSPORTINFO_PROTOCOL_3 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_PROTOCOL_3 := "MQTT"; - modulepar Json.String PX_MB_TRANSPORTINFO_VERSION_3 := ""; + modulepar Json.String PX_MB_TRANSPORTINFO_VERSION_3 := "3.1"; - modulepar Json.String PX_IOT_PLTF_ID_UNKNOWN := ""; + modulepar Json.String PX_IOT_PLTF_ID_UNKNOWN := "IOT_PLTF_ID_UNKNOWN"; } // End of module IoTAPI_Pixits \ No newline at end of file diff --git a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Templates.ttcn b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Templates.ttcn index 12199bd..91fcef0 100644 --- a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Templates.ttcn +++ b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_Templates.ttcn @@ -17,7 +17,7 @@ module IoTAPI_Templates { template (omit) DeviceInfo m_device_info( in Json.String p_deviceId, in Json.String p_deviceAuthenticationInfo, - in Json.Bool p_enabled := false, + in Json.Bool p_enabled := true, in template (omit) Json.String p_supi := omit, in template (omit) Json.String p_imsi := omit, in template (omit) Json.String p_requestedIotPlatformId := omit, @@ -90,7 +90,7 @@ module IoTAPI_Templates { template (omit) IotPlatformInfo m_iot_platform_info( in Json.String p_iotPlatformId, in template (value) MBTransportInfoList p_userTransportInfo, - in Json.Bool p_enabled := false, + in Json.Bool p_enabled := true, in template (omit) EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportInfoList p_customServicesTransportInfo := omit ) := { @@ -102,7 +102,7 @@ module IoTAPI_Templates { template (omit) IotPlatformInfo m_iot_platform_info_error( in Json.String p_iotPlatformId, - in Json.Bool p_enabled := false, + in Json.Bool p_enabled := true, in template (omit) EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportInfoList p_customServicesTransportInfo := omit ) := { diff --git a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_TypesAndValues.ttcn b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_TypesAndValues.ttcn index 20969c4..33c5ebc 100644 --- a/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/IoTAPI/ttcn/IoTAPI_TypesAndValues.ttcn @@ -89,7 +89,7 @@ module IoTAPI_TypesAndValues { */ type record IotPlatformInfo { Json.String iotPlatformId, - MBTransportInfoList userTransportInfo optional, // optional on;ly for the 400 Bad Request TP + MBTransportInfoList userTransportInfo optional, // optional only for the 400 Bad Request TP TransportInfoList customServicesTransportInfo optional, Json.Bool enabled } // End of IotPlatformInfo @@ -118,6 +118,8 @@ module IoTAPI_TypesAndValues { EdgePlatformApplicationEnablementAPI_TypesAndValues.EndPointInfo endpoint, EdgePlatformApplicationEnablementAPI_TypesAndValues.SecurityInfo security, ImplSpecificInfo implSpecificInfo + } with { + variant (type_) "name as 'type'"; } // End of type MBTransportInfo type set of MBTransportInfo MBTransportInfoList; @@ -137,8 +139,6 @@ module IoTAPI_TypesAndValues { type set of Json.String UplinkTopics; type set of Json.String DownlinkTopics; - type set of EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportInfo TransportInfoList; - /** * @desc Defines the format of the messages to be published on the user transport in order to provide application-specific information about events related to the established session between the IoT device and the end IoT application(s) * @member eventTopic Topic where the message containing application-specific information should be published diff --git a/ttcn/patch_lib_common_titan/ttcn/LibCommon_Sync.ttcn b/ttcn/patch_lib_common_titan/ttcn/LibCommon_Sync.ttcn index 7c54ff1..eb11aef 100644 --- a/ttcn/patch_lib_common_titan/ttcn/LibCommon_Sync.ttcn +++ b/ttcn/patch_lib_common_titan/ttcn/LibCommon_Sync.ttcn @@ -62,7 +62,7 @@ module LibCommon_Sync { //Common - import from LibCommon_BasicTypesAndValues { type UInt } ; + import from LibCommon_BasicTypesAndValues all; import from LibCommon_AbstractData all; import from LibCommon_VerdictControl all; @@ -148,8 +148,8 @@ module LibCommon_Sync { * @see LibCommon_Sync.ServerSyncComp * @see LibCommon_Sync.ClientSyncComp */ - type port SyncPort message { - inout SyncCmd + type port SyncPort message { + inout SyncCmd } with { extension "internal" } @@ -163,7 +163,7 @@ module LibCommon_Sync { e_testBody, e_postamble } - + } // end compTypeRelated group standardSyncPointNames { @@ -322,7 +322,7 @@ module LibCommon_Sync { * @param p_numClients number of synchronization clients * @param p_syncPointIds list of synchronization point name/ids */ - function f_serverSyncNClientsAndStop ( + function f_serverSyncNClientsAndStop ( in UInt p_numClients, in SyncPointList p_syncPointIds ) runs on ServerSyncComp { @@ -421,7 +421,7 @@ module LibCommon_Sync { f_clientSyncAndVerdictPreamble(p_syncPoint, p_ret); } } - + /** * @desc Calls either self synchronization function if * invoking component is the MTC, otherwise @@ -450,11 +450,11 @@ module LibCommon_Sync { f_clientSyncAndVerdictTestBody(p_syncPoint, p_ret); } } - + /** * @desc Function kept for backward compatibility * @see f_selfOrClientSyncAndVerdictPreamble - * + * */ function f_selfOrClientSyncAndVerdictPR( in charstring p_syncPoint, in FncRetCode p_ret) @@ -618,18 +618,18 @@ module LibCommon_Sync { stop ; } } // end altstep a_dummyShutDown - + /** - * @desc Shutdown alstep in case the sync server is requesting shutdown. - * - * @remark User shall stop the component + * @desc Shutdown alstep in case the sync server is requesting shutdown. + * + * @remark User shall stop the component */ - altstep a_shutdown() - runs on ClientSyncComp { + altstep a_shutdown() + runs on BaseSyncComp { [] syncPort.receive(m_syncServerStop){ tc_sync.stop ; log("**** a_shutdown: Test component received STOP signal from MTC **** "); - } + } } } // end group shutDownAltsteps @@ -663,7 +663,7 @@ module LibCommon_Sync { /** * @desc Implements synchronization of "n" clients from server - * side including intermediate synchronization. + * side including intermediate synchronization. * If a problem occurs, then server sends STOP to * all clients. Waits for PX_TSYNC_TIME_LIMIT to let * clients finish executing their behavior until this @@ -682,7 +682,7 @@ module LibCommon_Sync { runs on ServerSyncComp { f_serverSyncClientsTimedIntermediateSync(p_noOfClients,p_syncId, p_NoOfClientIntermediate, p_syncIdIntermediate, PX_TSYNC_TIME_LIMIT); } - + /** * @desc Handles synchronization of clients from server side. * If problem occurs, then server sends STOP to all clients. @@ -732,7 +732,7 @@ module LibCommon_Sync { } else if ( p_syncId == c_initDone ) { log("**** f_serverSyncClientsTimed: Sync server now starting UPPER TESTER synchronization ... ****") ; } else { - log("**** f_serverSyncClientsTimed: Sync server now starting handling of next synchronization point ... ****") ; + log("**** f_serverSyncClientsTimed: Sync server now starting handling of " & p_syncId & " synchronization point ... ****") ; } tc_sync.start(p_execTimeLimit) ; alt{ @@ -747,6 +747,7 @@ module LibCommon_Sync { repeat; } [] syncPort.receive(m_syncClientReady(p_syncId)) -> sender v_clientRef { + log("**** f_serverSyncClientsTimed: Sync server received READY signal from a client - server will wait for all clients to reach this synchronization point ****"); if(not f_isPresentInArray(v_clientRef, v_clientRefs)) { v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; v_noOfRecvdSyncMsgs := v_noOfRecvdSyncMsgs + 1; @@ -767,7 +768,7 @@ module LibCommon_Sync { log("**** f_serverSyncClientsTimed: Sync server received client sync message with incorrect synchronization point id which is currently not handled - server will stop all clients! ****") ; v_stopClients := true; if(not f_isPresentInArray(v_clientRef, v_clientRefs)) { - v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; + v_clientRefs[v_noOfRecvdSyncMsgs] := v_clientRef; } } [] syncPort.receive(SyncCmd :? ) { @@ -991,7 +992,7 @@ module LibCommon_Sync { syncPort.send(m_syncClientReady(p_syncId)); tc_sync.start; alt{ - [] syncPort.receive(m_syncServerReady(p_syncId)) { + [] syncPort.receive(m_syncServerReady(p_syncId)){ tc_sync.stop ; } [] tc_sync.timeout{ log("**** f_clientSync: Sync client did not receive message from sync server within the specified time limit - sync client will ask sync server to stop test case! ****") ; @@ -1139,7 +1140,7 @@ module LibCommon_Sync { f_selfSync(p_syncId,p_ret); vc_testcaseStep := e_testBody; } - + /** * @desc This function combines MTC verdict setting with self * synchronization for use after the test body. @@ -1317,29 +1318,29 @@ module LibCommon_Sync { alt { [] syncPort.receive { // clients may still try to send some sync message - } + } [] all component.done { tc_shutDown.stop; log("**** f_serverWaitForAllClientsToShutDown: All components have properly shut down. Sync server will now terminate the test case. ****") ; - } + } [] tc_shutDown.timeout { log("**** f_serverWaitForAllClientsToShutDown: Not all clients have properly shutdown within the shut down time limit. Sync server will now terminate test case! ****") ; - } + } } // end alt // cover case that shut down default is NOT activated setverdict(inconc); - //mtc.stop; - syncPort.send(m_syncServerStop) to self; // this MUST be _server_ for the default to catch! - tc_sync.start(PX_TSYNC_TIME_LIMIT); - alt{ - [] tc_sync.timeout{ - log("**** f_selfSyncStop: Stopping MTC without shutdown - either no shutdown default active or missing syncPort connection ****") ; - setverdict(inconc); - stop ; - } - }//end alt - tc_sync.stop; - stop; // if shutdown default is not activated or if it does not stop + //mtc.stop; + syncPort.send(m_syncServerStop) to self; // this MUST be _server_ for the default to catch! + tc_sync.start(PX_TSYNC_TIME_LIMIT); + alt{ + [] tc_sync.timeout{ + log("**** f_selfSyncStop: Stopping MTC without shutdown - either no shutdown default active or missing syncPort connection ****") ; + setverdict(inconc); + stop ; + } + }//end alt + tc_sync.stop; + stop; // if shutdown default is not activated or if it does not stop } // end function f_serverWaitForAllClientsToShutDown function f_isPresentInArray(in ClientSyncComp p_clientRef, in ClientSyncCompList p_clientRefs) -- GitLab From 14526c1f7c444cd4591506b8f388a1e1facf7897 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 11 Apr 2025 11:31:13 +0200 Subject: [PATCH 26/54] Partial validation of TTF T043 --- .../Json/json_codec_factory_mec046.hh | 46 ++++++ ccsrc/Protocols/Json/json_codec_mec046.cc | 113 +++++++++++++++ ccsrc/Protocols/Json/json_codec_mec046.hh | 25 ++++ ccsrc/Protocols/Json/module.mk | 1 + .../AtsMec_SensorsSharingService.cf_ | 18 +-- gs032p3-ttcn-test-suite.code-workspace | 3 - ...tsMec_SensorsSharingService_TestCases.ttcn | 131 ++++++++++++------ .../ttcn/SensorsSharingService_Functions.ttcn | 61 ++++---- .../ttcn/SensorsSharingService_Templates.ttcn | 28 +++- .../SensorsSharingService_TypesAndValues.ttcn | 22 ++- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../module/src/Abstract_Socket.cc | 1 + 12 files changed, 357 insertions(+), 94 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec046.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec046.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec046.hh diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec046.hh b/ccsrc/Protocols/Json/json_codec_factory_mec046.hh new file mode 100644 index 0000000..f18bd53 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec046.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec046.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 // TTF T043 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec046.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec046 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec046: public codec_factory { + static json_codec_factory_mec046 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec046 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec046() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec046", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec046(); + }; +}; // End of class json_codec_factory_mec046 diff --git a/ccsrc/Protocols/Json/json_codec_mec046.cc b/ccsrc/Protocols/Json/json_codec_mec046.cc new file mode 100644 index 0000000..d397ced --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec046.cc @@ -0,0 +1,113 @@ +#include +#include +#include + +#include "json_codec_factory_mec046.hh" + +#include "loggers.hh" + +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec046::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +{ + loggers::get_instance().log_msg(">>> json_codec_mec046::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_sensor__discovery__info)) { + const SensorsSharingService__TypesAndValues::SensorDiscoveryInfo& sensor_discovery_info = msg.sensor__discovery__info(); + sensor_discovery_info.encode(SensorsSharingService__TypesAndValues::SensorDiscoveryInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"sensorIdentifier\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_sensor__discovery__event__subscription)) { + const SensorsSharingService__TypesAndValues::SensorDiscoveryEventSubscription& sensor_discovery_event_subscription = msg.sensor__discovery__event__subscription(); + sensor_discovery_event_subscription.encode(SensorsSharingService__TypesAndValues::SensorDiscoveryEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"sensorIdentifier\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_sensor__status__subscription)) { + const SensorsSharingService__TypesAndValues::SensorStatusSubscription& sensor_status_subscription = msg.sensor__status__subscription(); + sensor_status_subscription.encode(SensorsSharingService__TypesAndValues::SensorStatusSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"sensorIdentifier\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_sensor__data__subscription)) { + const SensorsSharingService__TypesAndValues::SensorDataSubscription& sensor_data_subscription = msg.sensor__data__subscription(); + sensor_data_subscription.encode(SensorsSharingService__TypesAndValues::SensorDataSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"sensorIdentifier\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec046::encode"); + return 0; +} + +int json_codec_mec046::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +{ + loggers::get_instance().log_msg(">>> json_codec_mec046::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec046::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec046::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec046::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + // ..and create the decoding buffer + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec046::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + + if (it->second.find("\"sensorIdentifier\"") != std::string::npos) { // Be careful to the order + if (it->second[0] == '[') { + SensorsSharingService__TypesAndValues::SensorDiscoveryInfos sensor_discovery_infos; + sensor_discovery_infos.decode(SensorsSharingService__TypesAndValues::SensorDiscoveryInfos_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.sensor__discovery__infos() = sensor_discovery_infos; + } else { + SensorsSharingService__TypesAndValues::SensorDiscoveryInfo sensor_discovery_info; + sensor_discovery_info.decode(SensorsSharingService__TypesAndValues::SensorDiscoveryInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.sensor__discovery__info() = sensor_discovery_info; + } + } else if ( + (it->second.find("\"_links\"") != std::string::npos) && + ((it->second.find("\"subscriptions\"") != std::string::npos) || (it->second.find("\"subscriptionType\"") == std::string::npos)) + ) { + SensorsSharingService__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(SensorsSharingService__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscription__link__list__sss() = subscription_link_list; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SensorDiscoveryEventSubscription\"") != std::string::npos)) { + SensorsSharingService__TypesAndValues::SensorDiscoveryEventSubscription sensor_discovery_event_subscription; + sensor_discovery_event_subscription.decode(SensorsSharingService__TypesAndValues::SensorDiscoveryEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.sensor__discovery__event__subscription() = sensor_discovery_event_subscription; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SensorStatusSubscription\"") != std::string::npos)) { + SensorsSharingService__TypesAndValues::SensorStatusSubscription sensor_status_subscription; + sensor_status_subscription.decode(SensorsSharingService__TypesAndValues::SensorStatusSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.sensor__status__subscription() = sensor_status_subscription; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SensorDataSubscription\"") != std::string::npos)) { + SensorsSharingService__TypesAndValues::SensorDataSubscription sensor_data_subscription; + sensor_data_subscription.decode(SensorsSharingService__TypesAndValues::SensorDataSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.sensor__data__subscription() = sensor_data_subscription; + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec046::decode: ", (const Base_Type&)msg); + return 0; +} + +json_codec_factory_mec046 json_codec_factory_mec046::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec046.hh b/ccsrc/Protocols/Json/json_codec_mec046.hh new file mode 100644 index 0000000..4b9854c --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec046.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" + +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec046: public json_codec +{ +public: + explicit json_codec_mec046() : json_codec() { }; + virtual ~json_codec_mec046() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec046 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index c33311a..3f873bb 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -6,6 +6,7 @@ sources := \ json_codec_mec028.cc \ json_codec_mec033.cc \ json_codec_mec040.cc \ + json_codec_mec046.cc \ includes := . diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ index 9c9c6e2..8e95c00 100644 --- a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ @@ -16,10 +16,10 @@ LibHttp_Pics.PICS_USE_TOKEN_HEADER := true LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' -SensorsSharingService_Pixits.PX_SENS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; +SensorsSharingService_Pixits.PX_SENS_SUB_CALLBACK_URI := "http://yanngarcia.ddns.net/sens/v1/notif" SensorsSharingService_Pixits.PX_SENS_DISCOVERY_TYPE := "" -SensorsSharingService_Pixits.PX_SENS_DISCOVERY_PROPERTY_LIST := "" # Could be [], string or [string1 string2] -SensorsSharingService_Pixits.PX_SENSOR_IDENTIFIER := "" +SensorsSharingService_Pixits.PX_SENS_DISCOVERY_PROPERTY_LIST := "SAREF" # Could be [], string or [string1 string2] +SensorsSharingService_Pixits.PX_SENSOR_IDENTIFIER := "CNT" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -37,8 +37,8 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec046)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec046)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, @@ -66,7 +66,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1 #AtsMec_SensorsSharingService_TestControl.control # Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application -AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 # Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application - Using type filter #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid filter @@ -98,7 +98,7 @@ AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 # Check that the IUT responds with the list of SensorData when queried by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR +AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR # Check that the IUT responds with an error when the IUT does not have sensor(s) #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_NF # Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters @@ -131,7 +131,7 @@ AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Both callbackReference and websockNotifConfig provided #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_03 -# Check that the IUT acknowledges the creation of SensorDiscoveryEventSubscription request when commanded by a MEC Application +# Check that the IUT acknowledges the change of SensorDiscoveryEventSubscription request when commanded by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_NF @@ -143,6 +143,8 @@ AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK # Check that the IUT provides a test notification when requested by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_01 + + # Check that the IUT provides a notification when requested by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType diff --git a/gs032p3-ttcn-test-suite.code-workspace b/gs032p3-ttcn-test-suite.code-workspace index 6b71a12..a657388 100644 --- a/gs032p3-ttcn-test-suite.code-workspace +++ b/gs032p3-ttcn-test-suite.code-workspace @@ -9,9 +9,6 @@ { "path": "../eurecom" }, - { - "path": "../gs032p3-robot-test-suite" - }, { "path": "../mec.pipeline-scripts" } diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 7e11f3d..ef87f9a 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -48,7 +48,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_DISCOVERY, + PICS_ROOT_API & PX_SENS_DISCOVERY & "?type=" & PX_SENSOR_IDENTIFIER, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -103,7 +103,7 @@ module AtsMec_SensorsSharingService_TestCases { m_http_request_get( PICS_ROOT_API & PX_SENS_DISCOVERY & "?type=" & PX_SENS_DISCOVERY_TYPE & "&sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, v_headers - ))); //curl -X GET "https://mec-platform.etsi.org/sbxykqjr17/mep1/sens/v1/queries/sensor_discovery?type=string&sensorPropertyList=string1,string2&sensorCharacteristicList=[object Object]&geographicalArea=[object Object]" -H "accept: application/json" + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -154,7 +154,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_DISCOVERY & "&sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, // type omitted + PICS_ROOT_API & PX_SENS_DISCOVERY & "?sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, // type omitted v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -238,7 +238,9 @@ module AtsMec_SensorsSharingService_TestCases { testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; + var charstring v_subscription_id; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_SENS_API_SUPPORTED required for executing the TC ***"); @@ -252,6 +254,7 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -268,8 +271,16 @@ module AtsMec_SensorsSharingService_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_subscription_link_list_sss - )))) { + mw_body_json_subscription_link_list_sss( + mw_subscription_link_list( + mw_links_sub( + -, + superset( + { + href := v_sensor_discovery_event_subscription.links.self_.href, + subscriptionType := v_sensor_discovery_event_subscription.subscriptionType + } + )))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); @@ -282,6 +293,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_01 @@ -291,6 +303,8 @@ module AtsMec_SensorsSharingService_TestCases { testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; + var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { @@ -305,6 +319,7 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -321,8 +336,16 @@ module AtsMec_SensorsSharingService_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_subscription_link_list_sss - )))) { + mw_body_json_subscription_link_list_sss( + mw_subscription_link_list( + mw_links_sub( + -, + superset( + { + href := v_sensor_discovery_event_subscription.links.self_.href, + subscriptionType := v_sensor_discovery_event_subscription.subscriptionType + } + )))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of subscriptions ***"); @@ -335,6 +358,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_OK_02 @@ -395,6 +419,8 @@ module AtsMec_SensorsSharingService_TestCases { testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; + var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { @@ -409,6 +435,7 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -437,6 +464,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_002_NF @@ -447,7 +475,7 @@ module AtsMec_SensorsSharingService_TestCases { // Local variables var Headers v_headers; var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; - var charstring v_subscriptiopn_id; + var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { @@ -462,11 +490,12 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_discovery_subscription(v_sensor_discovery_event_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscriptiopn_id, + PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -493,6 +522,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSDISCOVERY_003_OK @@ -503,7 +533,7 @@ module AtsMec_SensorsSharingService_TestCases { // Local variables var Headers v_headers; var SensorDiscoveryEventSubscription v_sensor_discovery_event_subscription; - var charstring v_subscriptiopn_id; + var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { @@ -559,6 +589,8 @@ module AtsMec_SensorsSharingService_TestCases { testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { @@ -573,6 +605,7 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -603,6 +636,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_01 @@ -612,6 +646,8 @@ module AtsMec_SensorsSharingService_TestCases { testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var SensorStatusSubscription v_sensor_status_subscription; + var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_SENS_API_SUPPORTED)) { @@ -626,6 +662,7 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -656,6 +693,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_001_OK_02 @@ -744,8 +782,14 @@ module AtsMec_SensorsSharingService_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_404_not_found - )) { + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_subscription_link_list_sss( + mw_subscription_link_list( + mw_links_sub( + { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_SUBS }, + omit + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); @@ -783,6 +827,7 @@ module AtsMec_SensorsSharingService_TestCases { // Test adapter configuration // Preamble + f_create_sensor_status_subscription(v_sensor_status_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -814,6 +859,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSLOOKUP_002_OK @@ -1627,7 +1673,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK @@ -1689,7 +1735,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_01 @@ -1751,7 +1797,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_OK_02 @@ -1924,7 +1970,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_001_BR_03 /** - * @desc Check that the IUT acknowledges the creation of SensorDiscoveryEventSubscription request when commanded by a MEC Application + * @desc Check that the IUT acknowledges the change of SensorDiscoveryEventSubscription request when commanded by a MEC Application */ testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1981,7 +2027,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_OK @@ -2040,7 +2086,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_002_NF @@ -2095,7 +2141,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_OK @@ -2150,7 +2196,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DISCOVERY); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_003_NF @@ -2199,9 +2245,8 @@ module AtsMec_SensorsSharingService_TestCases { mw_body_json_sensor_status_subscription( mw_sensor_status_subscription( PX_SENS_SUB_CALLBACK_URI, - mw_links( - { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} - ))))))) -> value v_response { + mw_links + )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header @@ -2227,7 +2272,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK @@ -2268,9 +2313,8 @@ module AtsMec_SensorsSharingService_TestCases { mw_body_json_sens_test_notification( mw_test_notification( -, - mw_links( - { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} - ))))))) { + mw_links + )))))) { tc_wait.stop; f_init_default_headers_list(-, -, v_headers); @@ -2289,7 +2333,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_01 @@ -2351,7 +2395,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_004_OK_02 @@ -2593,7 +2637,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_OK @@ -2658,7 +2702,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_005_NF @@ -2713,7 +2757,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_OK @@ -2768,7 +2812,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_006_NF @@ -2845,7 +2889,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_STATUS); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK @@ -2907,7 +2951,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DATA); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_01 @@ -2969,7 +3013,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DATA); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_007_OK_02 @@ -3211,7 +3255,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DATA); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_OK @@ -3249,7 +3293,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, v_headers, m_http_message_body_json( m_body_json_sensor_data_subscription( @@ -3276,7 +3320,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DATA); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_008_NF @@ -3307,7 +3351,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id, + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA & "/" & v_subscription_id, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -3331,7 +3375,6 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_OK @@ -3362,7 +3405,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA & "/" & PX_UNKNOWN_SUBSCRIPTION_ID, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -3386,7 +3429,7 @@ module AtsMec_SensorsSharingService_TestCases { } // End of 'alt' statement // Postamble - f_delete_sensor_subscription(v_subscription_id); + f_delete_sensor_subscription(v_subscription_id, PX_SENS_LIST_SUBS_DATA); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC046_SRV_SENSSUBNOT_SUB_NOT_009_NF diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn index b7249fd..c19ae49 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Functions.ttcn @@ -96,13 +96,13 @@ module SensorsSharingService_Functions { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_sensor_discovery_event_subscription( - mw_sensor_discovery_event_subscription( - PX_SENS_SUB_CALLBACK_URI, - mw_links - )))))) { + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_sensor_discovery_event_subscription( + mw_sensor_discovery_event_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) -> value v_response { tc_ac.stop; // Extract HTTP Location header @@ -137,7 +137,7 @@ module SensorsSharingService_Functions { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS, v_headers, m_http_message_body_json( m_body_json_sensor_status_subscription( @@ -155,13 +155,13 @@ module SensorsSharingService_Functions { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_sensor_status_subscription( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_sensor_status_subscription( mw_sensor_status_subscription( - PX_SENS_SUB_CALLBACK_URI, - mw_links - )))))) { + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) -> value v_response { tc_ac.stop; // Extract HTTP Location header @@ -196,16 +196,16 @@ module SensorsSharingService_Functions { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY, + PICS_ROOT_API & PX_SENS_LIST_SUBS_DATA, v_headers, m_http_message_body_json( m_body_json_sensor_data_subscription( - m_sensor_data_subscription( - PX_SENS_SUB_CALLBACK_URI, - -, -, - p_test_notification, - -, - p_expiryDeadline + m_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI, + -, -, + p_test_notification, + -, + p_expiryDeadline )))))); @@ -214,13 +214,13 @@ module SensorsSharingService_Functions { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_sensor_data_subscription( - mw_sensor_data_subscription( - PX_SENS_SUB_CALLBACK_URI, - mw_links - )))))) { + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_sensor_data_subscription( + mw_sensor_data_subscription( + PX_SENS_SUB_CALLBACK_URI, + mw_links + )))))) -> value v_response { tc_ac.stop; // Extract HTTP Location header @@ -243,7 +243,8 @@ module SensorsSharingService_Functions { } // End of function f_create_sensor_data_subscription function f_delete_sensor_subscription( - in charstring p_subscription_id + in charstring p_subscription_id, + in charstring p_uri ) runs on HttpComponent { var Headers v_headers; @@ -251,7 +252,7 @@ module SensorsSharingService_Functions { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & p_subscription_id, + PICS_ROOT_API & p_uri & "/" & p_subscription_id, v_headers ))); tc_ac.start; diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn index 092e261..742fa1e 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_Templates.ttcn @@ -238,17 +238,33 @@ module SensorsSharingService_Templates { } // End of template mw_sensor_data_subscription template (value) SubscriptionLinkList m_subscription_link_list( - in template (value) Links p_links + in template (value) LinksSub p_links ) := { links := p_links } // End of template m_subscription_link_list template (present) SubscriptionLinkList mw_subscription_link_list( - template (present) Links p_links := ? + template (present) LinksSub p_links := ? ) := { links := p_links } // End of template mw_subscription_link_list + template (omit) LinksSub m_links_sub( + in template (value) LinkType p_self_, + in template (omit) Subscriptions p_subscriptions := omit + ) := { + self_ := p_self_, + subscriptions := p_subscriptions + } // End of template m_links_sub + + template (present) LinksSub mw_links_sub( + template (present) LinkType p_self_ := ?, + template Subscriptions p_subscriptions := * + ) := { + self_ := p_self_, + subscriptions := p_subscriptions + } // End of template mw_links_sub + template (value) TestNotification m_test_notification( in Json.String p_notificationType, in template (value) Links p_links @@ -446,15 +462,15 @@ module SensorsSharingService_Templates { } // End of template mw_subscription template (value) Links m_links( - in template (value) LinkType p_subscription + in template (value) LinkType p_self_ ) :={ - subscription := p_subscription + self_ := p_self_ } // End of template m_links template (present) Links mw_links( - template (present) LinkType p_subscription := ? + template (present) LinkType p_self_ := ? ) :={ - subscription := p_subscription + self_ := p_self_ } // End of template mw_links template (omit) WebsockNotifConfig m_websock_notif_config( diff --git a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn index e7324c0..5ee57ea 100644 --- a/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn +++ b/ttcn/LibMec/SensorsSharingService/ttcn/SensorsSharingService_TypesAndValues.ttcn @@ -155,11 +155,24 @@ module SensorsSharingService_TypesAndValues { * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.4-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinkList { - Links links + LinksSub links } with { variant (links) "name as '_links'"; } + /** + * @desc Hyperlink related to the resource + * @member subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.4 Type: SubscriptionLinkList + */ + type record LinksSub { + LinkType self_, + Subscriptions subscriptions optional + } with { + variant (self_) "name as 'self'"; + } + + /** * @desc This type represents a test notification from a location server to determine if the Websocket method is to be utilized for the location server to issue notifications for a subscription * @member notificationType Shall be set to "TestNotification" @@ -320,12 +333,13 @@ module SensorsSharingService_TypesAndValues { * @desc The service consumer's subscriptions * @member href The URI referring to the subscription * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 046 V3.1.1 (2024-04) 6.3.1 Type: NotificationSubscriptionList + * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.3.4-1: Attributes of the SubscriptionLinkList */ type record Subscription { Json.AnyURI href, Json.String subscriptionType } + type set of Subscription Subscriptions; /** * @desc This type represents a type of link @@ -342,7 +356,9 @@ module SensorsSharingService_TypesAndValues { * @see ETSI GS MEC 046 V3.1.1 (2024-04) Table 6.4.1-1: Attributes of the TestNotification */ type record Links { - LinkType subscription + LinkType self_ + } with { + variant (self_) "name as 'self'"; } /** diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index badb4a6..ce20425 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -118,6 +118,8 @@ module LibMec_Pixits { modulepar charstring PX_SENS_DATA := "sens/v1/queries/sensor_data"; + modulepar charstring PX_SENS_SUBS := "sens/v1/subscriptions"; + modulepar charstring PX_SENS_LIST_SUBS_DISCOVERY := "sens/v1/subscriptions/sensor_discovery"; modulepar charstring PX_SENS_LIST_SUBS_STATUS := "sens/v1/subscriptions/sensor_status"; diff --git a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc index 38bc8f5..910c13e 100644 --- a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc +++ b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc @@ -425,6 +425,7 @@ int Abstract_Socket::receive_message_on_fd(int client_id) size_t end_len=AS_TCP_CHUNCK_SIZE; recv_tb->get_end(end_ptr, end_len); int messageLength = recv(client_id, (char *)end_ptr, end_len, 0); + log_debug("========> receive_message_on_fd errno: '%d', '%s'", errno, strerror(errno)); if (messageLength==0) return messageLength; // peer disconnected else if (messageLength < 0) { log_warning("Error when reading the received TCP PDU: %s", strerror(errno)); -- GitLab From 81cfa2150730e00af8e2e6686fdae5a7812d8d31 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 7 May 2025 14:16:37 +0200 Subject: [PATCH 27/54] Validation of AtsMec_FederationEnablement (continue) --- README.md | 5 +- ccsrc/Protocols/Json/json_codec_mec040.cc | 10 +- ...on.cf_ => AtsMec_FederationEnablement.cf_} | 46 +- .../AtsMec_SensorsSharingService.cf_ | 6 +- gs032p3-ttcn-test-suite.code-workspace | 3 + ...Mec_FederationEnablementAPI_TestCases.ttcn | 447 ++++++------------ ...c_FederationEnablementAPI_TestControl.ttcn | 6 +- ...tsMec_SensorsSharingService_TestCases.ttcn | 2 +- .../FederationEnablementAPI_Functions.ttcn | 7 +- .../ttcn/FederationEnablementAPI_Pixits.ttcn | 6 +- ...ederationEnablementAPI_TypesAndValues.ttcn | 22 +- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 8 +- .../module/src/Abstract_Socket.cc | 237 +++------- .../module/src/Abstract_Socket.hh | 51 +- .../Abstract_Socket.cc.patch | 117 +++++ .../Abstract_Socket.hh.patch | 38 ++ 16 files changed, 466 insertions(+), 545 deletions(-) rename etc/AtsMec_FederationEnablement/{AtsMec_FederationEnablement_Mockoon.cf_ => AtsMec_FederationEnablement.cf_} (68%) mode change 100644 => 100755 ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc mode change 100644 => 100755 ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh create mode 100644 ttcn/patch_abstract_socket/Abstract_Socket.cc.patch create mode 100644 ttcn/patch_abstract_socket/Abstract_Socket.hh.patch diff --git a/README.md b/README.md index 10188b7..91bc27b 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,9 @@ The ETSI MEC protocols project builds and tests regularly on the following platf - Linux (Ubuntu) - Windows ([Cygwin x64](https://cygwin.com/install.html), [Npcap SDK x64](https://nmap.org/npcap/#download) and [OpenSSL-Windows x64](https://www.openssl.org) are required) -Note: The [OpenSSL](https://www.openssl.org) version >= 1.1.1 is also required. - +Note: +- The [OpenSSL](https://www.openssl.org) version >= 1.1.1 is also required. +- The version 11.x.y and more of Ericsson TITAN is required. ## Installation diff --git a/ccsrc/Protocols/Json/json_codec_mec040.cc b/ccsrc/Protocols/Json/json_codec_mec040.cc index 78ec67e..a55813f 100644 --- a/ccsrc/Protocols/Json/json_codec_mec040.cc +++ b/ccsrc/Protocols/Json/json_codec_mec040.cc @@ -20,6 +20,10 @@ int json_codec_mec040::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms const FederationEnablementAPI__TypesAndValues::SystemInfo& system_info = msg.systemInfo(); system_info.encode(FederationEnablementAPI__TypesAndValues::SystemInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"SystemInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_systemInfoUpdate)) { + const FederationEnablementAPI__TypesAndValues::SystemInfoUpdate& system_info_update = msg.systemInfoUpdate(); + system_info_update.encode(FederationEnablementAPI__TypesAndValues::SystemInfoUpdate_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"SystemInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { return json_codec::encode(msg, data); } @@ -61,7 +65,7 @@ int json_codec_mec040::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo loggers::get_instance().log("json_codec_mec040::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - if (it->second.find("\"systemId\"") != std::string::npos) { // Be careful to the order + if ((it->second.find("\"systemId\"") != std::string::npos) && (it->second.find("\"endPoint\"") == std::string::npos)) { // Be careful to the order if (it->second[0] == '[') { FederationEnablementAPI__TypesAndValues::SystemInfoList system_info_list; system_info_list.decode(FederationEnablementAPI__TypesAndValues::SystemInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); @@ -71,6 +75,10 @@ int json_codec_mec040::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo system_info.decode(FederationEnablementAPI__TypesAndValues::SystemInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.systemInfo() = system_info; } + } else if (it->second.find("\"endPoint\"") != std::string::npos) { + FederationEnablementAPI__TypesAndValues::SystemInfoUpdate system_info_update; + system_info_update.decode(FederationEnablementAPI__TypesAndValues::SystemInfoUpdate_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.systemInfoUpdate() = system_info_update; } else { return json_codec::decode(p_data, msg, p_params); } diff --git a/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_ b/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ similarity index 68% rename from etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_ rename to etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ index 5c8c070..e4a2443 100644 --- a/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement_Mockoon.cf_ +++ b/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ @@ -8,14 +8,17 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.39" +LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" #"192.168.1.39" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" # LibMec_Pixits +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' +# LibMec/FederationEnablementAPI +FederationEnablementAPI_Pixits.PX_FED_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -33,8 +36,7 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server=192.168.1.12,port=30030,use_ssl=0)" -#system.httpPort.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" [DEFINE] @@ -72,10 +74,8 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1 #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_04 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemName query parameters #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_05 -# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemName query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_05 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple SystemName query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_06 +AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_06 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty SystemName query parameters #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_07 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - systemProvider query parameters @@ -93,7 +93,39 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1 # Check that the IUT responds with an error when selection is not applicable - SystemProvider #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_03 # Check that the IUT responds with an error when request is malformed -AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR + + +# Check that the IUT creates a new systemInfo when requested by a MEC Orchestrator +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_002_OK +# Check that the IUT responds with an error on creating an existing systemInfo +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_002_BR +# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_003_OK +# Check that the IUT responds with an error when it receives a request for returning a systemInfo referred with a wrong systemId +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_003_NF +# Check that the IUT responds with an error when it receives a request with an inconsistant URI +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_003_BR +# Check that the IUT updates the systemInfo when requested by a MEC Orchestrator +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_004_OK_01 +# Check that the IUT updates the systemInfo when requested by a MEC Orchestrator +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_004_OK_02 +# Check that the IUT updates the systemInfo when requested by a MEC Orchestrator +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_004_OK_03 +# Check that the IUT responds with an error when requested to update an unknown systemInfo +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_004_NF +# Check that the IUT responds with an error when requested to update with no data provided +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_004_BR +# Check that the IUT deletes the systemInfo when requested by a MEC Orchestrator +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_005_OK +# Check that the IUT responds with an error when requested to delete an unknown systemInfo +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_005_NF +# Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_006_OK_01 + + + + diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ index 8e95c00..a8e0c22 100644 --- a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ @@ -19,7 +19,7 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in o SensorsSharingService_Pixits.PX_SENS_SUB_CALLBACK_URI := "http://yanngarcia.ddns.net/sens/v1/notif" SensorsSharingService_Pixits.PX_SENS_DISCOVERY_TYPE := "" SensorsSharingService_Pixits.PX_SENS_DISCOVERY_PROPERTY_LIST := "SAREF" # Could be [], string or [string1 string2] -SensorsSharingService_Pixits.PX_SENSOR_IDENTIFIER := "CNT" +SensorsSharingService_Pixits.PX_SENSOR_IDENTIFIER := "cnt8WkyGNcEDV" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -96,9 +96,9 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec046)/TCP(debug=1 # Check that the IUT responds with an error when the IUT does not have sensor(s) #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_002_NF # Check that the IUT responds with the list of SensorData when queried by a MEC Application -#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK +AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR # Check that the IUT responds with an error when the IUT does not have sensor(s) #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_NF # Check that the IUT responds with the list of subscriptions when queried by a MEC Application - No query parameters diff --git a/gs032p3-ttcn-test-suite.code-workspace b/gs032p3-ttcn-test-suite.code-workspace index a657388..fce41bb 100644 --- a/gs032p3-ttcn-test-suite.code-workspace +++ b/gs032p3-ttcn-test-suite.code-workspace @@ -11,6 +11,9 @@ }, { "path": "../mec.pipeline-scripts" + }, + { + "path": "../../frameworks/titan/titan.core" } ], "settings": { diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn index 4d44365..ca9bd6f 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn @@ -33,11 +33,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -71,11 +72,8 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( superset( - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ))))))) { + v_system_info_list[1] + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); @@ -98,11 +96,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -122,7 +121,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")), + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -136,11 +135,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ) + v_system_info_list[1] } ))))) { tc_ac.stop; @@ -165,11 +160,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -189,7 +185,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")) & "&systemName=" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")) & "&systemName=" & oct2char(unichar2oct(v_system_info_list[2].systemName, "UTF-8")), v_headers ) ) @@ -205,16 +201,8 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) + v_system_info_list[1], + v_system_info_list[2] } ))))) { tc_ac.stop; @@ -239,11 +227,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -263,7 +252,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=", + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO, v_headers ) ) @@ -278,18 +267,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_fed_system_info_list( - { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) - } + v_system_info_list ))))) { tc_ac.stop; @@ -313,11 +291,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_05() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -337,7 +316,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemName=" & oct2char(unichar2oct(PX_FED_SYSTEM_NAME_1, "UTF-8")), + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemName=" & oct2char(unichar2oct(v_system_info_list[1].systemName, "UTF-8")), v_headers ) ) @@ -353,11 +332,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ) + v_system_info_list[1] } ))))) { tc_ac.stop; @@ -382,11 +357,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_06() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -422,16 +398,8 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) + v_system_info_list[0], + v_system_info_list[0] } ))))) { tc_ac.stop; @@ -456,11 +424,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_07() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -530,11 +499,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_08() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -599,11 +569,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_09() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -673,11 +644,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_10() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -747,11 +719,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_001_OK_11() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1071,9 +1044,9 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info( mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 + PX_FED_SYSTEM_PROVIDER_1, + ? )))))) -> value v_response { tc_ac.stop; @@ -1094,71 +1067,10 @@ module AtsMec_FederationEnablementAPI_TestCases { /** * @desc Check that the IUT responds with an error on creating an existing systemInfo */ - testcase TC_MEC_MEC040_SRV_MEF_002_BR_01() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var HttpMessage v_response; - var SystemInfo v_system_info := valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)); - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_create_system_info(v_system_info); - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_FED_API_SYS_INFO, - v_headers, - m_http_message_body_json( - m_body_json_fed_system_info( - m_system_info( // Already created - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_PROVIDER_1 - )))))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_400_bad_request - )) -> value v_response { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with yhe correct error code ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_delete_system_info(v_system_info); - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC040_SRV_MEF_002_BR_01 - - /** - * @desc Check that the IUT responds with an error on creating an existing systemInfo - */ - testcase TC_MEC_MEC040_SRV_MEF_002_BR_02() runs on HttpComponent system HttpTestAdapter { + testcase TC_MEC_MEC040_SRV_MEF_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var HttpMessage v_response; - var SystemInfo v_system_info := valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)); + var SystemInfo v_system_info := valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, omit)); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1185,7 +1097,7 @@ module AtsMec_FederationEnablementAPI_TestCases { m_system_info( PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_ID_1 // Shall be omitted + v_system_info.systemId // Shall be omited )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1195,7 +1107,7 @@ module AtsMec_FederationEnablementAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request - )) -> value v_response { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with yhe correct error code ***"); @@ -1210,7 +1122,7 @@ module AtsMec_FederationEnablementAPI_TestCases { // Postamble f_delete_system_info(v_system_info); f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC040_SRV_MEF_002_BR_02 + } // End of testcase TC_MEC_MEC040_SRV_MEF_002_BR /** * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator @@ -1218,11 +1130,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1242,7 +1155,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")), v_headers ) ) @@ -1257,11 +1170,8 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_fed_system_info( - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - )))))) { + v_system_info_list[1] + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct SystemInfo entry ***"); @@ -1279,15 +1189,16 @@ module AtsMec_FederationEnablementAPI_TestCases { } // End of testcase TC_MEC_MEC040_SRV_MEF_003_OK /** - * @desc Check that the IUT responds with an error when it receives a request for returning a systemInfo referred with a wrong systemId + * @desc Check that the IUT responds with an error when it receives a request for returning a systemInfo referred with a wrong systemId */ testcase TC_MEC_MEC040_SRV_MEF_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1343,10 +1254,11 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_003_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1366,7 +1278,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_SYS_INFO_WRONG & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")), // Inconsistent URI + PICS_ROOT_API & PX_FED_API_SYS_INFO & "&" & oct2char(unichar2oct(v_system_info_list[0].systemId, "UTF-8")), // Inconsistent URI v_headers ) ) @@ -1378,7 +1290,7 @@ module AtsMec_FederationEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_404_not_found + mw_http_response_400_bad_request )) { tc_ac.stop; @@ -1402,11 +1314,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1426,12 +1339,12 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( m_system_info_update( - -, + PX_FED_SYSTEM_NAME_1, // Change name m_end_point_uris( { PX_FED_ENDPOINT_URI_1, PX_FED_ENDPOINT_URI_2 } ))))))); @@ -1446,9 +1359,9 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info( mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_2 + v_system_info_list[1].systemProvider, + v_system_info_list[1].systemId )))))) { tc_ac.stop; @@ -1472,11 +1385,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1496,7 +1410,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1514,9 +1428,9 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info( mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_1 & "_patched", - PX_FED_SYSTEM_ID_2 + v_system_info_list[1].systemProvider, + v_system_info_list[1].systemId )))))) { tc_ac.stop; @@ -1540,11 +1454,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_004_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1564,7 +1479,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1584,9 +1499,9 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info( mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_1 & "_patched", - PX_FED_SYSTEM_ID_2 + v_system_info_list[1].systemProvider, + v_system_info_list[1].systemId )))))) { tc_ac.stop; @@ -1611,7 +1526,7 @@ module AtsMec_FederationEnablementAPI_TestCases { // Local variables var Headers v_headers; var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) + valueof(m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit)) }; // Test control @@ -1666,76 +1581,14 @@ module AtsMec_FederationEnablementAPI_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_004_NF - /** - * @desc Check that the IUT responds with an error when requested to update with an inconsistant URI - */ - testcase TC_MEC_MEC040_SRV_MEF_004_BR_01() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) - }; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_create_system_info_list(v_system_info_list); - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SYS_INFO_WRONG & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), // v10 instead of v1 - v_headers, - m_http_message_body_json( - m_body_json_fed_system_info_update( - m_system_info_update( - -, - m_end_point_uris( - { PX_FED_ENDPOINT_URI_1, PX_FED_ENDPOINT_URI_2 } - ))))))); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_400_bad_request - )) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_delete_system_info_list(v_system_info_list); - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC040_SRV_MEF_004_BR_01 - /** * @desc Check that the IUT responds with an error when requested to update with no data provided */ - testcase TC_MEC_MEC040_SRV_MEF_004_BR_02() runs on HttpComponent system HttpTestAdapter { + testcase TC_MEC_MEC040_SRV_MEF_004_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) + valueof(m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit)) }; // Test control @@ -1756,7 +1609,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(v_system_info_list[0].systemId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fed_system_info_update( @@ -1785,7 +1638,7 @@ module AtsMec_FederationEnablementAPI_TestCases { // Postamble f_delete_system_info_list(v_system_info_list); f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC040_SRV_MEF_004_BR_02 + } // End of testcase TC_MEC_MEC040_SRV_MEF_004_BR /** * @desc Check that the IUT deletes the systemInfo when requested by a MEC Orchestrator @@ -1793,11 +1646,12 @@ module AtsMec_FederationEnablementAPI_TestCases { testcase TC_MEC_MEC040_SRV_MEF_005_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3)) - }; + var SystemInfoList v_system_info_list := valueof( + { + m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), + m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), + m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) + }); // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { @@ -1817,7 +1671,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_SYS_INFO & "/" & oct2char(unichar2oct(v_system_info_list[1].systemId, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1841,7 +1695,8 @@ module AtsMec_FederationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_system_info_list(v_system_info_list); + f_delete_system_info(v_system_info_list[0]); + f_delete_system_info(v_system_info_list[2]); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_005_OK @@ -1852,7 +1707,7 @@ module AtsMec_FederationEnablementAPI_TestCases { // Local variables var Headers v_headers; var SystemInfoList v_system_info_list := { - valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)) + valueof(m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit)) }; // Test control diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn index 05a6cd4..9c8860b 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn @@ -33,8 +33,7 @@ module AtsMec_FederationEnablementAPI_TestControl { execute(TC_MEC_MEC040_SRV_MEF_001_BR()); execute(TC_MEC_MEC040_SRV_MEF_002_OK()); - execute(TC_MEC_MEC040_SRV_MEF_002_BR_01()); - execute(TC_MEC_MEC040_SRV_MEF_002_BR_02()); + execute(TC_MEC_MEC040_SRV_MEF_002_BR()); execute(TC_MEC_MEC040_SRV_MEF_003_OK()); execute(TC_MEC_MEC040_SRV_MEF_003_NF()); @@ -45,8 +44,7 @@ module AtsMec_FederationEnablementAPI_TestControl { execute(TC_MEC_MEC040_SRV_MEF_004_OK_03()); execute(TC_MEC_MEC040_SRV_MEF_004_NF()); - execute(TC_MEC_MEC040_SRV_MEF_004_BR_01()); - execute(TC_MEC_MEC040_SRV_MEF_004_BR_02()); + execute(TC_MEC_MEC040_SRV_MEF_004_BR()); execute(TC_MEC_MEC040_SRV_MEF_005_OK()); execute(TC_MEC_MEC040_SRV_MEF_005_NF()); diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index ef87f9a..963677e 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -940,7 +940,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_DATA & "?" & PX_SENSOR_IDENTIFIER, + PICS_ROOT_API & PX_SENS_DATA & "?sensorIdentifier=" & PX_SENSOR_IDENTIFIER, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn index 0b244a3..b5aa41d 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Functions.ttcn @@ -53,8 +53,11 @@ module FederationEnablementAPI_Functions { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_fed_system_info( - p_system_info - ))))) -> value v_response { + mw_system_info( + p_system_info.systemName, + p_system_info.systemProvider, + ? + )))))) -> value v_response { tc_ac.stop; p_system_info := v_response.response.body.json_body.systemInfo; diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn index 0220a27..1e4d657 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_Pixits.ttcn @@ -33,11 +33,11 @@ module FederationEnablementAPI_Pixits { modulepar Json.String PX_FED_SYSTEM_PROVIDER_UNKNOWN := "systemProvider666"; - modulepar Json.String PX_FED_ENDPOINT_URI_1 := ""; + modulepar Json.String PX_FED_ENDPOINT_URI_1 := "http://ur1"; - modulepar Json.String PX_FED_ENDPOINT_URI_2 := ""; + modulepar Json.String PX_FED_ENDPOINT_URI_2 := "http://ur2"; - modulepar Json.String PX_FED_ENDPOINT_URI_3 := ""; + modulepar Json.String PX_FED_ENDPOINT_URI_3 := "http://ur3"; modulepar charstring PX_FED_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; diff --git a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn index 4723a52..b55f41d 100644 --- a/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/FederationEnablementAPI/ttcn/FederationEnablementAPI_TypesAndValues.ttcn @@ -26,7 +26,7 @@ module FederationEnablementAPI_TypesAndValues { * @member systemId Identifier of the MEC system * @member systemName The name of the MEC system * @member systemProvider Provider of the MEC system - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.2-1: Attributes of SystemInfo + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.2.2-1: Attributes of SystemInfo */ type record SystemInfo { Json.String systemId optional, // Shall be absent in POST request @@ -40,7 +40,7 @@ module FederationEnablementAPI_TypesAndValues { * @desc information provided by MEC orchestrator as a part of the "Update of MEC system(s) to the federation" * @member systemName The name of the MEC system * @member endpoint Endpoint information (e.g. URI, FQDN, IP address) of MEC federator - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.3-1: Attributes of SystemInfoUpdate + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.2.3-1: Attributes of SystemInfoUpdate */ type record SystemInfoUpdate { Json.String systemName optional, @@ -52,7 +52,7 @@ module FederationEnablementAPI_TypesAndValues { * @member systemId Identifier of the MEC system * @member mecHostInformation Represent the information of the MEC host * @member serviceInfo Represent the information of a MEC service - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.4-1: Attributes of FedServiceInfo + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.2.4-1: Attributes of FedServiceInfo */ type record FedServiceInfo { Json.String systemId, @@ -64,7 +64,7 @@ module FederationEnablementAPI_TypesAndValues { * @desc The type represents the information of the MEC host * @member hostName Human-readable name of MEC host * @member hostId Deployment-specific information to identify a MEC host - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.4-1: Attributes of FedServiceInfo + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.2.4-1: Attributes of FedServiceInfo */ type record MecHostInformation { Json.String hostName optional, @@ -75,7 +75,7 @@ module FederationEnablementAPI_TypesAndValues { * @desc This data type represents a list of key-value pairs * @member key_name * @member key_value - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.2.4-1: Attributes of FedServiceInfo + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.2.4-1: Attributes of FedServiceInfo */ type record KeyValuePairs { Json.String key_name, @@ -89,7 +89,7 @@ module FederationEnablementAPI_TypesAndValues { * @param _links Hyperlink related to the resource * @param systemId Identifier of the MEC system * @param expiryDeadline The expiration time of the subscription determined by the MEC Federation Enablement Service - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.2-1: Attributes of SystemUpdateNotificationSubscriptionn + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.3.2-1: Attributes of SystemUpdateNotificationSubscriptionn */ type record SystemUpdateNotificationSubscription { Json.String subscriptionType, @@ -104,7 +104,7 @@ module FederationEnablementAPI_TypesAndValues { /** * @desc This type represents a list of links related to existing subscriptions for subscription service consumers of the MEC federation * @param _links List of hyperlinks related to the resource - * @see EETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.3-1: Attributes of SubscriptionLinkList + * @see EETSI GS MEC 040 V3.3.1 (2025-03) Table 6.3.3-1: Attributes of SubscriptionLinkList */ type record SubscriptionLinkList { LinksList links @@ -117,7 +117,7 @@ module FederationEnablementAPI_TypesAndValues { * @param notificationType Shall be set to "SystemUpdateNotification" * @param updatedSystemInfo Updated information of the MEC system(s) in the MEC federation * @param _links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.4.2-1: Attributes of SystemUpdateNotification + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.4.2-1: Attributes of SystemUpdateNotification */ type record SystemUpdateNotification { Json.String notificationType, @@ -130,7 +130,7 @@ module FederationEnablementAPI_TypesAndValues { /** * @desc Object containing hyperlinks related to the resource * @member subscription A link to the related subscription - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.4.2-1: Attributes of SystemUpdateNotification + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.4.2-1: Attributes of SystemUpdateNotification */ type record LinksSub { LinkType subscription @@ -140,7 +140,7 @@ module FederationEnablementAPI_TypesAndValues { * @desc List of hyperlinks related to the resource * @param self_ List of hyperlinks related to the resource * @param subscription A link to a subscription - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.3-1: Attributes of SubscriptionLinkList + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.3.3-1: Attributes of SubscriptionLinkList */ type record LinksList { LinkType self_, @@ -153,7 +153,7 @@ module FederationEnablementAPI_TypesAndValues { * @desc A link to a subscription * @member href The URI referring to the subscription * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 040 V3.2.1 (2024-03) Table 6.3.3-1: Attributes of SubscriptionLinkList + * @see ETSI GS MEC 040 V3.3.1 (2025-03) Table 6.3.3-1: Attributes of SubscriptionLinkList */ type record Subscription { Json.AnyURI href, diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index ce20425..d476bdb 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -1,4 +1,4 @@ -module LibMec_Pixits { +module LibMec_Pixits { // FIXME FSCOM Split this file according to the different ATSs modulepar charstring PX_ME_APP_Q_ZONE_ID_URI := "location/v3/queries/zones"; @@ -96,11 +96,11 @@ module LibMec_Pixits { modulepar charstring PX_UE_ZONAL_TRAF_SUB_URI := "fai/v1/optical_network_info"; - modulepar charstring PX_FED_API_LIST_SYSTEM_INFO := "fed_enablement/v1/fed_resources/system_info"; + modulepar charstring PX_FED_API_LIST_SYSTEM_INFO := "fed_enablement/v1/fed_resources/systems"; - modulepar charstring PX_FED_API_SYS_INFO := "fed_enablement/v1/fed_resources/system_info"; + modulepar charstring PX_FED_API_SYS_INFO := "fed_enablement/v1/fed_resources/systems"; - modulepar charstring PX_FED_API_SYS_INFO_WRONG := "fed_enablement/v10/fed_resources/system_info"; // v10 instead of v1 + modulepar charstring PX_FED_API_SYS_INFO_WRONG := "fed_enablement/v10/fed_resources/systems"; // v10 instead of v1 modulepar charstring PX_FED_API_SUB := "fed_enablement/v1/fed_resources/subscription"; diff --git a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc old mode 100644 new mode 100755 index 910c13e..9d93bed --- a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc +++ b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.cc @@ -1,28 +1,17 @@ /****************************************************************************** -* Copyright (c) 2000-2019 Ericsson Telecom AB -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v2.0 -* which accompanies this distribution, and is available at -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html -* -* Contributors: -* Zoltan Bibo - initial implementation and initial documentation -* Gergely Futo -* Oliver Ferenc Czerman -* Balasko Jeno -* Zoltan Bibo -* Eduard Czimbalmos -* Kulcsár Endre -* Gabor Szalai -* Jozsef Gyurusi -* Csöndes Tibor -* Zoltan Jasz -******************************************************************************/ + * Copyright (c) 2000-2025 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html + ******************************************************************************/ // // File: Abstract_Socket.cc // Description: Abstract_Socket implementation file -// Rev: R9B +// Rev: // Prodnr: CNL 113 384 +// Updated: 2012-08-07 +// Contact: http://ttcn.ericsson.se // #include "Abstract_Socket.hh" @@ -254,20 +243,16 @@ bool Abstract_Socket::parameter_set(const char *parameter_name, Free(local_host_name); local_host_name = mcopystr(parameter_value); } else if(strcmp(parameter_name, remote_port_name()) == 0){ - int a; - if (sscanf(parameter_value, "%d", &a)!=1) log_error("Invalid input as port number given: %s", parameter_value); - if (a>65535 || a<0){ log_error("Port number must be between 0 and 65535, %d is given", remote_port_number);} - else {remote_port_number=a;} + if (sscanf(parameter_value, "%d", &remote_port_number)!=1) log_error("Invalid input as port number given: %s", parameter_value); + if (remote_port_number>65535 || remote_port_number<0) log_error("Port number must be between 0 and 65535, %d is given", remote_port_number); } else if(strcmp(parameter_name, ai_family_name()) == 0){ if (strcasecmp(parameter_value,"IPv6")==0 || strcasecmp(parameter_value,"AF_INET6")==0) ai_family = AF_INET6; else if (strcasecmp(parameter_value,"IPv4")==0 || strcasecmp(parameter_value,"AF_INET")==0) ai_family = AF_INET; else if (strcasecmp(parameter_value,"UNSPEC")==0 || strcasecmp(parameter_value,"AF_UNSPEC")==0) ai_family = AF_UNSPEC; else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ai_family_name()); } else if(strcmp(parameter_name, local_port_name()) == 0){ - int a; - if (sscanf(parameter_value, "%d", &a)!=1) log_error("Invalid input as port number given: %s", parameter_value); - if (a>65535 || a<0) {log_error("Port number must be between 0 and 65535, %d is given", local_port_number);} - else {local_port_number=a;} + if (sscanf(parameter_value, "%d", &local_port_number)!=1) log_error("Invalid input as port number given: %s", parameter_value); + if (local_port_number>65535 || local_port_number<0) log_error("Port number must be between 0 and 65535, %d is given", local_port_number); } else if (strcmp(parameter_name, nagling_name()) == 0) { if (strcasecmp(parameter_value,"yes")==0) nagling = true; else if (strcasecmp(parameter_value,"no")==0) nagling = false; @@ -316,14 +301,16 @@ void Abstract_Socket::Handle_Socket_Event(int fd, boolean is_readable, boolean i } else { if(shutdown(fd, SHUT_RD) != 0) { if(errno == ENOTCONN) { + remove_client(fd); + peer_disconnected(fd); errno = 0; - } else { + } else log_error("shutdown(SHUT_RD) system call failed"); - } + } else { + client_data->tcp_state = CLOSE_WAIT; + Remove_Fd_Read_Handler(fd); + peer_half_closed(fd); } - client_data->tcp_state = CLOSE_WAIT; - Remove_Fd_Read_Handler(fd); - peer_half_closed(fd); } } // switch (client_data->reading_state) } else if (messageLength > 0) { @@ -425,7 +412,6 @@ int Abstract_Socket::receive_message_on_fd(int client_id) size_t end_len=AS_TCP_CHUNCK_SIZE; recv_tb->get_end(end_ptr, end_len); int messageLength = recv(client_id, (char *)end_ptr, end_len, 0); - log_debug("========> receive_message_on_fd errno: '%d', '%s'", errno, strerror(errno)); if (messageLength==0) return messageLength; // peer disconnected else if (messageLength < 0) { log_warning("Error when reading the received TCP PDU: %s", strerror(errno)); @@ -464,11 +450,12 @@ int Abstract_Socket::send_message_on_nonblocking_fd(int client_id, log_debug("entering Abstract_Socket::" "send_message_on_nonblocking_fd(id: %d)", client_id); - as_client_struct * client_data = get_peer(client_id); + as_client_struct * client_data; int sent_len = 0; while(sent_len < length){ int ret; log_debug("Abstract_Socket::send_message_on_nonblocking_fd(id: %d): new iteration", client_id); + client_data = get_peer(client_id); if (client_data->reading_state == STATE_DONT_CLOSE){ goto client_closed_connection; } else ret = send(client_id, send_par + sent_len, length - sent_len, 0); @@ -549,7 +536,7 @@ const PacketHeaderDescr* Abstract_Socket::Get_Header_Descriptor() const return NULL; } -void Abstract_Socket::peer_connected(int /*client_id*/, sockaddr_in& /*remote_addr*/) +void Abstract_Socket::peer_connected(int client_id, sockaddr_in& remote_addr) { } @@ -614,8 +601,8 @@ void Abstract_Socket::map_user() char remotePort[6]; char localPort[6]; - sprintf(localPort, "%u", local_port_number); - sprintf(remotePort, "%u", remote_port_number); + sprintf(localPort, "%d", local_port_number); + sprintf(remotePort, "%d", remote_port_number); if(!use_connection_ASPs) { @@ -797,7 +784,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc log_warning("Cannot open socket when trying to open the listen port: %s", strerror(errno)); listen_port_opened(-1); errno = 0; - freeaddrinfo(aip); return -1; } else log_error("Cannot open socket"); @@ -815,7 +801,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc log_warning("Setsockopt failed when trying to open the listen port: %s", strerror(errno)); listen_port_opened(-1); errno = 0; - freeaddrinfo(aip); return -1; } else log_error("Setsockopt failed"); @@ -828,10 +813,10 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc log_debug("Bind to port..."); if (bind(listen_fd, res->ai_addr, res->ai_addrlen) == -1) { - error = errno; // save it for the warning message close(listen_fd); listen_fd = -1; log_debug("Cannot bind to port when trying to open the listen port: %s", strerror(errno)); + error = errno; // save it for the warning message errno = 0; continue; } @@ -843,8 +828,8 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc { log_warning("Cannot bind to port when trying to open the listen port: %s", strerror(error)); listen_port_opened(-1); + error = errno; // save it for the warning message error = 0; - freeaddrinfo(aip); return -1; } else log_error("Cannot bind to port"); @@ -858,7 +843,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc log_warning("Cannot listen at port when trying to open the listen port: %s", strerror(errno)); listen_port_opened(-1); errno = 0; - freeaddrinfo(aip); return -1; } else log_error("Cannot listen at port"); @@ -877,14 +861,13 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc log_warning("getsockname() system call failed on the server socket when trying to open the listen port: %s", strerror(errno)); listen_port_opened(-1); errno = 0; - freeaddrinfo(aip); return -1; } else log_error("getsockname() system call failed on the server socket"); } char hname[NI_MAXHOST]; char sname[NI_MAXSERV]; -/* error = getnameinfo(res->ai_addr, res->ai_addrlen, + error = getnameinfo(res->ai_addr, res->ai_addrlen, hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICSERV); if (error) { close(listen_fd); @@ -893,14 +876,13 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc { log_warning("getnameinfo() system call failed on the server socket when trying to open the listen port: %s", gai_strerror(error)); listen_port_opened(-1); - freeaddrinfo(aip); return -1; } else log_error("getsockname() system call failed on the server socket"); } else { log_debug("Listening on (name): %s/%s\n", hname, sname); - }*/ + } error = getnameinfo(res->ai_addr, res->ai_addrlen, hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICHOST|NI_NUMERICSERV); if (error) { @@ -910,7 +892,6 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc { log_warning("getnameinfo() system call failed on the server socket when trying to open the listen port: %s", gai_strerror(error)); listen_port_opened(-1); - freeaddrinfo(aip); return -1; } else log_error("getsockname() system call failed on the server socket"); @@ -932,12 +913,11 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc if(use_connection_ASPs) listen_port_opened(listenPort); - freeaddrinfo(aip); return listenPort; #endif } -void Abstract_Socket::listen_port_opened(int /*port_number*/) +void Abstract_Socket::listen_port_opened(int port_number) { // Intentionally blank } @@ -1084,9 +1064,7 @@ int Abstract_Socket::open_client_connection(const struct sockaddr_in & new_remot Add_Fd_Read_Handler(socket_fd); // Done here - as in case of error: remove_client expects the handler as added log_debug("Abstract_Socket::open_client_connection(). Handler set to socket fd %d", socket_fd); client_data->fd_buff = new TTCN_Buffer; -// client_data->clientAddr = *(struct sockaddr_storage*)&new_remote_addr; - memset(&client_data->clientAddr,0,sizeof(client_data->clientAddr)); - memcpy(&client_data->clientAddr,&new_remote_addr,sizeof(new_remote_addr)); + client_data->clientAddr = *(struct sockaddr_storage*)&new_remote_addr; client_data->clientAddrlen = sizeof(new_remote_addr); client_data->tcp_state = ESTABLISHED; client_data->reading_state = STATE_NORMAL; @@ -1259,22 +1237,22 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch ); if(bind(socket_fd, aip2->ai_addr, aip2->ai_addrlen)<0) { -/* if(use_connection_ASPs) // the if else branches are the same - {*/ + if(use_connection_ASPs) + { log_debug("Cannot bind to port when trying to open client connection: %s", strerror(errno)); //client_connection_opened(-1); //freeaddrinfo(localAddrinfo); errno = 0; continue; //aip2 cycle //return -1; -/* } + } else { //freeaddrinfo(localAddrinfo); //log_error("Cannot bind to port."); log_debug("Cannot bind to port when trying to open client connection: %s", strerror(errno)); errno = 0; continue; //aip2 cycle - }*/ + } } log_debug("Bind successful on client."); freeaddrinfo(localAddrinfo); @@ -1358,7 +1336,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch } char hname[NI_MAXHOST]; char sname[NI_MAXSERV]; -/* error = getnameinfo(aip->ai_addr, aip->ai_addrlen, + error = getnameinfo(aip->ai_addr, aip->ai_addrlen, hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICSERV); if (error) { close(socket_fd); @@ -1373,19 +1351,18 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch log_debug("Connection established (name): %s/%s -> %s/%s\n", hname, sname, remoteHostname, remoteServicename); - }*/ + } error = getnameinfo(aip->ai_addr, aip->ai_addrlen, hname, sizeof (hname), sname, sizeof (sname), NI_NUMERICHOST|NI_NUMERICSERV); if (error) { -/* close(socket_fd); + close(socket_fd); if(use_connection_ASPs) { log_warning("getnameinfo() system call failed on the client socket when trying to connect to server: %s", gai_strerror(error)); -// client_connection_opened(-1); -// return -1; + client_connection_opened(-1); + return -1; } - else*/ - log_warning("getnameinfo() system call failed on the client socket when trying to connect to server: %s", gai_strerror(error)); + else log_error("getnameinfo() system call failed on the client socket when trying to connect to server: %s", gai_strerror(error)); } else { log_debug("Connection established (addr): %s/%s -> %s/%s\n", hname, sname, @@ -1421,20 +1398,18 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch return -1; } else log_error("Set blocking mode failed."); - } + } as_client_struct * client_data=peer_list_add_peer(socket_fd); Add_Fd_Read_Handler(socket_fd); // Done here - as in case of error: remove_client expects the handler as added log_debug("Abstract_Socket::open_client_connection(). Handler set to socket fd %d", socket_fd); client_data->fd_buff = new TTCN_Buffer; -// client_data->clientAddr = *(struct sockaddr_storage*)aip->ai_addr; - memset(&client_data->clientAddr,0,sizeof(client_data->clientAddr)); - memcpy(&client_data->clientAddr,aip->ai_addr,sizeof(*aip->ai_addr)); + client_data->clientAddr = *(struct sockaddr_storage*)aip->ai_addr; client_data->clientAddrlen = aip->ai_addrlen; client_data->tcp_state = ESTABLISHED; client_data->reading_state = STATE_NORMAL; - freeaddrinfo(res); + freeaddrinfo(res); if (!add_user_data(socket_fd)) { remove_client(socket_fd); @@ -1449,7 +1424,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch } -void Abstract_Socket::client_connection_opened(int /*client_id*/) +void Abstract_Socket::client_connection_opened(int client_id) { // Intentionally blank } @@ -1463,7 +1438,7 @@ void Abstract_Socket::unmap_user() log_debug("leaving Abstract_Socket::unmap_user()"); } -void Abstract_Socket::peer_disconnected(int /*fd*/) +void Abstract_Socket::peer_disconnected(int fd) { // virtual peer_disconnected() needs to be overriden in test ports! if(!use_connection_ASPs) { @@ -1547,19 +1522,11 @@ void Abstract_Socket::send_outgoing(const unsigned char* send_par, int length, i nrOfBytesSent = use_non_blocking_socket ? send_message_on_nonblocking_fd(dest_fd, send_par, length) : send_message_on_fd(dest_fd, send_par, length); - if (nrOfBytesSent == -1){ - log_debug("Client %d closed connection. Error: %d %s", client_id, errno, strerror(errno)); - report_unsent(dest_fd,length,nrOfBytesSent,send_par,"Client closed the connection"); - - if(client_data->tcp_state == CLOSE_WAIT){ - log_debug("Client %d waiting for close ASP.", client_id); - } else { - errno = 0; - log_debug("Client %d closed connection", client_id); - client_data->tcp_state = CLOSE_WAIT; - Remove_Fd_Read_Handler(dest_fd); - peer_half_closed(dest_fd); - } + if (nrOfBytesSent == -1 && errno == EPIPE){ // means connection was interrupted by peer + errno = 0; + log_debug("Client %d closed connection", client_id); + remove_client(dest_fd); + peer_disconnected(dest_fd); }else if (nrOfBytesSent != length) { char *error_text=mprintf("Send system call failed: %d bytes were sent instead of %d", nrOfBytesSent, length); report_error(client_id,length,nrOfBytesSent,send_par,error_text); @@ -1570,16 +1537,11 @@ void Abstract_Socket::send_outgoing(const unsigned char* send_par, int length, i log_debug("leaving Abstract_Socket::send_outgoing()"); } -void Abstract_Socket::report_error(int /*client_id*/, int /*msg_length*/, int /*sent_length*/, const unsigned char* /*msg*/, const char* error_text) +void Abstract_Socket::report_error(int client_id, int msg_length, int sent_length, const unsigned char* msg, const char* error_text) { log_error("%s",error_text); } -void Abstract_Socket::report_unsent(int /*client_id*/, int /*msg_length*/, int /*sent_length*/, const unsigned char* /*msg*/, const char* error_text) -{ - log_debug("%s",error_text); -} - void Abstract_Socket::all_mandatory_configparameters_present() { if(!use_connection_ASPs) @@ -1813,6 +1775,7 @@ void Abstract_Socket::peer_list_resize_list(int client_id) { new_length++; // index starts from 0 log_debug("Abstract_Socket::peer_list_resize_list: Resizing to %d", new_length); peer_list_root = (as_client_struct **)Realloc(peer_list_root, new_length*sizeof(as_client_struct *)); + log_debug("Abstract_Socket::peer_list_resize_list: After Resizing: %p", peer_list_root); // initialize new entries for (int i = peer_list_length; i < new_length; i++) @@ -1974,13 +1937,6 @@ SSL_Socket::SSL_Socket() ssl_password=NULL; test_port_type=NULL; test_port_name=NULL; - ssl_ctx = NULL; - ssl_current_ssl = NULL; - SSLv2=true; - SSLv3=true; - TLSv1=true; - TLSv1_1=true; - TLSv1_2=true; } SSL_Socket::SSL_Socket(const char *tp_type, const char *tp_name) @@ -1997,13 +1953,6 @@ SSL_Socket::SSL_Socket(const char *tp_type, const char *tp_name) ssl_password=NULL; test_port_type=tp_type; test_port_name=tp_name; - ssl_ctx = NULL; - ssl_current_ssl = NULL; - SSLv2=true; - SSLv3=true; - TLSv1=true; - TLSv1_1=true; - TLSv1_2=true; } SSL_Socket::~SSL_Socket() @@ -2056,26 +2005,6 @@ bool SSL_Socket::parameter_set(const char *parameter_name, if(strcasecmp(parameter_value, "yes") == 0) ssl_verify_certificate = true; else if(strcasecmp(parameter_value, "no") == 0) ssl_verify_certificate = false; else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_verifycertificate_name()); - } else if(strcasecmp(parameter_name, ssl_disable_SSLv2()) == 0) { - if(strcasecmp(parameter_value, "yes") == 0) SSLv2= false; - else if(strcasecmp(parameter_value, "no") == 0) SSLv2 = true; - else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_SSLv2()); - } else if(strcasecmp(parameter_name, ssl_disable_SSLv3()) == 0) { - if(strcasecmp(parameter_value, "yes") == 0) SSLv2 = false; - else if(strcasecmp(parameter_value, "no") == 0) SSLv2 = true; - else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_SSLv3()); - } else if(strcasecmp(parameter_name, ssl_disable_TLSv1()) == 0) { - if(strcasecmp(parameter_value, "yes") == 0) TLSv1= false; - else if(strcasecmp(parameter_value, "no") == 0) TLSv1 = true; - else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_TLSv1()); - } else if(strcasecmp(parameter_name, ssl_disable_TLSv1_1()) == 0) { - if(strcasecmp(parameter_value, "yes") == 0) TLSv1_1 = false; - else if(strcasecmp(parameter_value, "no") == 0) TLSv1_1 = true; - else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_TLSv1_1()); - } else if(strcasecmp(parameter_name, ssl_disable_TLSv1_2()) == 0) { - if(strcasecmp(parameter_value, "yes") == 0) TLSv1_2 = false; - else if(strcasecmp(parameter_value, "no") == 0) TLSv1_2 = true; - else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ssl_disable_TLSv1_2()); } else { log_debug("leaving SSL_Socket::parameter_set(%s, %s)", parameter_name, parameter_value); return Abstract_Socket::parameter_set(parameter_name, parameter_value); @@ -2102,32 +2031,6 @@ bool SSL_Socket::add_user_data(int client_id) { if (ssl_current_ssl==NULL) log_error("Creation of SSL object failed"); -#ifdef SSL_OP_NO_SSLv2 - if(!SSLv2){ - SSL_set_options(ssl_current_ssl,SSL_OP_NO_SSLv2); - } -#endif -#ifdef SSL_OP_NO_SSLv3 - if(!SSLv3){ - SSL_set_options(ssl_current_ssl,SSL_OP_NO_SSLv3); - } -#endif -#ifdef SSL_OP_NO_TLSv1 - if(!TLSv1){ - SSL_set_options(ssl_current_ssl,SSL_OP_NO_TLSv1); - } -#endif -#ifdef SSL_OP_NO_TLSv1_1 - if(!TLSv1_1){ - SSL_set_options(ssl_current_ssl,SSL_OP_NO_TLSv1_1); - } -#endif -#ifdef SSL_OP_NO_TLSv1_2 - if(!TLSv1_2){ - SSL_set_options(ssl_current_ssl,SSL_OP_NO_TLSv1_2); - } -#endif - set_user_data(client_id, ssl_current_ssl); log_debug("New client added with key '%d'", client_id); log_debug("Binding SSL to the socket"); @@ -2362,10 +2265,9 @@ int SSL_Socket::send_message_on_fd(int client_id, const unsigned char* send_par, log_debug("SSL_ERROR_ZERO_RETURN is received, setting SSL SHUTDOWN mode to QUIET"); ssl_current_client=NULL; log_debug("leaving SSL_Socket::send_message_on_fd()"); - return -1; + return 0; default: - log_debug("SSL error occured"); - return -1; + log_error("SSL error occured"); } } // avoid compiler warnings @@ -2457,8 +2359,7 @@ int SSL_Socket::send_message_on_nonblocking_fd(int client_id, const unsigned cha case SSL_ERROR_ZERO_RETURN: goto client_closed_connection; default: - log_warning("SSL error occured"); - return -1; + log_error("SSL error occured"); } } @@ -2547,11 +2448,6 @@ const char* SSL_Socket::ssl_certificate_file_name() { return "ssl_certific const char* SSL_Socket::ssl_password_name() { return "ssl_private_key_password";} const char* SSL_Socket::ssl_cipher_list_name() { return "ssl_allowed_ciphers_list";} const char* SSL_Socket::ssl_verifycertificate_name() { return "ssl_verify_certificate";} -const char* SSL_Socket::ssl_disable_SSLv2() { return "ssl_disable_SSLv2";} -const char* SSL_Socket::ssl_disable_SSLv3() { return "ssl_disable_SSLv3";} -const char* SSL_Socket::ssl_disable_TLSv1() { return "ssl_disable_TLSv1";} -const char* SSL_Socket::ssl_disable_TLSv1_1() { return "ssl_disable_TLSv1_1";} -const char* SSL_Socket::ssl_disable_TLSv1_2() { return "ssl_disable_TLSv1_2";} void SSL_Socket::ssl_actions_to_seed_PRNG() { @@ -2654,10 +2550,10 @@ void SSL_Socket::ssl_init_SSL() // check the other side's certificates if (ssl_verify_certificate) { - log_debug("Setting verification behaviour: verification required and do not allow to continue on failure.."); + log_debug("Setting verification behaviour: verification required and do not allow to continue on failure"); SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, ssl_verify_callback); } else { - log_debug("Setting verification behaviour: verification not required and do allow to continue on failure.."); + log_debug("Setting verification behaviour: verification not required and do allow to continue on failure"); SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_NONE, ssl_verify_callback); } @@ -2757,7 +2653,7 @@ int SSL_Socket::ssl_getresult(int res) return err; } -int SSL_Socket::ssl_verify_certificates_at_handshake(int /*preverify_ok*/, X509_STORE_CTX */*ssl_ctx*/) { +int SSL_Socket::ssl_verify_certificates_at_handshake(int preverify_ok, X509_STORE_CTX *ssl_ctx) { // don't care by default return -1; } @@ -2765,7 +2661,7 @@ int SSL_Socket::ssl_verify_certificates_at_handshake(int /*preverify_ok*/, X50 // Callback function used by OpenSSL. // Called when a password is needed to decrypt the private key file. // NOTE: not thread safe -int SSL_Socket::ssl_password_cb(char *buf, int num, int /*rwflag*/,void */*userdata*/) { +int SSL_Socket::ssl_password_cb(char *buf, int num, int rwflag,void *userdata) { if (ssl_current_client!=NULL) { char *ssl_client_password; @@ -2795,23 +2691,18 @@ int SSL_Socket::ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ssl_ctx) ctx_pointer = SSL_get_SSL_CTX(ssl_pointer); if (ssl_current_client!=NULL) { - // if ssl_verifiycertificate == "no", then always accept connections - if(((SSL_Socket *)ssl_current_client)->ssl_verify_certificate) { - user_result=((SSL_Socket *)ssl_current_client)->ssl_verify_certificates_at_handshake(preverify_ok, ssl_ctx); - if (user_result>=0) return user_result; - } else { - return 1; - } + user_result=((SSL_Socket *)ssl_current_client)->ssl_verify_certificates_at_handshake(preverify_ok, ssl_ctx); + if (user_result>=0) return user_result; } else { // go on with default authentication fprintf(stderr, "Warning: no current SSL object found but ssl_verify_callback is called, programming error\n"); } // if ssl_verifiycertificate == "no", then always accept connections - if (SSL_CTX_get_verify_mode(ctx_pointer) == SSL_VERIFY_NONE) + if (SSL_CTX_get_verify_mode(ctx_pointer) && SSL_VERIFY_NONE) return 1; // if ssl_verifiycertificate == "yes", then accept connections only if the // certificate is valid - else if (SSL_CTX_get_verify_mode(ctx_pointer) & SSL_VERIFY_PEER) { + else if (SSL_CTX_get_verify_mode(ctx_pointer) && SSL_VERIFY_PEER) { return preverify_ok; } // something went wrong diff --git a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh old mode 100644 new mode 100755 index 7de8446..ad2d65d --- a/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh +++ b/ttcn/modules/titan.TestPorts.Common_Components.Abstract_Socket/module/src/Abstract_Socket.hh @@ -1,28 +1,17 @@ /****************************************************************************** -* Copyright (c) 2000-2019 Ericsson Telecom AB -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v2.0 -* which accompanies this distribution, and is available at -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html -* -* Contributors: -* Zoltan Bibo - initial implementation and initial documentation -* Gergely Futo -* Oliver Ferenc Czerman -* Balasko Jeno -* Zoltan Bibo -* Eduard Czimbalmos -* Kulcsr Endre -* Gabor Szalai -* Jozsef Gyurusi -* Csndes Tibor -* Zoltan Jasz -******************************************************************************/ + * Copyright (c) 2000-2025 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html + ******************************************************************************/ // // File: Abstract_Socket.hh // Description: Abstract_Socket header file -// Rev: R9B +// Rev: // Prodnr: CNL 113 384 +// Updated: 2010-11-24 +// Contact: http://ttcn.ericsson.se // @@ -120,7 +109,7 @@ protected: // Shall be called from Handle_Fd_Event() void Handle_Socket_Event(int fd, boolean is_readable, boolean is_writable, boolean is_error); // Shall be called from Handle_Timeout() - for possible future development - void Handle_Timeout_Event(double /*time_since_last_call*/) {}; + void Handle_Timeout_Event(double time_since_last_call) {}; // Shall be called from outgoing_send() void send_outgoing(const unsigned char* message_buffer, int length, int client_id = -1); @@ -144,9 +133,9 @@ protected: bool increase_send_buffer(int fd, int &old_size, int& new_size); const char* get_local_host_name(){return local_host_name; }; - unsigned int get_local_port_number(){return local_port_number; }; + const unsigned int get_local_port_number(){return local_port_number; }; const char* get_remote_host_name(){return remote_host_name; }; - unsigned int get_remote_port_number(){return remote_port_number; }; + const unsigned int get_remote_port_number(){return remote_port_number; }; const struct sockaddr_in & get_remote_addr() {return remoteAddr; }; /* FIXME: This function is deprecated and should be removed! */ const struct sockaddr_in & get_local_addr() {return localAddr; }; /* FIXME: This function is deprecated and should be removed! */ const int& get_ai_family() const {return ai_family;} @@ -190,15 +179,13 @@ protected: virtual int send_message_on_nonblocking_fd(int client_id, const unsigned char *message_buffer, int message_length); // Called after a peer is connected virtual void peer_connected(int client_id, sockaddr_in& remote_addr); /* This function should be removed! deprecated by: */ - virtual void peer_connected(int /*client_id*/, const char * /*host*/, const int /*port*/) {}; + virtual void peer_connected(int client_id, const char * host, const int port) {}; // Called after a peer is disconnected virtual void peer_disconnected(int client_id); // Called when a peer shut down its fd for writing virtual void peer_half_closed(int client_id); // Called after a send error virtual void report_error(int client_id, int msg_length, int sent_length, const unsigned char* msg, const char* error_text); - // Called after a unsent message - virtual void report_unsent(int client_id, int msg_length, int sent_length, const unsigned char* msg, const char* error_text); // Test port parameters virtual const char* local_port_name(); @@ -365,11 +352,6 @@ protected: virtual const char* ssl_password_name(); virtual const char* ssl_cipher_list_name(); virtual const char* ssl_verifycertificate_name(); - virtual const char* ssl_disable_SSLv2(); - virtual const char* ssl_disable_SSLv3(); - virtual const char* ssl_disable_TLSv1(); - virtual const char* ssl_disable_TLSv1_1(); - virtual const char* ssl_disable_TLSv1_2(); private: bool ssl_verify_certificate; // verify other part's certificate or not @@ -377,13 +359,6 @@ private: bool ssl_initialized; // whether SSL already initialized or not bool ssl_use_session_resumption; // use SSL sessions or not - bool SSLv2; - bool SSLv3; - bool TLSv1; - bool TLSv1_1; - bool TLSv1_2; - - char *ssl_key_file; // private key file char *ssl_certificate_file; // own certificate file char *ssl_trustedCAlist_file; // trusted CA list file diff --git a/ttcn/patch_abstract_socket/Abstract_Socket.cc.patch b/ttcn/patch_abstract_socket/Abstract_Socket.cc.patch new file mode 100644 index 0000000..55f334a --- /dev/null +++ b/ttcn/patch_abstract_socket/Abstract_Socket.cc.patch @@ -0,0 +1,117 @@ +diff --git a/src/Abstract_Socket.cc b/src/Abstract_Socket.cc +index 8b7b753..5e4addf 100644 +--- a/src/Abstract_Socket.cc ++++ b/src/Abstract_Socket.cc +@@ -40,6 +40,7 @@ + # include + #endif + ++#include + + #define AS_TCP_CHUNCK_SIZE 4096 + #define AS_SSL_CHUNCK_SIZE 16384 +@@ -171,6 +172,7 @@ Abstract_Socket::Abstract_Socket() { + remote_host_name = NULL; + remote_port_number = 0; + ai_family = AF_UNSPEC; // default: Auto ++ ip_proto = IPPROTO_TCP; // default + test_port_type=NULL; + test_port_name=NULL; + ttcn_buffer_usercontrol=false; +@@ -199,6 +201,7 @@ Abstract_Socket::Abstract_Socket(const char *tp_type, const char *tp_name) { + remote_host_name = NULL; + remote_port_number = 0; + ai_family = AF_UNSPEC; // default: Auto ++ ip_proto = IPPROTO_TCP; // default + test_port_type=tp_type; + test_port_name=tp_name; + ttcn_buffer_usercontrol=false; +@@ -261,6 +264,10 @@ bool Abstract_Socket::parameter_set(const char *parameter_name, + else if (strcasecmp(parameter_value,"IPv4")==0 || strcasecmp(parameter_value,"AF_INET")==0) ai_family = AF_INET; + else if (strcasecmp(parameter_value,"UNSPEC")==0 || strcasecmp(parameter_value,"AF_UNSPEC")==0) ai_family = AF_UNSPEC; + else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ai_family_name()); ++ } else if(strcmp(parameter_name, ip_proto_name()) == 0){ ++ if (strcasecmp(parameter_value,"IPPROTO_TCP")==0) ip_proto = IPPROTO_TCP; ++ else if (strcasecmp(parameter_value,"IPPROTO_SCTP")==0) ip_proto = IPPROTO_SCTP; ++ else log_error("Parameter value '%s' not recognized for parameter '%s'", parameter_value, ip_proto_name()); + } else if(strcmp(parameter_name, local_port_name()) == 0){ + int a; + if (sscanf(parameter_value, "%d", &a)!=1) log_error("Invalid input as port number given: %s", parameter_value); +@@ -760,6 +767,7 @@ int Abstract_Socket::open_listen_port(const char* localHostname, const char* loc + hints.ai_flags = /*AI_ALL|*/AI_ADDRCONFIG|AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + hints.ai_family = ai_family; ++ hints.ai_protocol = ip_proto; + + error = getaddrinfo(localHostname, localServicename, &hints, &aip); + if (error != 0) { +@@ -1143,6 +1151,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch + } + hints.ai_socktype = SOCK_STREAM; + hints.ai_family = ai_family; ++ hints.ai_protocol = ip_proto; + + error = getaddrinfo(remoteHostname, remoteServicename, &hints, &res); + if (error != 0) { +@@ -1191,9 +1200,11 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch + } + } + +- log_debug("Using address family for socket %d: %s",socket_fd, ++ log_debug("Using address family for socket %d: %s - %s",socket_fd, + ((aip->ai_family==AF_INET)?"IPv4": +- ((aip->ai_family==AF_INET6)?"IPv6":"unknown")) ++ ((aip->ai_family==AF_INET6)?"IPv6":"unknown")), ++ ((aip->ai_protocol==IPPROTO_TCP)?"IPPROTO_TCP": ++ ((aip->ai_protocol==IPPROTO_SCTP)?"IPPROTO_SCTP":"unknown")) + ); + + +@@ -1225,6 +1236,7 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch + hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + hints.ai_family = ai_family;//aip->ai_family; // NOTE: On solaris 10 if is set to aip->ai_family, getaddrinfo will crash for IPv4-mapped addresses! ++ hints.ai_protocol = ip_proto; + + error = getaddrinfo(localHostname, localServicename, &hints, &localAddrinfo); + if (error != 0) { +@@ -1390,10 +1402,13 @@ int Abstract_Socket::open_client_connection(const char* remoteHostname, const ch + } + + log_debug( +- "connected to: host %s service %s via address family %s\n", ++ "connected to: host %s service %s via address family %s with ip_proto %s\n", + remoteHostname, remoteServicename, + ((aip->ai_family==AF_INET)?"IPv4": +- ((aip->ai_family==AF_INET6)?"IPv6":"unknown"))); ++ ((aip->ai_family==AF_INET6)?"IPv6":"unknown")), ++ ((aip->ai_protocol==IPPROTO_TCP)?"IPPROTO_TCP": ++ ((aip->ai_protocol==IPPROTO_SCTP)?"IPPROTO_SCTP":"unknown")) ++ ); + break; + } + if (aip==NULL) { +@@ -1774,18 +1789,19 @@ const char* Abstract_Socket::remote_address_name() { return "destIPAddr + const char* Abstract_Socket::local_address_name() { return "serverIPAddr";} + const char* Abstract_Socket::remote_port_name() { return "destPort";} + const char* Abstract_Socket::ai_family_name() { return "ai_family";} ++const char* Abstract_Socket::ip_proto_name() { return "ip_proto";} + const char* Abstract_Socket::use_connection_ASPs_name() { return "use_connection_ASPs";} + const char* Abstract_Socket::halt_on_connection_reset_name(){ return "halt_on_connection_reset";} +-const char* Abstract_Socket::client_TCP_reconnect_name() { return "client_TCP_reconnect";} ++const char* Abstract_Socket::client_TCP_reconnect_name() { return "client_TCP_reconnect";} + const char* Abstract_Socket::TCP_reconnect_attempts_name() { return "TCP_reconnect_attempts";} +-const char* Abstract_Socket::TCP_reconnect_delay_name() { return "TCP_reconnect_delay";} ++const char* Abstract_Socket::TCP_reconnect_delay_name() { return "TCP_reconnect_delay";} + const char* Abstract_Socket::server_mode_name() { return "server_mode";} + const char* Abstract_Socket::socket_debugging_name() { return "socket_debugging";} + const char* Abstract_Socket::nagling_name() { return "nagling";} + const char* Abstract_Socket::use_non_blocking_socket_name() { return "use_non_blocking_socket";} + const char* Abstract_Socket::server_backlog_name() { return "server_backlog";} +-bool Abstract_Socket::add_user_data(int) {return true;} +-bool Abstract_Socket::remove_user_data(int) {return true;} ++bool Abstract_Socket::add_user_data(int) {return true;} ++bool Abstract_Socket::remove_user_data(int) {return true;} + bool Abstract_Socket::user_all_mandatory_configparameters_present() { return true; } + + diff --git a/ttcn/patch_abstract_socket/Abstract_Socket.hh.patch b/ttcn/patch_abstract_socket/Abstract_Socket.hh.patch new file mode 100644 index 0000000..bce5667 --- /dev/null +++ b/ttcn/patch_abstract_socket/Abstract_Socket.hh.patch @@ -0,0 +1,38 @@ +diff --git a/src/Abstract_Socket.hh b/src/Abstract_Socket.hh +index 6d7bc3d..a068662 100644 +--- a/src/Abstract_Socket.hh ++++ b/src/Abstract_Socket.hh +@@ -134,7 +134,7 @@ protected: + bool get_handle_half_close() const {return handle_half_close;} + int get_socket_fd() const; + int get_listen_fd() const {return listen_fd;} +- ++ + //set non-blocking mode + int set_non_block_mode(int fd, bool enable_nonblock); + +@@ -149,6 +149,8 @@ protected: + const struct sockaddr_in & get_local_addr() {return localAddr; }; /* FIXME: This function is deprecated and should be removed! */ + const int& get_ai_family() const {return ai_family;} + void set_ai_family(int parameter_value) {ai_family=parameter_value;} ++ const int& get_ip_proto() const {return ip_proto;} ++ void set_ip_proto(int parameter_value) {ip_proto=parameter_value;} + bool get_ttcn_buffer_usercontrol() const {return ttcn_buffer_usercontrol; } + void set_nagling(bool parameter_value) {nagling=parameter_value;} + void set_server_mode(bool parameter_value) {server_mode=parameter_value;} +@@ -204,6 +206,7 @@ protected: + virtual const char* local_address_name(); + virtual const char* remote_port_name(); + virtual const char* ai_family_name(); ++ virtual const char* ip_proto_name(); + virtual const char* use_connection_ASPs_name(); + virtual const char* halt_on_connection_reset_name(); + virtual const char* client_TCP_reconnect_name(); +@@ -269,6 +272,7 @@ private: + char* remote_host_name; + unsigned int remote_port_number; + int ai_family; // address family to use ++ int ip_proto; // protocol to use (e.g. IPPROTO_TCP, IPPROTO_SCTP) + // remoteAddr and localAddr is filled when map_user is called + struct sockaddr_in remoteAddr; /* FIXME: not used! should be removed */ + struct sockaddr_in localAddr; /* FIXME: not used! should be removed */ -- GitLab From d5d414e7728e3e41eb3e15955a73d781b2c85ed4 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 7 May 2025 15:59:53 +0200 Subject: [PATCH 28/54] End of validation of AtsMec_FederationEnablement --- .../AtsMec_FederationEnablement.cf_ | 15 +- ...Mec_FederationEnablementAPI_TestCases.ttcn | 194 ++---------------- ...c_FederationEnablementAPI_TestControl.ttcn | 2 - 3 files changed, 17 insertions(+), 194 deletions(-) diff --git a/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ b/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ index e4a2443..70cdbe5 100644 --- a/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ +++ b/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ @@ -75,17 +75,13 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemName query parameters #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_05 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple SystemName query parameters -AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_06 -# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty SystemName query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_07 +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_06 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - systemProvider query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_08 +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_07 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple systemProvider query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_09 -# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty systemProvider query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_10 +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_08 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_11 +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_09 # Check that the IUT responds with an error when selection is not applicable - SystemId #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_01 # Check that the IUT responds with an error when selection is not applicable - SystemName @@ -93,8 +89,7 @@ AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_06 # Check that the IUT responds with an error when selection is not applicable - SystemProvider #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_03 # Check that the IUT responds with an error when request is malformed -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR - +AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR # Check that the IUT creates a new systemInfo when requested by a MEC Orchestrator #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_002_OK diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn index ca9bd6f..ef65914 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn @@ -399,7 +399,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_body_json_fed_system_info_list( { v_system_info_list[0], - v_system_info_list[0] + v_system_info_list[1] } ))))) { tc_ac.stop; @@ -419,7 +419,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } // End of testcase TC_MEC_MEC040_SRV_MEF_001_OK_06 /** - * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty SystemName query parameters + * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - systemProvider query parameters */ testcase TC_MEC_MEC040_SRV_MEF_001_OK_07() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -449,7 +449,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemName=", + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemProvider=" & oct2char(unichar2oct(PX_FED_SYSTEM_PROVIDER_2, "UTF-8")), v_headers ) ) @@ -465,16 +465,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) + v_system_info_list[1] } ))))) { tc_ac.stop; @@ -494,7 +485,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } // End of testcase TC_MEC_MEC040_SRV_MEF_001_OK_07 /** - * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - systemProvider query parameters + * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple systemProvider query parameters */ testcase TC_MEC_MEC040_SRV_MEF_001_OK_08() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -524,7 +515,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemProvider=" & oct2char(unichar2oct(PX_FED_SYSTEM_PROVIDER_1, "UTF-8")), + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemProvider=" & oct2char(unichar2oct(PX_FED_SYSTEM_PROVIDER_1, "UTF-8")) & "&systemProvider=" & oct2char(unichar2oct(PX_FED_SYSTEM_PROVIDER_2, "UTF-8")), v_headers ) ) @@ -540,11 +531,8 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ) + v_system_info_list[0], + v_system_info_list[1] } ))))) { tc_ac.stop; @@ -564,7 +552,7 @@ module AtsMec_FederationEnablementAPI_TestCases { } // End of testcase TC_MEC_MEC040_SRV_MEF_001_OK_08 /** - * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple systemProvider query parameters + * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple query parameters */ testcase TC_MEC_MEC040_SRV_MEF_001_OK_09() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -594,7 +582,7 @@ module AtsMec_FederationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemProvider=" & oct2char(unichar2oct(PX_FED_SYSTEM_PROVIDER_1, "UTF-8")) & "?systemProvider=" & oct2char(unichar2oct(PX_FED_SYSTEM_PROVIDER_2, "UTF-8")), + PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(v_system_info_list[0].systemId, "UTF-8")) & "&systemName=" & oct2char(unichar2oct(PX_FED_SYSTEM_NAME_3, "UTF-8")), v_headers ) ) @@ -610,16 +598,8 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_fed_system_info_list( { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) + v_system_info_list[0], + v_system_info_list[2] } ))))) { tc_ac.stop; @@ -638,156 +618,6 @@ module AtsMec_FederationEnablementAPI_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_MEC040_SRV_MEF_001_OK_09 - /** - * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty systemProvider query parameters - */ - testcase TC_MEC_MEC040_SRV_MEF_001_OK_10() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var SystemInfoList v_system_info_list := valueof( - { - m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), - m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), - m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) - }); - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_create_system_info_list(v_system_info_list); - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemProvider=", - v_headers - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_fed_system_info_list( - { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) - } - ))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_delete_system_info_list(v_system_info_list); - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC040_SRV_MEF_001_OK_10 - - /** - * @desc Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple query parameters - */ - testcase TC_MEC_MEC040_SRV_MEF_001_OK_11() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - var SystemInfoList v_system_info_list := valueof( - { - m_system_info(PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_PROVIDER_1, omit), - m_system_info(PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_PROVIDER_2, omit), - m_system_info(PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_PROVIDER_3, omit) - }); - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FED_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FED_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_create_system_info_list(v_system_info_list); - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_get( - PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")) & "?systemName=" & oct2char(unichar2oct(PX_FED_SYSTEM_NAME_3, "UTF-8")), - v_headers - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_fed_system_info_list( - { - mw_system_info( - PX_FED_SYSTEM_PROVIDER_1, - PX_FED_SYSTEM_NAME_1, - PX_FED_SYSTEM_ID_1 - ), - mw_system_info( - PX_FED_SYSTEM_PROVIDER_2, - PX_FED_SYSTEM_NAME_2, - PX_FED_SYSTEM_ID_2 - ) - } - ))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_delete_system_info_list(v_system_info_list); - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC040_SRV_MEF_001_OK_11 - /** * @desc Check that the IUT responds with an error when selection is not applicable - SystemId */ diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn index 9c8860b..f1175e2 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestControl.ttcn @@ -23,8 +23,6 @@ module AtsMec_FederationEnablementAPI_TestControl { execute(TC_MEC_MEC040_SRV_MEF_001_OK_07()); execute(TC_MEC_MEC040_SRV_MEF_001_OK_08()); execute(TC_MEC_MEC040_SRV_MEF_001_OK_09()); - execute(TC_MEC_MEC040_SRV_MEF_001_OK_10()); - execute(TC_MEC_MEC040_SRV_MEF_001_OK_11()); execute(TC_MEC_MEC040_SRV_MEF_001_NF_01()); execute(TC_MEC_MEC040_SRV_MEF_001_NF_02()); -- GitLab From 92a179e5b9336f2d9887e4fea46343f01c1c3b88 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Mon, 26 May 2025 15:22:04 +0500 Subject: [PATCH 29/54] update MEC010-2 TTCN testcases as per version v3.2.1 --- ...ycleAndOperationGrantingAPI_TestCases.ttcn | 71 ++++++++++--------- ...fecycleAndOperationGrantingAPI_Pixits.ttcn | 6 +- ...ycleAndOperationGrantingAPI_Templates.ttcn | 56 +++++++-------- ...ndOperationGrantingAPI_TypesAndValues.ttcn | 42 +++++------ 4 files changed, 89 insertions(+), 86 deletions(-) diff --git a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn index 12ea8f6..02680c7 100644 --- a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn @@ -1,5 +1,5 @@ /** -* @Author ETSI / STF569 / TTF012 +* @Author ETSI / STF569 / TTF012 / TTF T043 * @version $URL:$ * $ID:$ * @desc This module provides the MEC test cases. @@ -7,7 +7,7 @@ * 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 GS MEC 003, Draft ETSI GS MEC 010-2 V2.2.1 +* @see ETSI GS MEC 003, Draft ETSI GS MEC 010-2 V3.2.1 */ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { @@ -623,8 +623,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { m_create_package_management( PX_APP_PKG_NAME, PX_APP_PKG_VERSION, - m_checksum(-, PX_CHECKSUM), - PX_APP_PKG_PATH + m_checksum(-, PX_CHECKSUM) )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -637,11 +636,11 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_message_body_json( mw_body_json_app_pkg_info( mw_app_pkg_info( - -, -, - PX_APP_PKG_NAME, - PX_APP_PKG_VERSION, - -, - mw_checksum + -, + mw_checksum, + CREATED, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE )))))) -> value v_response { tc_ac.stop; @@ -687,8 +686,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { m_create_package_management( "", PX_APP_PKG_VERSION, - m_checksum(-, PX_CHECKSUM), - PX_APP_PKG_PATH + m_checksum(-, PX_CHECKSUM) )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -755,12 +753,13 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { { *, mw_app_pkg_info( - -, -, - PX_APP_PKG_NAME, - PX_APP_PKG_VERSION, - -, - mw_checksum - ), + -, + mw_checksum, + PX_ONBOARDED_STATE, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE, + - + ), * } ))))) -> value v_response { @@ -821,12 +820,14 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_body_json_app_pkg_info_list( { *, - mw_app_pkg_info( - -, -, - PX_APP_PKG_NAME, - PX_APP_PKG_VERSION, - -, - mw_checksum + mw_app_pkg_info_onboarded( + -, -, + PX_APP_PKG_NAME, + PX_APP_PKG_VERSION, + -, + mw_checksum, + -, + PX_ONBOARDED_STATE_ONBOARDED ), * } @@ -994,8 +995,8 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_app_pkg_info( - mw_app_pkg_info( - PX_APP_PKG_ID + mw_app_pkg_info_onboarded( + v_app_pkg_info.id )))))) -> value v_response { tc_ac.stop; @@ -2209,10 +2210,12 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { { *, mw_app_pkg_info( - v_app_pkg_info.id, - v_app_pkg_info.appDId - ) - , + -, + mw_checksum, + PX_ONBOARDED_STATE, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE + ), * } ))))) { @@ -2233,7 +2236,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { } // End of testcase TC_MEC_MEC010p2_MEPM_PKGM_001_01_OK /** - * @desc Check that MEPM returns the list of App Packages when requested - Note 3 + * @desc Check that MEPM returns the list of on-boarded App Packages when requested - Note 3 */ testcase TC_MEC_MEC010p2_MEPM_PKGM_001_02_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2271,11 +2274,11 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_body_json_app_pkg_info_list( { *, - mw_app_pkg_info( + mw_app_pkg_info_onboarded( v_app_pkg_info.id, v_app_pkg_info.appDId, -, -, -, -, -, - ONBOARDED + PX_ONBOARDED_STATE_ONBOARDED ) , * @@ -2440,11 +2443,11 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_app_pkg_info( - mw_app_pkg_info( + mw_app_pkg_info_onboarded( v_app_pkg_info.id, v_app_pkg_info.appDId, -, -, -, -, -, - ONBOARDED + PX_ONBOARDED_STATE_ONBOARDED )))))) { tc_ac.stop; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn index 027b5cc..2a037b2 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn @@ -53,8 +53,12 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits { modulepar Json.String PX_CHECKSUM := "CHECKSUM"; modulepar Json.String PX_APP_PKG_PATH := "APP_PKG_PATH"; + + modulepar Json.String PX_ONBOARDED_STATE_ONBOARDED := "ONBOARDED"; + + modulepar Json.String PX_ONBOARDED_STATE := "CREATED"; - modulepar OperationalState PX_OPERATIONAL_STATE := STARTED; + modulepar OperationalState PX_OPERATIONAL_STATE := "ENABLED"; modulepar UsageState PX_USAGE_STATE := NOT_IN_USE; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn index b914cc0..2121e45 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn @@ -213,41 +213,37 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { appPkgPath := p_appPkgPath } // End of template mw_create_package_management - template (omit) AppPkgInfo m_app_pkg_info( - in template (value) Json.String p_id, - in template (value) Json.String p_appDId, - in template (value) Json.String p_appName, - in template (value) Json.String p_appSoftwareVersion, - in template (value) Json.String p_appDVersion, - in template (value) Checksum p_checksum, - in template (value) AppPkgSWImageInfo p_softwareImages, - in template (value) OnboardingState p_onboardingState, - in template (value) AppPkgInfo_OperationalState p_operationalState, - in template (value) UsageState p_usageState, - in template (value) AppPkgInfo_MecInfo p_mecInfo, - in template (value) AppPkgInfo_Links p_links, - in template (omit) Json.String p_appProvider := omit - ) := { - id := p_id, - appDId := p_appDId, - appProvider := p_appProvider, - appName := p_appName, - appSoftwareVersion := p_appSoftwareVersion, - appDVersion := p_appDVersion, + // template (omit) AppPkgInfo m_app_pkg_info( + // in template (value) Checksum p_checksum, + // in template (value) OnboardingState p_onboardingState, + // in template (value) AppPkgInfo_OperationalState p_operationalState, + // in template (value) UsageState p_usageState, + // in template (value) AppPkgInfo_Links p_links, + // ) := { + // checksum := p_checksum, + // onboardingState := p_onboardingState, + // operationalState := p_operationalState, + // usageState := p_usageState, + // links := p_links + // } // End of template m_app_pkg_info + + template (present) AppPkgInfo mw_app_pkg_info( + template (present) Json.String p_id := ?, + template (present) Checksum p_checksum := ?, + template (present) OnboardingState p_onboardingState := ?, + template (present) AppPkgInfo_OperationalState p_operationalState := ?, + template (present) UsageState p_usageState := ?, + template (present) AppPkgInfo_Links p_links := ? + ) := { + id := p_id, checksum := p_checksum, - signingCertificate := omit, - softwareImages := p_softwareImages, - additionalArtifacts := omit, onboardingState := p_onboardingState, operationalState := p_operationalState, usageState := p_usageState, - mecInfo := p_mecInfo, - userDefinedData := omit, - onboardingFailureDetails := omit, links := p_links - } // End of template m_app_pkg_info - - template (present) AppPkgInfo mw_app_pkg_info( + } // End of template mw_app_pkg_info + + template (present) AppPkgInfo mw_app_pkg_info_onboarded( template (present) Json.String p_id := ?, template (present) Json.String p_appDId := ?, template (present) Json.String p_appName := ?, diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn index 1a94526..4c87573 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.ttcn @@ -1,5 +1,5 @@ /** - * @author ETSI / TTF T012 / TTF T027 + * @author ETSI / TTF T012 / TTF T027 / TTF T043 * @version $Url$ * $Id$ * @desc Types ANd Values for ETSI GS MEC 010-2 V3.2.1 (2023-06) @@ -1323,25 +1323,25 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues { Json.String appProvider optional, Checksum checksum, KeyValuePairs userDefinedData optional, - Json.AnyURI appPkgPath + Json.AnyURI appPkgPath optional } /** * @desc The data type AppPkgInfo represents the parameters for an application package resource * @member id Identifier of the application package resource - * @member appDId The application descriptor identifier - * @member appProvider The provider's name of the onboarded application package - * @member appName Name of the onboarded application - * @member appSoftwareVersion Software version of the application. This is updated when there is any change to the software in the onboarded application package - * @member appDVersion Version of the application descriptor - * @member checksum Checksum of the onboarded application package - * @member signingCertificate The singleton signing certificate if it is included as a file in the AppD archive - * @member softwareImages Information of application software image in application package - * @member additionalArtifacts Additional information of application package artifacts that are not application software images - * @member onboardingState Onboarding state of application package - * @member operationalState Operational state of the onboarded application package + * @member appDId The application descriptor identifier. It shall be present after the application package content has been on-boarded and absent otherwise. + * @member appProvider The provider's name of the onboarded application package. It shall be present after the application package content has been on-boarded and absent otherwise. + * @member appName Name of the onboarded application. It shall be present after the application package content has been on-boarded and absent otherwise. + * @member appSoftwareVersion Software version of the application. This is updated when there is any change to the software in the onboarded application package. It shall be present after the application package content has been on-boarded and absent otherwise. + * @member appDVersion Version of the application descriptor. It shall be present after the application package content has been on-boarded and absent otherwise. + * @member checksum Checksum of the onboarded application package. This attribute shall not be present before the application package content is on-boarded. + * @member signingCertificate The singleton signing certificate if it is included as a file in the AppD archive. This attribute shall not be present before the application package content is on-boarded. + * @member softwareImages Information of application software image in application package. This attribute shall not be present before the application package content is on-boarded. + * @member additionalArtifacts Additional information of application package artifacts that are not application software images. This attribute shall not be present before the application package content is on-boarded. + * @member onboardingState Onboarding state of application package. This attribute shall not be present before the application package content is on-boarded. + * @member operationalState Operational state of the onboarded application package. This attribute shall not be present before the application package content is on-boarded. * @member usageState Usage state of the onboarded instance of the application package - * @member mecInfo The MEC version that compatible with this application + * @member mecInfo The MEC version that compatible with this application. This attribute shall not be present before the application package content is on-boarded. * @member userDefinedData User defined data for the application package * @member onboardingFailureDetails Failure details of current onboarding procedure * @member links Links to resources related to this resource @@ -1349,22 +1349,22 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues { */ type record AppPkgInfo { Json.String id, - Json.String appDId, + Json.String appDId optional, Json.String appProvider optional, - Json.String appName, - Json.String appSoftwareVersion, - Json.String appDVersion, + Json.String appName optional, + Json.String appSoftwareVersion optional, + Json.String appDVersion optional, Checksum checksum, Json.String signingCertificate optional, - AppPkgSWImageInfo softwareImages, + AppPkgSWImageInfo softwareImages optional, AppPkgArtifactInfo additionalArtifacts optional, OnboardingState onboardingState, AppPkgInfo_OperationalState operationalState, UsageState usageState, - AppPkgInfo_MecInfo mecInfo, + AppPkgInfo_MecInfo mecInfo optional, KeyValuePairs userDefinedData optional, ProblemDetails onboardingFailureDetails optional, - AppPkgInfo_Links links + AppPkgInfo_Links links optional } with { variant (links) "name as '_links'"; } -- GitLab From e189f298b2a9afc4eff679284e6a05e5b99f0ae4 Mon Sep 17 00:00:00 2001 From: ishaqm Date: Tue, 27 May 2025 12:08:19 +0500 Subject: [PATCH 30/54] Implement TPs, add templates and typing for MEC048 --- ...ec_SelfServiceEnablementAPI_TestCases.ttcn | 1064 +++++++++++++++++ ..._SelfServiceEnablementAPI_TestControl.ttcn | 56 + .../AtsMec_SelfServiceEnablementAPI/module.mk | 39 + .../LibMec/SelfServiceEnablementAPI/module.mk | 6 + .../SelfServiceEnablementAPI_Functions.ttcn | 190 +++ .../ttcn/SelfServiceEnablementAPI_Pics.ttcn | 8 + .../ttcn/SelfServiceEnablementAPI_Pixits.ttcn | 52 + .../SelfServiceEnablementAPI_Templates.ttcn | 457 +++++++ ...lfServiceEnablementAPI_TypesAndValues.ttcn | 332 +++++ ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 4 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 10 + .../ttcn/LibHttp_JsonTemplates.ttcn | 101 ++ 12 files changed, 2319 insertions(+) create mode 100644 ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn create mode 100644 ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn create mode 100644 ttcn/AtsMec_SelfServiceEnablementAPI/module.mk create mode 100644 ttcn/LibMec/SelfServiceEnablementAPI/module.mk create mode 100644 ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn create mode 100644 ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pics.ttcn create mode 100644 ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn create mode 100644 ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn create mode 100644 ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn diff --git a/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn new file mode 100644 index 0000000..a83b927 --- /dev/null +++ b/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn @@ -0,0 +1,1064 @@ + +module AtsMec_SelfServiceEnablementAPI_TestCases { + + // Libcommon + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_TypesAndValues all; + import from SelfServiceEnablementAPI_Templates all; + import from SelfServiceEnablementAPI_Functions all; + import from SelfServiceEnablementAPI_Pics all; + import from SelfServiceEnablementAPI_Pixits all; + + // LibMec + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + group tenant { + + /** + * @Desc Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - No query parameters + */ + testcase TC_MEC_MEC048_MEO_CSE_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfoList v_tenant_info_list := { + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)), + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, "Education", omit, PX_CSE_TENANT_NAME_2)), + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_3, PX_CSE_CUSTOMER_NAME_3, "Automotive", omit, PX_CSE_TENANT_NAME_3)) + }; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + var charstring_list v_tenant_id_list; + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info_list(v_tenant_info_list, v_tenant_id_list); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_tenant_info_list( + { + mw_tenant_info( + PX_CSE_CUSTOMER_ID_1, + PX_CSE_CUSTOMER_NAME_1, + PX_CSE_TENANT_NAME_1 + ), + mw_tenant_info( + PX_CSE_CUSTOMER_ID_2, + PX_CSE_CUSTOMER_NAME_1, + PX_CSE_TENANT_NAME_2 + ), + mw_tenant_info( + PX_CSE_CUSTOMER_ID_3, + PX_CSE_CUSTOMER_NAME_2, + PX_CSE_TENANT_NAME_1 + ) + } + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a TenantInfoList ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info_list(v_tenant_info_list); + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_001_OK_01 + + /** + * @desc Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - customerId attribute as query parameter + */ + testcase TC_MEC_MEC048_MEO_CSE_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfoList v_tenant_info_list := { + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)), + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, "Education", omit, PX_CSE_TENANT_NAME_2)), + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_3, PX_CSE_CUSTOMER_NAME_3, "Automotive", omit, PX_CSE_TENANT_NAME_3)) + }; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info_list(v_tenant_info_list); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "?customerId=" & oct2char(unichar2oct(PX_CSE_CUSTOMER_ID_1, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_tenant_info_list( + { + mw_tenant_info( + PX_CSE_CUSTOMER_ID_1, + PX_CSE_CUSTOMER_NAME_1, + PX_CSE_TENANT_NAME_1 + ) + } + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a TenantInfoList ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info_list(v_tenant_info_list); + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_001_OK_02 + + /** + * @desc Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - customerName as query parameter + */ + testcase TC_MEC_MEC048_MEO_CSE_001_OK_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfoList v_tenant_info_list := { + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)), + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, "Education", omit, PX_CSE_TENANT_NAME_2)), + valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_3, PX_CSE_CUSTOMER_NAME_3, "Automotive", omit, PX_CSE_TENANT_NAME_3)) + }; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info_list(v_tenant_info_list); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "?customerName=" & oct2char(unichar2oct(PX_CSE_CUSTOMER_NAME_1, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_tenant_info_list( + { + mw_tenant_info( + PX_CSE_CUSTOMER_ID_1, + PX_CSE_CUSTOMER_NAME_1, + PX_CSE_TENANT_NAME_1, PX_CSE_TENANT_NAME_1 + ), + mw_tenant_info( + PX_CSE_CUSTOMER_ID_2, + PX_CSE_CUSTOMER_NAME_2, + PX_CSE_TENANT_NAME_2 + ) + } + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a TenantInfoList ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info_list(v_tenant_info_list); + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_001_OK_03 + + /** + * @Desc Check that the IUT creates a new tenantInfo when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_CSE_CUSTOMER_ID_2, + PX_CSE_CUSTOMER_NAME_1, + omit, + omit, + PX_CSE_TENANT_NAME_1 + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_cse_tenant_info( + mw_tenant_info( + PX_CSE_CUSTOMER_ID_2, + PX_CSE_CUSTOMER_NAME_1, + PX_CSE_TENANT_NAME_1 + )))))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a TenantInfo ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_response.response.body.json_body.tenantInfo); + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_002_OK + + /** + * @desc Check that the IUT responds with an error on creating a tenantInfo with resourceUseInfo and siteList + */ + testcase TC_MEC_MEC048_MEO_CSE_002_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_CSE_CUSTOMER_ID_1, + PX_CSE_CUSTOMER_NAME_1, + omit, + omit, + PX_CSE_TENANT_NAME_1, + m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), + m_site_info("site-001", omit) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_002_BR + + /** + * @Desc Check that the IUT responds with a specific tenantInfo when requested to a MEC Consumer + */ + testcase TC_MEC_MEC048_MEO_CSE_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); + + var charstring v_tenant_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_tenant_info( + mw_tenant_info( + PX_CSE_CUSTOMER_ID_1, + PX_CSE_CUSTOMER_NAME_1, + PX_CSE_TENANT_NAME_1 + ) + + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with specific TenantInfo ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + + f_delete_tenant_info(v_tenant_info); + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_003_OK + + /** + * @Desc Check that the IUT returns an error when requesting a not existing tenantInfo to a MEC Consumer + */ + testcase TC_MEC_MEC048_MEO_CSE_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_CSE_TENANT_ID_1, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_003_NF + + /** + * @desc Check that the IUT updates an existing tenantInfo when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_004_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); + var charstring v_tenant_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_NEW_CUSTOMER_ID, + PX_NEW_CUSTOMER_NAME, + omit, + omit, + PX_NEW_TENANT_NAME + ) + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_tenant_info( + mw_tenant_info( + PX_NEW_CUSTOMER_ID, + PX_NEW_CUSTOMER_NAME, + PX_NEW_TENANT_NAME + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated TenantInfo entry ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_004_OK + + /** + * @desc Check that the IUT returns an error on updating a not existing tenantInfo requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_004_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_NEW_CUSTOMER_ID, + PX_NEW_CUSTOMER_NAME, + omit, + omit, + PX_NEW_TENANT_NAME + ) + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_004_NF + + /** + * @desc Check that the IUT returns an error on updating with invalid values tenantInfo requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_004_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_NEW_CUSTOMER_ID, + PX_NEW_CUSTOMER_NAME, + omit, + omit, + PX_NEW_TENANT_NAME, + m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), + m_site_info("site-001", omit) + ) + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_004_BR + + /** + * @Desc Check that the IUT removes a tenantInfo when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); + var charstring v_tenant_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully deletes the tenantInfo ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_005_OK + + /** + * @Desc Check that the IUT returns an error on deleting a not existing tenantInfo when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_005_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_005_NF + + /** + * @Desc Check that the IUT returns a resourceQuotaInfo for a specific tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_006_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); + var ResourceQuotaInfo v_resource_quota_info := valueof(m_resource_quota_info(PX_CPU_QUOTA, PX_MEMORY_QUOTA, PX_DISK_QUOTA)); + var charstring v_tenant_id; + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_resource_quota_info(v_resource_quota_info, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_resource_quota_info( + mw_resource_quota_info( + PX_CPU_QUOTA, + PX_MEMORY_QUOTA, + PX_DISK_QUOTA + ) + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with specific ResourceQuotaInfo ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_006_OK + + /** + * @Desc Check that the IUT returns an error on retrieving resourceQuotaInfo for a not existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_006_NF() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID , "UTF-8")) & "/resources/quota_in_system", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_006_NF + + /** + * @desc Check that the IUT updates the resourceQuotaInfo for an existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_007_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); + var ResourceQuotaInfo v_resource_quota_info := valueof(m_resource_quota_info(PX_CPU_QUOTA, PX_MEMORY_QUOTA, PX_DISK_QUOTA)); + var charstring v_tenant_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_resource_quota_info(v_resource_quota_info, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + m_body_json_cse_resource_quota_info( + m_resource_quota_info( + 5, + 3072, + 50 + ) + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_resource_quota_info( + mw_resource_quota_info( + 5, + 3072, + 50 + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated ResourceQuotaInfo ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_007_OK + + /** + * @desc Check that the IUT returns an error on updating the resourceQuotaInfo for a not existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_007_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID , "UTF-8")) & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + m_body_json_cse_resource_quota_info( + m_resource_quota_info( + 5, + 2048, + 75 + ) + ))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_007_NF + + } // End of group tenant + +} // End of module AtsMec_SelfServiceEnablementAPI_TestCases diff --git a/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn new file mode 100644 index 0000000..01e66d0 --- /dev/null +++ b/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn @@ -0,0 +1,56 @@ +module AtsMec_SelfServiceEnablementAPI_TestControl { + + // LibMec/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_Pics all; + + // LibMec + import from LibMec_Pics all; + + // AtsMec_SelfServiceEnablementAPI + import from AtsMec_SelfServiceEnablementAPI_TestCases all; + + control { + + if (PICS_CSE_API_SUPPORTED) { + + if (PICS_SERVICES) { + execute(TC_MEC_MEC048_MEO_CSE_001_OK_01()); + execute(TC_MEC_MEC048_MEO_CSE_001_OK_02()); + execute(TC_MEC_MEC048_MEO_CSE_001_OK_03()); + execute(TC_MEC_MEC048_MEO_CSE_002_OK()); + execute(TC_MEC_MEC048_MEO_CSE_002_BR()); + execute(TC_MEC_MEC048_MEO_CSE_003_OK()); + execute(TC_MEC_MEC048_MEO_CSE_003_NF()); + execute(TC_MEC_MEC048_MEO_CSE_004_OK()); + execute(TC_MEC_MEC048_MEO_CSE_004_NF()); + execute(TC_MEC_MEC048_MEO_CSE_004_BR()); + execute(TC_MEC_MEC048_MEO_CSE_005_OK()); + execute(TC_MEC_MEC048_MEO_CSE_005_NF()); + execute(TC_MEC_MEC048_MEO_CSE_006_OK()); + execute(TC_MEC_MEC048_MEO_CSE_006_NF()); + execute(TC_MEC_MEC048_MEO_CSE_007_OK()); + execute(TC_MEC_MEC048_MEO_CSE_007_NF()); + + execute(TC_MEC_MEC048_MEO_CSE_013_OK()); + execute(TC_MEC_MEC048_MEO_CSE_013_OK_02()); + execute(TC_MEC_MEC048_MEO_CSE_014_OK()); + execute(TC_MEC_MEC048_MEO_CSE_014_OK_02()); + execute(TC_MEC_MEC048_MEO_CSE_014_BR()); + execute(TC_MEC_MEC048_MEO_CSE_015_OK()); + execute(TC_MEC_MEC048_MEO_CSE_015_NF()); + execute(TC_MEC_MEC048_MEO_CSE_016_OK()); + execute(TC_MEC_MEC048_MEO_CSE_016_NF()); + execute(TC_MEC_MEC048_MEO_CSE_016_BR()); + execute(TC_MEC_MEC048_MEO_CSE_017_OK()); + execute(TC_MEC_MEC048_MEO_CSE_017_NF()); + + execute(TC_MEC_MEC048_MEO_CSE_018_OK()); + execute(TC_MEC_MEC048_MEO_CSE_019_OK()); + execute(TC_MEC_MEC048_MEO_CSE_020_OK()); + } + + } + + } // End of 'control' statement + +} // End of module AtsMec_SelfServiceEnablementAPI_TestControl diff --git a/ttcn/AtsMec_SelfServiceEnablementAPI/module.mk b/ttcn/AtsMec_SelfServiceEnablementAPI/module.mk new file mode 100644 index 0000000..24667ca --- /dev/null +++ b/ttcn/AtsMec_SelfServiceEnablementAPI/module.mk @@ -0,0 +1,39 @@ +suite := AtsMec_SelfServiceEnablementAPI + +sources := \ + AtsMec_SelfServiceEnablementAPI_TestCases.ttcn \ + AtsMec_SelfServiceEnablementAPI_TestControl.ttcn + +modules := ../LibCommon \ + ../../titan-test-system-framework/ttcn/LibHelpers \ + ../../titan-test-system-framework/ttcn/LibHttp \ + ../../titan-test-system-framework/ttcn/LibXsd \ + ../../titan-test-system-framework/ttcn/LibJson \ + ../patch_lib_http \ + ../LibMec \ + ../LibMec/LocationAPI \ + ../LibMec/EdgePlatformApplicationEnablementAPI \ + ../LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI \ + ../LibMec/TrafficManagementAPI \ + ../LibMec/UEAppInterfaceAPI \ + ../LibMec/UEidentityAPI \ + ../LibMec/V2XInformationServiceAPI \ + ../LibMec/DeviceApplicationInterfaceAPI \ + ../LibMec/WlanInformationAPI \ + ../LibMec/FixedAccessInformationServiceAPI \ + ../LibMec/ApplicationMobilityServiceAPI \ + ../LibMec/IoTAPI \ + ../LibMec/FederationEnablementAPI \ + ../LibMec/SelfServiceEnablementAPI \ + ../../titan-test-system-framework/ccsrc/Framework \ + ../../titan-test-system-framework/ccsrc/loggers \ + ../../titan-test-system-framework/ccsrc/Protocols/Http \ + ../../titan-test-system-framework/ccsrc/Protocols/Tcp \ + ../../titan-test-system-framework/ccsrc/Protocols/Xml \ + ../../titan-test-system-framework/ccsrc/Helpers \ + ../../ccsrc/Ports/LibHttp \ + ../../ccsrc/EncDec/LibMec \ + ../../ccsrc/externals \ + ../../ccsrc/Protocols/Http \ + ../../ccsrc/Protocols/Json \ + ../modules/titan.TestPorts.Common_Components.Abstract_Socket \ diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/module.mk b/ttcn/LibMec/SelfServiceEnablementAPI/module.mk new file mode 100644 index 0000000..586b4c0 --- /dev/null +++ b/ttcn/LibMec/SelfServiceEnablementAPI/module.mk @@ -0,0 +1,6 @@ +sources := \ + ttcn/SelfServiceEnablementAPI_Pics.ttcn \ + ttcn/SelfServiceEnablementAPI_Pixits.ttcn \ + ttcn/SelfServiceEnablementAPI_Templates.ttcn \ + ttcn/SelfServiceEnablementAPI_Functions.ttcn \ + ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn new file mode 100644 index 0000000..a16934c --- /dev/null +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn @@ -0,0 +1,190 @@ +module SelfServiceEnablementAPI_Functions { + + // JSON + import from Json all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibHttp + import from LibHttp_TypesAndValues all; + import from LibHttp_Functions all; + import from LibHttp_Templates all; + import from LibHttp_JsonTemplates all; + import from LibHttp_TestSystem all; + + // LibMec/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_TypesAndValues all; + import from SelfServiceEnablementAPI_Templates all; + import from SelfServiceEnablementAPI_Pixits all; + + // LibMec + import from LibMec_Templates all; + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + function f_create_tenant_info_list( + inout TenantInfoList p_tenant_info_list, + out charstring_list p_tenant_id_list + ) runs on HttpComponent { + log(">>> f_create_tenant_info_list: ", p_tenant_info_list); + var charstring v_tenant_id; + for (var integer i := 0; i < lengthof(p_tenant_info_list); i := i + 1) { + f_create_tenant_info(p_tenant_info_list[i], v_tenant_id); + p_tenant_id_list := p_tenant_id_list & { v_tenant_id }; + } + } // End of function f_create_tenant_info_list + + function f_create_tenant_info( + inout TenantInfo p_tenant_info, + out charstring p_tenant_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + log(">>> f_create_tenant_info: ", p_tenant_info); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info(p_tenant_info) + )))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_cse_tenant_info( + mw_tenant_info( + ?, + ?, + ?, + ?, + ? + ) + ))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_tenant_id; + f_get_header(v_response.response.header, "Location", v_tenant_id); + // Extract HTTP tenant id + p_tenant_id := regexp( + v_tenant_id[0], + "?+" & PX_CSE_TENANTS_INFO & "/(?*)", + 0 + ); + + p_tenant_info := v_response.response.body.json_body.tenantInfo; + log("f_create_tenant_info: INFO: IUT successfully creates the Tenants: ", p_tenant_info); + } + [] tc_ac.timeout { + log("f_create_tenant_info: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_tenant_info + + function f_delete_tenant_info_list( + in TenantInfoList p_tenant_info_list + ) runs on HttpComponent { + for (var integer i := 0; i < lengthof(p_tenant_info_list); i := i + 1) { + if (ispresent(p_tenant_info_list[i].tenantId)) { + f_delete_tenant_info(p_tenant_info_list[i]); + } + } + } // End of function f_delete_tenant_info_list + + function f_delete_tenant_info( + in TenantInfo p_tenant_info + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + // Check if tenantId is present + if (not ispresent(p_tenant_info.tenantId)) { + log("f_delete_tenant_info: INCONC: tenantId not present, cannot delete."); + return; + } + + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(p_tenant_info.tenantId, "UTF-8")), + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("f_delete_tenant_info: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_delete_tenant_info + + function f_create_resource_quota_info( + inout ResourceQuotaInfo p_resource_quota_info, + in charstring p_tenant_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + log(">>> f_create_resource_quota_info: ", p_resource_quota_info); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + m_body_json_cse_resource_quota_info( + m_resource_quota_info( + PX_CPU_QUOTA, + PX_MEMORY_QUOTA, + PX_DISK_QUOTA + ) + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_cse_resource_quota_info( + mw_resource_quota_info( + PX_CPU_QUOTA, + PX_MEMORY_QUOTA, + PX_DISK_QUOTA + ) + ))))) -> value v_response { + tc_ac.stop; + + p_resource_quota_info := v_response.response.body.json_body.resourceQuotaInfo; + log("f_create_resource_quota_info: INFO: IUT successfully creates the resources: ", p_resource_quota_info); + } + [] tc_ac.timeout { + log("f_create_resource_quota_info: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_resource_quota_info + + } // End of module SelfServiceEnablementAPI_Functions diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pics.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pics.ttcn new file mode 100644 index 0000000..e663e98 --- /dev/null +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pics.ttcn @@ -0,0 +1,8 @@ +module SelfServiceEnablementAPI_Pics { + + /** + * @desc Does the IUT support CSE API? + */ + modulepar boolean PICS_CSE_API_SUPPORTED := true; + +} // End of module SelfServiceEnablementAPI_Pics diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn new file mode 100644 index 0000000..c0532ba --- /dev/null +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn @@ -0,0 +1,52 @@ +module SelfServiceEnablementAPI_Pixits { + + // JSON + import from Json all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + // LibMec/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_TypesAndValues all; + + modulepar Json.String PX_CSE_CUSTOMER_ID_1 := "" + + modulepar Json.String PX_CSE_CUSTOMER_NAME_1 := "customerName"; + + modulepar Json.String PX_CSE_TENANT_ID_1 := ""; + + modulepar Json.String PX_CSE_TENANT_NAME_1 := "tenantX"; + + modulepar Json.String PX_CSE_CUSTOMER_ID_2 := "" + + modulepar Json.String PX_CSE_CUSTOMER_NAME_2 := "customerName02"; + + modulepar Json.String PX_CSE_TENANT_NAME_2 := "tenantY"; + + modulepar Json.String PX_CSE_CUSTOMER_ID_3 := "" + + modulepar Json.String PX_CSE_CUSTOMER_NAME_3 := "customerName03"; + + modulepar Json.String PX_CSE_TENANT_NAME_3 := "tenantName03"; + + modulepar Json.String PX_NON_EXISTENT_TENANT_ID := "9344"; + + modulepar Json.String PX_NEW_CUSTOMER_ID := ""; + + modulepar Json.String PX_NEW_CUSTOMER_NAME := "newCustomer"; + + modulepar Json.String PX_NEW_TENANT_NAME := "newTenat"; + + modulepar Json.Integer PX_CPU_QUOTA := 4; + + modulepar Json.Integer PX_MEMORY_QUOTA := 2048; + + modulepar Json.Integer PX_DISK_QUOTA := 50; + + modulepar Json.AnyURI PX_CSE_SUB_CALLBACK_URI := "http://127.0.0.1/callback"; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "0787"; + + modulepar Json.String PX_NON_EXISTENT_SUBSCRIPTION_ID := "NON_EXISTENT_SUBSCRIPTION_ID"; + +} // End of module SelfServiceEnablementAPI_Pixits diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn new file mode 100644 index 0000000..2c9bb1e --- /dev/null +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn @@ -0,0 +1,457 @@ +module SelfServiceEnablementAPI_Templates { + + // JSON + import from Json all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + // LibMec + import from LibMec_TypesAndValues all; + + // Lib/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_TypesAndValues all; + + template (omit) TenantInfo m_tenant_info( + in Json.String p_customerId, + in Json.String p_customerName, + in template (omit) Json.String p_customerCategory, + in template (omit) Json.String p_tenantId, + in Json.String p_tenantName, + in template (omit) ResourceInfo p_resourceUseInfo := omit, + in template (omit) SiteInfo p_siteList := omit + ) := { + customerId := p_customerId, + customerName := p_customerName, + customerCategory := p_customerCategory, + tenantId := p_tenantId, + tenantName := p_tenantName, + resourceUseInfo := p_resourceUseInfo, + siteList := p_siteList + } // End of template m_tenant_info + + template (present) TenantInfo mw_tenant_info( + template (present) Json.String p_customerId := ?, + template (present) Json.String p_customerName := ?, + template Json.String p_customerCategory := *, + template Json.String p_tenantId := *, + template (present) Json.String p_tenantName := ?, + template ResourceInfo p_resourceUseInfo := *, + template SiteInfo p_siteList := * + ) := { + customerId := p_customerId, + customerName := p_customerName, + customerCategory := p_customerCategory, + tenantId := p_tenantId, + tenantName := p_tenantName, + resourceUseInfo := p_resourceUseInfo, + siteList := p_siteList + } // End of template mw_tenant_info + + template (omit) ResourceQuotaInfo m_resource_quota_info( + in template (omit) Json.Integer p_cpuQuota, + in template (omit) Json.Integer p_memoryQuota, + in template (omit) Json.Integer p_diskQuota + ) := { + cpuQuota := p_cpuQuota, + memoryQuota := p_memoryQuota, + diskQuota := p_diskQuota + } // End of template m_resource_quota_info + + template (present) ResourceQuotaInfo mw_resource_quota_info( + template Json.Integer p_cpuQuota := *, + template Json.Integer p_memoryQuota := *, + template Json.Integer p_diskQuota := * + ) := { + cpuQuota := p_cpuQuota, + memoryQuota := p_memoryQuota, + diskQuota := p_diskQuota + } // End of template mw_resource_quota_info + + template (omit) SiteResourceQuotaInfo m_site_resource_quota_info( + in Json.String p_siteId, + in template (omit) Json.Integer p_cpuQuota, + in template (omit) Json.Integer p_memoryQuota, + in template (omit) Json.Integer p_diskQuota + ) := { + siteId := p_siteId, + cpuQuota := p_cpuQuota, + memoryQuota := p_memoryQuota, + diskQuota := p_diskQuota + } // End of template m_site_resource_quota_info + + template (present) SiteResourceQuotaInfo mw_site_resource_quota_info( + template (present) Json.String p_siteId := ?, + template Json.Integer p_cpuQuota := *, + template Json.Integer p_memoryQuota := *, + template Json.Integer p_diskQuota := * + ) := { + siteId := p_siteId, + cpuQuota := p_cpuQuota, + memoryQuota := p_memoryQuota, + diskQuota := p_diskQuota + } // End of template mw_site_resource_quota_info + + template (omit) ResourceUsageSubscription m_resource_usage_subscription( + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) Json.Bool p_requestTestNotification, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) Links p_links := omit, + in Json.String p_customerId, + in Json.String p_tenantId, + in template (value) NotificationTrigger p_notificationTrigger, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "ResourceUsageSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + customerId := p_customerId, + tenantId := p_tenantId, + notificationTrigger := p_notificationTrigger, + expiryDeadline := p_expiryDeadline + } // End of template m_resource_usage_subscription + + template (present) ResourceUsageSubscription mw_resource_usage_subscription( + template Json.AnyURI p_callbackReference := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template Links p_links := *, + template (present) Json.String p_customerId := ?, + template (present) Json.String p_tenantId := ?, + template (present) NotificationTrigger p_notificationTrigger := ?, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := "ResourceUsageSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + customerId := p_customerId, + tenantId := p_tenantId, + notificationTrigger := p_notificationTrigger, + expiryDeadline := p_expiryDeadline + } // End of template mw_resource_usage_subscription + + template (value) NotificationTrigger m_notification_trigger( + in template (value) TriggerType p_triggerType, + in Json.UInt8 p_threshold, + in Json.Bool p_greaterOrLess + ) := { + triggerType := p_triggerType, + threshold := p_threshold, + greaterOrLess := p_greaterOrLess + } // End of template m_notification_trigger + + template (present) NotificationTrigger mw_notification_trigger( + template (present) TriggerType p_triggerType := ?, + template (present) Json.UInt8 p_threshold := ?, + template (present) Json.Bool p_greaterOrLess := ? + ) := { + triggerType := p_triggerType, + threshold := p_threshold, + greaterOrLess := p_greaterOrLess + } // End of template mw_notification_trigger + + template (omit) SiteResourceUsageSubscription m_site_resource_usage_subscription( + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) Json.Bool p_requestTestNotification, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) Links p_links := omit, + in Json.String p_customerId, + in Json.String p_tenantId, + in template (value) SiteId p_siteList, + in template (value) NotificationTrigger p_notificationTrigger, + in template (omit) TimeStamp p_expiryDeadline := omit + ) := { + subscriptionType := "SiteResourceUsageSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + customerId := p_customerId, + tenantId := p_tenantId, + siteList := p_siteList, + notificationTrigger := p_notificationTrigger, + expiryDeadline := p_expiryDeadline + } // End of template m_site_resource_usage_subscription + + template (present) SiteResourceUsageSubscription mw_site_resource_usage_subscription( + template Json.AnyURI p_callbackReference := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template Links p_links := *, + template (present) Json.String p_customerId := ?, + template (present) Json.String p_tenantId := ?, + template (present) SiteId p_siteList := ?, + template (present) NotificationTrigger p_notificationTrigger := ?, + template TimeStamp p_expiryDeadline := * + ) := { + subscriptionType := "SiteResourceUsageSubscription", + callbackReference := p_callbackReference, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + customerId := p_customerId, + tenantId := p_tenantId, + siteList := p_siteList, + notificationTrigger := p_notificationTrigger, + expiryDeadline := p_expiryDeadline + } // End of template mw_site_resource_usage_subscription + + template (value) SubscriptionLinkList m_subscription_link_list( + in template (value) Links p_links + ) := { + links := p_links + } // End of template m_subscription_link_list + + template (present) SubscriptionLinkList mw_subscription_link_list( + template (present) Links p_links := ? + ) := { + links := p_links + } // End of template mw_subscription_link_list + + template (omit) ResourceUsageNotification m_resource_usage_notification( + in template (omit) TimeStamp p_timeStamp := omit, + in Json.String p_customerId, + in Json.String p_tenantId, + in template (value) ResourceUseInfo p_resourceUseInfo + ) := { + notificationType := "ResourceUsageNotification", + timeStamp := p_timeStamp, + customerId := p_customerId, + tenantId := p_tenantId, + resourceUseInfo := p_resourceUseInfo + } // End of template m_resource_usage_notification + + template (present) ResourceUsageNotification mw_resource_usage_notification( + template TimeStamp p_timeStamp := *, + template (present) Json.String p_customerId := ?, + template (present) Json.String p_tenantId := ?, + template (present) ResourceUseInfo p_resourceUseInfo := ? + ) := { + notificationType := "ResourceUsageNotification", + timeStamp := p_timeStamp, + customerId := p_customerId, + tenantId := p_tenantId, + resourceUseInfo := p_resourceUseInfo + } // End of template mw_resource_usage_notification + + template (omit) ResourceUseInfo m_resource_use_info( + in template (omit) Json.Integer p_cpuUsed, + in template (omit) Json.Integer p_cpuRemain, + in template (omit) Json.Integer p_memoryUsed, + in template (omit) Json.Integer p_memoryRemain, + in template (omit) Json.Integer p_diskUsed, + in template (omit) Json.Integer p_diskRemain + ) := { + cpuUsed := p_cpuUsed, + cpuRemain := p_cpuRemain, + memoryUsed := p_memoryUsed, + memoryRemain := p_memoryRemain, + diskUsed := p_diskUsed, + diskRemain := p_diskRemain + } // End of template m_resource_use_info + + template ResourceUseInfo mw_resource_use_info( + template Json.Integer p_cpuUsed := *, + template Json.Integer p_cpuRemain := *, + template Json.Integer p_memoryUsed := *, + template Json.Integer p_memoryRemain := *, + template Json.Integer p_diskUsed := *, + template Json.Integer p_diskRemain := * + ) := { + cpuUsed := p_cpuUsed, + cpuRemain := p_cpuRemain, + memoryUsed := p_memoryUsed, + memoryRemain := p_memoryRemain, + diskUsed := p_diskUsed, + diskRemain := p_diskRemain + } // End of template mw_resource_use_info + + template (omit) SiteResourceUsageNotification m_site_resource_usage_notification( + in template (omit) TimeStamp p_timeStamp := omit, + in Json.String p_customerId, + in Json.String p_tenantId, + in template (value) SiteResourceUseInfo p_siteResourceUseInfo + ) := { + notificationType := "SiteResourceUsageNotification", + timeStamp := p_timeStamp, + customerId := p_customerId, + tenantId := p_tenantId, + siteResourceUseInfo := p_siteResourceUseInfo + } // End of template m_site_resource_usage_notification + + template (present) SiteResourceUsageNotification mw_site_resource_usage_notification( + template TimeStamp p_timeStamp := *, + template (present) Json.String p_customerId := ?, + template (present) Json.String p_tenantId := ?, + template (present) SiteResourceUseInfo p_siteResourceUseInfo := ? + ) := { + notificationType := "SiteResourceUsageNotification", + timeStamp := p_timeStamp, + customerId := p_customerId, + tenantId := p_tenantId, + siteResourceUseInfo := p_siteResourceUseInfo + } // End of template mw_site_resource_usage_notification + + template (omit) SiteResourceUseInfo m_site_resource_use_info( + in Json.String p_siteId, + in template (omit) Json.Integer p_cpuUsed, + in template (omit) Json.Integer p_cpuRemain, + in template (omit) Json.Integer p_memoryUsed, + in template (omit) Json.Integer p_memoryRemain, + in template (omit) Json.Integer p_diskUsed, + in template (omit) Json.Integer p_diskRemain + ) := { + siteId := p_siteId, + cpuUsed := p_cpuUsed, + cpuRemain := p_cpuRemain, + memoryUsed := p_memoryUsed, + memoryRemain := p_memoryRemain, + diskUsed := p_diskUsed, + diskRemain := p_diskRemain + } // End of template m_site_resource_use_info + + template (present) SiteResourceUseInfo mw_site_resource_use_info( + template (present) Json.String p_siteId := ?, + template Json.Integer p_cpuUsed := *, + template Json.Integer p_cpuRemain := *, + template Json.Integer p_memoryUsed := *, + template Json.Integer p_memoryRemain := *, + template Json.Integer p_diskUsed := *, + template Json.Integer p_diskRemain := * + ) := { + siteId := p_siteId, + cpuUsed := p_cpuUsed, + cpuRemain := p_cpuRemain, + memoryUsed := p_memoryUsed, + memoryRemain := p_memoryRemain, + diskUsed := p_diskUsed, + diskRemain := p_diskRemain + } // End of template mw_site_resource_use_info + + template (value) ExpiryNotification m_expiry_notification( + in template (value) Links p_links, + in template (value) TimeStamp p_expiryDeadline + ) := { + notificationType := "ExpiryNotification", + expiryDeadline := p_expiryDeadline, + links := p_links + } // End of template m_expiry_notification + + template (present) ExpiryNotification mw_expiry_notification( + template (present) Links p_links := ?, + template (present) TimeStamp p_expiryDeadline := ? + ) := { + notificationType := "ExpiryNotification", + expiryDeadline := p_expiryDeadline, + links := p_links + } // End of template mw_expiry_notification + + template (value) Links m_links( + in LinkType p_self_, + in template (omit) Subscriptions p_subscription := omit + ) :={ + self_ := p_self_, + subscription := p_subscription + } // End of template m_links + + template (present) Links mw_links( + template (present) LinkType p_self_ := ?, + template Subscriptions p_subscription := * + ) :={ + self_ := p_self_, + subscription := p_subscription + } // End of template mw_links + + template (value) Subscription m_subscription( + in Json.AnyURI p_href, + in Json.String p_subscriptionType + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template m_subscription + + template (present) Subscription mw_subscription( + template (present) Json.AnyURI p_href := ?, + template (present) Json.String p_subscriptionType := ? + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template mw_subscription + + template SiteInfo m_site_info( + in template Json.String p_siteId, + in template (omit) ResourceInfo p_resourceInfo := omit + ) := { + siteId := p_siteId, + resourceInfo := p_resourceInfo + } // End of template m_site_info + + template (present) SiteInfo mw_site_info( + template (present) Json.String p_siteId := ?, + template ResourceInfo p_resourceInfo := * + ) := { + siteId := p_siteId, + resourceInfo := p_resourceInfo + } // End of template mw_site_info + + template SiteId m_site_id( + in template Json.String p_siteId + ) := { + siteId := p_siteId + } // End of template m_site_id + + template (present) SiteId mw_site_id( + template (present) Json.String p_siteId := ? + ) := { + siteId := p_siteId + } // End of template mw_site_id + + template (omit) ResourceInfo m_resource_info( + in template (omit) Json.Integer p_cpuQuota, + in template (omit) Json.Integer p_cpuUsed, + in template (omit) Json.Integer p_cpuRemain, + in template (omit) Json.Integer p_memoryQuota, + in template (omit) Json.Integer p_memoryUsed, + in template (omit) Json.Integer p_memoryRemain, + in template (omit) Json.Integer p_diskQuota, + in template (omit) Json.Integer p_diskUsed, + in template (omit) Json.Integer p_diskRemain + ) := { + cpuQuota := p_cpuQuota, + cpuUsed := p_cpuUsed, + cpuRemain := p_cpuRemain, + memoryQuota := p_memoryQuota, + memoryUsed := p_memoryUsed, + memoryRemain := p_memoryRemain, + diskQuota := p_diskQuota, + diskUsed := p_diskUsed, + diskRemain := p_diskRemain + } // End of template m_resource_info + + template (present) ResourceInfo mw_resource_info( + template Json.Integer p_cpuQuota := *, + template Json.Integer p_cpuUsed := *, + template Json.Integer p_cpuRemain := *, + template Json.Integer p_memoryQuota := *, + template Json.Integer p_memoryUsed := *, + template Json.Integer p_memoryRemain := *, + template Json.Integer p_diskQuota := *, + template Json.Integer p_diskUsed := *, + template Json.Integer p_diskRemain := * + ) := { + cpuQuota := p_cpuQuota, + cpuUsed := p_cpuUsed, + cpuRemain := p_cpuRemain, + memoryQuota := p_memoryQuota, + memoryUsed := p_memoryUsed, + memoryRemain := p_memoryRemain, + diskQuota := p_diskQuota, + diskUsed := p_diskUsed, + diskRemain := p_diskRemain +} // End of template mw_resource_info + +} // End of module SelfServiceEnablementAPI_Templates diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn new file mode 100644 index 0000000..9de9a4b --- /dev/null +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn @@ -0,0 +1,332 @@ +module SelfServiceEnablementAPI_TypesAndValues { + + // JSON + import from Json all; + + // LibMec + import from LibMec_TypesAndValues all; + + /** + * @desc This type represents the information on a tenant + * @param customerId Identifier of the customer + * @param customerName Name of the customer + * @param customerCategory Category of the customer + * @param tenantId Identifier of the tenant + * @param tenantName Name of the tenant + * @param resourceUseInfo Resource in the MEC system that can be used by the tenant + * @param siteList A list of edge sites that can be used by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.2.2-1: Definition of type TenantInfo + */ + type record TenantInfo { + Json.String customerId, + Json.String customerName, + Json.String customerCategory optional, + Json.String tenantId optional, + Json.String tenantName, + ResourceInfo resourceUseInfo optional, + SiteInfo siteList optional + } + type set of TenantInfo TenantInfoList; + + /** + * @desc This type represents the information on the computing resource quota for a tenant in a MEC system + * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant + * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant + * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.2.3-1: Definition of type ResourceQuotaInfo + */ + type record ResourceQuotaInfo { + Json.Integer cpuQuota optional, + Json.Integer memoryQuota optional, + Json.Integer diskQuota optional + } + + /** + * @desc This type represents the information on the computing resource quota for a tenant in an edge site + * @param siteId Identifier of an edge site + * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant + * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant + * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.2.4-1: Definition of type SiteResourceQuotaInfo + */ + type record SiteResourceQuotaInfo { + Json.String siteId, + Json.Integer cpuQuota optional, + Json.Integer memoryQuota optional, + Json.Integer diskQuota optional + } + type set of SiteResourceQuotaInfo SiteResourceQuotaInfoList; + + /** + * @desc This type represents a subscription to get updates on the computing resource usage of a tenant in a MEC system + * @param subscriptionType Shall be set to "ResourceUsageSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the WAIS and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param customerId Identifier to uniquely specify the customer for the subscription + * @param tenantId Identifier of the tenant + * @param notificationTrigger Set for trigger-based event notification reporting + * @param expiryDeadline The expiration time of the subscription determined by the CSE + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.2-1: Definition of type ResourceUsageSubscription + */ + type record ResourceUsageSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + Json.String customerId, + Json.String tenantId, + NotificationTrigger notificationTrigger, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a subscription to get updates on the computing resource usage of a tenant in one or multiple edge sites + * @param subscriptionType Shall be set to "SiteResourceUsageSubscription" + * @param callbackReference URI exposed by the client on which to receive notifications via HTTP + * @param requestTestNotification Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI + * @param websockNotifConfig Provides details to negotiate and signal the use of a Websocket connection between the WAIS and the service consumer for notifications + * @param _links Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests + * @param customerId Identifier to uniquely specify the customer for the subscription + * @param tenantId Identifier of the tenant + * @param notificationTrigger Set for trigger-based event notification reporting + * @param expiryDeadline The expiration time of the subscription determined by the CSE + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.3-1: Definition of type SiteResourceUsageSubscription + */ + type record SiteResourceUsageSubscription { + Json.String subscriptionType, + Json.AnyURI callbackReference optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + Links links optional, + Json.String customerId, + Json.String tenantId, + SiteId siteList, + NotificationTrigger notificationTrigger, + TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a list of links related to currently existing subscriptions for the service consumer + * @param _links List of hyperlinks related to the resource + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.4-1: Attributes of type SubscriptionLinkList + */ + type record SubscriptionLinkList { + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents a notification from CSE with regards to the computing resource usage of a tenant in a MEC system + * @param notificationType Shall be set to "ResourceUsageNotification" + * @param timeStamp Time stamp + * @param customerId Identifier to uniquely specify the customer for the subscription + * @param tenantId Identifier of the tenant + * @param resourceUseInfo Resource usage in the MEC system by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.2-1: Attributes of type ResourceUsageNotification + */ + type record ResourceUsageNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + Json.String customerId, + Json.String tenantId, + ResourceUseInfo resourceUseInfo + } + + /** + * @desc This type represents resource usage in the MEC system by the tenant + * @param cpuUsed Used number of CPUs by the tenant + * @param cpuRemain Remaining number of CPUs that can be used by the tenant + * @param memoryUsed Used amount of memory (MB) by the tenant + * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant + * @param diskUsed Used amount of disk (GB) by the tenant + * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.2-1: Attributes of type ResourceUseInfo + */ + type record ResourceUseInfo { + Json.Integer cpuUsed optional, + Json.Integer cpuRemain optional, + Json.Integer memoryUsed optional, + Json.Integer memoryRemain optional, + Json.Integer diskUsed optional, + Json.Integer diskRemain optional + } + + /** + * @desc This type represents a notification from CSE with regards to the computing resource usage of a tenant in one or multiple edge sites + * @param notificationType Shall be set to "SiteResourceUsageNotification" + * @param timeStamp Time stamp + * @param customerId Identifier to uniquely specify the customer for the subscriptionc + * @param tenantId Identifier of the tenant + * @param resourceUseInfo Resource usage in the MEC system by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification + */ + type record SiteResourceUsageNotification { + Json.String notificationType, + TimeStamp timeStamp optional, + Json.String customerId, + Json.String tenantId, + SiteResourceUseInfo siteResourceUseInfo + } + + /** + * @desc This type represents resource usage in the edge sites by the tenant + * @param siteId Identifier of an edge site + * @param cpuUsed Used number of CPUs by the tenant + * @param cpuRemain Remaining number of CPUs that can be used by the tenant + * @param memoryUsed Used amount of memory (MB) by the tenant + * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant + * @param diskUsed Used amount of disk (GB) by the tenant + * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of type SiteResourceUseInfo + */ + type record SiteResourceUseInfo { + Json.String siteId, + Json.Integer cpuUsed optional, + Json.Integer cpuRemain optional, + Json.Integer memoryUsed optional, + Json.Integer memoryRemain optional, + Json.Integer diskUsed optional, + Json.Integer diskRemain optional + } + + /** + * @desc This type represents a notification from CSE with regards to expiry of an existing subscription + * @param notificationType Shall be set to "ExpiryNotification" + * @param _links Object containing hyperlinks related to the resource + * @param expiryDeadline Time stamp + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.4-1: Attributes of type ExpiryNotification + */ + type record ExpiryNotification { + Json.String notificationType, + TimeStamp expiryDeadline, + Links links + } with { + variant (links) "name as '_links'"; + } + + /** + * @desc This type represents the information on an edge site + * @param siteId Identifier of an edge site + * @param resourceInfo Resource information in the edge site that is associated with a specific tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.5.2-1: Attributes of type SiteInfo + */ + type record SiteInfo { + Json.String siteId, + ResourceInfo resourceInfo + } + + /** + * @desc This type represents the resource information in an edge site or a MEC system that is associated with a tenant + * @param cpuQuota Allowed number of CPUs that can be used by the tenant + * @param cpuUsed Used number of CPUs by the tenant + * @param cpuRemain Remaining number of CPUs that can be used by the tenant + * @param memoryQuota Allowed amount of memory (MB) that can be used by the tenant + * @param memoryUsed Used amount of memory (MB) by the tenant + * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant + * @param diskQuota Allowed amount of disk (GB) that can be used by the tenant + * @param diskUsed Used amount of disk (GB) by the tenant + * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of type ResourceInfo + */ + type record ResourceInfo { + Json.Integer cpuQuota optional, + Json.Integer cpuUsed optional, + Json.Integer cpuRemain optional, + Json.Integer memoryQuota optional, + Json.Integer memoryUsed optional, + Json.Integer memoryRemain optional, + Json.Integer diskQuota optional, + Json.Integer diskUsed optional, + Json.Integer diskRemain optional + } + + /** + * @desc This type represents the information on an edge site + * @param siteId Identifier of an edge site + * @param resourceInfo Resource information in the edge site that is associated with a specific tenant + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.5.2-1: Attributes of type SiteInfo + */ + type record NotificationTrigger { + TriggerType triggerType, + Json.UInt8 threshold, + Json.Bool greaterOrLess + } + + /** + * @desc Trigger for the notification + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.2-1: Enumeration TriggerType + */ + type enumerated TriggerType { + e_tt_ten (10), // 10 = Notification trigged based on the number of used CPUs + e_tt_eleven (11), // 11 = Notification trigged based on the number of remaining CPUs + e_tt_twenty (20), // 20 = Notification trigged based on the amount of used memory + e_tt_twentyone (21), // 21 = Notification trigged based on the amount of remaining memory + e_tt_thirty (30), // 30 = Notification trigged based on the amount of used disk + e_tt_thirtyone (31) // 31 = Notification trigged based on the amount of remaining disk + } with { + variant "JSON: as number" + } + + /** + * @desc Hyperlink related to the resource + * @member subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 048 V3.1.1 (2024-04) : Definition of type Links + */ + type record Links { + LinkType self_, + Subscriptions subscription optional + } with { + variant (self_) "name as 'self'"; + } + + /** + * @desc The service consumer's subscriptions + * @member href The URI referring to the subscription + * @member subscriptionType Type of the subscription + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.4-11: Type Subscription + */ + type record Subscription { + Json.AnyURI href, + Json.String subscriptionType + } + type set of Subscription Subscriptions; + + /** + * @desc This type represents a type of link + * @member href URI referring to a resource + * @see ETSI GS MEC 048 V3.1.1 (2024-04) : Definition of type LinkType + */ + type record LinkType { + Json.AnyURI href + } + + /** + * @desc This type represents the identifier of an edge site. + * @param siteId Identifier of an edge site + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.5.5-1: Attributes of type SiteInfo + */ + type record SiteId { + Json.String siteId + } + + /** + * @desc This type represents configuration for the delivery of subscription notifications over Websockets + * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications + * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested + * @see ETSI GS MEC 048 V3.1.1 (2024-04) Type: WebsockNotifConfig + */ + type record WebsockNotifConfig { + Json.AnyURI websocketUri optional, + Json.Bool requestWebsocketUri optional +} with { + encode "JSON" +} +} // End of module SelfServiceEnablementAPI_TypesAndValues \ No newline at end of file diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index d476bdb..fa071c8 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -128,4 +128,8 @@ module LibMec_Pixits { // FIXME FSCOM Split this file according to the different modulepar charstring PX_SENS_MGMT := "sens/v1/sensor_management"; + modulepar charstring PX_CSE_TENANTS_INFO := "cse/v1/tenants"; + + modulepar charstring PX_CSE_LIST_SUBS := "/cse/v1/subscriptions"; + } // End of module LibMec_Pixits diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 0a6cc8d..5576ee7 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -34,6 +34,8 @@ module LibHttp_JsonMessageBodyTypes { import from QoSMeasurementAPI_TypesAndValues all; // LibMec/SensorsSharingService import from SensorsSharingService_TypesAndValues all; + // LibMec/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_TypesAndValues all; /** * This file volontary contains a trivial declaration of the type JsonBody. @@ -204,6 +206,14 @@ module LibHttp_JsonMessageBodyTypes { SensorCharacteristics sensor_characteristics, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.5.4 Type: SensorCharacteristic SensorCharacteristicInfos sensor_characteristic_infos, // ETSI GS MEC 046 V3.1.1 (2024-04) Clause 6.5.4 Type: SensorCharacteristic SensorsSharingService_TypesAndValues.TestNotification sens_test_notification, + TenantInfo tenantInfo, + TenantInfoList tenantInfoList, + ResourceQuotaInfo resourceQuotaInfo, + ResourceUsageSubscription resourceUsageSubscription, + SiteResourceUsageSubscription siteResourceUsageSubscription, + SiteResourceUsageNotification siteResourceUsageNotification, + ResourceUsageNotification resourceUsageNotification, + // TODO Add here your custom variants universal charstring raw } with { diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index dd41e8f..97d704a 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -61,6 +61,9 @@ module LibHttp_JsonTemplates { // LibMec/SensorsSharingService import from SensorsSharingService_TypesAndValues all; + // LibMec/SelfServiceEnablementAPI + import from SelfServiceEnablementAPI_TypesAndValues all; + template (value) JsonBody m_json_body_raw( in template (value) charstring p_raw ) := { @@ -1990,4 +1993,102 @@ module LibHttp_JsonTemplates { } // End of group sens + group cse { + + template (value) JsonBody m_body_json_cse_tenant_info( + in template (value) TenantInfo p_tenantInfo + ) := { + tenantInfo := p_tenantInfo + } // End of template m_body_json_cse_tenant_info + + template (present) JsonBody mw_body_json_cse_tenant_info( + template (present) TenantInfo p_tenantInfo := ? + ) := { + tenantInfo := p_tenantInfo + } // End of template mw_body_json_cse_tenant_info + + template (value) JsonBody m_body_json_cse_tenant_info_list( + in template (value) TenantInfoList p_tenantInfoList + ) := { + tenantInfoList := p_tenantInfoList + } // End of template m_body_json_fed_cse_tenant_info + + template (present) JsonBody mw_body_json_cse_tenant_info_list( + template (present) TenantInfoList p_tenantInfoList := ? + ) := { + tenantInfoList := p_tenantInfoList + } // End of template mw_body_json_cse_tenant_info_list + + template (value) JsonBody m_body_json_cse_resource_quota_info( + in template (value) ResourceQuotaInfo p_resourceQuotaInfo + ) := { + resourceQuotaInfo := p_resourceQuotaInfo + } // End of template m_body_json_cse_resource_quota_info + + template (present) JsonBody mw_body_json_cse_resource_quota_info( + template (present) ResourceQuotaInfo p_resourceQuotaInfo:= ? + ) := { + resourceQuotaInfo := p_resourceQuotaInfo + } // End of template mw_body_json_cse_resource_quota_info + + template (value) JsonBody m_body_json_resource_usage_subscription( + in template (value) ResourceUsageSubscription p_resourceUsageSubscription + ) := { + resourceUsageSubscription := p_resourceUsageSubscription + } // End of template m_body_json_resource_usage_subscription + + template (present) JsonBody mw_body_json_resource_usage_subscription( + template (present) ResourceUsageSubscription p_resourceUsageSubscription := ? + ) := { + resourceUsageSubscription := p_resourceUsageSubscription + } // End of template mw_body_json_resource_usage_subscription + + template (value) JsonBody m_body_json_site_resource_usage_subscription( + in template (value) SiteResourceUsageSubscription p_siteResourceUsageSubscription + ) := { + siteResourceUsageSubscription := p_siteResourceUsageSubscription + } // End of template m_body_json_site_resource_usage_subscription + + template (present) JsonBody mw_body_json_site_resource_usage_subscription( + template (present) SiteResourceUsageSubscription p_siteResourceUsageSubscription := ? + ) := { + siteResourceUsageSubscription := p_siteResourceUsageSubscription + } // End of template mw_body_json_site_resource_usage_subscription + + template (value) JsonBody m_body_json_cse_subscription_link_list( + in template (value) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list + ) := { + subscriptionLinkList := p_subscription_link_list + } // End of template m_body_json_cse_subscription_link_list + + template (present) JsonBody mw_body_json_cse_subscription_link_list( + template (present) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list := ? + ) := { + subscriptionLinkList := p_subscription_link_list + } // End of template mw_body_json_cse_subscription_link_list + + template (present) JsonBody m_body_json_site_resource_usage_notification( + template (value) SiteResourceUsageNotification p_siteResourceUsageNotification + ) := { + siteResourceUsageNotification := p_siteResourceUsageNotification + } // End of template m_body_json_site_resource_usage_notification + template (present) JsonBody mw_body_json_site_resource_usage_notification( + template (present) SiteResourceUsageNotification p_siteResourceUsageNotification := ? + ) := { + siteResourceUsageNotification := p_siteResourceUsageNotification + } // End of template mw_body_json_site_resource_usage_notification + + template (present) JsonBody m_body_json_resource_usage_notification( + template (value) ResourceUsageNotification p_resourceUsageNotification + ) := { + resourceUsageNotification := p_resourceUsageNotification + } // End of template m_body_json_site_resource_usage_notification + template (present) JsonBody mw_body_json_resource_usage_notification( + template (present) ResourceUsageNotification p_resourceUsageNotification := ? + ) := { + resourceUsageNotification := p_resourceUsageNotification + } // End of template mw_body_json_site_resource_usage_notification + + } // End of group cse + } // End of module LibHttp_JsonTemplates -- GitLab From 0dbb6c3be8320ffbcc6be939d32edc72a7389318 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 27 May 2025 11:11:15 +0200 Subject: [PATCH 31/54] End of validation of AtsMec_V2XInformationService --- ccsrc/Protocols/Json/json_codec_mec030.cc | 9 + .../AtsMec_FederationEnablement.cf_ | 4 +- .../AtsMec_V2XInformationService.cfg_ | 57 +++- ...ec_V2XInformationServiceAPI_TestCases.ttcn | 316 +++++++++++------- ..._V2XInformationServiceAPI_TestControl.ttcn | 3 +- ttcn/AtsMec_V2XInformationService/module.mk | 2 + .../ttcn/V2XInformationServiceAPI_Pixits.ttcn | 28 +- .../V2XInformationServiceAPI_Templates.ttcn | 76 ++++- ...XInformationServiceAPI_TypesAndValues.ttcn | 47 ++- 9 files changed, 386 insertions(+), 156 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec030.cc b/ccsrc/Protocols/Json/json_codec_mec030.cc index 49e7cbb..f84d794 100644 --- a/ccsrc/Protocols/Json/json_codec_mec030.cc +++ b/ccsrc/Protocols/Json/json_codec_mec030.cc @@ -24,6 +24,10 @@ int json_codec_mec030::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms const V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo& v2x_msg_distribution_server_info = msg.v2xMsgDistributionServerInfo(); v2x_msg_distribution_server_info.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgDistributionServerInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_v2xMsgPublication)) { + const V2XInformationServiceAPI__TypesAndValues::V2xMsgPublication& v2x_msg_publication = msg.v2xMsgPublication(); + v2x_msg_publication.encode(V2XInformationServiceAPI__TypesAndValues::V2xMsgPublication_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_provChgUuUniSubscription)) { const V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription& prov_chg_uu_uni_subscription = msg.provChgUuUniSubscription(); prov_chg_uu_uni_subscription.encode(V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); @@ -101,6 +105,11 @@ int json_codec_mec030::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); predicted_qos.decode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.predictedQos() = predicted_qos; + } else if ((it->second.find("\"subscriptions\"") != std::string::npos) && (it->second.find("\"_links\"") != std::string::npos)) { + V2XInformationServiceAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + subscription_link_list.decode(V2XInformationServiceAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList__v2x() = subscription_link_list; } else if (it->second.find("\"ProvChgUuUniSubscription\"") != std::string::npos) { V2XInformationServiceAPI__TypesAndValues::ProvChgUuUniSubscription prov_chg_uu_uni_subscription; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); diff --git a/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ b/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ index 70cdbe5..0dca633 100644 --- a/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ +++ b/etc/AtsMec_FederationEnablement/AtsMec_FederationEnablement.cf_ @@ -65,7 +65,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1 #AtsMec_TestControl.control # Check that the IUT responds with a list of all available systemInfo when requested by a MEC Orchestrator - No query parameters -#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_01 +AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_01 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemId query parameters #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_02 # Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple SystemId query parameters @@ -89,7 +89,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1 # Check that the IUT responds with an error when selection is not applicable - SystemProvider #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_03 # Check that the IUT responds with an error when request is malformed -AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR +#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR # Check that the IUT creates a new systemInfo when requested by a MEC Orchestrator #AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_002_OK diff --git a/etc/AtsMec_V2XInformationService/AtsMec_V2XInformationService.cfg_ b/etc/AtsMec_V2XInformationService/AtsMec_V2XInformationService.cfg_ index a2043ca..b378196 100644 --- a/etc/AtsMec_V2XInformationService/AtsMec_V2XInformationService.cfg_ +++ b/etc/AtsMec_V2XInformationService/AtsMec_V2XInformationService.cfg_ @@ -25,8 +25,28 @@ V2XInformationServiceAPI_Pixits.PX_V2X_ECGI_LAT := 43.730846 V2XInformationServiceAPI_Pixits.PX_V2X_ECGI_LONG := 7.415385 # Callbacks -V2XInformationServiceAPI_Pixits.PX_PROV_UU_UNI_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/" -V2XInformationServiceAPI_Pixits.PX_PROV_V2X_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/" +V2XInformationServiceAPI_Pixits.PX_PROV_UU_UNI_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/uu_uni" +V2XInformationServiceAPI_Pixits.PX_PROV_UU_MBMS_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/uu_mbs" +V2XInformationServiceAPI_Pixits.PX_PROV_PC5_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/pc5" +V2XInformationServiceAPI_Pixits.PX_PROV_V2X_SUB_CALLBACK := "https://yanngarcia.ddns.net:36001/vis/v2/v2x" + +# MQTT server +V2XInformationServiceAPI_Pixits.PX_V2X_MC_SERVER := "172.29.10.56"; +V2XInformationServiceAPI_Pixits.PX_V2X_MC_PORT := "1883"; + +# PredictedQos +V2XInformationServiceAPI_Pixits.PX_LOC_GRANULARITY := "30" +V2XInformationServiceAPI_Pixits.PX_QoS_LAT_1 := 43.729416 +V2XInformationServiceAPI_Pixits.PX_QoS_LON_1 := 7.414853 +V2XInformationServiceAPI_Pixits.PX_QoS_TS_1 := 1653295620 +V2XInformationServiceAPI_Pixits.PX_QoS_LAT_2 := 43.732456 +V2XInformationServiceAPI_Pixits.PX_QoS_LON_2 := 7.418417 +V2XInformationServiceAPI_Pixits.PX_QoS_TS_2 := 1653299220 +V2XInformationServiceAPI_Pixits.PX_STREAM_ID_1 := "0" +V2XInformationServiceAPI_Pixits.PX_STREAM_ID_2 := "1" +V2XInformationServiceAPI_Pixits.PX_STREAM_ID_3 := "2" +V2XInformationServiceAPI_Pixits.PX_QoS_LAT_1_OUT_OF_COVERAGE := 45.729416 +V2XInformationServiceAPI_Pixits.PX_QoS_LON_1_OUT_OF_COVERAGE := 10.414853 [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -73,7 +93,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec030)/TCP(debug=1 #AtsMec_V2XInformationServiceAPI_TestControl.control # Check that the IUT responds with a configured provisioning information over Uu unicast when queried by a MEC Application -AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 +#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 # Check that the IUT responds with a configured provisioning information over Uu unicast when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application @@ -83,13 +103,21 @@ AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 # Check that the IUT responds with a configured provisioning information over Uu MBMS when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_OK_01 +# Check that the IUT responds with a configured provisioning information over Uu MBMS when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_OK_02 -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_BR_01 +#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_BR_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_NF +# Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01 +# Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_02 +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_NF # Check that the IUT processes properly a request to information of V2X Message Distribution servers @@ -99,18 +127,29 @@ AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_NF +# Check that the IUT sends a request about QoS information for a vehicular UE when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_NF +# Check that the IUT processes properly a request to publish a V2X message #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_BR +# Check that the IUT responds with the requested list of subscription when queried by a MEC Application - prov_chg_uu_uni #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_01 +# Check that the IUT responds with the requested list of subscription when queried by a MEC Application - prov_chg_uu_mbms #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_02 +# Check that the IUT responds with the requested list of subscription when queried by a MEC Application - prov_chg_pc5 #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_03 +# Check that the IUT responds with the requested list of subscription when queried by a MEC Application - v2x_msg #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_04 +# #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_05 +# Check that the IUT responds with the requested list of subscription when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_BR # Check that the IUT responds with the requested to create a subscription - ProvChgUuUniSubscription @@ -143,13 +182,20 @@ AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_NF +# Check that the IUT responds with the requested of updating subscription when queried by a MEC Application - ProvChgUuUniSubscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_01 +# Check that the IUT responds with the requested of updating subscription when queried by a MEC Application - ProvChgUuMbmsSubscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_02 +# Check that the IUT responds with the requested of updating subscription when queried by a MEC Application - ProvChgPc5Subscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_03 +# Check that the IUT responds with the requested of updating subscription when queried by a MEC Application - V2xMsgSubscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_04 +# Check that the IUT responds with the requested of updating subscription when queried by a MEC Application - PredQosSubscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_05 +# Check that the IUT responds with the correct error code when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_BR -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_NF +# Check that the IUT responds with the correct error code when a request with incorrect parameters is sent by a MEC Application +AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_NF # Check that the IUT responds with the requested of removing subscription when queried by a MEC Application - ProvChgUuUniSubscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_011_OK_01 @@ -161,6 +207,7 @@ AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_011_OK_04 # Check that the IUT responds with the requested of removing subscription when queried by a MEC Application - PredQosSubscription #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_011_OK_05 +# Check that the IUT responds with the correct error code when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_011_NF [GROUPS] diff --git a/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn b/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn index 0d181df..bc631d2 100644 --- a/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestCases.ttcn @@ -398,7 +398,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application */ - testcase TC_MEC_MEC030_SRV_V2X_002_BR() runs on HttpComponent system HttpTestAdapter { + testcase TC_MEC_MEC030_SRV_V2X_002_BR_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; @@ -419,7 +419,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_V2X_QUERIES_URI & "/invalid_uu_mbms_provisioning_info?location_info=" & PX_V2X_LATITUDE, + PICS_ROOT_API & PX_ME_V2X_QUERIES_URI & "/uu_mbms_provisioning_info?zone_info=" & PX_V2X_LATITUDE, // Wrong query parameter v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -444,7 +444,58 @@ module AtsMec_V2XInformationServiceAPI_TestCases { // Postamble f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC030_SRV_V2X_002_BR + } // End of testcase TC_MEC_MEC030_SRV_V2X_002_BR_01 + + /** + * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + */ + testcase TC_MEC_MEC030_SRV_V2X_002_BR_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_V2X_INFORMATION_SERVICE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_V2X_INFORMATION_SERVICE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_V2X_QUERIES_URI & "/uu_mbms_provisioning_info?location_info=" & PX_V2X_LATITUDE & ",ecgi," & PX_V2X_ECGI, // Wrong query parameter + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with correct error message ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC030_SRV_V2X_002_BR_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application @@ -629,7 +680,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_V2X_QUERIES_URI & "/invalid_pc5_provisioning_info?location_info=" & PX_V2X_LATITUDE, + PICS_ROOT_API & PX_ME_V2X_QUERIES_URI & "/pc5_provisioning_info?location_info=" & PX_V2X_LATITUDE & ",ecgi," & PX_V2X_ECGI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -870,6 +921,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { m_v2x_msg_distribution_server_info( { m_v2x_msg_distribution_server( + m_info_protocol({ AMQP_1_0 }) ) } @@ -929,43 +981,48 @@ module AtsMec_V2XInformationServiceAPI_TestCases { m_predicted_qos( -, PX_LOC_GRANULARITY, + -, -, -, + /*m_prediction_area( + m_location_info( + m_ecgi( + PX_V2X_CELL_ID, + m_plmn(PX_MCC, PX_MNC) + ), + m_location_info_geo_area(43.72, 10.41) + ), + "100" + ) m_qos( { - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }), // FIXME To be refined - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }), - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }) + m_stream(PX_STREAM_ID_1, { m_qos_kpi("latency", "1"), m_qos_kpi("ul_bitrate", "1") }), + m_stream(PX_STREAM_ID_2, { m_qos_kpi("latency", "1"), m_qos_kpi("ul_bitrate", "1") }), + m_stream(PX_STREAM_ID_3, { m_qos_kpi("latency", "1"), m_qos_kpi("ul_bitrate", "1") }) } - )/*, + ),*/ { - m_predicted_qos_routes( - { - m_route_info( - m_location_info( - m_ecgi( - PX_V2X_CELL_ID, - m_plmn(PX_MCC, PX_MNC) - ), - m_location_info_geo_area(43.72, 10.41) - ), - -, - 128, - 128 - ), - m_route_info( - m_location_info( - m_ecgi( - PX_V2X_CELL_ID, - m_plmn(PX_MCC, PX_MNC) - ), - m_location_info_geo_area(43.75, 10.5) - ), - -, - 128, - 128 - ) - } - ) - }*/ + { + routeInfo := + { + m_route_info( + m_location_info( + omit/*m_ecgi( + PX_V2X_CELL_ID, + m_plmn(PX_MCC, PX_MNC) + )*/, + m_location_info_geo_area(PX_QoS_LAT_1, PX_QoS_LON_1) + ), + m_time_stamp(PX_QoS_TS_1) + ), + m_route_info( + m_location_info( + omit/*m_ecgi( + PX_V2X_CELL_ID, + m_plmn(PX_MCC, PX_MNC) + )*/, + m_location_info_geo_area(PX_QoS_LAT_2, PX_QoS_LON_2) + ), + m_time_stamp(PX_QoS_TS_2) + )}}} )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -978,8 +1035,33 @@ module AtsMec_V2XInformationServiceAPI_TestCases { mw_http_message_body_json( mw_body_json_v2x_predicted_qos( mw_predicted_qos( - -, - PX_LOC_GRANULARITY + SINGLE_UE_PREDICTION, + PX_LOC_GRANULARITY, + m_qos( + { + m_stream(PX_STREAM_ID_1, { m_qos_kpi("rsrp", "60", "1"), m_qos_kpi("rsrq", "20", "1") }), + m_stream(PX_STREAM_ID_2, { m_qos_kpi("rsrp", "55", "1"), m_qos_kpi("rsrq", "13", "1") }) + } + ), + -, -, + { + { + routeInfo := + { + mw_route_info( + mw_location_info( + omit, + mw_location_info_geo_area(PX_QoS_LAT_1, PX_QoS_LON_1) + ), + mw_time_stamp(PX_QoS_TS_1) + ), + mw_route_info( + mw_location_info( + omit, + mw_location_info_geo_area(PX_QoS_LAT_2, PX_QoS_LON_2) + ), + mw_time_stamp(PX_QoS_TS_2) + )}}} )))))) { tc_ac.stop; @@ -1027,43 +1109,25 @@ module AtsMec_V2XInformationServiceAPI_TestCases { m_predicted_qos( -, PX_LOC_GRANULARITY & "InvalidSemantic", - m_qos( - { - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }), // FIXME To be refined - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }), - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }) - } - )/*, + -, -, -, { - m_predicted_qos_routes( - { - m_route_info( - m_location_info( - m_ecgi( - PX_V2X_CELL_ID, - m_plmn(PX_MCC, PX_MNC) - ), - m_location_info_geo_area(43.72, 10.41) - ), - -, - 128, - 128 - ), - m_route_info( - m_location_info( - m_ecgi( - PX_V2X_CELL_ID, - m_plmn(PX_MCC, PX_MNC) - ), - m_location_info_geo_area(43.75, 10.5) - ), - -, - 128, - 128 - ) - } - ) - }*/ + { + routeInfo := + { + m_route_info( + m_location_info( + omit, + m_location_info_geo_area(PX_QoS_LAT_1, PX_QoS_LON_1) + ), + m_time_stamp(PX_QoS_TS_1) + ), + m_route_info( + m_location_info( + omit, + m_location_info_geo_area(PX_QoS_LAT_2, PX_QoS_LON_2) + ), + m_time_stamp(PX_QoS_TS_2) + )}}} )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1120,43 +1184,25 @@ module AtsMec_V2XInformationServiceAPI_TestCases { m_predicted_qos( -, PX_LOC_GRANULARITY, - m_qos( - { - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }), // FIXME To be refined - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }), - m_stream({ m_qos_kpi("", ""), m_qos_kpi("", "") }) - } - )/*, + -, -, -, { - m_predicted_qos_routes( - { - m_route_info( - m_location_info( - m_ecgi( - PX_V2X_UNKNOWN_CELL_ID, - m_plmn(PX_MCC, PX_MNC) - ), - m_location_info_geo_area(43.72, 10.41) - ), - -, - 128, - 128 - ), - m_route_info( - m_location_info( - m_ecgi( - PX_V2X_CELL_ID, - m_plmn(PX_UNKNOWN_MCC, PX_UNKNOWN_MNC) - ), - m_location_info_geo_area(43.75, 10.5) - ), - -, - 128, - 128 - ) - } - ) - }*/ + { + routeInfo := + { + m_route_info( + m_location_info( + omit, + m_location_info_geo_area(PX_QoS_LAT_1_OUT_OF_COVERAGE, PX_QoS_LON_1_OUT_OF_COVERAGE) + ), + m_time_stamp(PX_QoS_TS_1) + ), + m_route_info( + m_location_info( + omit, + m_location_info_geo_area(PX_QoS_LAT_2, PX_QoS_LON_2) + ), + m_time_stamp(PX_QoS_TS_2) + )}}} )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1347,8 +1393,14 @@ module AtsMec_V2XInformationServiceAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_v2x_subscription_link_list - )))) { + mw_body_json_v2x_subscription_link_list( + mw_subscription_link_list( + mw_subscription_links( + -, + superset(m_subscription_( + v_prov_chg_uu_uni_subscription.links.self_.href, + v_prov_chg_uu_uni_subscription.subscriptionType + ))))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of SubscriptionLinks ***"); @@ -1404,8 +1456,14 @@ module AtsMec_V2XInformationServiceAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_v2x_subscription_link_list - )))) { + mw_body_json_v2x_subscription_link_list( + mw_subscription_link_list( + mw_subscription_links( + -, + superset(m_subscription_( + v_prov_chg_uu_mbms_subscription.links.self_.href, + v_prov_chg_uu_mbms_subscription.subscriptionType + ))))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of SubscriptionLinks ***"); @@ -1461,8 +1519,14 @@ module AtsMec_V2XInformationServiceAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_v2x_subscription_link_list - )))) { + mw_body_json_v2x_subscription_link_list( + mw_subscription_link_list( + mw_subscription_links( + -, + superset(m_subscription_( + v_prov_chg_pc5_subscription.links.self_.href, + v_prov_chg_pc5_subscription.subscriptionType + ))))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of SubscriptionLinks ***"); @@ -1519,8 +1583,14 @@ module AtsMec_V2XInformationServiceAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_v2x_subscription_link_list - )))) { + mw_body_json_v2x_subscription_link_list( + mw_subscription_link_list( + mw_subscription_links( + -, + superset(m_subscription_( + v_v2x_msg_subscription.links.self_.href, + v_v2x_msg_subscription.subscriptionType + ))))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of SubscriptionLinks ***"); @@ -1619,7 +1689,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_V2X_URI & "/subscriptions/_prov_chg_uu_uni_", // Invalid subscription type + PICS_ROOT_API & PX_ME_V2X_URI & "?subscription_type=unknown_prov_chg_uu_uni", // Invalid subscription type v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -3018,7 +3088,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { } // End of testcase TC_MEC_MEC030_SRV_V2X_010_OK_05 /** - * @desc Check that the IUT responds with the requested of updating subscription when queried by a MEC Application + * @desc Check that the IUT responds with the correct error code when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC030_SRV_V2X_010_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -3091,7 +3161,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { } // End of testcase TC_MEC_MEC030_SRV_V2X_010_BR /** - * @desc Check that the IUT responds with the requested of updating subscription when queried by a MEC Application + * @desc Check that the IUT responds with the correct error code when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC030_SRV_V2X_010_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -3439,7 +3509,7 @@ module AtsMec_V2XInformationServiceAPI_TestCases { } // End of testcase TC_MEC_MEC030_SRV_V2X_011_OK_05 /** - * @desc Check that the IUT responds with the requested of removing subscription when queried by a MEC Application + * @desc Check that the IUT responds with the correct error code when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC030_SRV_V2X_011_NF() runs on HttpComponent system HttpTestAdapter { // Local variables diff --git a/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestControl.ttcn b/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestControl.ttcn index 5b60233..098fcd1 100644 --- a/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestControl.ttcn +++ b/ttcn/AtsMec_V2XInformationService/AtsMec_V2XInformationServiceAPI_TestControl.ttcn @@ -19,7 +19,8 @@ module AtsMec_V2XInformationServiceAPI_TestControl { execute(TC_MEC_MEC030_SRV_V2X_002_OK_01()); execute(TC_MEC_MEC030_SRV_V2X_002_OK_02()); - execute(TC_MEC_MEC030_SRV_V2X_002_BR()); + execute(TC_MEC_MEC030_SRV_V2X_002_BR_01()); + execute(TC_MEC_MEC030_SRV_V2X_002_BR_02()); execute(TC_MEC_MEC030_SRV_V2X_002_NF()); execute(TC_MEC_MEC030_SRV_V2X_003_OK_01()); diff --git a/ttcn/AtsMec_V2XInformationService/module.mk b/ttcn/AtsMec_V2XInformationService/module.mk index 4e4bc43..96fb923 100644 --- a/ttcn/AtsMec_V2XInformationService/module.mk +++ b/ttcn/AtsMec_V2XInformationService/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Pixits.ttcn b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Pixits.ttcn index e58c575..8e750f3 100644 --- a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Pixits.ttcn +++ b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Pixits.ttcn @@ -20,8 +20,6 @@ module V2XInformationServiceAPI_Pixits { modulepar charstring PX_V2X_LATITUDE := "latitude,43.730846,longitude,7.415385"; - modulepar charstring PX_LOC_GRANULARITY := "17"; - modulepar charstring PX_MCC := "1"; modulepar charstring PX_MNC := "1"; @@ -60,6 +58,30 @@ module V2XInformationServiceAPI_Pixits { modulepar Json.String PX_V2X_MSG_DISTRIBUTION_SERVER_IP_ADDRESS := "10.8.0.1"; - modulepar Json.UInt16 PX_V2X_MSG_DISTRIBUTION_SERVER_PORT := 12345; + modulepar Json.UInt16 PX_V2X_MSG_DISTRIBUTION_SERVER_PORT := 12345; + + modulepar charstring PX_LOC_GRANULARITY := "17"; + + modulepar Json.String PX_STREAM_ID_1 := "0"; + + modulepar Json.String PX_STREAM_ID_2 := "0"; + + modulepar Json.String PX_STREAM_ID_3 := "0"; + + modulepar Json.Number PX_QoS_LAT_1 := 43.729416; + + modulepar Json.Number PX_QoS_LON_1 := 7.414853; + + modulepar Json.UInteger PX_QoS_TS_1 := 1653295620; + + modulepar Json.Number PX_QoS_LAT_2 := 43.732456; + + modulepar Json.Number PX_QoS_LON_2 := 7.418417; + + modulepar Json.UInteger PX_QoS_TS_2 := 1653299220; + + modulepar Json.Number PX_QoS_LAT_1_OUT_OF_COVERAGE := 45.729416; + + modulepar Json.Number PX_QoS_LON_1_OUT_OF_COVERAGE := 10.414853; } // End of module V2XInformationServiceAPI_Pixits diff --git a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Templates.ttcn b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Templates.ttcn index dc06b56..8cf8708 100644 --- a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Templates.ttcn +++ b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_Templates.ttcn @@ -156,9 +156,9 @@ module V2XInformationServiceAPI_Templates { } // End of template mw_info_connection template (omit) PredictedQos m_predicted_qos( - in template (value) PredictionTarget p_predictionTarget := E2E_APPLICATION_INSTANCE_PREDICTION, + in template (value) PredictionTarget p_predictionTarget := SINGLE_UE_PREDICTION, in template (value) Json.String p_locationGranularity, - in template (value) Qos p_qos, + in template (omit) Qos p_qos := omit, in template (omit) TimeStamp p_noticePeriod := omit, in template (omit) PredictionArea p_predictionArea := omit, in template (omit) Routes p_routes := omit, @@ -191,6 +191,22 @@ module V2XInformationServiceAPI_Templates { qos := p_qos } // End of template mw_predicted_qos + template (value) PredictionArea m_prediction_area( + in template (value) LocationInfo p_center, + in template (value) Json.String p_radius + ) := { + center := p_center, + radius := p_radius + } // End of teradius m_prediction_area + + template (present) PredictionArea mw_prediction_area( + template (present) LocationInfo p_center := ?, + template (present) Json.String p_radius := ? + ) := { + center := p_center, + radius := p_radius + } // End of teradius mw_prediction_area + template (value) Qos m_qos( in template (value) StreamList p_stream ) := { @@ -204,14 +220,18 @@ module V2XInformationServiceAPI_Templates { } // End of template mw_qos template (value) Stream m_stream( + in Json.String p_stream_id, in template (value) QosKpiList p_qos_kpi ) := { - qosKpi := p_qos_kpi + streamId := p_stream_id, + qosKpi := p_qos_kpi } // End of template m_stream template (present) Stream mw_stream( + template (present) Json.String p_stream_id := ?, template (present) QosKpiList p_qos_kpi := ? ) := { + streamId := p_stream_id, qosKpi := p_qos_kpi } // End of template mw_stream @@ -238,7 +258,7 @@ module V2XInformationServiceAPI_Templates { template (omit) RouteInfo m_route_info( in template (value) LocationInfo p_location, in template (omit) TimeStamp p_time := omit - ) := { + ) := { location := p_location, time := p_time } // End of template m_route_info @@ -252,7 +272,7 @@ module V2XInformationServiceAPI_Templates { } // End of template mw_route_info template (omit) LocationInfo m_location_info( - in template (value) Ecgi p_ecgi, + in template (omit) Ecgi p_ecgi, in template (omit) LocationInfoGeoArea p_geoArea := omit ) := { ecgi := p_ecgi, @@ -260,7 +280,7 @@ module V2XInformationServiceAPI_Templates { } // End of template m_location_info template LocationInfo mw_location_info( - template (present) Ecgi p_ecgi := ?, + template Ecgi p_ecgi := ?, template LocationInfoGeoArea p_geoArea := * ) := { ecgi := p_ecgi, @@ -712,4 +732,48 @@ module V2XInformationServiceAPI_Templates { streamId := p_streamId } // End of template mw_filterCriteria + template (value) SubscriptionLinkList m_subscription_link_list( + in template (value) SubscriptionLinks p_links + ) := { + links := p_links + } // End of template m_subscription_link_list + + template (present) SubscriptionLinkList mw_subscription_link_list( + template (present) SubscriptionLinks p_links := ? + ) := { + links := p_links + } // End of template mw_subscription_link_list + + template (value) SubscriptionLinks m_subscription_links( + in template (value) LinkType p_self_, + in template (value) SubscriptionList p_subscriptions + ) := { + self_ := p_self_, + subscriptions := p_subscriptions + } // End of template m_subscription_links + + template (present) SubscriptionLinks mw_subscription_links( + template (present) LinkType p_self_ := ?, + template (present) SubscriptionList p_subscriptions := ? + ) := { + self_ := p_self_, + subscriptions := p_subscriptions + } // End of template mw_subscription_links + + template (value) Subscription_ m_subscription_( + in template (value) Json.AnyURI p_href, + in template (value) Json.String p_subscriptionType + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template m_subscription_ + + template (present) Subscription_ mw_subscription_( + template (present) Json.AnyURI p_href := ?, + template (present) Json.String p_subscriptionType := ? + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of template mw_subscription_ + } // End of module V2XInformationServiceAPI_Templates diff --git a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn index e90fe1d..51b83ba 100644 --- a/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/V2XInformationServiceAPI/ttcn/V2XInformationServiceAPI_TypesAndValues.ttcn @@ -119,14 +119,14 @@ module V2XInformationServiceAPI_TypesAndValues { TimeStamp noticePeriod optional, PredictionArea predictionArea optional, Routes routes optional, - Qos qos + Qos qos optional } type enumerated PredictionTarget { SINGLE_UE_PREDICTION (1), E2E_APPLICATION_INSTANCE_PREDICTION (2) - } with { - variant "JSON: as number" + // } with { + // variant "JSON: as number" } /** @@ -139,7 +139,7 @@ module V2XInformationServiceAPI_TypesAndValues { */ type record PredictionArea { LocationInfo center, - Json.String radius + Json.String radius } /** @@ -148,7 +148,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record Route { - RouteInfoList routeinfo + RouteInfoList routeInfo } type set of Route Routes; @@ -175,10 +175,12 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Predicted QoS at the related time and vehicular UE location + * @member streamId The identifier of a specific data stream * @member qosKpi This structure contains the prediction for a specific QoS KPI related to a given data stream * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.2.6-1: Attributes of the PredictedQos */ type record Stream { + Json.String streamId, QosKpiList qosKpi } type set of Stream StreamList; @@ -395,12 +397,12 @@ module V2XInformationServiceAPI_TypesAndValues { /** * @desc Hyperlink related to the resource * @member self_ URI of this resource. - * @member subscription The service consumer's subscriptions + * @member subscriptions The service consumer's subscriptions * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.3.7-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinks { LinkType self_, - SubscriptionList subscription optional + SubscriptionList subscriptions optional } with { variant (self_) "name as 'self'"; } @@ -413,7 +415,7 @@ module V2XInformationServiceAPI_TypesAndValues { */ type record Subscription_ { Json.AnyURI href, - Json.String subscriptionType + Json.String subscriptionType } type set of Subscription_ SubscriptionList; @@ -518,7 +520,7 @@ module V2XInformationServiceAPI_TypesAndValues { * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.3-1: Attributes of the LocationInfo */ type record LocationInfo { - Ecgi ecgi, + Ecgi ecgi optional, LocationInfoGeoArea geoArea optional } type set of LocationInfo LocationInfoList; @@ -756,13 +758,26 @@ module V2XInformationServiceAPI_TypesAndValues { * @see ETSI GS MEC 030 V3.3.1 (2024-06) Table 6.5.14-1: Attributes of the V2xMsgPropertiesValues */ type enumerated MsgType { - denm (1), - cam (2), - poi (3), - spat (4), - map_ (5), - ivi (6), - ev_rsr(7) + denm (1), + cam (2), + poi (3), + spatem (4), + mapem (5), + ivim (6), + evrsr (7), + tistpgtransaction (8), + srem (9), + ssem (10), + evcsn (11), + saem (12), + rtcmem (13), + cpm (14), + imzm (15), + vam (16), + dsm (17), + mim (18), + mvm (19), + mcm (20) // } with { // variant "JSON: as number" } -- GitLab From fc358faaebd04ce373f01e52537100c873a752ea Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Tue, 3 Jun 2025 06:19:34 +0000 Subject: [PATCH 32/54] add MEC048 SiteResourceQuotaInfo testcases and ResourceQuotaInfo post testcase --- .../AtsMec_SelfServiceEnablementAPI.cf_ | 107 +++ ...ec_SelfServiceEnablementAPI_TestCases.ttcn | 822 +++++++++++++++++- ..._SelfServiceEnablementAPI_TestControl.ttcn | 13 + .../module.mk | 0 .../SelfServiceEnablementAPI_Functions.ttcn | 88 +- .../ttcn/SelfServiceEnablementAPI_Pixits.ttcn | 26 +- .../SelfServiceEnablementAPI_Templates.ttcn | 6 +- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 3 + .../ttcn/LibHttp_JsonTemplates.ttcn | 30 +- 9 files changed, 1078 insertions(+), 17 deletions(-) create mode 100644 etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ rename ttcn/{AtsMec_SelfServiceEnablementAPI => AtsMec_SelfServiceEnablement}/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn (53%) rename ttcn/{AtsMec_SelfServiceEnablementAPI => AtsMec_SelfServiceEnablement}/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn (77%) rename ttcn/{AtsMec_SelfServiceEnablementAPI => AtsMec_SelfServiceEnablement}/module.mk (100%) diff --git a/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ b/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ new file mode 100644 index 0000000..6a30bc8 --- /dev/null +++ b/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ @@ -0,0 +1,107 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" #"192.168.1.39" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +# LibMec_Pixits +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_FederationEnablement/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +#system.httpPort.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server=172.26.214.231,port=3001,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT creates the resourceQuotaInfo for an existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_008_OK +# Check that the IUT returns an error on creating the resourceQuotaInfo for a not existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_008_NF +# Check that the IUT returns the list of per site resource quota for a specific tenant when requested to a CSE - No filter +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_009_OK +# Check that the IUT returns the list of per site resource quota for a specific tenant when requested to a CSE - siteId filter" +AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_009_OK_01 +# Check that the IUT returns an error on requesting site resource quota info on a not existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_009_NF +# Check that the IUT creates a site resource quota info for a existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_010_OK +# Check that the IUT returns an error on creating a site resource quota with wrong parameters +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_010_BR +# Check that the IUT returns the site resource quota for a specific tenant and site identifier when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_011_OK +# Check that the IUT returns an error on requesting site resource quota info on a not existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_011_NF +# Check that the IUT updates a site resource quota info for a existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_012_OK +# Check that the IUT returns an error updating a site resource quota info for a existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_012_BR +# Check that the IUT returns an error updating a site resource quota info for a not existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_012_NF + + + + + + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn similarity index 53% rename from ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn rename to ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn index a83b927..95ed72c 100644 --- a/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn @@ -24,7 +24,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { import from LibMec_Pixits all; group tenant { - + /** * @Desc Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - No query parameters */ @@ -1059,6 +1059,826 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { } // End of testcase TC_MEC_MEC048_MEO_CSE_007_NF + /** + * @desc Check that the IUT creates the resourceQuotaInfo for an existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_008_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_tenant_id; + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + mw_body_json_cse_resource_quota_info( + m_resource_quota_info( + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_cse_resource_quota_info( + mw_resource_quota_info( + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))) -> value v_response { + tc_ac.stop; + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in creating the resourceQuotaInfo for an existing tenant ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + + log("*** " & testcasename() & ": PASS: IUT passed in creating the resourceQuotaInfo for an existing tenant ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_008_OK + + /** + * @desc Check that the IUT returns an error on creating the resourceQuotaInfo for a not existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_008_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + m_body_json_cse_resource_quota_info( + m_resource_quota_info( + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_008_NF + + /** + * @desc Check that the IUT returns the list of per site resource quota for a specific tenant when requested to a CSE - No filter + */ + testcase TC_MEC_MEC048_MEO_CSE_009_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var charstring v_tenant_id; + var charstring v_site_id; + var charstring_list v_site_id_list; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + var SiteResourceQuotaInfoList v_site_resource_quota_info := { + valueof(m_site_resource_quota_info(PX_SITE_ID_1,PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)), + valueof(m_site_resource_quota_info(PX_SITE_ID_2,PX_CPU_QUOTA_2, PX_MEMORY_QUOTA_2, PX_DISK_QUOTA_2)), + valueof(m_site_resource_quota_info(PX_SITE_ID_3,PX_CPU_QUOTA_3, PX_MEMORY_QUOTA_3, PX_DISK_QUOTA_3)) + }; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_site_resource_quota_info_list(v_site_resource_quota_info, v_site_id_list, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & v_tenant_id & "/resources/quota_in_sites", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + tc_ac.start; + + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info_list( + { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ), + mw_site_resource_quota_info( + PX_SITE_ID_2, + PX_CPU_QUOTA_2, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + ), + mw_site_resource_quota_info( + PX_SITE_ID_3, + PX_CPU_QUOTA_3, + PX_MEMORY_QUOTA_3, + PX_DISK_QUOTA_3 + ) + } + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the list of per site resource quota for a specific tenant ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_009_OK + + + /** + * @desc Check that the IUT returns the list of per site resource quota for a specific tenant when requested to a CSE - siteId filter" + */ + testcase TC_MEC_MEC048_MEO_CSE_009_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var charstring v_tenant_id; + var charstring_list v_site_id_list; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + var SiteResourceQuotaInfoList v_site_resource_quota_info := { + valueof(m_site_resource_quota_info(PX_SITE_ID_1,PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)), + valueof(m_site_resource_quota_info(PX_SITE_ID_2,PX_CPU_QUOTA_2, PX_MEMORY_QUOTA_2, PX_DISK_QUOTA_2)), + valueof(m_site_resource_quota_info(PX_SITE_ID_3,PX_CPU_QUOTA_3, PX_MEMORY_QUOTA_3, PX_DISK_QUOTA_3)) + }; + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_site_resource_quota_info_list(v_site_resource_quota_info, v_site_id_list, v_tenant_id); + + f_init_default_headers_list(-, -, v_headers); + + //TODO: check uri and uri names of all testcases + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/resources/quota_in_sites?siteId=" & v_site_id_list[0] & "/" & v_site_id_list[1], + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info_list( + { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ), + mw_site_resource_quota_info( + PX_SITE_ID_2, + PX_CPU_QUOTA_2, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + ) + } + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the site resource quota for a specific tenant - siteId filter ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_009_OK_01 + + /** + * @desc Check that the IUT returns an error on requesting site resource quota info on a not existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_009_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + //TODO: check uri and uri names of all testcases + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_sites", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_009_NF + + /** + * @desc Check that the IUT creates a site resource quota info for a existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_010_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_site_id; + var charstring v_tenant_id; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); //TODO: change function name + f_init_default_headers_list(-, -, v_headers); + + //TODO: check uri and uri names of all testcases + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites", + v_headers, + m_http_message_body_json( + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info( + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))) -> value v_response { + tc_ac.stop; + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in responds with the list of per site resource quota for a specific tenant ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_location_header; + f_get_header(v_response.response.header, "Location", v_location_header); + // Build expected regex pattern with specific tenant ID + var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_sites/[^/]+"; + if (regexp(v_location_header[0], v_expected_pattern, 0) != "") { + log("Location header matches expected pattern with tenant ID: " & v_tenant_id); + } else { + setverdict(fail, "Location header does NOT match expected pattern: ", v_location_header[0]); + } + } + log("*** " & testcasename() & ": PASS: IUT passed in creating the site resource quota for an existing tenant ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_010_OK + + /** + * @desc Check that the IUT returns an error on creating a site resource quota with wrong parameters + */ + testcase TC_MEC_MEC048_MEO_CSE_010_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var charstring v_site_id; + var charstring v_tenant_id; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + + //TODO: check uri and uri names of all testcases + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites", + v_headers, + m_http_message_body_json( + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + - + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_010_BR + + + /** + * @desc Check that the IUT returns the site resource quota for a specific tenant and site identifier when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_011_OK() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + var charstring v_tenant_id; + var charstring v_site_id; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + var SiteResourceQuotaInfo v_site_resource_quota_info_1 := valueof(m_site_resource_quota_info(PX_SITE_ID_1,PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)); + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info,v_tenant_id); + f_create_site_resource_quota_info(v_site_resource_quota_info_1, v_site_id, v_tenant_id); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites" & "/" & v_site_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + tc_ac.start; + + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info( + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the site resource quota for a specific tenant and site identifier when requested to a CSE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_011_OK + + /** + * @desc Check that the IUT returns an error on requesting site resource quota info on a not existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_011_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + + //TODO: check uri and uri names of all testcases + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_sites" & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SITE_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_011_NF + + /** + * @desc Check that the IUT updates a site resource quota info for a existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_012_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_tenant_id; + var charstring v_site_id; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + var SiteResourceQuotaInfo v_site_resource_quota_info_1 := valueof(m_site_resource_quota_info(PX_SITE_ID_1,PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)); + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_site_resource_quota_info(v_site_resource_quota_info_1, v_site_id, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & v_tenant_id & "/resources/quota_in_system/" & v_site_id, + v_headers, + m_http_message_body_json( + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info( + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in responds with the list of per site resource quota for a specific tenant ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_location_header; + f_get_header(v_response.response.header, "Location", v_location_header); + // Build expected regex pattern with specific tenant ID + var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_sites/[^/]+"; + if (regexp(v_location_header[0], v_expected_pattern, 0) != "") { + log("Location header matches expected pattern with tenant ID: " & v_tenant_id); + } else { + setverdict(fail, "Location header does NOT match expected pattern: ", v_location_header[0]); + } + } + + log("*** " & testcasename() & ": PASS: IUT passed in updating a site resource quota info for a existing tenant when requested to a CSE ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_012_OK + + /** + * @desc Check that the IUT returns an error updating a site resource quota info for a existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_012_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var charstring v_tenant_id; + var charstring v_site_id; + var charstring_list v_header_location; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + var SiteResourceQuotaInfo v_site_resource_quota_info_1 := valueof(m_site_resource_quota_info(PX_SITE_ID_1,PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)); + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_site_resource_quota_info(v_site_resource_quota_info_1, v_site_id, v_tenant_id); + + f_init_default_headers_list(-, -, v_headers); + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system/" & v_site_id, + v_headers, + m_http_message_body_json( + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( //one of cpuQuota, memoryQuota and, diskQuota shall be present. + PX_SITE_ID_1, + -, + -, + - + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } // End of 'alt' statement + + // Postamble + f_delete_tenant_info(v_tenant_info); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_012_BR + + /** + * @desc Check that the IUT returns an error updating a site resource quota info for a not existing tenant when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_012_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var charstring v_tenant_id; + var charstring v_site_id; + var charstring_list v_header_location; + + var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, omit, omit, PX_CSE_TENANT_NAME_1)); + var SiteResourceQuotaInfo v_site_resource_quota_info_1 := valueof(m_site_resource_quota_info(PX_SITE_ID_1,PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)); + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_tenant_info(v_tenant_info, v_tenant_id); + f_create_site_resource_quota_info(v_site_resource_quota_info_1, v_site_id, v_tenant_id); + f_init_default_headers_list(-, -, v_headers); + + + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system/" & v_site_id, + v_headers, + m_http_message_body_json( + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_012_NF + } // End of group tenant } // End of module AtsMec_SelfServiceEnablementAPI_TestCases diff --git a/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn similarity index 77% rename from ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn rename to ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn index 01e66d0..d418a22 100644 --- a/ttcn/AtsMec_SelfServiceEnablementAPI/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestControl.ttcn @@ -31,6 +31,19 @@ module AtsMec_SelfServiceEnablementAPI_TestControl { execute(TC_MEC_MEC048_MEO_CSE_007_OK()); execute(TC_MEC_MEC048_MEO_CSE_007_NF()); + execute(TC_MEC_MEC048_MEO_CSE_008_OK()); + execute(TC_MEC_MEC048_MEO_CSE_008_NF()); + execute(TC_MEC_MEC048_MEO_CSE_009_OK()); + execute(TC_MEC_MEC048_MEO_CSE_009_OK_01()); + execute(TC_MEC_MEC048_MEO_CSE_009_NF()); + execute(TC_MEC_MEC048_MEO_CSE_010_OK()); + execute(TC_MEC_MEC048_MEO_CSE_010_BR()); + execute(TC_MEC_MEC048_MEO_CSE_011_OK()); + execute(TC_MEC_MEC048_MEO_CSE_011_NF()); + execute(TC_MEC_MEC048_MEO_CSE_012_OK()); + execute(TC_MEC_MEC048_MEO_CSE_012_BR()); + execute(TC_MEC_MEC048_MEO_CSE_012_NF()); + execute(TC_MEC_MEC048_MEO_CSE_013_OK()); execute(TC_MEC_MEC048_MEO_CSE_013_OK_02()); execute(TC_MEC_MEC048_MEO_CSE_014_OK()); diff --git a/ttcn/AtsMec_SelfServiceEnablementAPI/module.mk b/ttcn/AtsMec_SelfServiceEnablement/module.mk similarity index 100% rename from ttcn/AtsMec_SelfServiceEnablementAPI/module.mk rename to ttcn/AtsMec_SelfServiceEnablement/module.mk diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn index a16934c..7e4823d 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn @@ -157,9 +157,9 @@ module SelfServiceEnablementAPI_Functions { m_http_message_body_json( m_body_json_cse_resource_quota_info( m_resource_quota_info( - PX_CPU_QUOTA, - PX_MEMORY_QUOTA, - PX_DISK_QUOTA + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 ) ))))); tc_ac.start; @@ -170,9 +170,9 @@ module SelfServiceEnablementAPI_Functions { mw_http_message_body_json( mw_body_json_cse_resource_quota_info( mw_resource_quota_info( - PX_CPU_QUOTA, - PX_MEMORY_QUOTA, - PX_DISK_QUOTA + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 ) ))))) -> value v_response { tc_ac.stop; @@ -187,4 +187,78 @@ module SelfServiceEnablementAPI_Functions { } // End of function f_create_resource_quota_info - } // End of module SelfServiceEnablementAPI_Functions + function f_create_site_resource_quota_info_list( + inout SiteResourceQuotaInfoList p_site_resource_quota_info, + out charstring_list p_site_resource_quota_info_id_list, + in charstring p_tenant_id + ) runs on HttpComponent { + log(">>> f_create_site_resource_quota_info_list: ", p_site_resource_quota_info); + var charstring v_site_resource_quota_info_id; + for (var integer i := 0; i < lengthof(p_site_resource_quota_info); i := i + 1) { + f_create_site_resource_quota_info(p_site_resource_quota_info[i], -, p_tenant_id); + p_site_resource_quota_info_id_list := p_site_resource_quota_info_id_list & { v_site_resource_quota_info_id }; + } + } // End of function f_create_tenant_info_list + + function f_create_site_resource_quota_info( + inout SiteResourceQuotaInfo p_site_resource_quota_info, + out charstring v_site_id, + in charstring p_tenant_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + log(">>> f_create_site_resource_quota_info: ", p_site_resource_quota_info); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/resources/quota_in_sites", + v_headers, + m_http_message_body_json( + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info( + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) + ))))) -> value v_response { + tc_ac.stop; + p_site_resource_quota_info := v_response.response.body.json_body.siteResourceQuotaInfo; + + // Extract HTTP Location header + var charstring_list site_id; + f_get_header(v_response.response.header, "Location", site_id); + // Extract HTTP subssription id + v_site_id := regexp( + site_id[0], + "?+" & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/(?*)", + 0 + ); + + log("f_create_site_resource_quota_info: INFO: IUT successfully creates the resources: ", p_site_resource_quota_info); + } + [] tc_ac.timeout { + log("f_create_site_resource_quota_info: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_site_resource_quota_info + +} // End of module SelfServiceEnablementAPI_Functions diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn index c0532ba..e677770 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn @@ -37,11 +37,31 @@ module SelfServiceEnablementAPI_Pixits { modulepar Json.String PX_NEW_TENANT_NAME := "newTenat"; - modulepar Json.Integer PX_CPU_QUOTA := 4; + modulepar Json.String PX_SITE_ID_1 := "209153c9-0c28-428f-930f-d61328c30ffd"; - modulepar Json.Integer PX_MEMORY_QUOTA := 2048; + modulepar Json.String PX_SITE_ID_2 := "77e093bc-830c-4bcc-9ad8-6c3eff048335"; - modulepar Json.Integer PX_DISK_QUOTA := 50; + modulepar Json.String PX_SITE_ID_3 := "7d6b6123-b3b7-413e-ae73-b8bb349bda46"; + + modulepar Json.Integer PX_CPU_QUOTA_1 := 4; + + modulepar Json.Integer PX_MEMORY_QUOTA_1 := 2048; + + modulepar Json.Integer PX_DISK_QUOTA_1 := 50; + + modulepar Json.Integer PX_CPU_QUOTA_2 := 4; + + modulepar Json.Integer PX_MEMORY_QUOTA_2 := 2048; + + modulepar Json.Integer PX_DISK_QUOTA_2 := 50; + + modulepar Json.Integer PX_CPU_QUOTA_3 := 4; + + modulepar Json.Integer PX_MEMORY_QUOTA_3 := 2048; + + modulepar Json.Integer PX_DISK_QUOTA_3 := 50; + + modulepar Json.String PX_NON_EXISTENT_SITE_ID := "9344"; modulepar Json.AnyURI PX_CSE_SUB_CALLBACK_URI := "http://127.0.0.1/callback"; diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn index 2c9bb1e..d661a15 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn @@ -70,9 +70,9 @@ module SelfServiceEnablementAPI_Templates { template (omit) SiteResourceQuotaInfo m_site_resource_quota_info( in Json.String p_siteId, - in template (omit) Json.Integer p_cpuQuota, - in template (omit) Json.Integer p_memoryQuota, - in template (omit) Json.Integer p_diskQuota + in template (omit) Json.Integer p_cpuQuota := omit, + in template (omit) Json.Integer p_memoryQuota :=omit, + in template (omit) Json.Integer p_diskQuota := omit ) := { siteId := p_siteId, cpuQuota := p_cpuQuota, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 5576ee7..c6f0c37 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -209,10 +209,13 @@ module LibHttp_JsonMessageBodyTypes { TenantInfo tenantInfo, TenantInfoList tenantInfoList, ResourceQuotaInfo resourceQuotaInfo, + SiteResourceQuotaInfo siteResourceQuotaInfo, + SiteResourceQuotaInfoList siteResourceQuotaInfoList, ResourceUsageSubscription resourceUsageSubscription, SiteResourceUsageSubscription siteResourceUsageSubscription, SiteResourceUsageNotification siteResourceUsageNotification, ResourceUsageNotification resourceUsageNotification, + SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList subscription_link_list_cse, // TODO Add here your custom variants universal charstring raw diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 97d704a..0f8b63d 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -2025,12 +2025,36 @@ module LibHttp_JsonTemplates { resourceQuotaInfo := p_resourceQuotaInfo } // End of template m_body_json_cse_resource_quota_info - template (present) JsonBody mw_body_json_cse_resource_quota_info( + template (present) JsonBody mw_body_json_cse_resource_quota_info ( template (present) ResourceQuotaInfo p_resourceQuotaInfo:= ? ) := { resourceQuotaInfo := p_resourceQuotaInfo } // End of template mw_body_json_cse_resource_quota_info + template (value) JsonBody m_body_json_cse_site_resource_quota_info ( + in template (value) SiteResourceQuotaInfo p_siteResourceQuotaInfo + ) := { + siteResourceQuotaInfo := p_siteResourceQuotaInfo + } // End of template m_body_json_cse_resource_quota_info + + template (present) JsonBody mw_body_json_cse_site_resource_quota_info ( + template (present) SiteResourceQuotaInfo p_siteResourceQuotaInfo:= ? + ) := { + siteResourceQuotaInfo := p_siteResourceQuotaInfo + } // End of template mw_body_json_cse_resource_quota_info + + template (value) JsonBody m_body_json_cse_site_resource_quota_info_list( + in template (value) SiteResourceQuotaInfoList p_siteResourceQuotaInfoList + ) := { + siteResourceQuotaInfoList := p_siteResourceQuotaInfoList + } // End of template m_body_json_fed_cse_tenant_info + + template (present) JsonBody mw_body_json_cse_site_resource_quota_info_list( + template (present) SiteResourceQuotaInfoList p_siteResourceQuotaInfoList := ? + ) := { + siteResourceQuotaInfoList := p_siteResourceQuotaInfoList + } // End of template mw_body_json_cse_tenant_info_list + template (value) JsonBody m_body_json_resource_usage_subscription( in template (value) ResourceUsageSubscription p_resourceUsageSubscription ) := { @@ -2058,13 +2082,13 @@ module LibHttp_JsonTemplates { template (value) JsonBody m_body_json_cse_subscription_link_list( in template (value) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list ) := { - subscriptionLinkList := p_subscription_link_list + subscription_link_list_cse := p_subscription_link_list } // End of template m_body_json_cse_subscription_link_list template (present) JsonBody mw_body_json_cse_subscription_link_list( template (present) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list := ? ) := { - subscriptionLinkList := p_subscription_link_list + subscription_link_list_cse := p_subscription_link_list } // End of template mw_body_json_cse_subscription_link_list template (present) JsonBody m_body_json_site_resource_usage_notification( -- GitLab From 75803dc398299a9bc80e87094610174bb76e8fb7 Mon Sep 17 00:00:00 2001 From: Mubeena Ishaq Date: Mon, 30 Jun 2025 15:31:01 +0500 Subject: [PATCH 33/54] Implement TPs for Subscription/Notification of MEC048 --- .../Json/json_codec_factory_mec048.hh | 46 + ccsrc/Protocols/Json/json_codec_mec048.cc | 104 ++ ccsrc/Protocols/Json/json_codec_mec048.hh | 25 + .../AtsMec_SelfServiceEnablementAPI.cf_ | 66 +- ...ec_SelfServiceEnablementAPI_TestCases.ttcn | 1161 ++++++++++++++++- .../SelfServiceEnablementAPI_Functions.ttcn | 299 +++++ .../ttcn/SelfServiceEnablementAPI_Pixits.ttcn | 2 +- .../SelfServiceEnablementAPI_Templates.ttcn | 141 +- ...lfServiceEnablementAPI_TypesAndValues.ttcn | 77 +- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 3 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 24 +- 11 files changed, 1820 insertions(+), 128 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec048.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec048.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec048.hh diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec048.hh b/ccsrc/Protocols/Json/json_codec_factory_mec048.hh new file mode 100644 index 0000000..3049de1 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec048.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec048.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 // TTF T043 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec048.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec048 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec048: public codec_factory { + static json_codec_factory_mec048 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec048 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec048() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec048", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec048(); + }; +}; // End of class json_codec_factory_mec048 diff --git a/ccsrc/Protocols/Json/json_codec_mec048.cc b/ccsrc/Protocols/Json/json_codec_mec048.cc new file mode 100644 index 0000000..9d8cdf6 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec048.cc @@ -0,0 +1,104 @@ +#include +#include +#include + +#include "json_codec_factory_mec048.hh" + +#include "loggers.hh" + +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec048::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +{ + loggers::get_instance().log_msg(">>> json_codec_mec048::encode: ", (const Base_Type&)msg); + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_tenantInfo)) { + const SelfServiceEnablementAPI__TypesAndValues::TenantInfo& tenant_info = msg.tenantInfo(); + tenant_info.encode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"TenantInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_resourceUsageSubscription)) { + const SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription& resource_usage_subscription = msg.resourceUsageSubscription(); + resource_usage_subscription.encode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"ResourceUsageSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_siteResourceUsageSubscription)) { + const SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription& site_resource_usage_subscription = msg.siteResourceUsageSubscription(); + site_resource_usage_subscription.encode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"SiteResourceUsageSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec048::encode"); + return 0; +} + +int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +{ + loggers::get_instance().log_msg(">>> json_codec_mec048::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec048::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec048::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec048::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + // ..and create the decoding buffer + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec048::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + + if (it->second.find("\"tenantId\"") != std::string::npos) { // Be careful to the order + if (it->second[0] == '[') { + SelfServiceEnablementAPI__TypesAndValues::TenantInfoList tenant_info_list; + tenant_info_list.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.tenantInfoList() = tenant_info_list; + } else { + SelfServiceEnablementAPI__TypesAndValues::TenantInfo tenant_info; + tenant_info.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.tenantInfo() = tenant_info; + } + } else if ( + (it->second.find("\"_links\"") != std::string::npos) && + ((it->second.find("\"subscriptions\"") != std::string::npos) || (it->second.find("\"subscriptionType\"") == std::string::npos)) + ) { + SelfServiceEnablementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(SelfServiceEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList__cse() = subscription_link_list; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"ResourceUsageSubscription\"") != std::string::npos)) { + SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription resource_usage_subscription; + resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.resourceUsageSubscription() = resource_usage_subscription; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SiteResourceUsageSubscription\"") != std::string::npos)) { + SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription site_resource_usage_subscription; + site_resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.siteResourceUsageSubscription() = site_resource_usage_subscription; + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec048::decode: ", (const Base_Type&)msg); + return 0; +} + +json_codec_factory_mec048 json_codec_factory_mec048::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec048.hh b/ccsrc/Protocols/Json/json_codec_mec048.hh new file mode 100644 index 0000000..b15860e --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec048.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" + +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec048: public json_codec +{ +public: + explicit json_codec_mec048() : json_codec() { }; + virtual ~json_codec_mec048() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec048 diff --git a/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ b/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ index 6a30bc8..5a8b1e6 100644 --- a/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ +++ b/etc/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI.cf_ @@ -62,6 +62,38 @@ LogEventTypes:= Yes # In this section you can specify what parts of your test suite you want to execute. #AtsMec_TestControl.control +# Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - No query parameters +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_001_OK +# Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - customerId attribute as query parameter +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_001_OK_02 +# Check that the IUT responds with a list of all available tenantInfo when requested to a CSE - customerName as query parameter +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_001_OK_03 +# Check that the IUT creates a new tenantInfo when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_002_OK +# Check that the IUT responds with an error on creating a tenantInfo with resourceUseInfo and siteList +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_002_BR +# Check that the IUT responds with a specific tenantInfo when requested to a MEC Consumer +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_003_OK +# Check that the IUT returns an error when requesting a not existing tenantInfo to a MEC Consumer +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_003_NF +# Check that the IUT updates an existing tenantInfo when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_004_OK +# Check that the IUT returns an error on updating a not existing tenantInfo requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_004_NF +# Check that the IUT returns an error on updating with invalid values tenantInfo requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_004_BR +# Check that the IUT removes a tenantInfo when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_005_OK +# Check that the IUT returns an error on deleting a not existing tenantInfo when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_005_NF +# Check that the IUT returns a resourceQuotaInfo for a specific tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_006_OK +# Check that the IUT returns an error on retrieving resourceQuotaInfo for a not existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_006_NF +# Check that the IUT updates the resourceQuotaInfo for an existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_007_OK +# Check that the IUT returns an error on updating the resourceQuotaInfo for a not existing tenant when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_007_NF # Check that the IUT creates the resourceQuotaInfo for an existing tenant when requested to a CSE #AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_008_OK # Check that the IUT returns an error on creating the resourceQuotaInfo for a not existing tenant when requested to a CSE @@ -86,10 +118,36 @@ AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_009_OK_01 #AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_012_BR # Check that the IUT returns an error updating a site resource quota info for a not existing tenant when requested to a CSE #AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_012_NF - - - - +# Check that the IUT returns the list of subscriptions when requested to a CSE - no filter +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_013_OK +# Check that the IUT returns the list of subscriptions when requested to a CSE - subscription_type filter +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_013_OK_02 +# Check that the IUT creates a new subscription when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_014_OK +# Check that the IUT creates a new subscription when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_014_OK_02 +# Check that the IUT returns an error on creating a new subscription when requested to a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_014_BR +# Check that the IUT returns a subscription when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_015_OK +# Check that the IUT returns an error on requesting a not existing subscription when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_015_NF +# Check that the IUT updates an existing subscription when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_016_OK +# Check that the IUT returns an error updating an not existing subscription when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_016_NF +# Check that the IUT returns an error updating an existing subscription with wrong parameters when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_016_BR +# Check that the IUT deletes an existing subscription when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_017_OK +# Check that the IUT returns an error on a deletion of a not existing subscription when requested by a CSE +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_017_NF +# Check that the CSE sends a site resource usage notification if the CSE has an associated subscription and the event is generated +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_018_OK +# Check that the CSE sends a resource usage notification if the CSE has an associated subscription and the event is generated +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_019_OK +# Check that the CSE sends a notification on subscription expiration if the CSE has an associated subscription and the event is generated +#AtsMec_SelfServiceEnablementAPI_TestCases.TC_MEC_MEC048_MEO_CSE_020_OK [GROUPS] diff --git a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn index 95ed72c..eb2e0b3 100644 --- a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn @@ -21,6 +21,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // LibMec import from LibMec_Functions all; import from LibMec_Pics all; + import from LibMec_Templates all; import from LibMec_Pixits all; group tenant { @@ -470,7 +471,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_CSE_TENANT_ID_1, "UTF-8")), + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_CSE_TENANT_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -816,7 +817,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Local variables var Headers v_headers; var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); - var ResourceQuotaInfo v_resource_quota_info := valueof(m_resource_quota_info(PX_CPU_QUOTA, PX_MEMORY_QUOTA, PX_DISK_QUOTA)); + var ResourceQuotaInfo v_resource_quota_info := valueof(m_resource_quota_info(PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)); var charstring v_tenant_id; // Test control if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { @@ -851,9 +852,9 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_cse_resource_quota_info( mw_resource_quota_info( - PX_CPU_QUOTA, - PX_MEMORY_QUOTA, - PX_DISK_QUOTA + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 ) ))))) { tc_ac.stop; @@ -933,7 +934,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Local variables var Headers v_headers; var TenantInfo v_tenant_info := valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)); - var ResourceQuotaInfo v_resource_quota_info := valueof(m_resource_quota_info(PX_CPU_QUOTA, PX_MEMORY_QUOTA, PX_DISK_QUOTA)); + var ResourceQuotaInfo v_resource_quota_info := valueof(m_resource_quota_info(PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1)); var charstring v_tenant_id; // Test control @@ -1133,6 +1134,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { /** * @desc Check that the IUT returns an error on creating the resourceQuotaInfo for a not existing tenant when requested to a CSE */ + testcase TC_MEC_MEC048_MEO_CSE_008_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; @@ -1164,25 +1166,25 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { PX_MEMORY_QUOTA_1, PX_DISK_QUOTA_1 )))))); - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found - )) { - tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC048_MEO_CSE_008_NF + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_008_NF /** * @desc Check that the IUT returns the list of per site resource quota for a specific tenant when requested to a CSE - No filter @@ -1225,7 +1227,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - tc_ac.start; + tc_ac.start; alt { [] httpPort.receive( @@ -1270,7 +1272,6 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_MEC048_MEO_CSE_009_OK - /** * @desc Check that the IUT returns the list of per site resource quota for a specific tenant when requested to a CSE - siteId filter" */ @@ -1546,7 +1547,6 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_MEC048_MEO_CSE_010_BR - /** * @desc Check that the IUT returns the site resource quota for a specific tenant and site identifier when requested to a CSE */ @@ -1881,4 +1881,1109 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { } // End of group tenant + group subscription{ + + /** + * @desc Check that the IUT returns the list of subscriptions when requested to a CSE - no filter + */ + testcase TC_MEC_MEC048_MEO_CSE_013_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ResourceUsageSubscription v_resource_usage_subscription; + var SiteResourceUsageSubscription v_site_resource_usage_subscription; + var ResourceUsageSubscription v_resource_usage_subscription_2; + var charstring v_res_usage_sub_id; + var charstring v_site_res_usage_sub_id; + var charstring v_res_usage_sub_id_2; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_resource_usage_subscription(v_resource_usage_subscription, v_res_usage_sub_id); + f_create_site_resource_usage_subscription(v_site_resource_usage_subscription, v_site_res_usage_sub_id); + f_create_resource_usage_subscription_2(v_resource_usage_subscription_2, v_res_usage_sub_id_2); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_subscription_link_list( + mw_subscription_link_list( + mw_links_sub( + -, + { + mw_subscription( + v_resource_usage_subscription.links.self_.href, + "ResourceUsageSubscription" + ), + mw_subscription( + v_site_resource_usage_subscription.links.self_.href, + "SiteResourceUsageSubscription" + ), + mw_subscription( + v_resource_usage_subscription_2.links.self_.href, + "ResourceUsageSubscription" + ) + } + ) + + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of SubscriptionLinks ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_res_usage_sub_id); + f_delete_cse_subscription(v_site_res_usage_sub_id); + f_delete_cse_subscription(v_res_usage_sub_id_2); + + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_013_OK + + /** + * @desc Check that the IUT returns the list of subscriptions when requested to a CSE - subscription_type filter + */ + testcase TC_MEC_MEC048_MEO_CSE_013_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ResourceUsageSubscription v_resource_usage_subscription; + var SiteResourceUsageSubscription v_site_resource_usage_subscription; + var ResourceUsageSubscription v_resource_usage_subscription_2; + var charstring v_res_usage_sub_id; + var charstring v_site_res_usage_sub_id; + var charstring v_res_usage_sub_id_2; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_resource_usage_subscription(v_resource_usage_subscription, v_res_usage_sub_id); + f_create_site_resource_usage_subscription(v_site_resource_usage_subscription, v_site_res_usage_sub_id); + f_create_resource_usage_subscription_2(v_resource_usage_subscription_2, v_res_usage_sub_id_2); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "?" & "subscription_type=ResourceUsageSubscription", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_subscription_link_list( + mw_subscription_link_list( + mw_links_sub( + -, + { + mw_subscription( + v_resource_usage_subscription.links.self_.href, + "ResourceUsageSubscription" + ), + mw_subscription( + v_resource_usage_subscription_2.links.self_.href, + "ResourceUsageSubscription" + ) + } + ) + + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of SubscriptionLinks ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_res_usage_sub_id); + f_delete_cse_subscription(v_site_res_usage_sub_id); + f_delete_cse_subscription(v_res_usage_sub_id_2); + + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_013_OK_02 + + /** + * @desc Check that the IUT creates a new subscription when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_014_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_resource_usage_subscription( + m_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + omit, omit, + omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + *, + *, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in resourceUsgaeSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_CSE_LIST_SUBS & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a resourceUsageSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_subscription_id); + + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_014_OK + + /** + * @desc Check that the IUT creates a new subscription when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_014_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var charstring v_subscription_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in siteResourceUsgaeSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_CSE_LIST_SUBS & "/(?*)", + 0 + ); + } + log("*** " & testcasename() & ": PASS: IUT successfully responds with a siteResourceUsageSubscription, SubscriptionId: ", v_subscription_id," ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_subscription_id); + + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_014_OK_02 + + /** + * @desc Check that the IUT returns an error on creating a new subscription when requested to a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_014_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_resource_usage_subscription( + m_resource_usage_subscription( + omit, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_014_BR + + /** + * @desc Check that the IUT returns a subscription when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_015_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ResourceUsageSubscription v_resource_usage_subscription; + var SiteResourceUsageSubscription v_site_resource_usage_subscription; + var ResourceUsageSubscription v_resource_usage_subscription_2; + var charstring v_res_usage_sub_id; + var charstring v_site_res_usage_sub_id; + var charstring v_res_usage_sub_id_2; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_resource_usage_subscription(v_resource_usage_subscription, v_res_usage_sub_id); + f_create_site_resource_usage_subscription_2(v_site_resource_usage_subscription, v_site_res_usage_sub_id); + f_create_resource_usage_subscription_2(v_resource_usage_subscription_2, v_res_usage_sub_id_2); + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "?" & "subscription_type=SiteResourceUsageSubscription", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + *, omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a SiteResourceUsageSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_res_usage_sub_id); + f_delete_cse_subscription(v_site_res_usage_sub_id); + f_delete_cse_subscription(v_res_usage_sub_id_2); + + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_015_OK + + /** + * @desc Check that the IUT returns an error on requesting a not existing subscription when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_015_NF() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_015_NF + + /** + * @desc Check that the IUT updates an existing subscription when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_016_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SiteResourceUsageSubscription v_site_resource_usage_subscription; + var charstring v_site_res_usage_sub_id; + var Links v_links; + var HttpMessage v_response; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_site_resource_usage_subscription(v_site_resource_usage_subscription, v_site_res_usage_sub_id, v_links); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "/" & v_site_res_usage_sub_id, + v_headers, + m_http_message_body_json( + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + v_links, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully updates the siteResourceUsageSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_site_res_usage_sub_id); + + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_016_OK + + /** + * @desc Check that the IUT returns an error updating an not existing subscription when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_016_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_016_NF + + /** + * @desc Check that the IUT returns an error updating an existing subscription with wrong parameters when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_016_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SiteResourceUsageSubscription v_site_resource_usage_subscription; + var charstring v_site_res_usage_sub_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_site_resource_usage_subscription(v_site_resource_usage_subscription, v_site_res_usage_sub_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_resource_usage_subscription( + m_resource_usage_subscription( + omit, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_016_BR + + /** + * @desc Check that the IUT deletes an existing subscription when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_017_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ResourceUsageSubscription v_resource_usage_subscription; + var charstring v_res_usage_sub_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_resource_usage_subscription(v_resource_usage_subscription, v_res_usage_sub_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "/" & v_res_usage_sub_id, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully deletes the resourceUsageSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_017_OK + + /** + * @desc Check that the IUT returns an error on a deletion of a not existing subscription when requested by a CSE + */ + testcase TC_MEC_MEC048_MEO_CSE_017_NF() runs on HttpComponent system HttpTestAdapter { + + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "/" & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_017_NF + + } // End of group subscription + + group notification{ + + /** + * @desc Check that the CSE sends a site resource usage notification if the CSE has an associated subscription and the event is generated + */ + testcase TC_MEC_MEC048_MEO_CSE_018_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var SiteResourceUsageSubscription v_site_resource_usage_subscription; + var charstring v_site_res_usage_sub_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_site_resource_usage_subscription_2(v_site_resource_usage_subscription, v_site_res_usage_sub_id); + action("Trigger notification"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + oct2char(unichar2oct(PX_CSE_SUB_CALLBACK_URI, "UTF-8")), + -, + mw_http_message_body_json( + mw_body_json_site_resource_usage_notification( + mw_site_resource_usage_notification( + { seconds := 1684748494, nanoSeconds := 123456789 }, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + mw_site_resource_use_info( + PX_SITE_ID_1, + 5 + ) + )))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_site_res_usage_sub_id); + f_cf_01_http_notif_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_018_OK + + /** + * @desc Check that the CSE sends a resource usage notification if the CSE has an associated subscription and the event is generated + */ + testcase TC_MEC_MEC048_MEO_CSE_019_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ResourceUsageSubscription v_resource_usage_subscription; + var charstring v_res_usage_sub_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_resource_usage_subscription_2(v_resource_usage_subscription, v_res_usage_sub_id); + action("Trigger notification"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + oct2char(unichar2oct(PX_CSE_SUB_CALLBACK_URI, "UTF-8")), + -, + mw_http_message_body_json( + mw_body_json_resource_usage_notification( + mw_resource_usage_notification( + *, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + mw_resource_use_info ( + 5 + ) + )))))) { + tc_wait.stop; + + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send( + m_http_response( + m_http_response_ok_no_body( + v_headers + ))); + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_res_usage_sub_id); + f_cf_01_http_notif_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_019_OK + + /** + * @desc Check that the CSE sends a notification on subscription expiration if the CSE has an associated subscription and the event is generated + */ + testcase TC_MEC_MEC048_MEO_CSE_020_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ResourceUsageSubscription v_resource_usage_subscription; + var charstring v_res_usage_sub_id; + + // Test control + if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_SERVICES and PICS_CSE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_create_resource_usage_subscription_2(v_resource_usage_subscription, v_res_usage_sub_id); + action("Wait for subscription expiration"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + oct2char(unichar2oct(PX_CSE_SUB_CALLBACK_URI, "UTF-8")), + -, + mw_http_message_body_json( + mw_body_json_cse_expiry_notification( + mw_cse_expiry_notification( + -, + { seconds := 1684748494, nanoSeconds := 123456789 } + ) + ))))) { + tc_wait.stop; + + // Send 204 No Content + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); + + log("*** " & testcasename() & ": PASS: IUT successfully sends expiry notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_cse_subscription(v_res_usage_sub_id); + f_cf_01_http_notif_down(); + + } // End of testcase TC_MEC_MEC048_MEO_CSE_020_OK + + } //End of group notification + } // End of module AtsMec_SelfServiceEnablementAPI_TestCases diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn index 7e4823d..d65a164 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn @@ -261,4 +261,303 @@ module SelfServiceEnablementAPI_Functions { } // End of function f_create_site_resource_quota_info + function f_create_resource_usage_subscription( + out ResourceUsageSubscription p_resource_usage_subscription, + out charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_resource_usage_subscription( + m_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + omit, omit, omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + m_notification_trigger( + e_tt_ten, + 5, + true + ) + ) + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + *, + *, + ?,?,? + ) + ))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subscription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_CSE_LIST_SUBS & "/(?*)", + 0 + ); + p_resource_usage_subscription := v_response.response.body.json_body.resourceUsageSubscription; + log("f_create_resource_usage_subscription: INFO: IUT successfully responds to the subscription: ", p_resource_usage_subscription); + log("f_create_resource_usage_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_resource_usage_subscription: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_resource_usage_subscription + + function f_create_site_resource_usage_subscription( + out SiteResourceUsageSubscription p_site_resource_usage_subscription, + out charstring p_subscription_id, + out Links p_links + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + omit, omit, omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger( + e_tt_ten, + 5, + true + ) + ) + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + *, + *, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID + ) + ))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subscription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_CSE_LIST_SUBS & "/(?*)", + 0 + ); + p_site_resource_usage_subscription := v_response.response.body.json_body.siteResourceUsageSubscription; + p_links := v_response.response.body.json_body.siteResourceUsageSubscription.links; + + log("f_create_site_resource_usage_subscription: INFO: IUT successfully responds to the subscription: ", p_site_resource_usage_subscription); + log("f_create_site_resource_usage_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_site_resource_usage_subscription: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_site_resource_usage_subscription + + function f_create_resource_usage_subscription_2( + out ResourceUsageSubscription p_resource_usage_subscription, + out charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_resource_usage_subscription( + m_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + omit, omit, omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + ) + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + *, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID + ) + ))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subscription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_CSE_LIST_SUBS & "/(?*)", + 0 + ); + p_resource_usage_subscription := v_response.response.body.json_body.resourceUsageSubscription; + log("f_create_resource_usage_subscription_2: INFO: IUT successfully responds to the subscription: ", p_resource_usage_subscription); + log("f_create_resource_usage_subscription_2: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_resource_usage_subscription_2: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_create_resource_usage_subscription_2 + + function f_create_site_resource_usage_subscription_2( + out SiteResourceUsageSubscription p_site_resource_usage_subscription, + out charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, omit, + omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id("site-001"), + m_site_id("site-002") }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + ) + ))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subscription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_CSE_LIST_SUBS & "/(?*)", + 0 + ); + p_site_resource_usage_subscription := v_response.response.body.json_body.siteResourceUsageSubscription; + log("f_create_site_resource_usage_subscription: INFO: IUT successfully responds to the subscription: ", p_site_resource_usage_subscription); + log("f_create_site_resource_usage_subscription: INFO: p_subscription_id: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_resource_usage_subscription: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_site_resource_usage_subscription + + function f_delete_cse_subscription( + in charstring p_subscription_id + ) runs on HttpComponent { + // Local variables + var Headers v_headers; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_CSE_LIST_SUBS & "/" & p_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + log("f_delete_cse_subscription: INFO: Subscription successfully deleted: ", p_subscription_id); + } + [] tc_ac.timeout { + log("f_delete_cse_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + + } // End of function f_delete_cse_subscription + } // End of module SelfServiceEnablementAPI_Functions diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn index e677770..6ed7a28 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn @@ -13,7 +13,7 @@ module SelfServiceEnablementAPI_Pixits { modulepar Json.String PX_CSE_CUSTOMER_NAME_1 := "customerName"; - modulepar Json.String PX_CSE_TENANT_ID_1 := ""; + modulepar Json.String PX_CSE_TENANT_ID := ""; modulepar Json.String PX_CSE_TENANT_NAME_1 := "tenantX"; diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn index d661a15..8e14ba5 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn @@ -13,14 +13,14 @@ module SelfServiceEnablementAPI_Templates { import from SelfServiceEnablementAPI_TypesAndValues all; template (omit) TenantInfo m_tenant_info( - in Json.String p_customerId, - in Json.String p_customerName, - in template (omit) Json.String p_customerCategory, - in template (omit) Json.String p_tenantId, - in Json.String p_tenantName, - in template (omit) ResourceInfo p_resourceUseInfo := omit, - in template (omit) SiteInfo p_siteList := omit - ) := { + in Json.String p_customerId, + in Json.String p_customerName, + in template (omit) Json.String p_customerCategory, + in template (omit) Json.String p_tenantId, + in Json.String p_tenantName, + in template (omit) ResourceInfo p_resourceUseInfo := omit, + in template (omit) SiteInfo p_siteList := omit + ) := { customerId := p_customerId, customerName := p_customerName, customerCategory := p_customerCategory, @@ -161,7 +161,7 @@ module SelfServiceEnablementAPI_Templates { in template (omit) Links p_links := omit, in Json.String p_customerId, in Json.String p_tenantId, - in template (value) SiteId p_siteList, + in template (value) SiteIdList p_siteList, in template (value) NotificationTrigger p_notificationTrigger, in template (omit) TimeStamp p_expiryDeadline := omit ) := { @@ -184,7 +184,7 @@ module SelfServiceEnablementAPI_Templates { template Links p_links := *, template (present) Json.String p_customerId := ?, template (present) Json.String p_tenantId := ?, - template (present) SiteId p_siteList := ?, + template (present) SiteIdList p_siteList := ?, template (present) NotificationTrigger p_notificationTrigger := ?, template TimeStamp p_expiryDeadline := * ) := { @@ -201,13 +201,13 @@ module SelfServiceEnablementAPI_Templates { } // End of template mw_site_resource_usage_subscription template (value) SubscriptionLinkList m_subscription_link_list( - in template (value) Links p_links + in template (value) LinksSub p_links ) := { links := p_links } // End of template m_subscription_link_list template (present) SubscriptionLinkList mw_subscription_link_list( - template (present) Links p_links := ? + template (present) LinksSub p_links := ? ) := { links := p_links } // End of template mw_subscription_link_list @@ -297,14 +297,14 @@ module SelfServiceEnablementAPI_Templates { } // End of template mw_site_resource_usage_notification template (omit) SiteResourceUseInfo m_site_resource_use_info( - in Json.String p_siteId, - in template (omit) Json.Integer p_cpuUsed, - in template (omit) Json.Integer p_cpuRemain, - in template (omit) Json.Integer p_memoryUsed, - in template (omit) Json.Integer p_memoryRemain, - in template (omit) Json.Integer p_diskUsed, - in template (omit) Json.Integer p_diskRemain - ) := { + in Json.String p_siteId, + in template (omit) Json.Integer p_cpuUsed, + in template (omit) Json.Integer p_cpuRemain, + in template (omit) Json.Integer p_memoryUsed, + in template (omit) Json.Integer p_memoryRemain, + in template (omit) Json.Integer p_diskUsed, + in template (omit) Json.Integer p_diskRemain + ) := { siteId := p_siteId, cpuUsed := p_cpuUsed, cpuRemain := p_cpuRemain, @@ -315,14 +315,14 @@ module SelfServiceEnablementAPI_Templates { } // End of template m_site_resource_use_info template (present) SiteResourceUseInfo mw_site_resource_use_info( - template (present) Json.String p_siteId := ?, - template Json.Integer p_cpuUsed := *, - template Json.Integer p_cpuRemain := *, - template Json.Integer p_memoryUsed := *, - template Json.Integer p_memoryRemain := *, - template Json.Integer p_diskUsed := *, - template Json.Integer p_diskRemain := * - ) := { + template (present) Json.String p_siteId := ?, + template Json.Integer p_cpuUsed := *, + template Json.Integer p_cpuRemain := *, + template Json.Integer p_memoryUsed := *, + template Json.Integer p_memoryRemain := *, + template Json.Integer p_diskUsed := *, + template Json.Integer p_diskRemain := * + ) := { siteId := p_siteId, cpuUsed := p_cpuUsed, cpuRemain := p_cpuRemain, @@ -332,40 +332,53 @@ module SelfServiceEnablementAPI_Templates { diskRemain := p_diskRemain } // End of template mw_site_resource_use_info - template (value) ExpiryNotification m_expiry_notification( - in template (value) Links p_links, - in template (value) TimeStamp p_expiryDeadline - ) := { - notificationType := "ExpiryNotification", - expiryDeadline := p_expiryDeadline, - links := p_links + template (value) ExpiryNotification m_cse_expiry_notification( + in template (value) LinkExpiry p_links, + in template (value) TimeStamp p_expiryDeadline + ) := { + notificationType := "ExpiryNotification", + links := p_links, + expiryDeadline := p_expiryDeadline } // End of template m_expiry_notification - template (present) ExpiryNotification mw_expiry_notification( - template (present) Links p_links := ?, - template (present) TimeStamp p_expiryDeadline := ? - ) := { + template (present) ExpiryNotification mw_cse_expiry_notification( + template (present) LinkExpiry p_links := ?, + template (present) TimeStamp p_expiryDeadline := ? + ) := { notificationType := "ExpiryNotification", - expiryDeadline := p_expiryDeadline, - links := p_links + links := p_links, + expiryDeadline := p_expiryDeadline + } // End of template mw_expiry_notification template (value) Links m_links( - in LinkType p_self_, - in template (omit) Subscriptions p_subscription := omit + in template (value) LinkType p_self_ ) :={ - self_ := p_self_, - subscription := p_subscription + self_ := p_self_ } // End of template m_links template (present) Links mw_links( - template (present) LinkType p_self_ := ?, - template Subscriptions p_subscription := * - ) :={ - self_ := p_self_, - subscription := p_subscription + template (present) LinkType p_self_ := ? + ) :={ + self_ := p_self_ } // End of template mw_links + template (value) LinksSub m_links_sub( + in template (value) LinkType p_self_, + in template (omit) Subscriptions p_subscription := omit + ) :={ + self_ := p_self_, + subscriptions := p_subscription + } // End of template m_links_sub + + template (present) LinksSub mw_links_sub( + template (present) LinkType p_self_ := ?, + template Subscriptions p_subscription := * + ) :={ + self_ := p_self_, + subscriptions := p_subscription + } // End of template mw_links_sub + template (value) Subscription m_subscription( in Json.AnyURI p_href, in Json.String p_subscriptionType @@ -382,8 +395,8 @@ module SelfServiceEnablementAPI_Templates { subscriptionType := p_subscriptionType } // End of template mw_subscription - template SiteInfo m_site_info( - in template Json.String p_siteId, + template (omit) SiteInfo m_site_info( + in Json.String p_siteId, in template (omit) ResourceInfo p_resourceInfo := omit ) := { siteId := p_siteId, @@ -398,15 +411,15 @@ module SelfServiceEnablementAPI_Templates { resourceInfo := p_resourceInfo } // End of template mw_site_info - template SiteId m_site_id( - in template Json.String p_siteId - ) := { + template (value) SiteId m_site_id( + in Json.String p_siteId + ) := { siteId := p_siteId } // End of template m_site_id template (present) SiteId mw_site_id( - template (present) Json.String p_siteId := ? - ) := { + template (present) Json.String p_siteId := ? + ) := { siteId := p_siteId } // End of template mw_site_id @@ -452,6 +465,18 @@ module SelfServiceEnablementAPI_Templates { diskQuota := p_diskQuota, diskUsed := p_diskUsed, diskRemain := p_diskRemain -} // End of template mw_resource_info + } // End of template mw_resource_info + + template (value) LinkExpiry m_link_expiry( + in template (value) LinkType p_subscription + ) := { + subscription := p_subscription + } //End of temaplate m_link_expiry + + template (present) LinkExpiry mw_link_expiry( + template (present) LinkType p_subscription := ? + ) := { + subscription := p_subscription + } //End of temaplate mw_link_expiry } // End of module SelfServiceEnablementAPI_Templates diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn index 9de9a4b..7fa6b01 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn @@ -15,7 +15,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantName Name of the tenant * @param resourceUseInfo Resource in the MEC system that can be used by the tenant * @param siteList A list of edge sites that can be used by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.2.2-1: Definition of type TenantInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.2-1: Definition of type TenantInfo */ type record TenantInfo { Json.String customerId, @@ -33,7 +33,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.2.3-1: Definition of type ResourceQuotaInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.3-1: Definition of type ResourceQuotaInfo */ type record ResourceQuotaInfo { Json.Integer cpuQuota optional, @@ -47,7 +47,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.2.4-1: Definition of type SiteResourceQuotaInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.4-1: Definition of type SiteResourceQuotaInfo */ type record SiteResourceQuotaInfo { Json.String siteId, @@ -68,7 +68,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantId Identifier of the tenant * @param notificationTrigger Set for trigger-based event notification reporting * @param expiryDeadline The expiration time of the subscription determined by the CSE - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.2-1: Definition of type ResourceUsageSubscription + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2-1: Definition of type ResourceUsageSubscription */ type record ResourceUsageSubscription { Json.String subscriptionType, @@ -95,7 +95,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantId Identifier of the tenant * @param notificationTrigger Set for trigger-based event notification reporting * @param expiryDeadline The expiration time of the subscription determined by the CSE - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.3-1: Definition of type SiteResourceUsageSubscription + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.3-1: Definition of type SiteResourceUsageSubscription */ type record SiteResourceUsageSubscription { Json.String subscriptionType, @@ -105,7 +105,7 @@ module SelfServiceEnablementAPI_TypesAndValues { Links links optional, Json.String customerId, Json.String tenantId, - SiteId siteList, + SiteIdList siteList, NotificationTrigger notificationTrigger, TimeStamp expiryDeadline optional } with { @@ -115,10 +115,10 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents a list of links related to currently existing subscriptions for the service consumer * @param _links List of hyperlinks related to the resource - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.4-1: Attributes of type SubscriptionLinkList + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.4-1: Attributes of type SubscriptionLinkList */ type record SubscriptionLinkList { - Links links + LinksSub links } with { variant (links) "name as '_links'"; } @@ -130,7 +130,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param customerId Identifier to uniquely specify the customer for the subscription * @param tenantId Identifier of the tenant * @param resourceUseInfo Resource usage in the MEC system by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.2-1: Attributes of type ResourceUsageNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.2-1: Attributes of type ResourceUsageNotification */ type record ResourceUsageNotification { Json.String notificationType, @@ -148,7 +148,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.2-1: Attributes of type ResourceUseInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.2-1: Attributes of type ResourceUseInfo */ type record ResourceUseInfo { Json.Integer cpuUsed optional, @@ -166,7 +166,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param customerId Identifier to uniquely specify the customer for the subscriptionc * @param tenantId Identifier of the tenant * @param resourceUseInfo Resource usage in the MEC system by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification */ type record SiteResourceUsageNotification { Json.String notificationType, @@ -185,7 +185,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of type SiteResourceUseInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type SiteResourceUseInfo */ type record SiteResourceUseInfo { Json.String siteId, @@ -202,12 +202,12 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param notificationType Shall be set to "ExpiryNotification" * @param _links Object containing hyperlinks related to the resource * @param expiryDeadline Time stamp - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.4-1: Attributes of type ExpiryNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.4-1: Attributes of type ExpiryNotification */ type record ExpiryNotification { Json.String notificationType, - TimeStamp expiryDeadline, - Links links + LinkExpiry links, + TimeStamp expiryDeadline } with { variant (links) "name as '_links'"; } @@ -216,7 +216,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @desc This type represents the information on an edge site * @param siteId Identifier of an edge site * @param resourceInfo Resource information in the edge site that is associated with a specific tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.5.2-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.2-1: Attributes of type SiteInfo */ type record SiteInfo { Json.String siteId, @@ -234,7 +234,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param diskQuota Allowed amount of disk (GB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.4.3-1: Attributes of type ResourceInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type ResourceInfo */ type record ResourceInfo { Json.Integer cpuQuota optional, @@ -252,7 +252,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @desc This type represents the information on an edge site * @param siteId Identifier of an edge site * @param resourceInfo Resource information in the edge site that is associated with a specific tenant - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.5.2-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.2-1: Attributes of type SiteInfo */ type record NotificationTrigger { TriggerType triggerType, @@ -262,7 +262,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Trigger for the notification - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.2-1: Enumeration TriggerType + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2-1: Enumeration TriggerType */ type enumerated TriggerType { e_tt_ten (10), // 10 = Notification trigged based on the number of used CPUs @@ -278,11 +278,11 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Hyperlink related to the resource * @member subscription URI identifying the subscription for the test notification - * @see ETSI GS MEC 048 V3.1.1 (2024-04) : Definition of type Links - */ - type record Links { + * @see ETSI GS MEC 048 V3.2.1 (2025-09) : Definition of type Links + */ + type record LinksSub { LinkType self_, - Subscriptions subscription optional + Subscriptions subscriptions optional } with { variant (self_) "name as 'self'"; } @@ -291,18 +291,30 @@ module SelfServiceEnablementAPI_TypesAndValues { * @desc The service consumer's subscriptions * @member href The URI referring to the subscription * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.3.4-11: Type Subscription + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.4-11: Type Subscription */ + type record Subscription { Json.AnyURI href, Json.String subscriptionType } type set of Subscription Subscriptions; + /** + * @desc Hyperlink related to the resource + * @member subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2: Attributes of the Links + */ + type record Links { + LinkType self_ + } with { + variant (self_) "name as 'self'"; + } + /** * @desc This type represents a type of link * @member href URI referring to a resource - * @see ETSI GS MEC 048 V3.1.1 (2024-04) : Definition of type LinkType + * @see ETSI GS MEC 048 V3.2.1 (2025-09) : Definition of type LinkType */ type record LinkType { Json.AnyURI href @@ -311,22 +323,27 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents the identifier of an edge site. * @param siteId Identifier of an edge site - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Table 6.5.5-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.5-1: Attributes of type SiteInfo */ type record SiteId { Json.String siteId } + type set of SiteId SiteIdList; /** * @desc This type represents configuration for the delivery of subscription notifications over Websockets * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested - * @see ETSI GS MEC 048 V3.1.1 (2024-04) Type: WebsockNotifConfig + * @see ETSI GS MEC 048 V3.2.1 (2025-09) Type: WebsockNotifConfig */ type record WebsockNotifConfig { Json.AnyURI websocketUri optional, Json.Bool requestWebsocketUri optional -} with { - encode "JSON" -} + } with { + encode "JSON" + } + + type record LinkExpiry { + LinkType subscription + } } // End of module SelfServiceEnablementAPI_TypesAndValues \ No newline at end of file diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index c6f0c37..fc74f4e 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -215,7 +215,8 @@ module LibHttp_JsonMessageBodyTypes { SiteResourceUsageSubscription siteResourceUsageSubscription, SiteResourceUsageNotification siteResourceUsageNotification, ResourceUsageNotification resourceUsageNotification, - SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList subscription_link_list_cse, + SelfServiceEnablementAPI_TypesAndValues.ExpiryNotification expiryNotification_cse, + SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_cse, // TODO Add here your custom variants universal charstring raw diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 0f8b63d..fd0b342 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -2080,18 +2080,18 @@ module LibHttp_JsonTemplates { } // End of template mw_body_json_site_resource_usage_subscription template (value) JsonBody m_body_json_cse_subscription_link_list( - in template (value) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list + in template (value) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscriptionLinkList ) := { - subscription_link_list_cse := p_subscription_link_list + subscriptionLinkList_cse := p_subscriptionLinkList } // End of template m_body_json_cse_subscription_link_list template (present) JsonBody mw_body_json_cse_subscription_link_list( - template (present) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscription_link_list := ? + template (present) SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList p_subscriptionLinkList := ? ) := { - subscription_link_list_cse := p_subscription_link_list + subscriptionLinkList_cse := p_subscriptionLinkList } // End of template mw_body_json_cse_subscription_link_list - template (present) JsonBody m_body_json_site_resource_usage_notification( + template (value) JsonBody m_body_json_site_resource_usage_notification( template (value) SiteResourceUsageNotification p_siteResourceUsageNotification ) := { siteResourceUsageNotification := p_siteResourceUsageNotification @@ -2102,7 +2102,7 @@ module LibHttp_JsonTemplates { siteResourceUsageNotification := p_siteResourceUsageNotification } // End of template mw_body_json_site_resource_usage_notification - template (present) JsonBody m_body_json_resource_usage_notification( + template (value) JsonBody m_body_json_resource_usage_notification( template (value) ResourceUsageNotification p_resourceUsageNotification ) := { resourceUsageNotification := p_resourceUsageNotification @@ -2113,6 +2113,18 @@ module LibHttp_JsonTemplates { resourceUsageNotification := p_resourceUsageNotification } // End of template mw_body_json_site_resource_usage_notification + template (value) JsonBody m_body_json_cse_expiry_notification( + in template (value) SelfServiceEnablementAPI_TypesAndValues.ExpiryNotification p_expiryNotification + ) := { + expiryNotification_cse := p_expiryNotification + } // End of template m_body_json_cse_expiry_notification + + template (present) JsonBody mw_body_json_cse_expiry_notification( + template (present) SelfServiceEnablementAPI_TypesAndValues.ExpiryNotification p_expiryNotification := ? + ) := { + expiryNotification_cse := p_expiryNotification + } // End of template mw_body_json_cse_expiry_notification + } // End of group cse } // End of module LibHttp_JsonTemplates -- GitLab From c597505ca0a676a652dcc579d3e18ff50d99c93e Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Wed, 2 Jul 2025 17:20:26 +0500 Subject: [PATCH 34/54] validate and bug fixes in MEC015 Traffic Management API --- ccsrc/Protocols/Json/json_codec.cc | 169 ++++++++---------- .../Json/json_codec_factory_mec015.hh | 46 +++++ ccsrc/Protocols/Json/json_codec_mec015.cc | 154 ++++++++++++++++ ccsrc/Protocols/Json/json_codec_mec015.hh | 24 +++ ccsrc/Protocols/Json/module.mk | 3 +- .../AtsMec_TrafficManagement.cfg_ | 10 +- ..._BandwidthChangeEventSubAPI_TestCases.ttcn | 115 ++++++------ ..._MultiAccessSteeringInfoAPI_TestCases.ttcn | 6 +- ...AtsMec_TrafficManagementAPI_TestCases.ttcn | 22 +-- .../ttcn/TrafficManagementAPI_Functions.ttcn | 13 +- .../ttcn/TrafficManagementAPI_Pixits.ttcn | 4 +- .../ttcn/TrafficManagementAPI_Templates.ttcn | 80 +++++---- .../TrafficManagementAPI_TypesAndValues.ttcn | 27 ++- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 4 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 12 +- 15 files changed, 471 insertions(+), 218 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec015.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec015.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec015.hh diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index 3c31d8a..cb6d90c 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -8,39 +8,34 @@ #include "LibHttp_JsonMessageBodyTypes.hh" -int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +int json_codec::encode(const LibHttp__JsonMessageBodyTypes::JsonBody &msg, OCTETSTRING &data) { - loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type&)msg); + loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type &)msg); TTCN_EncDec::clear_error(); TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_Buffer encoding_buffer; - if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_ueIdentityTagInfo)) { - const UEidentityAPI__TypesAndValues::UeIdentityTagInfo& ue_identity_tag_info = msg.ueIdentityTagInfo(); + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_ueIdentityTagInfo)) + { + const UEidentityAPI__TypesAndValues::UeIdentityTagInfo &ue_identity_tag_info = msg.ueIdentityTagInfo(); ue_identity_tag_info.encode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) { - const RnisAPI__TypesAndValues::CellChangeSubscription& cell_change_subscription = msg.cellChangeSubscription(); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) + { + const RnisAPI__TypesAndValues::CellChangeSubscription &cell_change_subscription = msg.cellChangeSubscription(); cell_change_subscription.encode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"CellChangeSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext)) { - const UEAppInterfaceAPI__TypesAndValues::AppContext& app_context = msg.appContext(); + data = /*char2oct(CHARSTRING("{\"CellChangeSubscription\": ")) + */ OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) /* + char2oct(CHARSTRING("}"))*/; + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext)) + { + const UEAppInterfaceAPI__TypesAndValues::AppContext &app_context = msg.appContext(); app_context.encode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"AppContext\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) { - const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo(); - bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ATL_bwchgeventsubscription)) { - const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription& bw_chg_event_subscription = msg.bwInfo(); - bw_info.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) { - const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); - mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; - } else { + } + else + { loggers::get_instance().error("json_codec::encode: Not supported"); } @@ -48,18 +43,22 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE return 0; } -int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +int json_codec::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBodyTypes::JsonBody &msg, params *p_params) { loggers::get_instance().log_msg(">>> json_codec::decode: p_data=", p_data); // Sanity checks params::const_iterator it; - if (p_params == nullptr) { + if (p_params == nullptr) + { loggers::get_instance().warning("json_codec::decode: Failed to access p_params (null pointer)"); return -1; // TODO Use p_data instead of return -1 - } else { + } + else + { it = p_params->find("decode_str"); - if (it == p_params->cend()) { + if (it == p_params->cend()) + { loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); return -1; // TODO Use p_data instead of return -1 } @@ -68,129 +67,109 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes // Remove data structure name (if present) ... std::string str; - if ((it->second[0] != '[') && (it->second[0] != '{')) { + if ((it->second[0] != '[') && (it->second[0] != '{')) + { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); - } else { + } + else + { str = it->second; } // ..and create the decoding buffer TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_EncDec::clear_error(); loggers::get_instance().log("json_codec::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); - TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); - if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) { + if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) + { UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.ueIdentityTagInfo() = ue_identity_tag_info; - } else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) { + } + else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) + { RnisAPI__TypesAndValues::CellChangeSubscription cell_change_subscription; cell_change_subscription.decode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.cellChangeSubscription() = cell_change_subscription; - //TODO Continue with other ChangeSubscription - } else if (it->second.find("\"cellInfo\"") != std::string::npos) { + // TODO Continue with other ChangeSubscription + } + else if (it->second.find("\"cellInfo\"") != std::string::npos) + { RnisAPI__TypesAndValues::L2Meas l2_meas; l2_meas.decode(RnisAPI__TypesAndValues::L2Meas_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.l2Meas() = l2_meas; - } else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"requestId\"") != std::string::npos)) { + } + else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"requestId\"") != std::string::npos)) + { RnisAPI__TypesAndValues::RabInfo rab_info; rab_info.decode(RnisAPI__TypesAndValues::RabInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.rabInfo() = rab_info; - } else if (it->second.find("\"S1BearerInfo\"") != std::string::npos) { + } + else if (it->second.find("\"S1BearerInfo\"") != std::string::npos) + { RnisAPI__TypesAndValues::S1BearerInfo s1_nearer_info; s1_nearer_info.decode(RnisAPI__TypesAndValues::S1BearerInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.s1BearerInfo() = s1_nearer_info; - } else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"plmn\"") != std::string::npos)) { + } + else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"plmn\"") != std::string::npos)) + { RnisAPI__TypesAndValues::PlmnInfos plmn_infos; plmn_infos.decode(RnisAPI__TypesAndValues::PlmnInfos_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.plmnInfos() = plmn_infos; - } else if (it->second.find("\"RabEstSubscription\"") != std::string::npos) { + } + else if (it->second.find("\"RabEstSubscription\"") != std::string::npos) + { RnisAPI__TypesAndValues::RabEstSubscription rab_est_subscription; rab_est_subscription.decode(RnisAPI__TypesAndValues::RabEstSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.rabEstSubscription() = rab_est_subscription; - } else if (it->second.find("\"RabModSubscription\"") != std::string::npos) { + } + else if (it->second.find("\"RabModSubscription\"") != std::string::npos) + { RnisAPI__TypesAndValues::RabModSubscription rab_mod_subscription; rab_mod_subscription.decode(RnisAPI__TypesAndValues::RabModSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.rabModSubscription() = rab_mod_subscription; - } else if (it->second.find("\"RabRelSubscription\"") != std::string::npos) { + } + else if (it->second.find("\"RabRelSubscription\"") != std::string::npos) + { RnisAPI__TypesAndValues::RabRelSubscription rab_rel_subscription; rab_rel_subscription.decode(RnisAPI__TypesAndValues::RabRelSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.rabRelSubscription() = rab_rel_subscription; - } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList + } + else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) + { // SubscriptionLinkList // FIXME Conflict with MEC-028 SubscriptionLinkList data type RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.subscriptionLinkList() = subscription_link_list; - } else if (it->second.find("\"associateDevAppId\"") != std::string::npos) { + } + else if (it->second.find("\"associateDevAppId\"") != std::string::npos) + { UEAppInterfaceAPI__TypesAndValues::AppContext appContext; appContext.decode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appContext() = appContext; - } else if (it->second.find("\"appInfo\"") != std::string::npos) { + } + else if (it->second.find("\"appInfo\"") != std::string::npos) + { UEAppInterfaceAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(UEAppInterfaceAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo() = appInfo; - } else if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) { - // Need to change some enumerated string not supported by TTCN-3 language - while (true) { - if (str.find("\"00\"") != std::string::npos) { - str = regex_replace(str, regex("\"00\""), "\"Downlink\""); - } else if (str.find("\"01\"") != std::string::npos) { - str = regex_replace(str, regex("\"01\""), "\"Uplink\""); - } else if (str.find("\"10\"") != std::string::npos) { - str = regex_replace(str, regex("\"10\""), "\"Symmetrical\""); - } else { - loggers::get_instance().log("json_codec::decode: BwInfo in break"); - break; - } - } // End of 'while' loop - loggers::get_instance().log("json_codec::decode: BwInfo after converting enum: %s", str.c_str()); - if (it->second[0] == '[') { // BwInfoList - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - TrafficManagementAPI__TypesAndValues::BwInfoList bw_info_list; - bw_info_list.decode(TrafficManagementAPI__TypesAndValues::BwInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwInfoList() = bw_info_list; - } else { // BwInfo - TrafficManagementAPI__TypesAndValues::BwInfo bw_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwInfo() = bw_info; - } - } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList - TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; - subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.subscriptionLinkList() = subscription_link_list; - } else if ((it->second.find("\"bwchgeventsubscription\"") != std::string::npos) { - TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwchgeventsubscription() = bw_chg_event_subscription; - } else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) { - TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - mts_cap_info.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.mtsCapabilityInfo() = mts_cap_info; - } else if ((it->second.find("\"mtsSessionInfo\"") != std::string::npos) || (it->second.find("\"mtsMode\"") != std::string::npos)) { - TrafficManagementAPI__TypesAndValues::MtsSessionInfo mts_session_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.mtsSessionInfo() = mts_session_info; - } else if ((it->second[0] == '[') && (it->second.find("\"iotPlatformId\"") != std::string::npos)) { - IoTAPI__TypesAndValues::IotPlatformInfoList iot_platform_info_list; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - iot_platform_info_list.decode(IoTAPI__TypesAndValues::IotPlatformInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.iotPlatformInfoList() = iot_platform_info_list; - } else if (it->second.find("\"detail\"") != std::string::npos) { + } + else if (it->second.find("\"detail\"") != std::string::npos) + { LibMec__TypesAndValues::ProblemDetails problem_details; problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.problemDetails() = problem_details; - } else { + } + else + { loggers::get_instance().warning("json_codec::decode: Unsupported variant"); return -1; } - loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type&)msg); + loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type &)msg); return 0; } diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec015.hh b/ccsrc/Protocols/Json/json_codec_factory_mec015.hh new file mode 100644 index 0000000..d02ab43 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec015.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec015.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec015.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec015 + * \brief This class provides a factory class to create a json_codec class instance + */ +class json_codec_factory_mec015: public codec_factory { + static json_codec_factory_mec015 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec015 class + * \remark The MEC015 codec identifier is json_codec_mec015 + */ + json_codec_factory_mec015() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec015", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec015(); + }; +}; // End of class json_codec_factory_mec015 diff --git a/ccsrc/Protocols/Json/json_codec_mec015.cc b/ccsrc/Protocols/Json/json_codec_mec015.cc new file mode 100644 index 0000000..89772ac --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec015.cc @@ -0,0 +1,154 @@ +#include +#include +#include + +#include "json_codec_factory_mec015.hh" +#include "loggers.hh" +#include "LibHttp_JsonMessageBodyTypes.hh" + + +int json_codec_mec015::encode (const LibHttp__JsonMessageBodyTypes::JsonBody &msg, OCTETSTRING &data) +{ + loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type &)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfo)) + { + const TrafficManagementAPI__TypesAndValues::BwInfo &bw_info = msg.bwInfo(); + bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwchgeventsubscription)) + { + const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription &bw_chg_event_subscription = msg.bwchgeventsubscription(); + bw_chg_event_subscription.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) + { + const TrafficManagementAPI__TypesAndValues::MtsSessionInfo &mts_session_info = msg.mtsSessionInfo(); + mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + else + { + loggers::get_instance().error("json_codec::encode: Not supported"); + } + + loggers::get_instance().log("<<< json_codec::encode"); + return 0; +} + +int json_codec_mec015::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBodyTypes::JsonBody &msg, params *p_params) +{ + loggers::get_instance().log_msg(">>> json_codec::decode: p_data=", p_data); + + params::const_iterator it; + if (p_params == nullptr) + { + loggers::get_instance().warning("json_codec::decode: Failed to access p_params (null pointer)"); + return -1; + } + else + { + it = p_params->find("decode_str"); + if (it == p_params->cend()) + { + loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); + return -1; + } + } + + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) + { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } + else + { + str = it->second; + } + + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + + if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) + { + while (true) + { + if (str.find("\"00\"") != std::string::npos) + str = regex_replace(str, regex("\"00\""), "\"Downlink\""); + else if (str.find("\"01\"") != std::string::npos) + str = regex_replace(str, regex("\"01\""), "\"Uplink\""); + else if (str.find("\"10\"") != std::string::npos) + str = regex_replace(str, regex("\"10\""), "\"Symmetrical\""); + else + break; + } + + if (it->second[0] == '[') + { + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + TrafficManagementAPI__TypesAndValues::BwInfoList bw_info_list; + bw_info_list.decode(TrafficManagementAPI__TypesAndValues::BwInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwInfoList() = bw_info_list; + } + else + { + TrafficManagementAPI__TypesAndValues::BwInfo bw_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwInfo() = bw_info; + } + } + else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList__bw() = subscription_link_list; + } + else if ((it->second.find("\"BwChgEventSubscription\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwchgeventsubscription() = bw_chg_event_subscription; + } + else if ((it->second.find("\"notificationType\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::BwChgEventNotification bw_chg_event_notification; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + bw_chg_event_notification.decode(TrafficManagementAPI__TypesAndValues::BwChgEventNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.bwChgEventNotification() = bw_chg_event_notification; + } + else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + mts_cap_info.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mtsCapabilityInfo() = mts_cap_info; + } + else if ((it->second.find("\"mtsSessionInfo\"") != std::string::npos) || (it->second.find("\"mtsMode\"") != std::string::npos)) + { + TrafficManagementAPI__TypesAndValues::MtsSessionInfo mts_session_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mtsSessionInfo() = mts_session_info; + } + else + { + loggers::get_instance().warning("json_codec::decode: Unsupported variant"); + return -1; + } + + loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type &)msg); + return 0; +} + +json_codec_factory_mec015 json_codec_factory_mec015::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec015.hh b/ccsrc/Protocols/Json/json_codec_mec015.hh new file mode 100644 index 0000000..a235de4 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec015.hh @@ -0,0 +1,24 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec015: public json_codec +{ +public: + explicit json_codec_mec015() : json_codec() { }; + virtual ~json_codec_mec015() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec015 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index 3f873bb..270da2a 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -2,11 +2,10 @@ sources := \ json_codec.cc \ json_codec_mec011.cc \ json_codec_mec013.cc \ + json_codec_mec015.cc \ json_codec_mec030.cc \ json_codec_mec028.cc \ - json_codec_mec033.cc \ json_codec_mec040.cc \ - json_codec_mec046.cc \ includes := . diff --git a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ index 5464190..e73de25 100644 --- a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ +++ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ @@ -8,7 +8,7 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.39" +LibHttp_Pics.PICS_HEADER_HOST := "172.26.214.231" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true @@ -33,9 +33,9 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.12,port=30030,use_ssl=0)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server=172.26.208.1,port=3002,use_ssl=0)" #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, @@ -107,7 +107,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server #Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_NF -// Multi-access Traffic Steering information Test Cases +# Multi-access Traffic Steering information Test Cases #Check that the IUT responds with the Multi-access Traffic Steering information when queried by a MEC Application #AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_001_OK #Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - none @@ -145,7 +145,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server #Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application #AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_006_NF -// BWM change event susbsciption Testcases +# BWM change event susbsciption Testcases #Check that the IUT responds with a list of BWM change event susbsciption when queried by a MEC Application #AtsMec_BandwidthChangeEventSubAPI_TestCases.TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn index 0bf8bcf..967d1e2 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn @@ -50,6 +50,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { var Headers v_headers; var BwChgEventSubscription v_bw_chg_event_subscription; var charstring v_subscription_id; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { @@ -83,14 +84,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_bw_subscription_link_list( - mw_subscription_link_list( - { href := pattern "http?+" & PICS_ROOT_API & PX_ME_BWM_SUB_URI }, - superset( - mw_subscription( - v_bw_chg_event_subscription.links.self_.href, - "BwChgEventSubscription" - ) - ))))))) { + mw_subscription_link( + mw_subscription_link_list( + -, + superset( + mw_subscription( + v_bw_chg_event_subscription.links.self_.href, + "BwChgEventSubscription" + ) + )))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); @@ -254,14 +256,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_bw_subscription_link_list( - mw_subscription_link_list( - { href := pattern "http?+" & PICS_ROOT_API & PX_ME_BWM_SUB_URI }, - superset( - mw_subscription( - v_bw_chg_event_subscription.links.self_.href, - "BwChgEventSubscription" - ) - ))))))) { + mw_subscription_link( + mw_subscription_link_list( + -, + superset( + mw_subscription( + v_bw_chg_event_subscription.links.self_.href, + v_bw_chg_event_subscription.subscriptionType + ) + )))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a BW event subscription list ***"); @@ -379,11 +382,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { v_bw_chg_event_subscription.callbackReference, -, mw_links( - v_bw_chg_event_subscription.links.self.href + v_bw_chg_event_subscription.links.self_ ), - mw_filter_criteria( - v_bw_chg_event_subscription.filterCriteria.appInsId - ) + v_bw_chg_event_subscription.filterCriteria + + )))))) { tc_ac.stop; @@ -451,7 +454,6 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_bw_chg_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF @@ -492,13 +494,15 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria(PX_APP_INSTANCE_ID,-)} )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + tc_ac.start; alt { [] httpPort.receive( @@ -507,11 +511,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria(PX_APP_INSTANCE_ID,-)} )))))) -> value v_response { tc_ac.stop; @@ -543,7 +547,6 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { } // End of testcase TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK - /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid subscriptionType */ @@ -577,7 +580,9 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_bw_chg_event_subscription( PX_UNKNOWN_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, - m_filter_Criteria + -, + -, + {m_filter_criteria} )))))); // Test Body @@ -634,11 +639,13 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_type, + PX_BW_SUBSCRIPTION_TYPE, -, -, -, - m_filter_criteria + { + m_filter_criteria + } )))))); // Test Body @@ -693,11 +700,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, { websocketUri := PX_BW_SUB_WEB_SOCKET, requestWebsocketUri := omit }, -, - m_filter_criteria + {m_filter_criteria} )))))); // Test Body @@ -753,11 +760,11 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria} )))))); tc_ac.start; @@ -768,12 +775,14 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_Type + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria - )))))) -> value v_response { + { + m_filter_criteria + } + )))))) { tc_ac.stop; @@ -824,11 +833,16 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + { + m_filter_criteria ( + -, + - + ) + } )))))); // Test Body tc_ac.start; @@ -972,8 +986,10 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { // Local variables var Headers v_headers; var HttpMessage v_response; + var BwChgEventSubscription v_bw_chg_event_subscription; var charstring v_subscription_id; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED required for executing the TC ***"); @@ -989,34 +1005,33 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { // Preamble f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); + action("Trigger a event"); f_selfOrClientSyncAndVerdict(c_prDone, e_success); tc_wait.start; alt { [] httpPort_notif.receive( - mw_http_response( + mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( - mw_body_json__bw_chg_event_notification( + mw_body_json_bw_chg_event_notification( mw_bw_chg_event_notification( + PX_BW_NOTIFICATION_TYPE, -, - -, - mw_data_vol_dispersion( - 1024,PX_APP_INSTANCE_ID - ), - - + { + mw_data_vol_dispersion( + 1024,PX_APP_INSTANCE_ID,- + ) + }, + v_bw_chg_event_subscription.links )))))) -> value v_response { tc_wait.stop; f_init_default_headers_list(-, -, v_headers); - httpPort_notif.send( - m_http_response( - m_http_response_ok_no_body( - v_headers - ))); + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn index 091c223..b8cb2d9 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn @@ -785,7 +785,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & "mts/v0/mts_sessions/" & PX_UNKNOWN_APP_INSTANCE_ID, // Wrong version number + PICS_ROOT_API & "mts/v0/mts_sessions/" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), // Wrong version number v_headers ) ) @@ -846,7 +846,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & PX_UNKNOWN_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ) ) @@ -1156,7 +1156,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & PX_UNKNOWN_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ))); diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn index 50d2114..096ac87 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn @@ -118,7 +118,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & PX_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -173,7 +173,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & PX_APP_NAME, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & oct2char(unichar2oct(PX_APP_NAME, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -230,7 +230,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & PX_APP_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & oct2char(unichar2oct(PX_APP_ALLOCATION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -288,7 +288,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?appInstId=" & PX_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?appInstId=" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -339,7 +339,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & PX_UNKNOWN_APP_INSTANCE_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_instance_id=" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -390,7 +390,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & PX_UNKNOWN_APP_NAME, + PICS_ROOT_API & PX_ME_BWM_URI & "?app_name=" & oct2char(unichar2oct(PX_UNKNOWN_APP_NAME, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -441,7 +441,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & PX_UNKNOWN_APP_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & oct2char(unichar2oct(PX_UNKNOWN_APP_ALLOCATION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -762,7 +762,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1005,7 +1005,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -1267,7 +1267,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_patch( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_bw_info_deltas( @@ -1386,7 +1386,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & PX_UNKNOWN_BW_ALLOCATION_ID, + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), v_headers ))); diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index e126aac..b6fcd66 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -124,10 +124,11 @@ module TrafficManagementAPI_Functions { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + {m_filter_criteria(PX_APP_INSTANCE_ID,-)} )))))); tc_ac.start; alt { @@ -137,11 +138,15 @@ module TrafficManagementAPI_Functions { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_type, + PX_BW_SUBSCRIPTION_TYPE, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + { + mw_filter_criteria( + PX_APP_INSTANCE_ID + ) + } )))))) -> value v_response { tc_ac.stop; @@ -154,7 +159,7 @@ module TrafficManagementAPI_Functions { "?+" & PX_ME_BWM_SUB_URI & "/(?*)", 0 ); - p_bw_chg_event_subscription := v_response.response.body.json_body.m_bw_chg_event_subscription; + p_bw_chg_event_subscription := v_response.response.body.json_body.bwchgeventsubscription; log("f_create_bw_chg_event_subscription: INFO: IUT successfully responds to the subscription: ", p_bw_chg_event_subscription); log("f_create_bw_chg_event_subscription: INFO: p_subscription_id: ", p_subscription_id); } diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn index 3abc8a6..79f1edb 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn @@ -29,7 +29,9 @@ module TrafficManagementAPI_Pixits { modulepar ResourceURL PX_RESOURCE_URL := "http://example.com/exampleAPI/location/v2/users?address:acr:192.0.0.1"; - modulepar Json.String PX_BW_Subcription_Type := "BwChgEventSubscription"; + modulepar Json.String PX_BW_SUBSCRIPTION_TYPE := "BwChgEventSubscription"; + + modulepar Json.String PX_BW_NOTIFICATION_TYPE := "BwChgEventNotification"; modulepar Json.String PX_BW_EVENT_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456"; diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn index 4d0300e..3f2abd0 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn @@ -120,20 +120,26 @@ module TrafficManagementAPI_Templates { } // End of template mw_session_filter template (omit) BwChgEventSubscription m_bw_chg_event_subscription( - in template (omit) Json.String p_subscription_type := ?, - in template (omit) Json.AnyURI p_callbackReference, + in Json.String p_subscription_type, + in template (omit) Json.AnyURI p_callbackReference := omit, in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, in template (omit) Links p_links := omit, - in template (value) FlowFilter p_flowfilter := ? + in template (omit) FilterCriteria p_filtercriteria := omit ) := { subscriptionType := p_subscription_type, callbackReference := p_callbackReference, websockNotifConfig := p_websockNotifConfig, links := p_links, - filterCriteria := p_flowfilter + filterCriteria := p_filtercriteria } - template (omit) FilterCriteria m_filter_criteria( + template (present) Links m_links( + template (present) LinkType p_self := ? + ) := { + self_ := p_self + } // End of template m_links + + template (omit) FilterCriteria_ m_filter_criteria( in AppInsId p_appInsId := PX_APP_INSTANCE_ID, in template (omit) Json.String p_ueIp := omit ) := { @@ -142,66 +148,72 @@ module TrafficManagementAPI_Templates { } // End of template m_flowfilterW template (present) BwChgEventSubscription mw_bw_chg_event_subscription( - template (present) Json.String p_subscriptionType := ? + template (present) Json.String p_subscriptionType := ?, template (present) Json.AnyURI p_callbackReference := ?, - template WebsockNotifConfig p_websockNotifConfig := *, + template (omit) WebsockNotifConfig p_websockNotifConfig := omit, template Links p_links := *, - template (present) FlowFilter p_flowfilter := ? + template (present) FilterCriteria p_filtercriteria := ? ) := { subscriptionType := p_subscriptionType, callbackReference := p_callbackReference, websockNotifConfig := p_websockNotifConfig, links := p_links, - filterCriteria := p_flowfilter + filterCriteria := p_filtercriteria } - template (present) SubscriptionLinkList mw_subscription_link_list( - template (present) Links p_links := ?, - template Subscriptions p_subscription := * + template (present) SubscriptionLinkList mw_subscription_link( + template (present) SubscriptionLink_List p_links := ? + ) := { + links := p_links + } // End of template mw_subscription_link_list + + template (present) SubscriptionLink_List mw_subscription_link_list( + template LinkType p_links := *, + template (present) Subscriptions p_subscription := ? ) := { - links := p_links, - subscription := p_subscription + self_ := p_links, + subscriptions := p_subscription } // End of template mw_subscription_link_list template (present) Links mw_links( - template (value) LinkType p_self - ) :={ - self := p_self - } // End of template m_links + template (present) LinkType p_self := ? + ) := { + self_ := p_self + } // End of template mw_links template (present) Subscription mw_subscription( template (present) Json.AnyURI p_href := ?, template (present) Json.String p_subscriptionType := ? - ) := { + ) := { href := p_href, subscriptionType := p_subscriptionType } // End of template mw_subscription - - - template (present) FilterCriteria mw_filter_criteria( + template (present) FilterCriteria_ mw_filter_criteria( template Json.String p_appInsId := *, - template Json.String p_ueIp := * + template (omit) Json.String p_ueIp := omit ) := { appInsId := p_appInsId, ueIp := p_ueIp } // End of template m_flowfilterW - template (present) BwChgEventNotification mw_bw_chg_event_notificatipn( - template (present) Json.String p_notificationType := "BwChgEventNotification", - template TimeStamp p_timeStamp := ?, - template DataVolDispersion p_dataVolDispersion := *, - template Links p_links := ?, + template (present) BwChgEventNotification mw_bw_chg_event_notification( + template (present) Json.String p_notificationType := ?, + template TimeStamp p_timeStamp := *, + template (present) DataVolDispersion p_dataVolDispersion := ?, + template Links p_links := ? ) := { - appInsId := p_appInsId, - ueIp := p_ueIp + notificationType := p_notificationType, + timeStamp := p_timeStamp, + dataVolDispersion := p_dataVolDispersion, + links := p_links } // End of template mw_bw_chg_event_notificatipn - template (present) DataVolDispersion mw_data_vol_dispersion( - template (value) uint32 p_dataVol, - template (value) Json.String p_appInsId, - template (present) Json.String p_ueIp := ? + template (present) DataVolDispersion_ mw_data_vol_dispersion( + template (present) UInt32 p_dataVol, + template (present) Json.String p_appInsId, + template Json.String p_ueIp := * ) := { dataVol := p_dataVol, appInsId := p_appInsId, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 0d3b625..1b8c4b7 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -3,6 +3,9 @@ module TrafficManagementAPI_TypesAndValues { // JSON import from Json all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + // LibMec import from LibMec_TypesAndValues all; @@ -212,8 +215,8 @@ module TrafficManagementAPI_TypesAndValues { * @see ETSI GS MEC 015 V3.1.1 (2024-04) Table 7.3.2: Attributes of the BwChgEventSubscription */ type record FilterCriteria_ { - Json.String appInsId optional, - Json.String ueIp optional + AppInsId appInsId optional, + Json.String ueIp optional } type set of FilterCriteria_ FilterCriteria @@ -224,12 +227,25 @@ module TrafficManagementAPI_TypesAndValues { * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinkList { - Links links optional, // URI of this resource - Subscription subscriptions optional // List of subscriptions + SubscriptionLink_List links optional // URI of this resource } with { variant (links) "name as '_links'"; } + /** + * @desc List of links related to currently existing subscriptions for the service consumer + * @member links List of hyperlinks related to the resource + * @member subscription + * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList + */ + type record SubscriptionLink_List { + LinkType self_, + Subscriptions subscriptions optional // List of subscriptions + } with { + variant (self_) "name as 'self'"; + } + + /** * @desc Hyperlink related to the resource * @see ETSI GS MEC 015 V3.1.1 (2024-03) Table 7.3.2: Attributes of the BwChgEventSubscription @@ -256,7 +272,7 @@ module TrafficManagementAPI_TypesAndValues { * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList */ type record Subscription { - Json.AnyURI href // The URI referring to the subscription + Json.AnyURI href, // The URI referring to the subscription Json.String subscriptionType // Type of the subscription } type set of Subscription Subscriptions @@ -292,6 +308,7 @@ module TrafficManagementAPI_TypesAndValues { type set of DataVolDispersion_ DataVolDispersion + /** * @desc The information on access network connection * @member timeStamp Time stamp to indicate when the corresponding information elements are sent diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index feb1ec9..6bc800b 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -84,8 +84,8 @@ module LibHttp_JsonMessageBodyTypes { BwInfo bwInfo, BwInfoDeltas bwInfoDeltas, BwChgEventSubscription bwchgeventsubscription, - TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw - BwChgEventNotification bwChgEventNotification + TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw, + BwChgEventNotification bwChgEventNotification, MtsCapabilityInfo mtsCapabilityInfo, MtsSessionInfo mtsSessionInfo, MtsSessionInfos mtsSessionInfos, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 255ddcb..3e00be4 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -937,22 +937,22 @@ module LibHttp_JsonTemplates { bwchgeventsubscription := p_bwchgeventsubscription } // End - template (present) JsonBody mw_body_json_bw_chg_event_subscription( + template (present) JsonBody mw_body_json_bw_subscription_link_list( template (present) TrafficManagementAPI_TypesAndValues.SubscriptionLinkList p_subscriptionlinklist := ? ) := { - subscriptionLinkList := p_subscriptionlinklist + subscriptionLinkList_bw := p_subscriptionlinklist } // End - template (value) JsonBody m_body_json__bw_chg_event_notification( + template (value) JsonBody m_body_json_bw_chg_event_notification( in template (value) BwChgEventNotification p_bwchgeventnotification ) := { - mobilityProcedureNotification := p_mobilityProcedureNotification + bwChgEventNotification := p_bwchgeventnotification } // End of template m_body_json__bw_chg_event_notification - template (present) JsonBody mw_body_json__bw_chg_event_notification( + template (present) JsonBody mw_body_json_bw_chg_event_notification( template (present) BwChgEventNotification p_bwchgeventnotification := ? ) := { - mobilityProcedureNotification := p_mobilityProcedureNotification + bwChgEventNotification := p_bwchgeventnotification } // End of template mw_body_json__bw_chg_event_notification template (value) JsonBody m_body_json_mts_capability_info( -- GitLab From 78ed2ceea54b4ab75352c6a20113033e45fbf79f Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Wed, 2 Jul 2025 17:21:13 +0500 Subject: [PATCH 35/54] fix code bugs in MEC010-2 API --- ...ycleAndOperationGrantingAPI_TestCases.ttcn | 49 +++++++++++++------ .../module.mk | 1 - ...ycleAndOperationGrantingAPI_Functions.ttcn | 12 +++-- ...fecycleAndOperationGrantingAPI_Pixits.ttcn | 10 ++-- ...ycleAndOperationGrantingAPI_Templates.ttcn | 2 +- 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn index 02680c7..e11644d 100644 --- a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn @@ -623,7 +623,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { m_create_package_management( PX_APP_PKG_NAME, PX_APP_PKG_VERSION, - m_checksum(-, PX_CHECKSUM) + m_checksum(-,PX_CHECKSUM) )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -639,8 +639,9 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { -, mw_checksum, CREATED, - PX_OPERATIONAL_STATE, - PX_USAGE_STATE + -, + PX_USAGE_STATE, + - )))))) -> value v_response { tc_ac.stop; @@ -753,11 +754,11 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { { *, mw_app_pkg_info( - -, + v_app_pkg_info.id, mw_checksum, - PX_ONBOARDED_STATE, - PX_OPERATIONAL_STATE, - PX_USAGE_STATE, + CREATED, + -, + -, - ), * @@ -821,13 +822,14 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { { *, mw_app_pkg_info_onboarded( - -, -, + v_app_pkg_info.id, + -, PX_APP_PKG_NAME, PX_APP_PKG_VERSION, -, mw_checksum, -, - PX_ONBOARDED_STATE_ONBOARDED + PX_ONBOARDED_STATE_ONBOARDED ), * } @@ -938,7 +940,12 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_message_body_json( mw_body_json_app_pkg_info( mw_app_pkg_info( - v_app_pkg_info.id + v_app_pkg_info.id, + -, + PX_ONBOARDED_STATE, + -, + PX_USAGE_STATE, + v_app_pkg_info.links )))))) -> value v_response { tc_ac.stop; @@ -996,11 +1003,22 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_http_message_body_json( mw_body_json_app_pkg_info( mw_app_pkg_info_onboarded( - v_app_pkg_info.id + v_app_pkg_info.id, + v_app_pkg_info.appDId, + v_app_pkg_info.appName, + v_app_pkg_info.appSoftwareVersion, + v_app_pkg_info.appDVersion, + v_app_pkg_info.checksum, + -, + PX_ONBOARDED_STATE_ONBOARDED, + -, + -, + v_app_pkg_info.mecInfo, + v_app_pkg_info.links )))))) -> value v_response { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with an App Package ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with an Onboarded App Package ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -2213,7 +2231,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { -, mw_checksum, PX_ONBOARDED_STATE, - PX_OPERATIONAL_STATE, + PX_APPPKGINFO_OPERATIONAL_STATE, PX_USAGE_STATE ), * @@ -2286,7 +2304,7 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with an App Package list ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with an Onboarded App Package list ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -2388,7 +2406,8 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { mw_body_json_app_pkg_info( mw_app_pkg_info( v_app_pkg_info.id, - v_app_pkg_info.appDId + -, + PX_ONBOARDED_STATE_ONBOARDED )))))) { tc_ac.stop; diff --git a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk index 9b2aa7c..13df0a9 100644 --- a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk +++ b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/module.mk @@ -22,7 +22,6 @@ modules := ../LibCommon \ ../LibMec/WlanInformationAPI \ ../LibMec/FixedAccessInformationServiceAPI \ ../LibMec/ApplicationMobilityServiceAPI \ - ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn index ecff7dd..243a912 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn @@ -143,11 +143,13 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Functions { mw_http_message_body_json( mw_body_json_app_pkg_info( mw_app_pkg_info( - -, -, - PX_APP_PKG_NAME, - PX_APP_PKG_VERSION, - -, - mw_checksum + -, + mw_checksum(-, PX_CHECKSUM), + CREATED, + -, + -, + - + )))))) -> value v_response { tc_ac.stop; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn index 2a037b2..cf91989 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn @@ -54,11 +54,13 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits { modulepar Json.String PX_APP_PKG_PATH := "APP_PKG_PATH"; - modulepar Json.String PX_ONBOARDED_STATE_ONBOARDED := "ONBOARDED"; + modulepar OnboardingState PX_ONBOARDED_STATE_ONBOARDED := ONBOARDED; - modulepar Json.String PX_ONBOARDED_STATE := "CREATED"; - - modulepar OperationalState PX_OPERATIONAL_STATE := "ENABLED"; + modulepar OnboardingState PX_ONBOARDED_STATE := CREATED; + + modulepar AppPkgInfo_OperationalState PX_APPPKGINFO_OPERATIONAL_STATE := ENABLED; + + modulepar OperationalState PX_OPERATIONAL_STATE := STARTED; modulepar UsageState PX_USAGE_STATE := NOT_IN_USE; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn index 3a9495d..2a39429 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn @@ -189,7 +189,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { in String p_appPkgName, in String p_appPkgVersion, in template (value) Checksum p_checksum, - in AnyURI p_appPkgPath + in template (omit) AnyURI p_appPkgPath := omit ) := { appPkgName := p_appPkgName, appPkgVersion := p_appPkgVersion, -- GitLab From 4aef2a380a7c720c84d60ce2682e55d5a385d4e0 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Mon, 7 Jul 2025 10:30:38 +0500 Subject: [PATCH 36/54] validate MEC015 Traffic Management API and Multi-access Traffic Steering API --- ccsrc/Protocols/Json/json_codec_mec015.cc | 99 +++++++++-- ..._MultiAccessSteeringInfoAPI_TestCases.ttcn | 100 ++++++----- ...AtsMec_TrafficManagementAPI_TestCases.ttcn | 167 +++++++++++------- .../ttcn/TrafficManagementAPI_Functions.ttcn | 37 ++-- .../ttcn/TrafficManagementAPI_Pixits.ttcn | 12 +- .../ttcn/TrafficManagementAPI_Templates.ttcn | 9 +- .../TrafficManagementAPI_TypesAndValues.ttcn | 11 +- 7 files changed, 282 insertions(+), 153 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec015.cc b/ccsrc/Protocols/Json/json_codec_mec015.cc index 89772ac..cd3c997 100644 --- a/ccsrc/Protocols/Json/json_codec_mec015.cc +++ b/ccsrc/Protocols/Json/json_codec_mec015.cc @@ -6,8 +6,7 @@ #include "loggers.hh" #include "LibHttp_JsonMessageBodyTypes.hh" - -int json_codec_mec015::encode (const LibHttp__JsonMessageBodyTypes::JsonBody &msg, OCTETSTRING &data) +int json_codec_mec015::encode(const LibHttp__JsonMessageBodyTypes::JsonBody &msg, OCTETSTRING &data) { loggers::get_instance().log_msg(">>> json_codec::encode: ", (const Base_Type &)msg); @@ -19,6 +18,24 @@ int json_codec_mec015::encode (const LibHttp__JsonMessageBodyTypes::JsonBody &ms { const TrafficManagementAPI__TypesAndValues::BwInfo &bw_info = msg.bwInfo(); bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + // Convert raw buffer to string + std::string json_str((const char *)encoding_buffer.get_data(), encoding_buffer.get_len()); + + // Apply single substitution + if (json_str.find("\"Downlink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Downlink\""), "\"00\""); + else if (json_str.find("\"Uplink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Uplink\""), "\"01\""); + else if (json_str.find("\"Symmetrical\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Symmetrical\""), "\"10\""); + + // Set output + data = OCTETSTRING(json_str.length(), (const unsigned char *)json_str.c_str()); + } + else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwInfoDeltas)) + { + const TrafficManagementAPI__TypesAndValues::BwInfoDeltas &bw_info_deltas = msg.bwInfoDeltas(); + bw_info_deltas.encode(TrafficManagementAPI__TypesAndValues::BwInfoDeltas_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwchgeventsubscription)) @@ -31,14 +48,26 @@ int json_codec_mec015::encode (const LibHttp__JsonMessageBodyTypes::JsonBody &ms { const TrafficManagementAPI__TypesAndValues::MtsSessionInfo &mts_session_info = msg.mtsSessionInfo(); mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + // Convert raw buffer to string + std::string json_str((const char *)encoding_buffer.get_data(), encoding_buffer.get_len()); + + // Apply single substitution + if (json_str.find("\"Downlink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Downlink\""), "\"00\""); + else if (json_str.find("\"Uplink\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Uplink\""), "\"01\""); + else if (json_str.find("\"Symmetrical\"") != std::string::npos) + json_str = std::regex_replace(json_str, std::regex("\"Symmetrical\""), "\"10\""); + + // Set output + data = OCTETSTRING(json_str.length(), (const unsigned char *)json_str.c_str()); } else { - loggers::get_instance().error("json_codec::encode: Not supported"); + return json_codec::encode(msg, data); } - loggers::get_instance().log("<<< json_codec::encode"); + loggers::get_instance().log("<<< json_codec_mec015::encode"); return 0; } @@ -78,7 +107,13 @@ int json_codec_mec015::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBod TTCN_EncDec::clear_error(); TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); - if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) + if (it->second == "[]") + { + msg.bwInfoList().set_size(0); // Assign bound empty list + return 0; + } + + if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos) || (it->second.find("\"allocationId\"") != std::string::npos)) { while (true) { @@ -94,9 +129,13 @@ int json_codec_mec015::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBod if (it->second[0] == '[') { - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + OCTETSTRING json_str_oct((int)str.length(), (const unsigned char *)str.c_str()); + loggers::get_instance().log_msg("Attempting to decode BwInfoList JSON string:", json_str_oct); + + TTCN_Buffer decoding_buffer_(json_str_oct); TrafficManagementAPI__TypesAndValues::BwInfoList bw_info_list; bw_info_list.decode(TrafficManagementAPI__TypesAndValues::BwInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + loggers::get_instance().warning("Decoded BwInfoList successfully."); msg.bwInfoList() = bw_info_list; } else @@ -127,24 +166,54 @@ int json_codec_mec015::decode(const OCTETSTRING &p_data, LibHttp__JsonMessageBod bw_chg_event_notification.decode(TrafficManagementAPI__TypesAndValues::BwChgEventNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.bwChgEventNotification() = bw_chg_event_notification; } - else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) + else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos) || (it->second.find("\"allocationId\"") != std::string::npos)) { TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); mts_cap_info.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.mtsCapabilityInfo() = mts_cap_info; } - else if ((it->second.find("\"mtsSessionInfo\"") != std::string::npos) || (it->second.find("\"mtsMode\"") != std::string::npos)) + else if ((it->second.find("\"mtsSessionInfo\"") != std::string::npos) || (it->second.find("\"sessionId\"") != std::string::npos)) { - TrafficManagementAPI__TypesAndValues::MtsSessionInfo mts_session_info; - TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); - mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.mtsSessionInfo() = mts_session_info; + while (true) + { + if (str.find("\"00\"") != std::string::npos) + str = regex_replace(str, regex("\"00\""), "\"Downlink\""); + else if (str.find("\"01\"") != std::string::npos) + str = regex_replace(str, regex("\"01\""), "\"Uplink\""); + else if (str.find("\"10\"") != std::string::npos) + str = regex_replace(str, regex("\"10\""), "\"Symmetrical\""); + else + break; + } + if (it->second[0] == '[') + { + OCTETSTRING json_str_oct((int)str.length(), (const unsigned char *)str.c_str()); + loggers::get_instance().log_msg("Attempting to decode mtsSessionInfoList JSON string:", json_str_oct); + + TTCN_Buffer decoding_buffer_(json_str_oct); + TrafficManagementAPI__TypesAndValues::MtsSessionInfos mts_session_infos; + mts_session_infos.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + loggers::get_instance().warning("Decoded mtsSessionInfoList successfully"); + msg.mtsSessionInfos() = mts_session_infos; + } + else + { + TrafficManagementAPI__TypesAndValues::MtsSessionInfo mts_session_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char *)str.c_str())); + mts_session_info.decode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mtsSessionInfo() = mts_session_info; + } + } + else if (it->second.find("\"detail\"") != std::string::npos) + { + LibMec__TypesAndValues::ProblemDetails problem_details; + problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.problemDetails() = problem_details; } else { - loggers::get_instance().warning("json_codec::decode: Unsupported variant"); - return -1; + return json_codec::decode(p_data, msg, p_params); } loggers::get_instance().log_msg("<<< json_codec::decode: ", (const Base_Type &)msg); diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn index b8cb2d9..4838dab 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn @@ -141,13 +141,17 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_mts_session_info( v_mts_session_info_1.appInsId, v_mts_session_info_1.requestType, - -, -, -, + -, + -, + -, v_mts_session_info_1.sessionId ), mw_mts_session_info( v_mts_session_info_2.appInsId, v_mts_session_info_2.requestType, - -, -, -, + -, + -, + -, v_mts_session_info_2.sessionId ), * @@ -209,16 +213,22 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_mts_session_info( - mw_mts_session_info( - v_mts_session_info.appInsId, - v_mts_session_info.requestType, - -, -, -, - v_mts_session_id - )))))) { + mw_body_json_mts_session_info_list( + { + *, + mw_mts_session_info( + v_mts_session_info.appInsId, + v_mts_session_info.requestType, + -,-,-, + v_mts_session_info.sessionId + ), + * + } + + ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list - app_instance_id ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -228,7 +238,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_02 @@ -271,14 +281,19 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_mts_session_info( - mw_mts_session_info( - v_mts_session_info.appInsId, - v_mts_session_info.requestType, - -, -, -, - v_mts_session_id, - v_mts_session_info.appName - )))))) { + mw_body_json_mts_session_info_list( + { + *, + mw_mts_session_info( + v_mts_session_info.appInsId, + v_mts_session_info.requestType, + -, -, -, + v_mts_session_info.sessionId, + v_mts_session_info.appName + ), + * + } + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); @@ -291,7 +306,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_03 @@ -334,14 +349,19 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_mts_session_info( + mw_body_json_mts_session_info_list( + { + *, mw_mts_session_info( v_mts_session_info.appInsId, v_mts_session_info.requestType, -, -, -, v_mts_session_info.sessionId, v_mts_session_info.appName - )))))) { + ), + * + } + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); @@ -506,7 +526,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink // TrafficDirection )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -584,7 +604,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, FLOW_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink, // TrafficDirection -, -, { m_flow_filter("10.10.10.10", 1010) } // FIXME Use PIXITs @@ -721,7 +741,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8")), v_headers ))); @@ -741,7 +761,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { )))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a BwInfo ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a MTS session ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -751,7 +771,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_004_OK @@ -794,12 +814,8 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_problem_details( - mw_problem_details( - -, -, 404 - )))))) { + mw_http_response_404_not_found + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); @@ -904,7 +920,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, + PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_mts_session_info( @@ -912,10 +928,10 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink // TrafficDirection )))))); - + f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { @@ -928,7 +944,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type mw_qosd_1, // QoS - LowCost, // MtsMode + QoS, // MtsMode Downlink // TrafficDirection )))))) { tc_ac.stop; @@ -943,7 +959,7 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); + f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID, oct2char(unichar2oct(v_mts_session_info.sessionId, "UTF-8"))); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_005_OK @@ -980,10 +996,12 @@ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { m_body_json_mts_session_info( m_mts_session_info( // MEC015 Clause 7.2.5 Type: MtsSessionInfo Table 7.2.5-1: Elements of MtsSessionInfo, flowFilter shall be omit PX_APP_INSTANCE_ID, - FLOW_SPECIFIC_MTS_SESSION, // Request type + APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS - LowCost, // MtsMode - Downlink // TrafficDirection + QoS, // MtsMode + Downlink, // TrafficDirection + -,-, + { m_flow_filter("10.10.10.10", 1010) } )))))); // Test Body diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn index 096ac87..6a05b12 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_TrafficManagementAPI_TestCases.ttcn @@ -47,7 +47,7 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - + // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_BWMANAGEMENT_API_SUPPORTED required for executing the TC ***"); @@ -77,7 +77,7 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info_list + mw_body_json_bw_info_list({}) )))) { tc_ac.stop; @@ -100,6 +100,8 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var charstring v_bw_allocation_id; + var BwInfo v_bw_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { @@ -114,6 +116,7 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test adapter configuration // Preamble + f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -130,13 +133,19 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info( - mw_bw_info( - PX_APP_INSTANCE_ID - )))))) { + mw_body_json_bw_info_list( + { + *, + mw_bw_info( + PX_APP_INSTANCE_ID + ), + * + } + + ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo List***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -146,6 +155,7 @@ module AtsMec_TrafficManagementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_TM_001_OK_02 @@ -155,6 +165,8 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var charstring v_bw_allocation_id; + var BwInfo v_bw_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { @@ -169,6 +181,7 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test adapter configuration // Preamble + f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -185,12 +198,17 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info( - mw_bw_info( - PX_APP_INSTANCE_ID, - -, -, -, - PX_APP_NAME - )))))) { + mw_body_json_bw_info_list( + { + *, + mw_bw_info( + PX_APP_INSTANCE_ID, + -, -, -, + PX_APP_NAME + ), + * + } + ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo ***"); @@ -203,6 +221,7 @@ module AtsMec_TrafficManagementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_TM_001_OK_03 @@ -212,6 +231,9 @@ module AtsMec_TrafficManagementAPI_TestCases { testcase TC_MEC_MEC015_SRV_TM_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + var charstring v_bw_allocation_id; + var BwInfo v_bw_info; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_BWMANAGEMENT_API_SUPPORTED)) { @@ -226,11 +248,12 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test adapter configuration // Preamble + f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & oct2char(unichar2oct(PX_APP_ALLOCATION_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI & "?session_id=" & oct2char(unichar2oct(v_bw_info.allocationId, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -242,16 +265,21 @@ module AtsMec_TrafficManagementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_bw_info( - mw_bw_info( - PX_APP_INSTANCE_ID, - -, -, -, - PX_APP_NAME, - PX_APP_ALLOCATION_ID - )))))) { + mw_body_json_bw_info_list( + { + *, + mw_bw_info( + PX_APP_INSTANCE_ID, + -, -, -, + PX_APP_NAME, + v_bw_info.allocationId + ), + * + } + ))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with the required BwInfo - session_id ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -261,6 +289,7 @@ module AtsMec_TrafficManagementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_TM_001_OK_04 @@ -494,7 +523,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI, v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -526,7 +555,7 @@ module AtsMec_TrafficManagementAPI_TestCases { // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { - log("*** " & testcasename() & ": FAIL: IUT failed in Area subscription ***"); + log("*** " & testcasename() & ": FAIL: IUT failed in creation of a bandwidthAllocation resource ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; @@ -540,6 +569,7 @@ module AtsMec_TrafficManagementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a BwInfo, CreationID: ", v_bw_allocation_id," ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); @@ -576,7 +606,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI, v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -587,7 +617,7 @@ module AtsMec_TrafficManagementAPI_TestCases { Downlink, PX_APP_NAME, PX_APP_ALLOCATION_ID, - { m_session_filter("10.10.10.10", 1010) } // FIXME Use PIXITs + { m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT), m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT) } // sessionFilter shall be omitted when APPLICATION_SPECIFIC_BW_ALLOCATION )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -637,7 +667,7 @@ module AtsMec_TrafficManagementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), + PICS_ROOT_API & PX_ME_BWM_URI, v_headers, m_http_message_body_json( m_body_json_bw_info( @@ -816,18 +846,21 @@ module AtsMec_TrafficManagementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } f_init_default_headers_list(-, -, v_headers); + httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, - v_headers, - m_http_message_body_json( + PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, + v_headers, + m_http_message_body_json( m_body_json_bw_info( m_bw_info( PX_APP_INSTANCE_ID, - APPLICATION_SPECIFIC_BW_ALLOCATION, // Request type - "2048", // FixedAllocation - Downlink // AllocationDirection + APPLICATION_SPECIFIC_BW_ALLOCATION, + "2048", + Downlink, + PX_APP_NAME, + PX_APP_ALLOCATION_ID )))))); // Test Body @@ -887,15 +920,15 @@ module AtsMec_TrafficManagementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); } f_init_default_headers_list(-, -, v_headers); - v_bw_info.sessionFilter := { valueof(m_session_filter("10.10.10.10", 1010)) }; // FIXME Use PIXITs + v_bw_info.sessionFilter := { valueof(m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT)) }; // FIXME Use PIXITs httpPort.send( m_http_request( - m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, - v_headers, - m_http_message_body_json( - m_body_json_bw_info( - v_bw_info + m_http_request_put( + PICS_ROOT_API & PX_ME_BWM_URI & "/" & v_bw_allocation_id, + v_headers, + m_http_message_body_json( + m_body_json_bw_info( + v_bw_info ))))); // Test Body @@ -944,9 +977,9 @@ module AtsMec_TrafficManagementAPI_TestCases { // Preamble f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); - if (v_bw_allocation_id == "") { - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); - } + // if (v_bw_allocation_id == "") { + // f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // } f_init_default_headers_list(-, -, v_headers); v_bw_info.requestType := SESSION_SPECIFIC_BW_ALLOCATION; httpPort.send( @@ -998,23 +1031,26 @@ module AtsMec_TrafficManagementAPI_TestCases { // Test component configuration f_cf_01_http_up(); - - // Test adapter configuration - + + // oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), + // Preamble + f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), - v_headers, - m_http_message_body_json( + PICS_ROOT_API & PX_ME_BWM_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_BW_ALLOCATION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( m_body_json_bw_info( m_bw_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_BW_ALLOCATION, - "2048", // FixedAllocation - Downlink - )))))); + "2048", + Downlink, + PX_APP_NAME, + PX_UNKNOWN_BW_ALLOCATION_ID + )))))); // Test Body tc_ac.start; @@ -1074,7 +1110,8 @@ module AtsMec_TrafficManagementAPI_TestCases { m_body_json_bw_info_deltas( m_bw_info_deltas( PX_APP_INSTANCE_ID, - APPLICATION_SPECIFIC_BW_ALLOCATION + APPLICATION_SPECIFIC_BW_ALLOCATION, + v_bw_info.allocationId )))))); // Test Body @@ -1145,7 +1182,7 @@ module AtsMec_TrafficManagementAPI_TestCases { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_BW_ALLOCATION, v_bw_info.allocationId, - { m_session_filter("10.10.10.10", 1010) } // FIXME Use PIXITs + { m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT) } // FIXME Use PIXITs )))))); // Test Body @@ -1213,7 +1250,7 @@ module AtsMec_TrafficManagementAPI_TestCases { PX_APP_INSTANCE_ID, SESSION_SPECIFIC_BW_ALLOCATION, v_bw_info.allocationId - //{ m_session_filter("10.10.10.10", 1010) } sessionFilter shall be present + //{ m_session_filter(PX_SESSION_IPv4, PX_SESSION_PORT) } sessionFilter shall be present )))))); // Test Body @@ -1321,9 +1358,9 @@ module AtsMec_TrafficManagementAPI_TestCases { // Preamble f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); - if (v_bw_allocation_id == "") { - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); - } + // if (v_bw_allocation_id == "") { + // f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // } f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -1344,6 +1381,7 @@ module AtsMec_TrafficManagementAPI_TestCases { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds to deletion ***"); + setverdict(pass, "IUT successfully responds to deletion"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1379,9 +1417,9 @@ module AtsMec_TrafficManagementAPI_TestCases { // Preamble f_create_bw_allocation_resource(PX_APP_INSTANCE_ID, v_bw_allocation_id, v_bw_info); - if (v_bw_allocation_id == "") { - f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); - } + // if (v_bw_allocation_id == "") { + // f_selfOrClientSyncAndVerdict(c_prDone, e_timeout); + // } f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -1395,11 +1433,10 @@ module AtsMec_TrafficManagementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_204_no_content - )) { + mw_http_response_404_not_found + )) { tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds to deletion ***"); + log("*** " & testcasename() & ": PASS: IUT responds with an error when a request for an unknown URI is sent by a MEC Application ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index b6fcd66..b164253 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -36,20 +36,23 @@ module TrafficManagementAPI_Functions { var HttpMessage v_response; p_bw_allocation_id := ""; + f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_ME_BWM_URI, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_ME_BWM_URI, + v_headers, + m_http_message_body_json( m_body_json_bw_info( m_bw_info( p_app_instance_id, - APPLICATION_SPECIFIC_BW_ALLOCATION, // Request type - "1024", // FixedAllocation - Downlink // AllocationDirection - )))))); + APPLICATION_SPECIFIC_BW_ALLOCATION, + "1024", + Downlink, + PX_APP_NAME, + PX_APP_ALLOCATION_ID + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -59,11 +62,9 @@ module TrafficManagementAPI_Functions { mw_body_json_bw_info( mw_bw_info( p_app_instance_id - )))))) -> value v_response { - var charstring_list v_header_location; - + )))))) -> value v_response { + // var charstring_list v_header_location; tc_ac.stop; - log("f_create_bw_allocation_resource: BwInfo resource created: ", v_response); f_get_header(valueof(v_response.response.header), "Location", v_header_location); p_bw_allocation_id := regexp( @@ -128,7 +129,7 @@ module TrafficManagementAPI_Functions { PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - {m_filter_criteria(PX_APP_INSTANCE_ID,-)} + {m_filter_criteria(-,-)} )))))); tc_ac.start; alt { @@ -218,9 +219,11 @@ module TrafficManagementAPI_Functions { PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS - LowCost, // MtsMode - Downlink // TrafficDirection - )))))); + QoS, // MtsMode + Downlink, // TrafficDirection + -, + PX_APP_NAME + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -241,6 +244,8 @@ module TrafficManagementAPI_Functions { p_mts_session_id := v_mts_session_info_id[0]; p_mts_session_info := v_response.response.body.json_body.mtsSessionInfo; } + p_mts_session_info := v_response.response.body.json_body.mtsSessionInfo; + log("f_create_mts_session_info_resource: BwInfo resource created: ", p_mts_session_info); } [] tc_ac.timeout { log("f_create_mts_session_info_resource: Expected message not received"); diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn index 79f1edb..442f5e3 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Pixits.ttcn @@ -8,16 +8,18 @@ module TrafficManagementAPI_Pixits { // LibMec/TrafficManagementAPI import from TrafficManagementAPI_TypesAndValues all; - // LibMec/LocationAPI - import from LocationAPI_TypesAndValues all; - modulepar Json.String PX_APP_INSTANCE_ID := "appInst01"; + modulepar Json.String PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b"; modulepar Json.String PX_APP_INSTANCE_ID_2 := "appInst02"; - modulepar Json.String PX_APP_ALLOCATION_ID := "appAllocationId01"; + modulepar Json.String PX_APP_ALLOCATION_ID := "1"; modulepar Json.String PX_APP_NAME := "appName01"; + + modulepar Json.String PX_SESSION_IPv4 := "10.10.10.10"; + + modulepar Json.String PX_SESSION_PORT := "1010"; modulepar Json.String PX_UNKNOWN_APP_INSTANCE_ID := "appInst99"; @@ -26,8 +28,6 @@ module TrafficManagementAPI_Pixits { modulepar Json.String PX_UNKNOWN_APP_ALLOCATION_ID := "appAllocationId99"; modulepar Json.String PX_UNKNOWN_BW_ALLOCATION_ID := "bwAllocationId99"; - - modulepar ResourceURL PX_RESOURCE_URL := "http://example.com/exampleAPI/location/v2/users?address:acr:192.0.0.1"; modulepar Json.String PX_BW_SUBSCRIPTION_TYPE := "BwChgEventSubscription"; diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn index 3f2abd0..d57cdb8 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn @@ -14,7 +14,7 @@ module TrafficManagementAPI_Templates { import from TrafficManagementAPI_Pixits all; template (omit) BwInfo m_bw_info( - in AppInsId p_appInsId := PX_APP_INSTANCE_ID, + in AppInsId p_appInsId, in BwRequestType p_requestType, in FixedAllocation p_fixedAllocation, in AllocationDirection p_allocationDirection, @@ -161,7 +161,6 @@ module TrafficManagementAPI_Templates { filterCriteria := p_filtercriteria } - template (present) SubscriptionLinkList mw_subscription_link( template (present) SubscriptionLink_List p_links := ? ) := { @@ -265,7 +264,7 @@ module TrafficManagementAPI_Templates { template MtsSessionInfo mw_mts_session_info( template (present) AppInsId p_appInsId := ?, template (present) MtsRequestType p_requestType := ?, - template (present) QosD p_qosD := ?, + template QosD p_qosD := *, template (present) MtsMode p_mtsMode := ?, template (present) TrafficDirection p_trafficDirection := ?, template SessionId p_sessionId := *, @@ -286,7 +285,7 @@ module TrafficManagementAPI_Templates { template (omit) FlowFilterItem m_flow_filter( in template (value) SourceIp p_sourceIp, - in template (value) SourcePort p_sourcePort, + in template (value) Json.UInteger p_sourcePort, in template (omit) DstAddress p_dstIp := omit, in template (omit) DstPort p_dstPort := omit, in template (omit) Protocol p_protocol := omit, @@ -304,7 +303,7 @@ module TrafficManagementAPI_Templates { template FlowFilterItem mw_flow_filter( template (present) SourceIp p_sourceIp := ?, - template (present) SourcePort p_sourcePort := ?, + template (present) Json.UInteger p_sourcePort := ?, template DstAddress p_dstIp := *, template DstPort p_dstPort := *, template Protocol p_protocol := *, diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 1b8c4b7..781e242 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -31,7 +31,7 @@ module TrafficManagementAPI_TypesAndValues { FixedBWPriority fixedBWPriority optional, FixedAllocation fixedAllocation, AllocationDirection allocationDirection - } + } type set of BwInfo BwInfoList; /** @@ -142,6 +142,7 @@ module TrafficManagementAPI_TypesAndValues { * @desc The direction of the requested BW allocation * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ + type enumerated AllocationDirection { Downlink, Uplink, @@ -158,7 +159,7 @@ module TrafficManagementAPI_TypesAndValues { * @desc Source port identity of session * @see ETSI GS MEC 015 V3.1.1 (2024-04) Clause 7.2.2 Type: BwInfo */ - type Json.UInteger SourcePort; + type Json.String SourcePort; /** * @desc Destination address identity of session (including range) @@ -409,8 +410,8 @@ type set of DataVolDispersion_ DataVolDispersion AppInsId appInsId, Json.String appName optional, MtsRequestType requestType, - FlowFilter flowFilter, - QosD qosD, + FlowFilter flowFilter optional, + QosD qosD optional, MtsMode mtsMode, TrafficDirection trafficDirection } @@ -435,7 +436,7 @@ type set of DataVolDispersion_ DataVolDispersion */ type record FlowFilterItem { SourceIp sourceIp optional, - SourcePort sourcePort optional, + Json.UInteger sourcePort optional, DstAddress dstIp optional, DstPort dstPort optional, Protocol protocol optional, -- GitLab From b54e204ff1947b7fcc40671934795ae1c826a5fd Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 7 Jul 2025 07:57:39 +0200 Subject: [PATCH 37/54] Validation of MEC 012/Rnis --- ccsrc/Protocols/Json/json_codec.cc | 54 +- .../Json/json_codec_factory_mec012.hh | 46 ++ ccsrc/Protocols/Json/json_codec_mec012.cc | 113 ++++ ccsrc/Protocols/Json/json_codec_mec012.hh | 25 + ccsrc/Protocols/Json/module.mk | 1 + ...PlatformApplicationEnablement_Sandbox.cfg_ | 6 +- etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ | 238 -------- .../AtsMec_Location_Mockoon.cf_ | 575 ------------------ .../AtsMec_Location_Sandbox.cf_ | 4 +- etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ | 28 +- .../module.mk | 4 +- ...ormApplicationEnablementAPI_TestCases.ttcn | 121 ++++ ...mApplicationEnablementAPI_TestControl.ttcn | 3 + .../module.mk | 2 + ttcn/AtsMec_Location/module.mk | 2 + .../AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn | 115 ++-- ttcn/AtsMec_Rnis/module.mk | 2 + ..._BandwidthChangeEventSubAPI_TestCases.ttcn | 7 +- ...ycleAndOperationGrantingAPI_Functions.ttcn | 2 +- ...fecycleAndOperationGrantingAPI_Pixits.ttcn | 2 +- ...ycleAndOperationGrantingAPI_Templates.ttcn | 26 +- ...atformApplicationEnablementAPI_Pixits.ttcn | 2 + .../RnisAPI/ttcn/RnisAPI_Templates.ttcn | 4 +- .../RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn | 2 +- .../ttcn/TrafficManagementAPI_Functions.ttcn | 7 +- .../ttcn/TrafficManagementAPI_Templates.ttcn | 105 ++-- .../TrafficManagementAPI_TypesAndValues.ttcn | 16 +- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 7 +- .../ttcn/LibHttp_JsonTemplates.ttcn | 60 +- 30 files changed, 518 insertions(+), 1063 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec012.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec012.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec012.hh delete mode 100644 etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ delete mode 100644 etc/AtsMec_Location/AtsMec_Location_Mockoon.cf_ diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index 3c31d8a..a86f221 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -20,10 +20,6 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const UEidentityAPI__TypesAndValues::UeIdentityTagInfo& ue_identity_tag_info = msg.ueIdentityTagInfo(); ue_identity_tag_info.encode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) { - const RnisAPI__TypesAndValues::CellChangeSubscription& cell_change_subscription = msg.cellChangeSubscription(); - cell_change_subscription.encode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"CellChangeSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext)) { const UEAppInterfaceAPI__TypesAndValues::AppContext& app_context = msg.appContext(); app_context.encode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); @@ -32,9 +28,9 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo(); bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; - } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ATL_bwchgeventsubscription)) { - const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription& bw_chg_event_subscription = msg.bwInfo(); - bw_info.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_bwChgEventSubscription)) { + const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription& bw_chg_event_subscription = msg.bwChgEventSubscription(); + bw_chg_event_subscription.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) { const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); @@ -85,44 +81,6 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.ueIdentityTagInfo() = ue_identity_tag_info; - } else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) { - RnisAPI__TypesAndValues::CellChangeSubscription cell_change_subscription; - cell_change_subscription.decode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.cellChangeSubscription() = cell_change_subscription; - //TODO Continue with other ChangeSubscription - } else if (it->second.find("\"cellInfo\"") != std::string::npos) { - RnisAPI__TypesAndValues::L2Meas l2_meas; - l2_meas.decode(RnisAPI__TypesAndValues::L2Meas_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.l2Meas() = l2_meas; - } else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"requestId\"") != std::string::npos)) { - RnisAPI__TypesAndValues::RabInfo rab_info; - rab_info.decode(RnisAPI__TypesAndValues::RabInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.rabInfo() = rab_info; - } else if (it->second.find("\"S1BearerInfo\"") != std::string::npos) { - RnisAPI__TypesAndValues::S1BearerInfo s1_nearer_info; - s1_nearer_info.decode(RnisAPI__TypesAndValues::S1BearerInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.s1BearerInfo() = s1_nearer_info; - } else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"plmn\"") != std::string::npos)) { - RnisAPI__TypesAndValues::PlmnInfos plmn_infos; - plmn_infos.decode(RnisAPI__TypesAndValues::PlmnInfos_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.plmnInfos() = plmn_infos; - } else if (it->second.find("\"RabEstSubscription\"") != std::string::npos) { - RnisAPI__TypesAndValues::RabEstSubscription rab_est_subscription; - rab_est_subscription.decode(RnisAPI__TypesAndValues::RabEstSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.rabEstSubscription() = rab_est_subscription; - } else if (it->second.find("\"RabModSubscription\"") != std::string::npos) { - RnisAPI__TypesAndValues::RabModSubscription rab_mod_subscription; - rab_mod_subscription.decode(RnisAPI__TypesAndValues::RabModSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.rabModSubscription() = rab_mod_subscription; - } else if (it->second.find("\"RabRelSubscription\"") != std::string::npos) { - RnisAPI__TypesAndValues::RabRelSubscription rab_rel_subscription; - rab_rel_subscription.decode(RnisAPI__TypesAndValues::RabRelSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.rabRelSubscription() = rab_rel_subscription; - } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList - // FIXME Conflict with MEC-028 SubscriptionLinkList data type - RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; - subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.subscriptionLinkList() = subscription_link_list; } else if (it->second.find("\"associateDevAppId\"") != std::string::npos) { UEAppInterfaceAPI__TypesAndValues::AppContext appContext; appContext.decode(UEAppInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); @@ -160,12 +118,12 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.subscriptionLinkList() = subscription_link_list; - } else if ((it->second.find("\"bwchgeventsubscription\"") != std::string::npos) { + msg.subscriptionLinkList__bw() = subscription_link_list; + } else if (it->second.find("\"BwChgEventSubscription\"") != std::string::npos) { TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); - msg.bwchgeventsubscription() = bw_chg_event_subscription; + msg.bwChgEventSubscription() = bw_chg_event_subscription; } else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) { TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec012.hh b/ccsrc/Protocols/Json/json_codec_factory_mec012.hh new file mode 100644 index 0000000..9154750 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec012.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec012.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec012.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec012 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec012: public codec_factory { + static json_codec_factory_mec012 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec012 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec012() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec012", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec012(); + }; +}; // End of class json_codec_factory_mec012 diff --git a/ccsrc/Protocols/Json/json_codec_mec012.cc b/ccsrc/Protocols/Json/json_codec_mec012.cc new file mode 100644 index 0000000..46aeec6 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec012.cc @@ -0,0 +1,113 @@ +#include +#include +#include + +#include "json_codec_factory_mec012.hh" + +#include "loggers.hh" + +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec012::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +{ + loggers::get_instance().log_msg(">>> json_codec_mec012::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_cellChangeSubscription)) { + const RnisAPI__TypesAndValues::CellChangeSubscription& cell_change_subscription = msg.cellChangeSubscription(); + cell_change_subscription.encode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = /*char2oct(CHARSTRING("{\"CellChangeSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec012::encode"); + return 0; +} + +int json_codec_mec012::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +{ + loggers::get_instance().log_msg(">>> json_codec_mec012::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec012::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec012::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec012::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + // ..and create the decoding buffer + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec012::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + + if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList + RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList() = subscription_link_list; + } else if (it->second.find("\"RabEstSubscription\"") != std::string::npos) { + RnisAPI__TypesAndValues::RabEstSubscription rab_est_subscription; + rab_est_subscription.decode(RnisAPI__TypesAndValues::RabEstSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabEstSubscription() = rab_est_subscription; + } else if (it->second.find("\"RabModSubscription\"") != std::string::npos) { + RnisAPI__TypesAndValues::RabModSubscription rab_mod_subscription; + rab_mod_subscription.decode(RnisAPI__TypesAndValues::RabModSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabModSubscription() = rab_mod_subscription; + } else if (it->second.find("\"RabRelSubscription\"") != std::string::npos) { + RnisAPI__TypesAndValues::RabRelSubscription rab_rel_subscription; + rab_rel_subscription.decode(RnisAPI__TypesAndValues::RabRelSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabRelSubscription() = rab_rel_subscription; + } else if (it->second.find("\"CellChangeSubscription\"") != std::string::npos) { + RnisAPI__TypesAndValues::CellChangeSubscription cell_change_subscription; + cell_change_subscription.decode(RnisAPI__TypesAndValues::CellChangeSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.cellChangeSubscription() = cell_change_subscription; + //TODO Continue with other ChangeSubscription + } else if (it->second.find("\"cellInfo\"") != std::string::npos) { + RnisAPI__TypesAndValues::L2Meas l2_meas; + l2_meas.decode(RnisAPI__TypesAndValues::L2Meas_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.l2Meas() = l2_meas; + } else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"requestId\"") != std::string::npos)) { + RnisAPI__TypesAndValues::RabInfo rab_info; + rab_info.decode(RnisAPI__TypesAndValues::RabInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.rabInfo() = rab_info; + } else if (it->second.find("\"S1BearerInfo\"") != std::string::npos) { + RnisAPI__TypesAndValues::S1BearerInfo s1_nearer_info; + s1_nearer_info.decode(RnisAPI__TypesAndValues::S1BearerInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.s1BearerInfo() = s1_nearer_info; + } else if ((it->second.find("\"appInstanceId\"") != std::string::npos) && (it->second.find("\"plmn\"") != std::string::npos)) { + RnisAPI__TypesAndValues::PlmnInfos plmn_infos; + plmn_infos.decode(RnisAPI__TypesAndValues::PlmnInfos_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.plmnInfos() = plmn_infos; + + + + + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec012::decode: ", (const Base_Type&)msg); + return 0; +} + +json_codec_factory_mec012 json_codec_factory_mec012::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec012.hh b/ccsrc/Protocols/Json/json_codec_mec012.hh new file mode 100644 index 0000000..f6c1ede --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec012.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" + +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec012: public json_codec +{ +public: + explicit json_codec_mec012() : json_codec() { }; + virtual ~json_codec_mec012() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec012 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index 3f873bb..27728dc 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -1,6 +1,7 @@ sources := \ json_codec.cc \ json_codec_mec011.cc \ + json_codec_mec012.cc \ json_codec_mec013.cc \ json_codec_mec030.cc \ json_codec_mec028.cc \ diff --git a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ index 0164f79..7c8767b 100644 --- a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ +++ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ @@ -19,7 +19,7 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i LibMec_Pics.PICS_MEC_PLAT := true # Application Instance ID -EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "a503822f-a3ff-4ac3-913b-c35acf610498" # Copied from ETSI MEC Sandbox GUI +EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "f1e4d448-e277-496b-bf63-98391cfd20fb" # Copied from ETSI MEC Sandbox GUI # Callbacks @@ -72,7 +72,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_BR # Check that the IUT responds with an error when a request with an unknown service is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_NF +AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_NF # Check that the IUT notifies the authorised relevant (subscribed) application instances when a new service for a given application instance is registered #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application @@ -116,7 +116,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1 # Check that the IUT responds that the MEC application is up and running #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_002_OK # Check that the IUT responds that it has completed the application level termination -AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_001_OK +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_001_OK # Check that the IUT responds with an error when a request for an operationAction is sent to an unknown application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_001_NF # Check that the IUT responds with an error when a request for an indication is sent to an unknown application diff --git a/etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ b/etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ deleted file mode 100644 index 384e475..0000000 --- a/etc/AtsMec_Location/AtsMec_Location_Lewis.cf_ +++ /dev/null @@ -1,238 +0,0 @@ -[MODULE_PARAMETERS] -# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. - -# IUT roles - -LibCommon_Time.PX_TAC := 30.0 -#LibCommon_Time.PX_TWAIT := 30.0 -LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; -LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; - -LibHttp_Pics.PICS_HEADER_HOST := "172.22.1.6" - -LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" -LibHttp_Pics.PICS_USE_TOKEN_HEADER := true -#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" - -LibMec_Pics.PICS_ROOT_API := "etsi-013" - -# LibMex_Pixits -LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI := "/location/v3/zones" -LibMec_Pixits.PX_ME_APP_Q_USERS_LIST_URI := "/location/v3/users" -LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v1/subscriptions" -LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v1/queries" -LibMec_Pixits.PX_MEC_SVC_MGMT_APPS_URI := "/mec_service_mgmt/v1/applications" -LibMec_Pixits.PX_ME_APP_SUPPORT_URI := "/mec_app_support/v1/applications" -LibMec_Pixits.PX_SVC_MGMT_TRANS_URI := "/mec_service_mgmt/v1/transports" -LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CAPS_URI := "/mec_app_support/v1/timing/timing_caps" -LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CURRENT_URI := "/mec_app_support/v1/timing/current_time" - -# Mec-011 AppEnblementAPI -AppEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "appInst01" -AppEnablementAPI_Pixits.PX_SERVICE_NAME := "serName" -AppEnablementAPI_Pixits.PX_SERVICE_ID := "serInst01" -AppEnablementAPI_Pixits.PX_SERVICE_INFO_VERSION := "1.0.0" -AppEnablementAPI_Pixits.PX_NEW_SERVICE_INFO_VERSION := "1.0.0" -AppEnablementAPI_Pixits.PX_SERVICE_INFO_STATE := ACTIVE -AppEnablementAPI_Pixits.PX_SUBSCRIPTION_ID := "7777" -AppEnablementAPI_Pixits.PX_DNS_RULE_ID := "route2home" -AppEnablementAPI_Pixits.PX_DOMAIN_NAME := "etsi.org" -AppEnablementAPI_Pixits.PX_IP_ADDRESS := "10.10.0.2" -AppEnablementAPI_Pixits.PX_TTL := 8 -AppEnablementAPI_Pixits.PX_TRAFFIC_RULE_ID := "trafficRuleId01" - -# Mec-012 RnisAPI -RnisAPI_Pixits.PX_SUBSCRIPTION_HREF_VALUE := "cell_change" -RnisAPI_Pixits.PX_SUBSCRIPTION_TYPE := CELL_CHANGE -RnisAPI_Pixits.PX_SUBSCRIPTION_ID := "7777" -RnisAPI_Pixits.PX_ASSOCIATE_ID_VALUE := "192.0.0.2" -RnisAPI_Pixits.PX_CELL_ID := "0x0800000A" -RnisAPI_Pixits.PX_C_ID := "0xFFFFFFFF" -RnisAPI_Pixits.PX_APP_INS_ID := "01" -RnisAPI_Pixits.PX_APP_ID := "19" -RnisAPI_Pixits.PX_E_RAB_ID := 0 -RnisAPI_Pixits.PX_QCI := 0 - -# Mec-013 LocationAPI -LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true -LocationAPI_Pixits.PX_ZONE_ID := "zone1" -LocationAPI_Pixits.PX_USER := "ue1" -LocationAPI_Pixits.PX_CLIENT_ID := "0123" -LocationAPI_Pixits.PX_SUBSCRIPTION_ID := "subscription0123" - -UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := false - -BwManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := false - -[LOGGING] -# In this section you can specify the name of the log file and the classes of events -# you want to log into the file or display on console (standard error). - -LogFile := "../logs/%e.%h-%r.%s" -#FileMask := LOG_ALL | USER | DEBUG | MATCHING -#ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING -FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT -ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT -LogSourceInfo := Stack -LogEntityName:= Yes -LogEventTypes:= Yes -#TimeStampFormat := DateTime - -[TESTPORT_PARAMETERS] -# In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=172.22.1.6,port=31007,use_ssl=0)" -#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=172.28.4.253,port=30007,use_ssl=0)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=8081,use_ssl=0)" - -[DEFINE] -# In this section you can create macro definitions, -# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. - -[INCLUDE] -# To use configuration settings given in other configuration files, -# the configuration files just need to be listed in this section, with their full or relative pathnames. - -[ORDERED_INCLUDE] -# To use configuration settings given in other configuration files, -# the configuration files just need to be listed in this section, with their full or relative pathnames. - -[EXTERNAL_COMMANDS] -# This section can define external commands (shell scripts) to be executed by the ETS -# whenever a control part or test case is started or terminated. - -#BeginTestCase := "" -#EndTestCase := "" -#BeginControlPart := "" -#EndControlPart := "" - -[EXECUTE] -# In this section you can specify what parts of your test suite you want to execute. -#AtsMec_TestControl.control -#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_OK -#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_BR -#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_NF -#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_OK -#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_BR -#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_PF - -# ETSI GS MEC 013 -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCLOOK_001_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCLOOK_001_BR -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCLOOK_001_NF -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_001_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_001_BR -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_002_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UELOCSUB_002_NF -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_001_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_001_BR -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_002_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UETRACKSUB_002_NF -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFLOOK_001_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFLOOK_001_BR -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFLOOK_001_NF -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_001_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_001_BR -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_002_OK -#AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_002_NF -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_RLOCLOOK_001_OK -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_RLOCLOOK_001_NF -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEAREASUB_001_OK -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEAREASUB_001_BR -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEAREASUB_002_OK -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEAREASUB_002_NF -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEDISTLOOK_001_OK -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEDISTLOOK_001_BR -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEDISTSUB_001_OK -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEDISTSUB_001_BR -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEDISTSUB_002_OK -#AtsMec_RadioNodeLocationAPI_TestCases.TC_MEC_SRV_UEDISTSUB_002_NF - -# ETSI GS MEC 012 -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_011_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_012_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_011_BR -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_012_BR -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_017_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_018_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_019_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_BR -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_016_NF -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_017_BR -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_017_NF -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_018_BR -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_018_NF -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_019_BR -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_019_NF -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_001_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_002_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_003_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_004_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_005_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_006_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_007_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_008_OK - -# ETSI GS MEC 011 -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_001_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_002_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_002_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_003_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_003_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_004_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_004_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_004_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSAQ_004_PF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_001_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_002_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_003_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_003_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_004_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_APPSUB_004_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_002_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_003_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_003_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_003_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_DNS_003_PF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SAQ_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SAQ_001_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SAQ_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SAQ_002_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_001_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_002_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_003_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_003_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_004_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_SRVSUB_004_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TIME_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TIME_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_001_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_001_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_002_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_003_OK -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_003_BR -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_003_NF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_003_PF -#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRANS_001_OK - -[GROUPS] -# In this section you can specify groups of hosts. These groups can be used inside the -# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. - -[COMPONENTS] -# This section consists of rules restricting the location of created PTCs. - -[MAIN_CONTROLLER] -# The options herein control the behavior of MC. -KillTimer := 10.0 -LocalAddress := 127.0.0.1 -TCPPort := 12000 -NumHCs := 1 diff --git a/etc/AtsMec_Location/AtsMec_Location_Mockoon.cf_ b/etc/AtsMec_Location/AtsMec_Location_Mockoon.cf_ deleted file mode 100644 index 292a40d..0000000 --- a/etc/AtsMec_Location/AtsMec_Location_Mockoon.cf_ +++ /dev/null @@ -1,575 +0,0 @@ -[MODULE_PARAMETERS] -# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. - -# IUT roles - -LibCommon_Time.PX_TAC := 30.0 -#LibCommon_Time.PX_TWAIT := 30.0 -LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; -LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; - -LibHttp_Pics.PICS_HEADER_HOST := "try-mec.etsi.org" #"192.168.1.39" - -LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" -LibHttp_Pics.PICS_USE_TOKEN_HEADER := true -#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" - -LibMec_Pics.PICS_ROOT_API := "/sbx1y8q0x9/mep1" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application' - -# LibMec_Pixits -LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions" -LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v2/queries" -LibMec_Pixits.PX_MEC_SVC_MGMT_APPS_URI := "/mec_service_mgmt/v2/applications" -LibMec_Pixits.PX_ME_APP_SUPPORT_URI := "/mec_app_support/v2/applications" -LibMec_Pixits.PX_SVC_MGMT_TRANS_URI := "/mec_service_mgmt/v2/transports" -LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CAPS_URI := "/mec_app_support/v2/timing/timing_caps" -LibMec_Pixits.PX_ME_APP_SUPPORT_TIMING_CURRENT_URI := "/mec_app_support/v2/timing/current_time" - -LibMec_Pics.PICS_MEC_PLAT := true - -# Mec-011 AppEnblementAPI -EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "b8ae165a-a1e3-4d6c-86d9-52c59ad314b6" -EdgePlatformApplicationEnablementAPI_Pixits.PX_NON_EXISTENT_APP_INSTANCE_ID := "1b5d27e6-5cc4-47d4-812b-a943233dbe08" -EdgePlatformApplicationEnablementAPI_Pixits.PX_SERVICE_NAME := "mec028-1" -EdgePlatformApplicationEnablementAPI_Pixits.PX_SERVICE_ID := "1b5d27e6-5cc4-47d4-812b-a943233dbe08" -EdgePlatformApplicationEnablementAPI_Pixits.PX_HREF := "http://yanngarcia.ddns.net/mec_service_mgmt/v2/notif/1" -EdgePlatformApplicationEnablementAPI_Pixits.PX_SRV_AVAIL_NOTIF_CALLBACK_URI := "http://yanngarcia.ddns.net/mec_service_mgmt/v2/srv_notif/1" -EdgePlatformApplicationEnablementAPI_Pixits.PX_SERVICE_INFO_VERSION := "v2" -EdgePlatformApplicationEnablementAPI_Pixits.PX_NEW_SERVICE_INFO_VERSION := "v2.1" -EdgePlatformApplicationEnablementAPI_Pixits.PX_SERVICE_INFO_STATE := ACTIVE -EdgePlatformApplicationEnablementAPI_Pixits.PX_SUBSCRIPTION_ID := "3" -EdgePlatformApplicationEnablementAPI_Pixits.PX_DNS_RULE_ID := "route2home" -EdgePlatformApplicationEnablementAPI_Pixits.PX_DOMAIN_NAME := "try-mec.etsi.org" -EdgePlatformApplicationEnablementAPI_Pixits.PX_IP_ADDRESS := "10.10.0.2" -EdgePlatformApplicationEnablementAPI_Pixits.PX_TTL := 8 -EdgePlatformApplicationEnablementAPI_Pixits.PX_TRAFFIC_RULE_ID := "trafficRuleId01" - -# Mec-012 RnisAPI -RnisAPI_Pixits.PX_SUBSCRIPTION_HREF_VALUE := "cell_change" -RnisAPI_Pixits.PX_CALLBACK_REFERENCE := "http://yanngarcia.ddns.net/rni/v2/notif/1" -RnisAPI_Pixits.PX_ASSOCIATE_ID_VALUE := "10.100.0.1" -RnisAPI_Pixits.PX_CELL_ID := "1010101" -RnisAPI_Pixits.PX_C_ID := "0xFFFFFFFF" -RnisAPI_Pixits.PX_APP_INS_ID := "01" -RnisAPI_Pixits.PX_APP_ID := "19" -RnisAPI_Pixits.PX_E_RAB_ID := 0 -RnisAPI_Pixits.PX_QCI := 0 - -# Mec-013 LocationAPI -LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true -LocationAPI_Pixits.PX_ZONE_ID := "zone01" -LocationAPI_Pixits.PX_ACCESS_POINT_ID := "4g-macro-cell-2" -LocationAPI_Pixits.PX_USER := "4005C0A640001" -LocationAPI_Pixits.PX_IP_ADDRESS := "10.100.0.1" -LocationAPI_Pixits.PX_CLIENT_ID := "0123" -LocationAPI_Pixits.PX_SUBSCRIPTION_ID := "1" -LocationAPI_Pixits.PX_CALLBACK_REF_URL := { notifyURL := "http://yanngarcia.ddns.net/location/v3/notif/1", callbackData := omit, notificationFormat := omit } -LocationAPI_Pixits.PX_AREA_SUB_CALLBACK_URI := { notifyURL := "http://yanngarcia.ddns.net/location/v3/notif/1", callbackData := omit, notificationFormat := omit } -LocationAPI_Pixits.PX_UE_DIST_SUB_CALLBACK_URI := { notifyURL := "http://yanngarcia.ddns.net/location/v3/notif/1", callbackData := omit, notificationFormat := omit } -LocationAPI_Pixits.PX_UE_COORD_LAT := 43.729538 -LocationAPI_Pixits.PX_UE_COORD_LONG := 7.413819 - - -UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := false - -# Mec-015 TrafficManagementAPI -TrafficManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := true - -# Mec-028 WLAN Information API -LibMec_Pixits.PX_ME_WLAN_QUERIES_URI := "/wai/v2/queries" -LibMec_Pixits.PX_ME_WLAN_URI := "/wai/v2" - -#WlanInformationAPI_Pixits.PX_WLAN_FILTER_FIELD := "ap/macId" # ApInfo filter -WlanInformationAPI_Pixits.PX_WLAN_FILTER_FIELD := "staId/macId" # StatInfo filter -WlanInformationAPI_Pixits.PX_WLAN_FILTER_VALUE := "\"005C06060606\"" -WlanInformationAPI_Pixits.PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "http://yanngarcia.ddns.net/wai/v2/notif" - -# Mec-030 V2X Information Service API - -[LOGGING] -# In this section you can specify the name of the log file and the classes of events -# you want to log into the file or display on console (standard error). - -LogFile := "../logs/AtsMec/%e.%h-%r.%s" -FileMask := LOG_ALL | USER | DEBUG | MATCHING -ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING -#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE -#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE -LogSourceInfo := Stack -LogEntityName:= Yes -LogEventTypes:= Yes -#TimeStampFormat := DateTime - -[TESTPORT_PARAMETERS] -# In this section you can specify parameters that are passed to Test Ports. -#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.39,port=30030,use_ssl=0)" -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" -#system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)" - -[DEFINE] -# In this section you can create macro definitions, -# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. - -[INCLUDE] -# To use configuration settings given in other configuration files, -# the configuration files just need to be listed in this section, with their full or relative pathnames. - -[ORDERED_INCLUDE] -# To use configuration settings given in other configuration files, -# the configuration files just need to be listed in this section, with their full or relative pathnames. - -[EXTERNAL_COMMANDS] -# This section can define external commands (shell scripts) to be executed by the ETS -# whenever a control part or test case is started or terminated. - -#BeginTestCase := "" -#EndTestCase := "" -#BeginControlPart := "" -#EndControlPart := "" - -[EXECUTE] -# In this section you can specify what parts of your test suite you want to execute. -#AtsMec_TestControl.control - -# ETSI GS MEC 011 -# Check that the IUT responds with a list of available MEC services for a given application instance when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_BR -# Check that the IUT notifies the authorised relevant (subscribed) application instances when a new service for a given application instance is registered -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_NF -# Check that the IUT responds with the information on a specific service for a given application instance when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_003_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_003_NF -# Check that the IUT updates a service information for a given application instance when commanded by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_NF -# Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_PF -# Check that the IUT responds with a list of subscriptions for notifications on services availability when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_001_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_001_NF -# Check that the IUT acknowledges the subscription by a MEC Application to notifications on service availability events -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_002_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_002_BR -# Check that the IUT responds with the information on a specific subscription when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_003_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_003_NF -# Check that the IUT acknowledges the unsubscribe from service availability event notifications when commanded by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_004_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSUB_004_NF -# Check that the IUT responds that it has completed the application level termination -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_001_OK -# Check that the IUT responds with an error when a request for an operationAction is sent to an unknown application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_001_NF -# Check that the IUT responds that the MEC application is up and running -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_002_OK -# Check that the IUT responds with an error when a request for an indication is sent to an unknown application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_002_NF -# Check that the IUT responds with a list of active DNS rules when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_001_OK -# Check that the IUT responds with the information on a specific DNS rule when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_002_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_002_NF -# Check that the IUT updates a specific DNS rule when commanded by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_003_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_003_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_003_NF -# Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_DNS_003_PF -# Check that the IUT responds with the liveness of a MEC service instance when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_001_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_001_NF -# Check that the IUT updates the liveness of a MEC service instance when requested by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_002_OK -# Check that the IUT responds with an error when incorrect parameters were sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_002_BR -# Check that the IUT responds with a list of available MEC services when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SAQ_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SAQ_001_BR -# Check that the IUT responds with the information on a specific service when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SAQ_002_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SAQ_002_NF -# Check that the IUT responds with a list of subscriptions for notifications on services availability when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_001_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_001_NF -# Check that the IUT acknowledges the subscription by a MEC Application to notifications on service availability events -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_002_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_002_BR -# Check that the IUT responds with the information on a specific subscription when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_003_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_003_NF -# Check that the IUT acknowledges the unsubscribe from service availability event notifications when commanded by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_004_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_004_NF -# Check that the IUT responds with timing capabilities when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TIME_001_OK -# Check that the IUT responds with current time when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TIME_002_OK -# Check that the IUT responds with a list of available traffic rules when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_001_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_001_NF -# Check that the IUT responds with the information on a specific traffic rule when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_002_OK -# Check that the IUT updates a specific traffic rule when commanded by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_003_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_003_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_003_NF -# Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRAF_003_PF -# Check that the IUT responds with a list of available transports when queried by a MEC Application -#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TRANS_001_OK - -# ETSI GS MEC 012 -# Check that the RNIS service sends an RNIS notification about cell change if the RNIS service has an associated subscription and the event is generated -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_001_OK -# Check that the RNIS service sends an RNIS notification about RAB establishment if the RNIS service has an associated subscription and the event is generated -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_002_OK -# Check that the RNIS service sends an RNIS notification about RAB modification if the RNIS service has an associated subscription and the event is generated -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_003_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_004_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_005_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_006_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_007_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_008_OK -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_009_OK -# Check that the RNIS service sends the list of links to the relevant RNIS subscriptions when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_011_OK -# Check that the RNIS service creates a new RNIS subscription -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_012_OK -# Check that the RNIS service responds with an error when it receives a request to get all RNIS subscriptions with a wrong subscription type -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_011_BR -# Check that the RNIS service responds with an error when it receives a request to create a new RNIS subscription with a wrong format -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_012_BR -# Check that the RNIS service sends a RNIS subscription when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_OK -# Check that the RNIS service responds with error when a not existing RNIS subscription is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF -# Check that the RNIS service modifies a RNIS subscription when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_014_OK -# Check that the RNIS service sends an error when it receives a malformed modify request for a RNIS subscription -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_014_BR -# Check that the RNIS service responds with error when a modification for a not existing RNIS subscription is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_014_NF -# Check that the RNIS service deletes a RNIS subscription when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_015_OK -# Check that the RNIS service responds with error when the deletion of a not existing RNIS subscription is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_015_NF -# Check that the RNIS service returns the RAB information when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_016_OK -# Check that the RNIS service returns the PLMN information when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_017_OK -# Check that the RNIS service returns the S1 bearer information -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_018_OK -# Check that the RNIS service returns the L2 measurements information -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_019_OK -# Check that the RNIS service returns an error when the RAB information is requested with a malformatted message -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_016_BR -# Check that the RNIS service returns an error when the RAB information is requested with a malformatted message -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_016_NF -# Check that the RNIS service returns an error when the PLMN information is requested with a malformatted message -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_017_BR -# Check that the RNIS service returns an error when the PLMN information for a not existing element is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_017_NF -# Check that the RNIS service returns an error when the S1 bearer information is requested with a malformatted message -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_018_BR -# Check that the RNIS service returns an error when the S1 bearer information for a not existing element is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_018_NF -# Check that the RNIS service returns an error when the L2 measurements information is requested with a malformatted message -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_019_BR -# Check that the RNIS service returns an error when the L2 measurements information for a not existing element is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_019_NF - -# ETSI GS MEC 013 -# Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCLOOK_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCLOOK_001_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCLOOK_001_NF -# Check that the IUT acknowledges the subscription by a MEC Application to notifications user location event -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_001_OK_01 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_001_BR_01 -# Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_002_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_002_NF -# Check that the IUT acknowledges the subscription by a MEC Application to notifications user location periodic -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_001_OK_02 -# Check that the IUT acknowledges the UE location change subscription request when commanded by a MEC Application and notifies it when the UE changes location -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_001_BR -# Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_002_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETRACKSUB_002_NF -# Check that the IUT responds with the information pertaining to one or more UEs in a particular location when queried by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFLOOK_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFLOOK_001_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFLOOK_001_NF -# Check that the IUT responds with a list zones when queried by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_001_BR -# Check that the IUT acknowledges the cancellation of UE information change notifications when commanded by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_002_OK -# Check that the IUT acknowledges the cancellation of UE information change notifications when commanded by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEINFSUB_002_NF -# heck that the IUT responds with the list of radio nodes currently associated with the MEC host and the location of each radio node when queried by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_RLOCLOOK_001_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_RLOCLOOK_001_NF -# Check that the IUT acknowledges the UE area change subscription request when commanded by a MEC Application and notifies it when the UE enters the specified circle -#AtsMec_LocationAPI_TestCases.TP_MEC_MEC013_SRV_UEAREASUB_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEAREASUB_001_BR -# Check that the IUT acknowledges the cancellation of UE area change notifications when commanded by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEAREASUB_002_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEAREASUB_002_NF -# Check that the IUT responds with the distance to a UE when queried by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTLOOK_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTLOOK_001_BR -# Check that the IUT acknowledges the UE distance subscription request when commanded by a MEC Application and notifies it when (all) the requested UE(s) is (are) within the specified distance -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR -# Check that the IUT acknowledges the cancellation of UE distance notifications when commanded by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_002_OK -# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_002_NF - -# ETSI GS MEC 014 -#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_OK -#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_BR -#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_NF -#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_002_OK -#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_002_BR -#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_002_PF - -# ETSI GS MEC 015 -# Check that the IUT responds with the list of configured bandwidth allocations when queried by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_001_OK -# Check that the IUT responds with a configured bandwidth allocation when queried by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR -# Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_NF -# Check that the IUT responds with a registration and initialisation approval for the requested bandwidth requirements sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_OK_01 -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_OK_02 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_BR_01 -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_BR_02 -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_BR_03 -# Check that the IUT responds with the configured bandwidth allocation when queried by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_NF -# Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_NF -# Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_OK -#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_NF -# Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_007_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_007_NF -# Check that the IUT responds with the Multi-access Traffic Steering information when queried by a MEC Application -#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_001_OK -# Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application -#AtsMec_MultiAccessSteeringInfoAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_OK -#Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_MTS_002_NF -# Check that the IUT responds with a configured Multi-access Traffic Steering when queried by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_MTS_003_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_MTS_003_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_MTS_003_NF - -# ETSI GS MEC 016 - -# ETSI GS MEC 028 -# Check that the IUT responds with the list of WLAN Access Point -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_001_OK -# Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_002_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_002_BR -# Check that the IUT responds with the list of Station Point -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_003_OK -# Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_BR -# Check that the IUT responds with the requested list of subscription -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK -# Check that the IUT responds with the requested list of subscription -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_BR -# Check that the IUT responds with an error when a request with not existing parameters is sent -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_NF -# Check that the IUT responds with a Notification Subscription -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_OK -# Check that the IUT responds with an error when an invalid Subscription request is sent -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_BR -# Check that the IUT responds with an error when a request with not existing parameters is sent -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_NF -# Check that the IUT responds with the list of Subscription -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_008_OK -# Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_008_NF -# Check that the IUT responds with a Notification Subscription when it is modified -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_009_OK -# Check that the IUT responds with an error when an invalid field is set in the subscription modification reques -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_009_BR -# Check that the IUT responds with 204 when an existing subscription is correctly deleted -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_010_OK -# Check that the IUT responds with an error when an not existing subscription cannot be deleted -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_010_NF -# Check that the IUT sends a notification about WLAN event notification if the MEC service has an associated subscription and the event is generated -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK - -# ETSI GS MEC 030 -# Check that the IUT responds with a configured provisioning information over Uu unicast when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_01 -# Check that the IUT responds with a configured provisioning information over Uu unicast when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_OK_02 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_001_NF -# Check that the IUT responds with a configured provisioning information over Uu MBMS when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_OK_01 -# Check that the IUT responds with a configured provisioning information over Uu MBMS when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_OK_02 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_NF -# Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01 -# Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_02 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_NF -# Check that the IUT sends a request about QoS information for a vehicular UE when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_NF -# Check that the IUT processes properly a request to publish a V2X message -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_005_BR -# Check that the IUT responds with the requested list of subscription when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_01 -# Check that the IUT responds with the requested list of subscription when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_02 -# Check that the IUT responds with the requested list of subscription when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_03 -# Check that the IUT responds with the requested list of subscription when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_OK_04 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_006_BR -# Check that the IUT responds with the requested to create a subscription -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_01 -# Check that the IUT responds with the requested to create a subscription -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_02 -# Check that the IUT responds with the requested to create a subscription -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_03 -# Check that the IUT responds with the requested to create a subscription -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_OK_04 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_007_BR -# Check that the IUT responds with the requested of subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_01 -# Check that the IUT responds with the requested of subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_02 -# Check that the IUT responds with the requested of subscription information when queried by a MEC Application#AtsMec_V2XInformationServiceAPI_TestCases.TC_#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_03 -# Check that the IUT responds with the requested of subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_OK_04 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_008_NF -# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_01 -# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_02 -# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_03 -# Check that the IUT responds with the request of updating subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_OK_04 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_009_NF -# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_01 -# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_02 -# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_03 -# Check that the IUT responds with the request of removing subscription information when queried by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_OK_04 -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_010_NF - -[GROUPS] -# In this section you can specify groups of hosts. These groups can be used inside the -# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. - -[COMPONENTS] -# This section consists of rules restricting the location of created PTCs. - -[MAIN_CONTROLLER] -# The options herein control the behavior of MC. -KillTimer := 10.0 -LocalAddress := 127.0.0.1 -TCPPort := 12000 -NumHCs := 1 diff --git a/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ b/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ index 9132740..ac8733c 100644 --- a/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ +++ b/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ @@ -8,13 +8,13 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" #"192.168.1.39" +LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" -LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://sandbox-mec.etsi.org/, section 'Try-it from your MEC application' +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' LibMec_Pics.PICS_MEC_PLAT := true diff --git a/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ b/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ index 7daad53..1c42eb4 100644 --- a/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ +++ b/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ @@ -8,26 +8,19 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "sandbox-mec.etsi.org" #"192.168.1.39" +LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" -LibMec_Pics.PICS_ROOT_API := "/sbx8tunqyy/mep1" # Need to sign in on https://sandbox-mec.etsi.org/, section 'Try-it from your MEC application' +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' # LibMec_Pixits -LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions" -LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v2/queries" - LibMec_Pics.PICS_MEC_PLAT := true -LibMec_Pixits.PX_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions" -LibMec_Pixits.PX_RNIS_QUERIES_URI := "/rni/v2/queries" - RnisAPI_Pixits.PX_SUBSCRIPTION_HREF_VALUE := "cell_change" RnisAPI_Pixits.PX_ASSOCIATE_ID_VALUE := "192.0.0.2" -RnisAPI_Pixits.PX_CELL_ID := "0x0800000A" RnisAPI_Pixits.PX_C_ID := "0xFFFFFFFF" RnisAPI_Pixits.PX_APP_INS_ID := "01" RnisAPI_Pixits.PX_APP_ID := "19" @@ -51,8 +44,8 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=sandbox-mec.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" -system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec012)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec012)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" [DEFINE] # In this section you can create macro definitions, @@ -79,19 +72,26 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server # In this section you can specify what parts of your test suite you want to execute. #AtsMec_TestControl.control -#AtsMec_RnisAPI_TestCases.tc_HelloW # Check that the RNIS service sends an RNIS notification about cell change if the RNIS service has an associated subscription and the event is generated -AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_001_OK +#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_001_OK # Check that the RNIS service sends an RNIS notification about RAB establishment if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_002_OK # Check that the RNIS service sends an RNIS notification about RAB modification if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_003_OK +# Check that the RNIS service sends an RNIS notification about RAB release if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_004_OK +# Check that the RNIS service sends an RNIS notification about UE measurement report if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_005_OK +# Check that the RNIS service sends an RNIS notification about UE timing advance if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_006_OK +# Check that the RNIS service sends an RNIS notification about UE carrier aggregation reconfiguration if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_007_OK +# Check that the RNIS service sends an RNIS notification about S1-U bearer if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_008_OK +# Check that the RNIS service sends an RNIS notification about 5G NR UE measurement report if the RNIS service has an associated subscription and the event is generated #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_009_OK +# Check that the RNIS service sends an RNIS notification on subscription expiration if the RNIS service has an associated subscription and the event is generated +#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_010_OK # Check that the RNIS service sends the list of links to the relevant RNIS subscriptions when requested #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_011_OK # Check that the RNIS service creates a new RNIS subscription @@ -101,7 +101,7 @@ AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_001_OK # Check that the RNIS service responds with an error when it receives a request to create a new RNIS subscription with a wrong format #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_012_BR # Check that the RNIS service sends a RNIS subscription when requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_OK +AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_OK # Check that the RNIS service responds with error when a not existing RNIS subscription is requested #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF # Check that the RNIS service modifies a RNIS subscription when requested diff --git a/ttcn/AtsMec_ApplicationMobiltyService/module.mk b/ttcn/AtsMec_ApplicationMobiltyService/module.mk index 3f0d273..a58eaa7 100644 --- a/ttcn/AtsMec_ApplicationMobiltyService/module.mk +++ b/ttcn/AtsMec_ApplicationMobiltyService/module.mk @@ -22,8 +22,10 @@ modules := ../LibCommon \ ../LibMec/WlanInformationAPI \ ../LibMec/FixedAccessInformationServiceAPI \ ../LibMec/ApplicationMobilityServiceAPI \ - ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ + ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 5a3f0f3..65eff77 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -4613,4 +4613,125 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of group transport_rules + group capif { + + /** + * @desc Check that the IUT responds with all service APIs when queried by a MEC Application - No filter + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_URI, + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_discovered_apis + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01 + + /** + * @desc Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiName + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_URI & "?apiName=" & oct2char(unichar2oct(PX_API_NAME, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_discovered_apis( + { + ? + } + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02 + + } // End of group capif + } // End of module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn index 56fdf43..2edb810 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn @@ -98,6 +98,9 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestControl { execute(TC_MEC_MEC011_SRV_TRAF_003_PF()); execute(TC_MEC_MEC011_SRV_TRANS_001_OK()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02()); } } diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk b/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk index 25ab67b..cf355a8 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_Location/module.mk b/ttcn/AtsMec_Location/module.mk index a601740..5c7fa8e 100644 --- a/ttcn/AtsMec_Location/module.mk +++ b/ttcn/AtsMec_Location/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn index 7fd34ac..a0b151c 100644 --- a/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 GS MEC 003, Draft ETSI GS MEC 012 V2.0.3 (2018-10) + * @see ETSI GS MEC 012, ETSI GS MEC 012 V2.2.1 (2022-02) */ module AtsMec_RnisAPI_TestCases { @@ -38,30 +38,6 @@ module AtsMec_RnisAPI_TestCases { import from LibMec_Pics all; import from LibMec_Pixits all; - testcase tc_HelloW() runs on HttpComponent system HttpTestAdapter { - var charstring v_str; // Used for Query path update - var integer v_start; // Used for Query path update - var integer v_count; // Used for Query path update - - var charstring v_uri := "/queries/zones/{zoneId}/accessPoints/{accessPointId}"; - - var charstring v_zoneId := "zoneId"; - v_str := regexp(v_uri, charstring: "(?+)({zoneId})?+", 0); - v_start := lengthof(v_str); - v_count := lengthof(v_uri) - (v_start + lengthof(v_zoneId)); - log("lengthof(v_uri): ", lengthof(v_uri)); - log("v_str: ", v_str); - log("v_start: ", v_start); - log("v_count: ", v_count); - v_uri := substr(v_uri, 0, v_start) & v_zoneId & substr(v_uri, v_start + lengthof(v_zoneId) , v_count) - log("v_uri: ", v_uri); - - v_str := "/queries/zones/status=[0,1,2,"; - log("v_str: ", substr(v_str, 0, lengthof(v_str) - 1) & "]"); - - setverdict(pass); - } - group rnis_notifications { /** @@ -103,9 +79,7 @@ module AtsMec_RnisAPI_TestCases { PX_V2X_CELL_ID ) } - ) - ) - ), + ))), v_json_body ); if (v_result == 0) { @@ -135,11 +109,12 @@ module AtsMec_RnisAPI_TestCases { mw_body_json_cell_change_subscription( mw_cell_change_subscription( PX_CALLBACK_REFERENCE - )))))) { + )))))) { tc_wait.stop; log("*** " & testcasename() & ": INFO: IUT successfully sends cell-change notification ***"); // Send 204 No Content + f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully sends cell-change notification ***"); @@ -204,10 +179,11 @@ module AtsMec_RnisAPI_TestCases { PX_APP_INS_ID, -, PX_QCI - ))))))) { + ))))))) { tc_wait.stop; // Send 204 No Content + f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully sends RAB establishment notification ***"); @@ -729,9 +705,7 @@ module AtsMec_RnisAPI_TestCases { m_http_request_get( PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & "?subscription_type=" & oct2char(unichar2oct(PX_SUBSCRIPTION_HREF_VALUE, "UTF-8")), v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -745,7 +719,7 @@ module AtsMec_RnisAPI_TestCases { mw_subscriptions_list( mw_subscription_link_list_Link( ?//PX_LINKS_SELF.self_ - ))))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); @@ -812,7 +786,7 @@ module AtsMec_RnisAPI_TestCases { PX_V2X_CELL_ID ) } - ))))))); + ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -824,7 +798,8 @@ module AtsMec_RnisAPI_TestCases { mw_http_message_body_json( mw_body_json_cell_change_subscription( mw_cell_change_subscription( - PX_CALLBACK_REFERENCE )))))) -> value v_response { + PX_CALLBACK_REFERENCE + )))))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); @@ -878,9 +853,7 @@ module AtsMec_RnisAPI_TestCases { m_http_request_get( PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & "?subscription_type=wrongSubscriptionType", v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -893,10 +866,19 @@ module AtsMec_RnisAPI_TestCases { mw_body_json_problem_details( mw_problem_details( -, -, 400 - )))))) { + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request with ProblemDetails ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 Bad Request w/o ProblemDetails ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -948,7 +930,7 @@ module AtsMec_RnisAPI_TestCases { PX_V2X_CELL_ID ) } - ))))))); + ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -961,10 +943,19 @@ module AtsMec_RnisAPI_TestCases { mw_body_json_problem_details( mw_problem_details( -, -, 400 - )))))) { + )))))) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription with ProblemDetails ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription w/o ProblemDetails ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -1058,9 +1049,7 @@ module AtsMec_RnisAPI_TestCases { m_http_request_get( PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & v_uri, v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -1073,7 +1062,7 @@ module AtsMec_RnisAPI_TestCases { mw_body_json_cell_change_subscription( mw_cell_change_subscription( PX_CALLBACK_REFERENCE, - { self_ := { href := "https://" & PICS_HEADER_HOST & PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & v_uri } }, // TODO Rebuild PX_LINKS_SELF, + { self_ := { href := "http://" & PICS_HEADER_HOST & PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & v_uri } }, mw_filter_criteria_ho( "01", { mw_associate_id(UE_IPV4_ADDRESS, PX_ASSOCIATE_ID_VALUE) }, @@ -1083,8 +1072,7 @@ module AtsMec_RnisAPI_TestCases { PX_V2X_CELL_ID ) } - ) - )))))) { + ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); @@ -1154,9 +1142,7 @@ module AtsMec_RnisAPI_TestCases { PX_V2X_CELL_ID ) } - ) - ) - ), + ))), v_json_body ); if (v_result == 0) { @@ -1197,12 +1183,7 @@ module AtsMec_RnisAPI_TestCases { ), -, -, v_json_body.cellChangeSubscription.links - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -1226,7 +1207,7 @@ module AtsMec_RnisAPI_TestCases { ) } ) - )))))) { + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); @@ -1286,9 +1267,7 @@ module AtsMec_RnisAPI_TestCases { PX_V2X_CELL_ID ) } - ) - ) - ), + ))), v_json_body ); if (v_result == 0) { @@ -1313,7 +1292,7 @@ module AtsMec_RnisAPI_TestCases { m_http_request_delete( PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & v_uri, v_headers - ))); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -1322,7 +1301,7 @@ module AtsMec_RnisAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_204_no_content - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully deletes subscription ***"); @@ -1366,7 +1345,7 @@ module AtsMec_RnisAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & PX_UNKNOWN_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), v_headers ) ) @@ -1534,7 +1513,7 @@ module AtsMec_RnisAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & PX_UNKNOWN_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_cell_change_subscription( @@ -1604,7 +1583,7 @@ module AtsMec_RnisAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & PX_UNKNOWN_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & oct2char(unichar2oct(PX_UNKNOWN_SUBSCRIPTION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); diff --git a/ttcn/AtsMec_Rnis/module.mk b/ttcn/AtsMec_Rnis/module.mk index 5889511..796c30c 100644 --- a/ttcn/AtsMec_Rnis/module.mk +++ b/ttcn/AtsMec_Rnis/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn index 0bf8bcf..ac5a2e4 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn @@ -492,8 +492,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_type, - PX_BW_EVENT_SUB_CALLBACK_URI, + \PX_BW_EVENT_SUB_CALLBACK_URI, -, -, m_filter_criteria @@ -507,7 +506,6 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_type, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, @@ -634,7 +632,6 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_type, -, -, -, @@ -999,7 +996,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { -, -, mw_http_message_body_json( - mw_body_json__bw_chg_event_notification( + mw_body_json_bw_chg_event_notification( mw_bw_chg_event_notification( -, -, diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn index ecff7dd..b59ceeb 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Functions.ttcn @@ -142,7 +142,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Functions { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_app_pkg_info( - mw_app_pkg_info( + mw_app_pkg_info_onboarded( -, -, PX_APP_PKG_NAME, PX_APP_PKG_VERSION, diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn index 2a037b2..ff38b9d 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits.ttcn @@ -58,7 +58,7 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Pixits { modulepar Json.String PX_ONBOARDED_STATE := "CREATED"; - modulepar OperationalState PX_OPERATIONAL_STATE := "ENABLED"; + modulepar OperationalState PX_OPERATIONAL_STATE := STARTED; modulepar UsageState PX_USAGE_STATE := NOT_IN_USE; diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn index 3a9495d..19720c8 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn @@ -244,19 +244,19 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { } // End of template mw_app_pkg_info template (present) AppPkgInfo mw_app_pkg_info_onboarded( - template (present) Json.String p_id := ?, - template (present) Json.String p_appDId := ?, - template (present) Json.String p_appName := ?, - template (present) Json.String p_appSoftwareVersion := ?, - template (present) Json.String p_appDVersion := ?, - template (present) Checksum p_checksum := ?, - template (present) AppPkgSWImageInfo p_softwareImages := ?, - template (present) OnboardingState p_onboardingState := ?, - template (present) AppPkgInfo_OperationalState p_operationalState := ?, - template (present) UsageState p_usageState := ?, - template (present) AppPkgInfo_MecInfo p_mecInfo := ?, - template (present) AppPkgInfo_Links p_links := ? - ) := { + template (present) Json.String p_id := ?, + template (present) Json.String p_appDId := ?, + template (present) Json.String p_appName := ?, + template (present) Json.String p_appSoftwareVersion := ?, + template (present) Json.String p_appDVersion := ?, + template (present) Checksum p_checksum := ?, + template (present) AppPkgSWImageInfo p_softwareImages := ?, + template (present) OnboardingState p_onboardingState := ?, + template (present) AppPkgInfo_OperationalState p_operationalState := ?, + template (present) UsageState p_usageState := ?, + template (present) AppPkgInfo_MecInfo p_mecInfo := ?, + template (present) AppPkgInfo_Links p_links := ? + ) := { id := p_id, appDId := p_appDId, appProvider := *, diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn index 3b54f9a..3dab506 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn @@ -69,5 +69,7 @@ module EdgePlatformApplicationEnablementAPI_Pixits { modulepar TrafficRule_Id PX_NON_EXISTENT_TRAFFIC_RULE_ID := "trafficRuleId99"; modulepar charstring PX_LINK_LIV := "mec_service_mgmt/v1/resource_uri_allocated_by_MEC_platform"; + + modulepar Json.String PX_API_NAME := "MEC-013"; } // End of module EdgePlatformApplicationEnablementAPI_Pixits diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn index 83d31c1..1ca9de5 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn @@ -41,7 +41,7 @@ module RnisAPI_Templates { } // End of template mw_subscription_link_list_Link template (value) Subscription_ m_subscription( - in LinkType p_href, + in Json.AnyURI p_href, in Json.String p_subscriptionType ) := { href := p_href, @@ -49,7 +49,7 @@ module RnisAPI_Templates { } // End of temlate m_subscription template (present) Subscription_ mw_subscription( - template (present) LinkType p_href := ?, + template (present) Json.AnyURI p_href := ?, template (present) Json.String p_subscriptionType := ? ) := { href := p_href, diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn index 7a08346..cb444d9 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn @@ -626,7 +626,7 @@ module RnisAPI_TypesAndValues { * @see ETSI GS MEC 012 V2.2.1 (2022-02) Table 6.3.10-1: Attributes of the SubscriptionLinkList */ type record Subscription_ { - LinkType href, + Json.AnyURI href, Json.String subscriptionType } type set of Subscription_ Subscription; diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index e126aac..2f0fcf6 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -127,7 +127,7 @@ module TrafficManagementAPI_Functions { PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + { m_filter_criteria } )))))); tc_ac.start; alt { @@ -137,11 +137,10 @@ module TrafficManagementAPI_Functions { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_type, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, - m_filter_criteria + { m_filter_criteria } )))))) -> value v_response { tc_ac.stop; @@ -154,7 +153,7 @@ module TrafficManagementAPI_Functions { "?+" & PX_ME_BWM_SUB_URI & "/(?*)", 0 ); - p_bw_chg_event_subscription := v_response.response.body.json_body.m_bw_chg_event_subscription; + p_bw_chg_event_subscription := v_response.response.body.json_body.bwChgEventSubscription; log("f_create_bw_chg_event_subscription: INFO: IUT successfully responds to the subscription: ", p_bw_chg_event_subscription); log("f_create_bw_chg_event_subscription: INFO: p_subscription_id: ", p_subscription_id); } diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn index 4d0300e..b63d197 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Templates.ttcn @@ -105,13 +105,13 @@ module TrafficManagementAPI_Templates { protocol := p_protocol } // End of template m_session_filter - template SessionFilterItem mw_session_filter( - template (present) SourceIp p_sourceIp := ?, - template (present) SourcePort p_sourcePort := ?, - template DstAddress p_dstAddress := *, - template DstPort p_dstPort := *, - template Protocol p_protocol := * - ) := { + template (present) SessionFilterItem mw_session_filter( + template (present) SourceIp p_sourceIp := ?, + template (present) SourcePort p_sourcePort := ?, + template DstAddress p_dstAddress := *, + template DstPort p_dstPort := *, + template Protocol p_protocol := * + ) := { sourceIp := p_sourceIp, sourcePort := p_sourcePort, dstAddress := p_dstAddress, @@ -120,39 +120,37 @@ module TrafficManagementAPI_Templates { } // End of template mw_session_filter template (omit) BwChgEventSubscription m_bw_chg_event_subscription( - in template (omit) Json.String p_subscription_type := ?, - in template (omit) Json.AnyURI p_callbackReference, - in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, - in template (omit) Links p_links := omit, - in template (value) FlowFilter p_flowfilter := ? - ) := { - subscriptionType := p_subscription_type, - callbackReference := p_callbackReference, - websockNotifConfig := p_websockNotifConfig, - links := p_links, - filterCriteria := p_flowfilter - } + in template (omit) Json.AnyURI p_callbackReference, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) Links p_links := omit, + in template (value) FilterCriteria p_filterCriteria + ) := { + subscriptionType := "BwChgEventSubscription", + callbackReference := p_callbackReference, + websockNotifConfig := p_websockNotifConfig, + links := p_links, + filterCriteria := p_filterCriteria + } // End of template m_bw_chg_event_subscription - template (omit) FilterCriteria m_filter_criteria( - in AppInsId p_appInsId := PX_APP_INSTANCE_ID, - in template (omit) Json.String p_ueIp := omit - ) := { + template (omit) FilterCriteria_ m_filter_criteria( + in AppInsId p_appInsId := PX_APP_INSTANCE_ID, + in template (omit) Json.String p_ueIp := omit + ) := { appInsId := p_appInsId, ueIp := p_ueIp - } // End of template m_flowfilterW + } // End of template m_filter_criteria template (present) BwChgEventSubscription mw_bw_chg_event_subscription( - template (present) Json.String p_subscriptionType := ? - template (present) Json.AnyURI p_callbackReference := ?, - template WebsockNotifConfig p_websockNotifConfig := *, - template Links p_links := *, - template (present) FlowFilter p_flowfilter := ? - ) := { - subscriptionType := p_subscriptionType, + template (present) Json.AnyURI p_callbackReference := ?, + template WebsockNotifConfig p_websockNotifConfig := *, + template Links p_links := *, + template (present) FilterCriteria p_filterCriteria := ? + ) := { + subscriptionType := "BwChgEventSubscription", callbackReference := p_callbackReference, websockNotifConfig := p_websockNotifConfig, links := p_links, - filterCriteria := p_flowfilter + filterCriteria := p_filterCriteria } @@ -165,9 +163,9 @@ module TrafficManagementAPI_Templates { } // End of template mw_subscription_link_list template (present) Links mw_links( - template (value) LinkType p_self - ) :={ - self := p_self + template (value) LinkType p_self + ) :={ + self_ := p_self } // End of template m_links template (present) Subscription mw_subscription( @@ -180,32 +178,33 @@ module TrafficManagementAPI_Templates { - template (present) FilterCriteria mw_filter_criteria( - template Json.String p_appInsId := *, - template Json.String p_ueIp := * - ) := { + template (present) FilterCriteria_ mw_filter_criteria( + template Json.String p_appInsId := *, + template Json.String p_ueIp := * + ) := { appInsId := p_appInsId, ueIp := p_ueIp } // End of template m_flowfilterW template (present) BwChgEventNotification mw_bw_chg_event_notificatipn( - template (present) Json.String p_notificationType := "BwChgEventNotification", - template TimeStamp p_timeStamp := ?, - template DataVolDispersion p_dataVolDispersion := *, - template Links p_links := ?, - ) := { - appInsId := p_appInsId, - ueIp := p_ueIp + template TimeStamp p_timeStamp := ?, + template DataVolDispersion p_dataVolDispersion := *, + template Links p_links := ? + ) := { + notificationType := "BwChgEventNotification", + timeStamp := p_timeStamp, + dataVolDispersion := p_dataVolDispersion, + links := p_links } // End of template mw_bw_chg_event_notificatipn - template (present) DataVolDispersion mw_data_vol_dispersion( - template (value) uint32 p_dataVol, - template (value) Json.String p_appInsId, - template (present) Json.String p_ueIp := ? - ) := { - dataVol := p_dataVol, + template (present) DataVolDispersion_ mw_data_vol_dispersion( + template (present) Json.UInteger p_dataVol := ?, + template (present) Json.String p_appInsId := ?, + template (present) Json.String p_ueIp := ? + ) := { + dataVol := p_dataVol, appInsId := p_appInsId, - ueIp := p_ueIp + ueIp := p_ueIp } // End of template mw_data_vol_dispersion template (omit) MtsCapabilityInfo m_mts_capability_info( diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn index 0d3b625..0a1be09 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_TypesAndValues.ttcn @@ -225,7 +225,7 @@ module TrafficManagementAPI_TypesAndValues { */ type record SubscriptionLinkList { Links links optional, // URI of this resource - Subscription subscriptions optional // List of subscriptions + Subscriptions subscription optional // List of subscriptions } with { variant (links) "name as '_links'"; } @@ -256,7 +256,7 @@ module TrafficManagementAPI_TypesAndValues { * @see Table 7.3.3-1: Attributes of the SubscriptionLinkList */ type record Subscription { - Json.AnyURI href // The URI referring to the subscription + Json.AnyURI href, // The URI referring to the subscription Json.String subscriptionType // Type of the subscription } type set of Subscription Subscriptions @@ -270,10 +270,10 @@ module TrafficManagementAPI_TypesAndValues { * @see Table 7.4.2: Attributes of the BwChgEventNotification */ type record BwChgEventNotification { - Json.String notificationType, - TimeStamp timeStamp optional, + Json.String notificationType, + TimeStamp timeStamp optional, DataVolDispersion dataVolDispersion, - Links links optional + Links links optional } with { variant (links) "name as '_links'"; }; @@ -285,9 +285,9 @@ module TrafficManagementAPI_TypesAndValues { * @member ueIp Source address identity of session (optional). */ type record DataVolDispersion_ { - UInt32 dataVol, - Json.String appInsId, - Json.String ueIp optional + Json.UInteger dataVol, + Json.String appInsId, + Json.String ueIp optional }; type set of DataVolDispersion_ DataVolDispersion diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 55a8c4d..24a3c88 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -81,6 +81,8 @@ module LibMec_Pixits { // FIXME FSCOM Split this file according to the different modulepar charstring PX_ME_APP_SUPPORT_URI := "mec_app_support/v2/applications"; modulepar charstring PX_ME_APP_REG_APPS_URI := "mec_service_mgmt/v1/applications"; + + modulepar charstring PX_ME_CAPIF_URI := "service-apis/v1/allServiceAPIs"; modulepar charstring PX_MEC_SVC_MGMT_SVC_URI := "mec_service_mgmt/v1/services"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index feb1ec9..41f1d64 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -83,9 +83,9 @@ module LibHttp_JsonMessageBodyTypes { BwInfoList bwInfoList, BwInfo bwInfo, BwInfoDeltas bwInfoDeltas, - BwChgEventSubscription bwchgeventsubscription, - TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw - BwChgEventNotification bwChgEventNotification + BwChgEventSubscription bwChgEventSubscription, + TrafficManagementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_bw, + BwChgEventNotification bwChgEventNotification, MtsCapabilityInfo mtsCapabilityInfo, MtsSessionInfo mtsSessionInfo, MtsSessionInfos mtsSessionInfos, @@ -144,6 +144,7 @@ module LibHttp_JsonMessageBodyTypes { SerAvailabilityNotificationSubscription serAvailabilityNotificationSubscription, TimingCaps timingCaps, CurrentTime currentTime, + DiscoveredAPIs discovered_apis, DeviceApplicationInterfaceAPI_TypesAndValues.ApplicationList applicationList, DeviceApplicationInterfaceAPI_TypesAndValues.AppContext appContext_device_info, ApplicationLocationAvailability applicationLocationAvailability, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 255ddcb..4003ce1 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -926,34 +926,28 @@ module LibHttp_JsonTemplates { } // End of template mw_body_json_bw_info_list template (value) JsonBody m_body_json_bw_chg_event_subscription( - in template (value) BwChgEventSubscription p_bwchgeventsubscription - ) := { - bwchgeventsubscription := p_bwchgeventsubscription - } // End - - template (present) JsonBody mw_body_json_bw_chg_event_subscription( - template (present) BwChgEventSubscription p_bwchgeventsubscription := ? - ) := { - bwchgeventsubscription := p_bwchgeventsubscription - } // End + in template (value) BwChgEventSubscription p_bwchgeventsubscription + ) := { + bwChgEventSubscription := p_bwchgeventsubscription + } // End of template m_body_json_bw_chg_event_subscription template (present) JsonBody mw_body_json_bw_chg_event_subscription( - template (present) TrafficManagementAPI_TypesAndValues.SubscriptionLinkList p_subscriptionlinklist := ? - ) := { - subscriptionLinkList := p_subscriptionlinklist - } // End + template (present) BwChgEventSubscription p_bwchgeventsubscription := ? + ) := { + bwChgEventSubscription := p_bwchgeventsubscription + } // End of template mw_body_json_bw_chg_event_subscription - template (value) JsonBody m_body_json__bw_chg_event_notification( - in template (value) BwChgEventNotification p_bwchgeventnotification + template (value) JsonBody m_body_json_bw_chg_event_notification( + in template (value) BwChgEventNotification p_bwChgEventNotification ) := { - mobilityProcedureNotification := p_mobilityProcedureNotification - } // End of template m_body_json__bw_chg_event_notification + bwChgEventNotification := p_bwChgEventNotification + } // End of template m_body_json_bw_chg_event_notification - template (present) JsonBody mw_body_json__bw_chg_event_notification( - template (present) BwChgEventNotification p_bwchgeventnotification := ? - ) := { - mobilityProcedureNotification := p_mobilityProcedureNotification - } // End of template mw_body_json__bw_chg_event_notification + template (present) JsonBody mw_body_json_bw_chg_event_notification( + template (present) BwChgEventNotification p_bwChgEventNotification := ? + ) := { + bwChgEventNotification := p_bwChgEventNotification + } // End of template mw_body_json_bw_chg_event_notification template (value) JsonBody m_body_json_mts_capability_info( in template (value) MtsCapabilityInfo p_mtsCapabilityInfo @@ -1193,6 +1187,26 @@ module LibHttp_JsonTemplates { appInfo_regapps := p_appInfo_regapps } // End of template mw_body_json_app_info_regapps + + + + + template (value) JsonBody m_body_json_discovered_apis( + in template (value) DiscoveredAPIs p_discovered_apis + ) := { + discovered_apis := p_discovered_apis + } // End of template m_body_json_discovered_apis + + template (present) JsonBody mw_body_json_discovered_apis( + template (present) DiscoveredAPIs p_discovered_apis := ? + ) := { + discovered_apis := p_discovered_apis + } // End of template mw_body_json_discovered_apis + + + + + } // End of group app_enablement_api group ue_app_ctx { -- GitLab From 8c03352ffcfc37d9d3fcfbc5086931004313ce97 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 7 Jul 2025 08:03:16 +0200 Subject: [PATCH 38/54] Update module.mk adding SelfServiceEnablementAPI library --- etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ | 4 ++-- ttcn/AtsMec_ApplicationMobiltyService/module.mk | 1 + ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk | 1 + ttcn/AtsMec_FederationEnablement/module.mk | 1 + ttcn/AtsMec_IoT/module.mk | 1 + ttcn/AtsMec_Location/module.mk | 1 + ttcn/AtsMec_QoSMeasurement/module.mk | 1 + ttcn/AtsMec_Rnis/module.mk | 1 + ttcn/AtsMec_SensorsSharingService/module.mk | 1 + ttcn/AtsMec_V2XInformationService/module.mk | 1 + 10 files changed, 11 insertions(+), 2 deletions(-) diff --git a/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ b/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ index 1c42eb4..f7e55aa 100644 --- a/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ +++ b/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ @@ -101,9 +101,9 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec012)/TCP(debug=1 # Check that the RNIS service responds with an error when it receives a request to create a new RNIS subscription with a wrong format #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_012_BR # Check that the RNIS service sends a RNIS subscription when requested -AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_OK +#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_OK # Check that the RNIS service responds with error when a not existing RNIS subscription is requested -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF +AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF # Check that the RNIS service modifies a RNIS subscription when requested #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_014_OK # Check that the RNIS service sends an error when it receives a malformed modify request for a RNIS subscription diff --git a/ttcn/AtsMec_ApplicationMobiltyService/module.mk b/ttcn/AtsMec_ApplicationMobiltyService/module.mk index a58eaa7..9dbea5d 100644 --- a/ttcn/AtsMec_ApplicationMobiltyService/module.mk +++ b/ttcn/AtsMec_ApplicationMobiltyService/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/IoTAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk b/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk index cf355a8..251be10 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/IoTAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_FederationEnablement/module.mk b/ttcn/AtsMec_FederationEnablement/module.mk index ae6c907..f78a2af 100644 --- a/ttcn/AtsMec_FederationEnablement/module.mk +++ b/ttcn/AtsMec_FederationEnablement/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/FederationEnablementAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_IoT/module.mk b/ttcn/AtsMec_IoT/module.mk index ff1e030..08dc86d 100644 --- a/ttcn/AtsMec_IoT/module.mk +++ b/ttcn/AtsMec_IoT/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/FederationEnablementAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_Location/module.mk b/ttcn/AtsMec_Location/module.mk index 5c7fa8e..8bdf454 100644 --- a/ttcn/AtsMec_Location/module.mk +++ b/ttcn/AtsMec_Location/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/IoTAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_QoSMeasurement/module.mk b/ttcn/AtsMec_QoSMeasurement/module.mk index aa46c15..62223e5 100644 --- a/ttcn/AtsMec_QoSMeasurement/module.mk +++ b/ttcn/AtsMec_QoSMeasurement/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/FederationEnablementAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_Rnis/module.mk b/ttcn/AtsMec_Rnis/module.mk index 796c30c..14f39e2 100644 --- a/ttcn/AtsMec_Rnis/module.mk +++ b/ttcn/AtsMec_Rnis/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/IoTAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_SensorsSharingService/module.mk b/ttcn/AtsMec_SensorsSharingService/module.mk index 2f3383d..41a3429 100644 --- a/ttcn/AtsMec_SensorsSharingService/module.mk +++ b/ttcn/AtsMec_SensorsSharingService/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/FederationEnablementAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_V2XInformationService/module.mk b/ttcn/AtsMec_V2XInformationService/module.mk index 96fb923..5f02cdc 100644 --- a/ttcn/AtsMec_V2XInformationService/module.mk +++ b/ttcn/AtsMec_V2XInformationService/module.mk @@ -26,6 +26,7 @@ modules := ../LibCommon \ ../LibMec/IoTAPI \ ../LibMec/QoSMeasurementAPI \ ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ -- GitLab From 127e13d5eee6ace10e9fba76bc6661fe8243ce8d Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 7 Jul 2025 08:53:01 +0200 Subject: [PATCH 39/54] Bug fixed in SelfServiceEnablementAPI_TypesAndValues.ttcn --- ttcn/AtsMec_SelfServiceEnablement/module.mk | 2 ++ .../ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn | 7 ++++--- ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ttcn/AtsMec_SelfServiceEnablement/module.mk b/ttcn/AtsMec_SelfServiceEnablement/module.mk index 24667ca..2094dd2 100644 --- a/ttcn/AtsMec_SelfServiceEnablement/module.mk +++ b/ttcn/AtsMec_SelfServiceEnablement/module.mk @@ -24,6 +24,8 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/IoTAPI \ ../LibMec/FederationEnablementAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn index 7fa6b01..a6f9d63 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn @@ -339,11 +339,12 @@ module SelfServiceEnablementAPI_TypesAndValues { type record WebsockNotifConfig { Json.AnyURI websocketUri optional, Json.Bool requestWebsocketUri optional - } with { - encode "JSON" } type record LinkExpiry { LinkType subscription } -} // End of module SelfServiceEnablementAPI_TypesAndValues \ No newline at end of file + +} with { + encode "JSON" +} // End of module SelfServiceEnablementAPI_TypesAndValues diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 41f1d64..43a6d65 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -219,9 +219,8 @@ module LibHttp_JsonMessageBodyTypes { SiteResourceUsageSubscription siteResourceUsageSubscription, SiteResourceUsageNotification siteResourceUsageNotification, ResourceUsageNotification resourceUsageNotification, - SelfServiceEnablementAPI_TypesAndValues.ExpiryNotification expiryNotification_cse, - SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_cse, - + SelfServiceEnablementAPI_TypesAndValues.ExpiryNotification expiryNotification_cse, + SelfServiceEnablementAPI_TypesAndValues.SubscriptionLinkList subscriptionLinkList_cse, // TODO Add here your custom variants universal charstring raw } with { -- GitLab From 5810f3f098a408a298a2c0a8895605e8fcf79011 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 7 Jul 2025 13:24:40 +0200 Subject: [PATCH 40/54] Finalyse validation MEC 012 --- etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ | 6 +++--- .../AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn | 20 ++++--------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ b/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ index f7e55aa..0cb48e1 100644 --- a/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ +++ b/etc/AtsMec_Rnis/AtsMec_Sandbox.cf_ @@ -19,6 +19,7 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i # LibMec_Pixits LibMec_Pics.PICS_MEC_PLAT := true +RnisAPI_Pixits.PX_V2X_CELL_ID := "606060606" RnisAPI_Pixits.PX_SUBSCRIPTION_HREF_VALUE := "cell_change" RnisAPI_Pixits.PX_ASSOCIATE_ID_VALUE := "192.0.0.2" RnisAPI_Pixits.PX_C_ID := "0xFFFFFFFF" @@ -27,7 +28,6 @@ RnisAPI_Pixits.PX_APP_ID := "19" RnisAPI_Pixits.PX_E_RAB_ID := 0 RnisAPI_Pixits.PX_QCI := 0 - [LOGGING] # In this section you can specify the name of the log file and the classes of events # you want to log into the file or display on console (standard error). @@ -103,7 +103,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec012)/TCP(debug=1 # Check that the RNIS service sends a RNIS subscription when requested #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_OK # Check that the RNIS service responds with error when a not existing RNIS subscription is requested -AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF +#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF # Check that the RNIS service modifies a RNIS subscription when requested #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_014_OK # Check that the RNIS service sends an error when it receives a malformed modify request for a RNIS subscription @@ -119,7 +119,7 @@ AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_013_NF # Check that the RNIS service returns the PLMN information when requested #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_017_OK # Check that the RNIS service returns the S1 bearer information -#AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_018_OK +AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_018_OK # Check that the RNIS service returns the L2 measurements information #AtsMec_RnisAPI_TestCases.TC_MEC_MEC012_SRV_RNIS_019_OK # Check that the RNIS service returns an error when the RAB information is requested with a malformatted message diff --git a/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn index a0b151c..4d70ab3 100644 --- a/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn @@ -1196,7 +1196,7 @@ module AtsMec_RnisAPI_TestCases { mw_body_json_cell_change_subscription( mw_cell_change_subscription( PX_CALLBACK_REFERENCE & "_1", - { self_ := { href := "https://" & PICS_HEADER_HOST & PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & v_uri } }, // TODO Rebuild PX_LINKS_SELF, + { self_ := { href := "http://" & PICS_HEADER_HOST & PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & v_uri } }, // TODO Rebuild PX_LINKS_SELF, mw_filter_criteria_ho( "01", { mw_associate_id(UE_IPV4_ADDRESS, PX_ASSOCIATE_ID_VALUE) }, @@ -1616,7 +1616,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns the RAB information when requested. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_016_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1655,7 +1654,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_message_body_json( mw_body_json_rab_info( mw_rab_info( - -,//PX_APP_INS_ID, + -, -, { *, mw_cell_user_info( mw_ecgi( @@ -1683,8 +1682,8 @@ module AtsMec_RnisAPI_TestCases { ))))) { tc_ac.stop; - log("*** " & testcasename() & ": INCONC: IUT successfully responds with a RAB information, without any detail on this cell ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a RAB information, without any detail on this cell ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); @@ -1698,7 +1697,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns the PLMN information when requested. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_017_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1760,7 +1758,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns the S1 bearer information. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_018_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1828,7 +1825,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns the L2 measurements information. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BV.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_019_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1901,7 +1897,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the RAB information is requested with a malformatted message. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_016_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1955,7 +1950,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the RAB information is requested with a malformatted message. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_016_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2009,7 +2003,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the PLMN information is requested with a malformatted message. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_017_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2063,7 +2056,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the PLMN information for a not existing element is requested. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_017_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2117,7 +2109,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the S1 bearer information is requested with a malformatted message. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_018_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2171,7 +2162,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the S1 bearer information for a not existing element is requested. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_018_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2225,7 +2215,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the L2 measurements information is requested with a malformatted message. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_019_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -2279,7 +2268,6 @@ module AtsMec_RnisAPI_TestCases { /** * @desc Check that the RNIS service returns an error when the L2 measurements information for a not existing element is requested. - * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisQuery_BI_BO.tplan2 */ testcase TC_MEC_MEC012_SRV_RNIS_019_NF() runs on HttpComponent system HttpTestAdapter { // Local variables -- GitLab From 529166f3917d9985ba01e9ae5d963653c4c4736a Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 8 Jul 2025 11:35:09 +0200 Subject: [PATCH 41/54] Add missing fields in ApplicationPackageLifecycleAndOperationGrantingAPI_Templates; Bugs ficxed in AtsMec_Location ATS --- ccsrc/Protocols/Json/json_codec_mec013.cc | 2 +- .../AtsMec_Location_Sandbox.cf_ | 4 +- .../AtsMec_LocationAPI_TestCases.ttcn | 12 +++-- ...ycleAndOperationGrantingAPI_Templates.ttcn | 45 +++++++++++++++---- .../ttcn/LocationAPI_Templates.ttcn | 12 ++--- .../ttcn/LocationAPI_TypesAndValues.ttcn | 31 +++---------- .../ttcn/LibHttp_JsonTemplates.ttcn | 8 ++-- 7 files changed, 65 insertions(+), 49 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec013.cc b/ccsrc/Protocols/Json/json_codec_mec013.cc index edcf6a6..66acbe1 100644 --- a/ccsrc/Protocols/Json/json_codec_mec013.cc +++ b/ccsrc/Protocols/Json/json_codec_mec013.cc @@ -201,7 +201,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserDistanceSubscription user_distance_subscription; user_distance_subscription.decode(LocationAPI__TypesAndValues::UserDistanceSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userDistanceSubscription() = user_distance_subscription; - } else if (it->second.find("\"userDistanceNotification\"") != std::string::npos) { + } else if (it->second.find("\"UserDistanceNotification\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); diff --git a/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ b/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ index ac8733c..f2241a6 100644 --- a/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ +++ b/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ @@ -131,7 +131,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec013)/TCP(debug=1 # Check that the IUT acknowledges the UE distance subscription request when commanded by a MEC Application and notifies it when (all) the requested UE(s) is (are) within the specified distance #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR +AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR # Check that the IUT acknowledges the cancellation of UE distance notifications when commanded by a MEC Application #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_002_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application @@ -197,7 +197,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec013)/TCP(debug=1 # Check that the IUT acknowledges a request to modify a not existing subscription by a MEC Application #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_003_NF_02 # Check that the IUT provides a test notification when requested by a MEC Application -AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETESTNOT_001_OK +#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETESTNOT_001_OK # Check that the IUT responds with a list zones when queried by a MEC Application #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEZONELOOK_001_OK # Check that the IUT responds with the subscription when queried by a MEC Application - Zone location Event diff --git a/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn b/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn index 23c0452..62cb536 100644 --- a/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn @@ -1380,9 +1380,11 @@ module AtsMec_LocationAPI_TestCases { -, -, mw_http_message_body_json( - mw_body_json_user_distance_subscription( - v_user_distance_subscription - ))))) { + mw_body_json_user_distance_notification( + mw_user_distance_notification( + -, -, + v_user_distance_subscription.links_ + )))))) { tc_ac.stop; // Send response @@ -1393,6 +1395,10 @@ module AtsMec_LocationAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a userDistanceNotification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] httpPort_notif.receive { + log("*** " & testcasename() & ": INFO: Unsollicited message received ***"); + repeat; + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); diff --git a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn index 19720c8..b3ce9c8 100644 --- a/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationPackageLifecycleAndOperationGrantingAPI/ttcn/ApplicationPackageLifecycleAndOperationGrantingAPI_Templates.ttcn @@ -233,13 +233,35 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { template (present) OnboardingState p_onboardingState := ?, template (present) AppPkgInfo_OperationalState p_operationalState := ?, template (present) UsageState p_usageState := ?, - template (present) AppPkgInfo_Links p_links := ? + template (present) AppPkgInfo_Links p_links := ?, + template Json.String p_appDId := *, + template Json.String p_appProvider := *, + template Json.String p_appName := *, + template Json.String p_appSoftwareVersion := *, + template Json.String p_appDVersion := *, + template Json.String p_signingCertificate := *, + template AppPkgSWImageInfo p_softwareImages := *, + template AppPkgArtifactInfo p_additionalArtifacts := *, + template AppPkgInfo_MecInfo p_mecInfo := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.KeyValuePairs p_userDefinedData := *, + template ProblemDetails p_onboardingFailureDetails := * ) := { id := p_id, + appDId := p_appDId, + appProvider := p_appProvider, + appName := p_appName, + appSoftwareVersion := p_appSoftwareVersion, + appDVersion := p_appDVersion, checksum := p_checksum, + signingCertificate := p_signingCertificate, + softwareImages := p_softwareImages, + additionalArtifacts := p_additionalArtifacts, onboardingState := p_onboardingState, operationalState := p_operationalState, usageState := p_usageState, + mecInfo := p_mecInfo, + userDefinedData := p_userDefinedData, + onboardingFailureDetails := p_onboardingFailureDetails, links := p_links } // End of template mw_app_pkg_info @@ -255,25 +277,32 @@ module ApplicationPackageLifecycleAndOperationGrantingAPI_Templates { template (present) AppPkgInfo_OperationalState p_operationalState := ?, template (present) UsageState p_usageState := ?, template (present) AppPkgInfo_MecInfo p_mecInfo := ?, - template (present) AppPkgInfo_Links p_links := ? + template (present) AppPkgInfo_Links p_links := ?, + template Json.String p_appProvider := *, + template Json.String p_signingCertificate := *, + template AppPkgArtifactInfo p_additionalArtifacts := *, + template ApplicationPackageLifecycleAndOperationGrantingAPI_TypesAndValues.KeyValuePairs p_userDefinedData := *, + template ProblemDetails p_onboardingFailureDetails := * ) := { - id := p_id, + + id := p_id, appDId := p_appDId, - appProvider := *, + appProvider := p_appProvider, appName := p_appName, appSoftwareVersion := p_appSoftwareVersion, appDVersion := p_appDVersion, checksum := p_checksum, - signingCertificate := *, + signingCertificate := p_signingCertificate, softwareImages := p_softwareImages, - additionalArtifacts := *, + additionalArtifacts := p_additionalArtifacts, onboardingState := p_onboardingState, operationalState := p_operationalState, usageState := p_usageState, mecInfo := p_mecInfo, - userDefinedData := *, - onboardingFailureDetails := *, + userDefinedData := p_userDefinedData, + onboardingFailureDetails := p_onboardingFailureDetails, links := p_links + } // End of template mw_app_pkg_info template (value) Checksum m_checksum( diff --git a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn index 1a665cc..e1456c5 100644 --- a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn +++ b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn @@ -24,7 +24,7 @@ module LocationAPI_Templates { accessPointId := p_access_point_id, zoneId := p_zone_id, resourceURL := p_resource_url, - timestamp_ := p_timestamp, + timeStamp := p_timestamp, locationInfo := omit, civicInfo := omit, ancillaryInfo := omit, @@ -42,7 +42,7 @@ module LocationAPI_Templates { accessPointId := p_access_point_id, zoneId := p_zone_id, resourceURL := p_resource_url, - timestamp_ := p_timestamp, + timeStamp := p_timestamp, locationInfo := *, civicInfo := *, ancillaryInfo := *, @@ -84,7 +84,7 @@ module LocationAPI_Templates { offsetAngle := omit, includedAngle := omit, shape := p_shape, - timestamp_ := omit, + timeStamp := omit, velocity := omit } // End of template m_location_info @@ -106,7 +106,7 @@ module LocationAPI_Templates { offsetAngle := *, includedAngle := *, shape := p_shape, - timestamp_ := *, + timeStamp := *, velocity := * } // End of template mw_location_info @@ -907,13 +907,13 @@ module LocationAPI_Templates { template (value) TerminalDistance m_terminal_distance(in Json.Number p_distance) := { distance := p_distance, accuracy := omit, - timestamp_ := omit + timeStamp := omit } // End of template m_terminal_distance template (present) TerminalDistance mw_terminal_distance(template (present) Json.Number p_distance := ?) := { distance := p_distance, accuracy := *, - timestamp_ := * + timeStamp := * } // End of template mw_terminal_distance } // End of module LocationAPI_Templates diff --git a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn index 33b44ca..4e1ca47 100644 --- a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn @@ -143,10 +143,8 @@ module LocationAPI_TypesAndValues { Json.UInteger offsetAngle optional, Json.UInteger includedAngle optional, Shape shape, - TimeStamp timestamp_ optional, + TimeStamp timeStamp optional, Velocity velocity optional - } with { - variant (timestamp_) "name as 'timestamp'"; } // End of type LocationInfo /** @@ -449,20 +447,6 @@ module LocationAPI_TypesAndValues { */ type Json.String Timezone; - /** - * @desc User event - */ - type enumerated UserEventType { - Entering, - Leaving, - Transferring - } - - /** - * @desc List of user event values to generate notifications for (these apply to address specified). If this element is missing, a notification is requested to be generated for any change in user event. - */ - type set of UserEventType UserEventCriteria; - /** * @desc Definition of type CivicAddress * @member country The two-letter ISO 3166 country code in capital ASCII letters @@ -540,7 +524,7 @@ module LocationAPI_TypesAndValues { * @member address_ Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI). * @member accessPointId Identifier of access point, (reference ETSI TS 129 171). * @member zoneId The identity of the zone the user is currently within, - * @member timestamp Date and time that location was collected + * @member timeStamp Date and time that location was collected * @member resourceURL Self referring URL. * @member locationInfo A type containing location information with latitude, longitude and altitude, in addition the accuracy of the information are provided. * @member civicInfo Contextual information of a user location @@ -553,14 +537,13 @@ module LocationAPI_TypesAndValues { AccessPointId accessPointId, ZoneId zoneId, ResourceURL resourceURL optional, - TimeStamp timestamp_, + TimeStamp timeStamp , LocationInfo locationInfo optional, CivicAddress civicInfo optional, AncillaryInfo ancillaryInfo optional, RelativeLocationInfo relativeLocationInfo optional } with { variant (address_) "name as 'address'"; - variant (timestamp_) "name as 'timestamp'"; } // End of type UserInfo /** @@ -615,18 +598,16 @@ module LocationAPI_TypesAndValues { } /** - * @desc A type containing information about the distance from a terminal to a location or between two terminals, in addition the accuracy and a timestamp of the information are provided + * @desc A type containing information about the distance from a terminal to a location or between two terminals, in addition the accuracy and a timeStamp of the information are provided * @member distance Distance from terminal to a location or between two terminals specified in meters * @member accuracy Accuracy of the provided distance in meters - * @member timestamp Date and time that location from which distance is calculated was collected + * @member timeStamp Date and time that location from which distance is calculated was collected * @see OMA-TS-REST_NetAPI_TerminalLocation-V1_0_1-20151029-A Clause 5.2.2.5 Type: TerminalDistance */ type record TerminalDistance { Json.Number distance, Json.Number accuracy optional, - TimeStamp timestamp_ optional - } with { - variant (timestamp_) "name as 'timestamp'"; + TimeStamp timeStamp optional } /** diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 4003ce1..69f4da0 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -628,14 +628,14 @@ module LibHttp_JsonTemplates { } // End of template mw_body_json_user_area_notification template (value) JsonBody m_body_json_user_distance_notification( - in template (value) UserDistanceNotification p_userDistanceNotification - ) := { + in template (value) UserDistanceNotification p_userDistanceNotification + ) := { userDistanceNotification := p_userDistanceNotification } // End of template m_body_json_user_distance_notification template (present) JsonBody mw_body_json_user_distance_notification( - template (present) UserDistanceNotification p_userDistanceNotification := ? - ) := { + template (present) UserDistanceNotification p_userDistanceNotification := ? + ) := { userDistanceNotification := p_userDistanceNotification } // End of template mw_body_json_user_distance_notification -- GitLab From 90eff7af96c0014050af87a74486b37f41a87b06 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Wed, 9 Jul 2025 13:57:12 +0500 Subject: [PATCH 42/54] validate and bug fixes MEC016 --- .../Json/json_codec_factory_mec016.hh | 46 ++++ ccsrc/Protocols/Json/json_codec_mec016.cc | 93 ++++++++ ccsrc/Protocols/Json/json_codec_mec016.hh | 24 +++ ccsrc/Protocols/Json/module.mk | 1 + .../AtsMec_DeviceApplicationInterface.cfg | 115 ++++++++++ .../AtsMec_TrafficManagement.cfg_ | 23 +- ...viceApplicationInterfaceAPI_TestCases.ttcn | 203 ++++++++++-------- ...viceApplicationInterfaceAPI_Functions.ttcn | 21 +- .../DeviceApplicationInterfaceAPI_Pixits.ttcn | 42 ++-- ...viceApplicationInterfaceAPI_Templates.ttcn | 23 +- ...pplicationInterfaceAPI_TypesAndValues.ttcn | 41 ++-- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 6 + 12 files changed, 493 insertions(+), 145 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec016.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec016.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec016.hh create mode 100644 etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec016.hh b/ccsrc/Protocols/Json/json_codec_factory_mec016.hh new file mode 100644 index 0000000..a6dd5b9 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec016.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec013.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec016.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec013 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec016: public codec_factory { + static json_codec_factory_mec016 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec013 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec016() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec016", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec016(); + }; +}; // End of class json_codec_factory_mec013 diff --git a/ccsrc/Protocols/Json/json_codec_mec016.cc b/ccsrc/Protocols/Json/json_codec_mec016.cc new file mode 100644 index 0000000..eccd133 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec016.cc @@ -0,0 +1,93 @@ +#include +#include +#include + +#include "json_codec_factory_mec016.hh" + +#include "loggers.hh" +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec016::encode(const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) { + loggers::get_instance().log_msg(">>> json_codec_mec016::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + // Application Context + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_appContext__device__info)) { + const DeviceApplicationInterfaceAPI__TypesAndValues::AppContext& ctx = msg.appContext__device__info(); + ctx.encode(DeviceApplicationInterfaceAPI__TypesAndValues::AppContext_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + //data = char2oct(CHARSTRING("{\"appContext\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_applicationLocationAvailability)) { + const DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability& ctx = msg.applicationLocationAvailability(); + ctx.encode(DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()); + } + // // Fallback to generic codec + else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec016::encode"); + return 0; +} + +int json_codec_mec016::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) { + + loggers::get_instance().log_msg(">>> json_codec_mec016::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec016::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec016::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec016::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + + + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec016::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.size(), (const unsigned char*)str.c_str())); + + // Determine body type by finding JSON field name + if ((str.find("\"userAppInstanceInfo\"") != std::string::npos) && (str.find("\"appInfo\"") != std::string::npos)) { + DeviceApplicationInterfaceAPI__TypesAndValues::AppContext ctx; + ctx.decode(DeviceApplicationInterfaceAPI__TypesAndValues::AppContext_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.appContext__device__info() = ctx; + } else if ((str.find("\"appList\"") != std::string::npos) && (str.find("\"appInfo\"") != std::string::npos)) { + DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationList ctx; + ctx.decode(DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.applicationList() = ctx; + } else if ((it->second.find("\"appInfo\"") != std::string::npos) && (str.find("\"availableLocations\"") != std::string::npos)) { + DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability application_location_availability; + application_location_availability.decode(DeviceApplicationInterfaceAPI__TypesAndValues::ApplicationLocationAvailability_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.applicationLocationAvailability() = application_location_availability; + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec016::decode: ", (const Base_Type&)msg); + return 0; +} + +// Register codec factory +json_codec_factory_mec016 json_codec_factory_mec016::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec016.hh b/ccsrc/Protocols/Json/json_codec_mec016.hh new file mode 100644 index 0000000..f8e194d --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec016.hh @@ -0,0 +1,24 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec016: public json_codec +{ +public: + explicit json_codec_mec016() : json_codec() { }; + virtual ~json_codec_mec016() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec013 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index 270da2a..2978aa9 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -3,6 +3,7 @@ sources := \ json_codec_mec011.cc \ json_codec_mec013.cc \ json_codec_mec015.cc \ + json_codec_mec016.cc \ json_codec_mec030.cc \ json_codec_mec028.cc \ json_codec_mec040.cc \ diff --git a/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg new file mode 100644 index 0000000..27b44cf --- /dev/null +++ b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg @@ -0,0 +1,115 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "192.168.40.50" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +#LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" + +# LibMec_Pixits +DeviceApplicationInterfaceAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" +# DeviceApplicationInterfaceAPI_Pixits.PX_APPD_ID := "onboarded-demo4" +# DeviceApplicationInterfaceAPI_Pixits.PX_APP_DESCRIPTION := "Basic HTTP" +# DeviceApplicationInterfaceAPI_Pixits.PX_APP_PROVIDER := "demo" +# DeviceApplicationInterfaceAPI_Pixits.PX_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23-b786-a3062a371c8a" + + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_DeviceApplicationInterface/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec016)/TCP(debug=1,server=192.168.40.50,port=80,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT responds with the list of user applications when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_NF +# Check that the IUT responds with the list of user applications when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_BR +#Check that the IUT acknowledges the creation of the application context when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_OK +# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_BR +# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_NF +# Check that the IUT acknowledges the creation of the application context when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_BR +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_NF +# Check that the IUT deletes the application context when commanded by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_NF +# Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_NF + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ index e73de25..0f34812 100644 --- a/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ +++ b/etc/AtsMec_TrafficManagement/AtsMec_TrafficManagement.cfg_ @@ -8,14 +8,17 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "172.26.214.231" +LibHttp_Pics.PICS_HEADER_HOST := "192.168.40.50" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true #LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" -# LibMec_Pixits +LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" +# LibMec_Pixits +TrafficManagementAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" +TrafficManagementAPI_Pixits.PX_APP_INSTANCE_ID_2 := "81c51643-8c6f-4781-ad45-f8a457ca549b" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -33,7 +36,7 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server=172.26.208.1,port=3002,use_ssl=0)" +system.httpPort.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server=192.168.40.50,port=80,use_ssl=0)" #system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" #system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" @@ -84,24 +87,26 @@ system.httpPort.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,serve #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR_01 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_002_BR_02 -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +# Check that the IUT responds with the configured bandwidth allocation when queried by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_OK -#Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_003_NF +# Check that the IUT updates the requested bandwidth requirements when commanded by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_01 #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present -#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_01 -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_BR_02 +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_004_NF #Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application -#TC_MEC_MEC015_SRV_TM_005_OK +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_OK #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be omitted #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR_01 #Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - sessionFilter shall be present #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_BR_02 #Check that the IUT when provided with just the changes (deltas) updates the requested bandwidth requirements when commanded by a MEC Application -#TC_MEC_MEC015_SRV_TM_005_NF +#AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_005_NF #Check that the IUT unregisters from the Bandwidth Management Service when commanded by a MEC Application #AtsMec_TrafficManagementAPI_TestCases.TC_MEC_MEC015_SRV_TM_006_OK #Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application diff --git a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn index eda51f7..ce71620 100644 --- a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn @@ -83,7 +83,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_device_info_app_list - )))) -> value v_response { + )))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); @@ -125,7 +125,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "appName", + PICS_ROOT_API & "dev_app/v1/app_list_error", v_headers ) ) @@ -181,7 +181,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?appName=" & PX_DEVICE_APP_NAME, + PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?appName=" & oct2char(unichar2oct(PX_DEVICE_APP_NAME, "UTF-8")), v_headers ) ) @@ -238,7 +238,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "appName", + PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?APP_NAME", v_headers ) ) @@ -331,7 +331,9 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { // Local variables var Headers v_headers; var HttpMessage v_response; - + + var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := PX_APP_INSTANCE_ID, referenceURI := "http://example.com/aeiou", appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; + // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); @@ -354,12 +356,16 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, - PX_APPD_VERSION + PX_APPD_VERSION, + PX_APP_DESCRIPTION, + PX_APP_SOFT_VERSION, + v_userAppInstanceInfo ), PX_DEVICE_APP_CALLBACK ) @@ -427,17 +433,21 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "Invalid", + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, - PX_APPD_VERSION + PX_APPD_VERSION, + PX_APP_DESCRIPTION, + PX_APP_SOFT_VERSION, + omit ), PX_DEVICE_APP_CALLBACK ) @@ -496,11 +506,12 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "WRONGURL", v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -568,17 +579,18 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & v_device_info_app_context.contextId, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(v_device_info_app_context.contextId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + v_device_info_app_context.contextId, PX_ASSOCIATE_DEV_APPID, m_app_context_info( - PX_APPD_ID, - PX_APP_NAME, - PX_APP_PROVIDER, - PX_APPD_VERSION + PX_APPD_ID_2, + PX_APP_NAME_2, + PX_APP_PROVIDER_2, + PX_APPD_VERSION_2 ), PX_DEVICE_NEW_APP_CALLBACK ) @@ -642,11 +654,12 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & v_device_info_app_context.contextId, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(v_device_info_app_context.contextId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + -, PX_INVALID_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -711,11 +724,12 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_CONTEXT_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( + PX_UNKNOWN_APP_CONTEXT_ID, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -782,7 +796,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(v_device_info_app_context.contextId, "UTF-8")), v_headers ) ) @@ -837,7 +851,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, + PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & oct2char(unichar2oct(PX_UNKNOWN_APP_CONTEXT_ID, "UTF-8")), v_headers ) ) @@ -872,71 +886,90 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var Headers v_headers; - - // Test control - if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - httpPort.send( - m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, - v_headers, - m_http_message_body_json( - m_body_json_device_info_app_location_availability( - m_application_location_availability( - PX_ASSOCIATE_DEV_APPID, - m_application_location_availability_info( - PX_APPD_ID, - PX_APP_NAME, - PX_APP_PROVIDER, - PX_APPD_VERSION - ) - ) - ) - ) - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); + // Local variables + var Headers v_headers; + template (value) ApplicationLocationAvailability_AppInfo t_appLocAvail := + { + appName := "onboarded-demo4", + appProvider := "ETSI", + appSoftVersion := "v0.1.0", + appDVersion := "v0.1.0", + appDescription := "Basic HTTP Ping Pong", + availableLocations := { + { + appLocation := { + countryCode := "492", + civicAddressElement := { + { caType := 1, caValue := "A1" }, + { caType := 2, caValue := "A2" } + }, + area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}} + } + } + }, + appPackageSource := "http://example.com/aeiou" + }; - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - m_body_json_device_info_app_location_availability( - mw_application_location_availability( - PX_ASSOCIATE_DEV_APPID, - mw_application_location_availability_info - )))))) { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_down(); + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_DEVICE_APP_LOC_URI, + v_headers, + m_http_message_body_json( + m_body_json_device_info_app_location_availability( + m_application_location_availability( + PX_ASSOCIATE_DEV_APPID, + t_appLocAvail + ) + + ) + + ) + ) + ) + + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + m_body_json_device_info_app_location_availability( + mw_application_location_availability( + PX_ASSOCIATE_DEV_APPID, + t_appLocAvail + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK /** @@ -965,7 +998,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "_invalid", + PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( @@ -973,7 +1006,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_ASSOCIATE_DEV_APPID, m_application_location_availability_info( PX_APPD_ID, - PX_APP_NAME, + PX_UNKNOWN_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ) @@ -1062,7 +1095,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { )) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn index 0f43a1f..4cf0942 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn @@ -33,6 +33,7 @@ module DeviceApplicationInterfaceAPI_Functions { ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; + var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := PX_APP_INSTANCE_ID, referenceURI := "http://example.com/aeiou", appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -43,14 +44,18 @@ module DeviceApplicationInterfaceAPI_Functions { m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( - PX_ASSOCIATE_DEV_APPID, - m_app_context_info( - PX_APPD_ID, - PX_UNKNOWN_APP_NAME, - PX_APP_PROVIDER, - PX_APPD_VERSION - ), - PX_DEVICE_APP_CALLBACK + -, + PX_ASSOCIATE_DEV_APPID, + m_app_context_info( + PX_APPD_ID, + PX_APP_NAME, + PX_APP_PROVIDER, + PX_APPD_VERSION, + PX_APP_DESCRIPTION, + PX_APP_SOFT_VERSION, + v_userAppInstanceInfo + ), + PX_DEVICE_APP_CALLBACK ) ) ) diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn index 49e31f2..56a6d9f 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Pixits.ttcn @@ -3,34 +3,46 @@ module DeviceApplicationInterfaceAPI_Pixits { // JSON import from Json all; - modulepar charstring PX_DEVICE_APP_LIST_URI := "/dev_app/v1/app_list"; + modulepar Json.String PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b"; - modulepar charstring PX_DEVICE_APP_CTX_URI := "/dev_app/v1/app_contexts"; + modulepar Json.String PX_DEVICE_APP_NAME := ""; - modulepar charstring PX_DEVICE_APP_LOC_URI := "/dev_app/v1/obtain_app_loc_availability"; + modulepar Json.String PX_DEVICE_UNKNOWN_APP_NAME := ""; - modulepar charstring PX_DEVICE_APP_NAME := ""; + modulepar Json.String PX_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23-b786-a3062a371c8a"; - modulepar charstring PX_DEVICE_UNKNOWN_APP_NAME := ""; + modulepar Json.String PX_UNKNOWN_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23"; - modulepar charstring PX_ASSOCIATE_DEV_APPID := ""; + modulepar Json.String PX_INVALID_ASSOCIATE_DEV_APPID := ""; - modulepar charstring PX_INVALID_ASSOCIATE_DEV_APPID := ""; + modulepar Json.String PX_DEVICE_APP_CALLBACK := "http://clientApp.example.com/location_notifications/123456"; - modulepar charstring PX_DEVICE_APP_CALLBACK := ""; + modulepar Json.String PX_DEVICE_NEW_APP_CALLBACK := ""; - modulepar charstring PX_DEVICE_NEW_APP_CALLBACK := ""; + modulepar Json.String PX_APPD_ID := ""; + + modulepar Json.String PX_APPD_ID_2 := "Ccee2135-2750-4d23-b786-a3062a371c8a"; - modulepar charstring PX_APPD_ID := ""; + modulepar Json.String PX_APP_NAME := "onboarded-demo4"; - modulepar charstring PX_APP_NAME := ""; + modulepar Json.String PX_APP_NAME_2 := "demo2"; - modulepar charstring PX_UNKNOWN_APP_NAME := ""; + modulepar Json.String PX_UNKNOWN_APP_NAME := "UNKNOWN"; - modulepar charstring PX_APP_PROVIDER := ""; + modulepar Json.String PX_APP_PROVIDER := "ETSI"; - modulepar charstring PX_APPD_VERSION := ""; + modulepar Json.String PX_APP_PROVIDER_2 := "ETSI_2"; - modulepar charstring PX_UNKNOWN_APP_CONTEXT_ID := ""; + modulepar Json.String PX_APPD_VERSION := "v0.1.0"; + + modulepar Json.String PX_APPD_VERSION_2 := "v0.1.1"; + + modulepar Json.String PX_APP_SOFT_VERSION := "v0.1.0" + + modulepar Json.String PX_APP_SOFT_VERSION_2 := "v0.1.1" + + modulepar Json.String PX_APP_DESCRIPTION := "" + + modulepar Json.String PX_UNKNOWN_APP_CONTEXT_ID := "ccee2135-2750-4d23-b786-a3062a371c8aaa"; } // End of module DeviceApplicationInterfaceAPI_Pixits diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn index 8b1ab83..8114254 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Templates.ttcn @@ -12,13 +12,14 @@ module DeviceApplicationInterfaceAPI_Templates { template (omit) AppContext m_device_app_context( + in template (omit) Json.String p_contextID := omit, in template (value) Json.String p_associateDevAppId, in template (value) ApplicationContext_AppInfo p_appInfo, in template (omit) Json.AnyURI p_callbackReference := omit, in template (omit) boolean p_appLocationUpdates := omit, in template (omit) boolean p_appAutoInstantiation := omit ) := { - contextId := omit, + contextId := p_contextID, associateDevAppId := p_associateDevAppId, callbackReference := p_callbackReference, appLocationUpdates := p_appLocationUpdates, @@ -82,24 +83,23 @@ module DeviceApplicationInterfaceAPI_Templates { appPackageSource := p_appPackageSource } // End ot template mw_app_context_info - template (value) ApplicationLocationAvailability m_application_location_availability( - in Json.String p_associateDevAppId, - in template (value) ApplicationLocationAvailability_AppInfo p_appInfo + template (omit) ApplicationLocationAvailability m_application_location_availability( + in template (value) Json.String p_associateDevAppId, + in template (omit) ApplicationLocationAvailability_AppInfo p_appInfo := omit ) := { associateDevAppId := p_associateDevAppId, appInfo := p_appInfo } // End of template m_application_location_availability - template (present) ApplicationLocationAvailability mw_application_location_availability( - template (present) Json.String p_associateDevAppId := ?, - template (present) ApplicationLocationAvailability_AppInfo p_appInfo := ? - ) := { + template ApplicationLocationAvailability mw_application_location_availability( + template (present) Json.String p_associateDevAppId := ?, + template (present) ApplicationLocationAvailability_AppInfo p_appInfo := ? + ) := { associateDevAppId := p_associateDevAppId, appInfo := p_appInfo } // End of template mw_application_location_availability template (omit) ApplicationLocationAvailability_AppInfo m_application_location_availability_info( - in Json.String p_appDId, in Json.String p_appName, in Json.String p_appProvider, in Json.String p_appDVersion, @@ -108,7 +108,6 @@ module DeviceApplicationInterfaceAPI_Templates { in template (omit) AvailableLocationsList p_availableLocations := omit, in template (omit) Json.AnyURI p_appPackageSource := omit ) := { - appDId := p_appDId, appName := p_appName, appProvider := p_appProvider, appSoftVersion := p_appSoftVersion, @@ -118,8 +117,7 @@ module DeviceApplicationInterfaceAPI_Templates { appPackageSource := p_appPackageSource } // End of template m_application_location_availability_info - template (present) ApplicationLocationAvailability_AppInfo mw_application_location_availability_info( - template (present) Json.String p_appDId := ?, + template ApplicationLocationAvailability_AppInfo mw_application_location_availability_info( template (present) Json.String p_appName := ?, template (present) Json.String p_appProvider := ?, template (present) Json.String p_appDVersion := ?, @@ -128,7 +126,6 @@ module DeviceApplicationInterfaceAPI_Templates { template AvailableLocationsList p_availableLocations := *, template Json.AnyURI p_appPackageSource := * ) := { - appDId := p_appDId, appName := p_appName, appProvider := p_appProvider, appSoftVersion := p_appSoftVersion, diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn index 72e35ca..f1b0575 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_TypesAndValues.ttcn @@ -174,7 +174,6 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { * @seeETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.2.4 Type: ApplicationLocationAvailability */ type record ApplicationLocationAvailability_AppInfo { - Json.String appDId, Json.String appName, Json.String appProvider, Json.String appSoftVersion optional, @@ -255,7 +254,7 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { */ type record LocationConstraints { Json.String countryCode optional, - CivicAddressElement civicAddressElement optional, + CivicAddressElementList civicAddressElement optional, Polygon area optional } type set of LocationConstraints LocationConstraintsList; @@ -270,33 +269,45 @@ module DeviceApplicationInterfaceAPI_TypesAndValues { Json.Integer caType, Json.String caValue } + type set of CivicAddressElement CivicAddressElementList /** * @desc * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ - type record Polygon { - Json.String type_, - Geometry geometry, - Properties properties, - Json.String this_ - } with { - variant (type_) "name as 'type'"; - variant (this_) "name as 'this'"; - } + // type record Polygon_ { + // Json.String type_, + // Geometry geometry, + // Properties properties, + // Json.String this_ + // } with { + // variant (type_) "name as 'type'"; + // variant (this_) "name as 'this'"; + // } +type record Polygon { + Coordinates coordinates +} with { + variant (coordinates) "name as 'coordinates'" +} /** * @desc * @see ETSI GS MEC 016 V3.1.1 (2024-03) Clause 6.5.2 Type: LocationConstraints */ type record Geometry { - Json.String type_, - Coordinates coordinates + Json.String type_ optional, + Coordinates coordinates_ } with { variant (type_) "name as 'type'"; + variant (coordinates_) "name as 'coordinates'"; } - type set of Json.Number Coordinate; - type set of Coordinate Coordinates; + + + +type record length(2) of Json.Number Position; +type set of Position LinearRing; +type set of LinearRing Coordinates; + /** * @desc diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 55a8c4d..4456a24 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -30,6 +30,12 @@ module LibMec_Pixits { // FIXME FSCOM Split this file according to the different modulepar charstring PX_ME_MTS_SESSIONS_URI := "mts/v1/mts_sessions"; + modulepar charstring PX_DEVICE_APP_LIST_URI := "dev_app/v1/app_list"; + + modulepar charstring PX_DEVICE_APP_CTX_URI := "dev_app/v1/app_contexts"; + + modulepar charstring PX_DEVICE_APP_LOC_URI := "dev_app/v1/obtain_app_loc_availability"; + modulepar charstring PX_ME_WLAN_QUERIES_URI := "wai/v2/queries"; modulepar charstring PX_ME_WLAN_URI := "wai/v2"; -- GitLab From 089e24b36ae21d6a0c06f81b0270055956f5de23 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 9 Jul 2025 14:42:06 +0200 Subject: [PATCH 43/54] Minor bug fixed in MEC013 ATS; Update support of MEC021 & MEC029 ATSs --- .../Json/json_codec_factory_mec021.hh | 46 ++++++ .../Json/json_codec_factory_mec029.hh | 46 ++++++ ccsrc/Protocols/Json/json_codec_mec012.cc | 4 - ccsrc/Protocols/Json/json_codec_mec013.cc | 30 ++-- ccsrc/Protocols/Json/json_codec_mec021.cc | 84 ++++++++++ ccsrc/Protocols/Json/json_codec_mec021.hh | 25 +++ ccsrc/Protocols/Json/json_codec_mec029.cc | 82 ++++++++++ ccsrc/Protocols/Json/json_codec_mec029.hh | 25 +++ ccsrc/Protocols/Json/module.mk | 2 + ...Mec_ApplicationMobiltyService_Sandbox.cfg_ | 146 ++++++++++++++++++ ..._FixedAccessInformationService_Sandbox.cf_ | 133 ++++++++++++++++ .../AtsMec_Location_Sandbox.cf_ | 19 +-- ...pplicationMobiltyServiceAPI_TestCases.ttcn | 16 +- ...ycleAndOperationGrantingAPI_TestCases.ttcn | 8 +- .../module.mk | 3 + .../AtsMec_LocationAPI_TestCases.ttcn | 48 ++++-- .../AtsMec_LocationAPI_TestControl.ttcn | 3 +- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 38 ++--- 18 files changed, 689 insertions(+), 69 deletions(-) create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec021.hh create mode 100644 ccsrc/Protocols/Json/json_codec_factory_mec029.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec021.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec021.hh create mode 100644 ccsrc/Protocols/Json/json_codec_mec029.cc create mode 100644 ccsrc/Protocols/Json/json_codec_mec029.hh create mode 100644 etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ create mode 100644 etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec021.hh b/ccsrc/Protocols/Json/json_codec_factory_mec021.hh new file mode 100644 index 0000000..bfa4f9c --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec021.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec021.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec021.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec021 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec021: public codec_factory { + static json_codec_factory_mec021 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec021 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec021() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec021", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec021(); + }; +}; // End of class json_codec_factory_mec021 diff --git a/ccsrc/Protocols/Json/json_codec_factory_mec029.hh b/ccsrc/Protocols/Json/json_codec_factory_mec029.hh new file mode 100644 index 0000000..e810f93 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_factory_mec029.hh @@ -0,0 +1,46 @@ +/*! + * \file json_codec_factory_mec029.hh + * \brief Header file for ITS JSON/IP protocol codec factory. + * \author ETSI STF569 / TTF T027 + * \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. + * \version 0.1 + */ +#pragma once + +#include "codec_stack_builder.hh" + +#include "json_codec_mec029.hh" + +class Record_Type; //! TITAN forward declaration + +/*! + * \class json_codec_factory_mec029 + * \brief This class provides a factory class to create an json_codec class instance + */ +class json_codec_factory_mec029: public codec_factory { + static json_codec_factory_mec029 _f; //! Reference to the unique instance of this class +public: //! \publicsection + /*! + * \brief Default constructor + * Create a new instance of the json_codec_factory_mec029 class + * \remark The HELD/IP codec identifier is HELD + */ + json_codec_factory_mec029() { + // register factory + codec_stack_builder::register_codec_factory("json_codec_mec029", this); + }; + /*! + * \fn codec* create_codec(const std::string & type, const std::string & param); + * \brief Create the codecs stack based on the provided codecs stack description + * \param[in] p_type The provided codecs stack description + * \param[in] p_params Optional parameters + * \return 0 on success, -1 otherwise + * \inline + */ + inline virtual codec_gen* create_codec() { + return (codec_gen*)new json_codec_mec029(); + }; +}; // End of class json_codec_factory_mec029 diff --git a/ccsrc/Protocols/Json/json_codec_mec012.cc b/ccsrc/Protocols/Json/json_codec_mec012.cc index 46aeec6..7ab051b 100644 --- a/ccsrc/Protocols/Json/json_codec_mec012.cc +++ b/ccsrc/Protocols/Json/json_codec_mec012.cc @@ -98,10 +98,6 @@ int json_codec_mec012::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo RnisAPI__TypesAndValues::PlmnInfos plmn_infos; plmn_infos.decode(RnisAPI__TypesAndValues::PlmnInfos_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.plmnInfos() = plmn_infos; - - - - } else { return json_codec::decode(p_data, msg, p_params); } diff --git a/ccsrc/Protocols/Json/json_codec_mec013.cc b/ccsrc/Protocols/Json/json_codec_mec013.cc index 66acbe1..e415664 100644 --- a/ccsrc/Protocols/Json/json_codec_mec013.cc +++ b/ccsrc/Protocols/Json/json_codec_mec013.cc @@ -113,7 +113,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::NotificationSubscriptionList notification_subscription_list; notification_subscription_list.decode(LocationAPI__TypesAndValues::NotificationSubscriptionList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.notificationSubscriptionList() = notification_subscription_list; - } else if (it->second.find("\"userLocationEventSubscription\"") != std::string::npos) { + } else if (it->second.find("\"UserLocationEventSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -121,7 +121,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserLocationEventSubscription user_location_event_subscription; user_location_event_subscription.decode(LocationAPI__TypesAndValues::UserLocationEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationEventSubscription() = user_location_event_subscription; - } else if (it->second.find("\"userLocationEventNotification\"") != std::string::npos) { + } else if (it->second.find("\"UserLocationEventNotification\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -129,7 +129,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserLocationEventNotification user_location_event_notification; user_location_event_notification.decode(LocationAPI__TypesAndValues::UserLocationEventNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationEventNotification() = user_location_event_notification; - } else if (it->second.find("\"userLocationPeriodicSubscription\"") != std::string::npos) { + } else if (it->second.find("\"UserLocationPeriodicSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -137,7 +137,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserLocationPeriodicSubscription user_location_periodic_subscription; user_location_periodic_subscription.decode(LocationAPI__TypesAndValues::UserLocationPeriodicSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationPeriodicSubscription() = user_location_periodic_subscription; - } else if (it->second.find("\"userLocationPeriodicNotification\"") != std::string::npos) { + } else if (it->second.find("\"UserLocationPeriodicNotification\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -145,7 +145,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserLocationPeriodicNotification user_location_periodic_notification; user_location_periodic_notification.decode(LocationAPI__TypesAndValues::UserLocationPeriodicNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userLocationPeriodicNotification() = user_location_periodic_notification; - } else if (it->second.find("\"zoneStatusSubscription\"") != std::string::npos) { + } else if (it->second.find("\"ZoneStatusSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -153,7 +153,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::ZoneStatusSubscription zone_status_subscription; zone_status_subscription.decode(LocationAPI__TypesAndValues::ZoneStatusSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zoneStatusSubscription() = zone_status_subscription; - } else if (it->second.find("\"zoneStatusNotification\"") != std::string::npos) { + } else if (it->second.find("\"ZoneStatusNotification\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -161,7 +161,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::ZoneStatusNotification zone_status_notification; zone_status_notification.decode(LocationAPI__TypesAndValues::ZoneStatusNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zoneStatusNotification() = zone_status_notification; - } else if (it->second.find("\"zoneLocationEventSubscription\"") != std::string::npos) { + } else if (it->second.find("\"ZoneLocationEventSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -169,7 +169,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::ZoneLocationEventSubscription zone_location_event_subscription; zone_location_event_subscription.decode(LocationAPI__TypesAndValues::ZoneLocationEventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zoneLocationEventSubscription() = zone_location_event_subscription; - } else if (it->second.find("\"zoneLocationEventNotification\"") != std::string::npos) { + } else if (it->second.find("\"ZoneLocationEventNotification\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -177,7 +177,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::ZoneLocationEventNotification zone_location_event_notification; zone_location_event_notification.decode(LocationAPI__TypesAndValues::ZoneLocationEventNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.zoneLocationEventNotification() = zone_location_event_notification; - } else if (it->second.find("\"userAreaSubscription\"") != std::string::npos) { + } else if (it->second.find("\"UserAreaSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -185,7 +185,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserAreaSubscription user_area_subscription; user_area_subscription.decode(LocationAPI__TypesAndValues::UserAreaSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userAreaSubscription() = user_area_subscription; - } else if (it->second.find("\"userAreaNotification\"") != std::string::npos) { + } else if (it->second.find("\"UserAreaNotification\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -193,7 +193,7 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserAreaNotification user_area_notification; user_area_notification.decode(LocationAPI__TypesAndValues::UserAreaNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userAreaNotification() = user_area_notification; - } else if (it->second.find("\"userDistanceSubscription\"") != std::string::npos) { + } else if (it->second.find("\"UserDistanceSubscription\"") != std::string::npos) { int idx_begin = it->second.find(":"); int idx_end = it->second.rfind("}") - 1; // Remove the last '}' str = it->second.substr(idx_begin + 1, idx_end - idx_begin); @@ -209,6 +209,14 @@ int json_codec_mec013::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo LocationAPI__TypesAndValues::UserDistanceNotification user_distance_notification; user_distance_notification.decode(LocationAPI__TypesAndValues::UserDistanceNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userDistanceNotification() = user_distance_notification; + } else if (it->second.find("\"TestNotification\"") != std::string::npos) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + LocationAPI__TypesAndValues::TestNotification test_notification; + test_notification.decode(LocationAPI__TypesAndValues::TestNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.testNotification() = test_notification; } else if (it->second.find("\"accessPointId\"") != std::string::npos) { if (it->second.find("\"address\"") != std::string::npos) { LocationAPI__TypesAndValues::UserInfo user_info; diff --git a/ccsrc/Protocols/Json/json_codec_mec021.cc b/ccsrc/Protocols/Json/json_codec_mec021.cc new file mode 100644 index 0000000..4c2af72 --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec021.cc @@ -0,0 +1,84 @@ +#include +#include +#include + +#include "json_codec_factory_mec021.hh" + +#include "loggers.hh" + +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec021::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +{ + loggers::get_instance().log_msg(">>> json_codec_mec021::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_registrationInfo)) { + const ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo& registration_info = msg.registrationInfo(); + registration_info.encode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec021::encode"); + return 0; +} + +int json_codec_mec021::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +{ + loggers::get_instance().log_msg(">>> json_codec_mec021::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec021::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec021::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec021::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + // ..and create the decoding buffer + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec021::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + + if (it->second.find("\"appMobilityServiceId\"") != std::string::npos) { + if (it->second[0] == '[') { + ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfos registration_infos; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + registration_infos.decode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.registrationInfos() = registration_infos; + } else { + ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo registration_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + registration_info.decode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.registrationInfo() = registration_info; + } + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec021::decode: ", (const Base_Type&)msg); + return 0; +} + +json_codec_factory_mec021 json_codec_factory_mec021::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec021.hh b/ccsrc/Protocols/Json/json_codec_mec021.hh new file mode 100644 index 0000000..033a59b --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec021.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" + +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec021: public json_codec +{ +public: + explicit json_codec_mec021() : json_codec() { }; + virtual ~json_codec_mec021() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec021 diff --git a/ccsrc/Protocols/Json/json_codec_mec029.cc b/ccsrc/Protocols/Json/json_codec_mec029.cc new file mode 100644 index 0000000..2e8596e --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec029.cc @@ -0,0 +1,82 @@ +#include +#include +#include + +#include "json_codec_factory_mec029.hh" + +#include "loggers.hh" + +#include "LibHttp_JsonMessageBodyTypes.hh" + +int json_codec_mec029::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTETSTRING& data) +{ + loggers::get_instance().log_msg(">>> json_codec_mec029::encode: ", (const Base_Type&)msg); + + TTCN_EncDec::clear_error(); + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_Buffer encoding_buffer; + + if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_registrationInfo)) { + const FixedAccessInformationServiceAPI__TypesAndValues::OnuAlarmSubscription& onu_alarm_subscription = msg.onuAlarmSubscription(); + onu_alarm_subscription.encode(FixedAccessInformationServiceAPI__TypesAndValues::OnuAlarmSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else { + return json_codec::encode(msg, data); + } + + loggers::get_instance().log("<<< json_codec_mec029::encode"); + return 0; +} + +int json_codec_mec029::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +{ + loggers::get_instance().log_msg(">>> json_codec_mec029::decode: p_data=", p_data); + + // Sanity checks + params::const_iterator it; + if (p_params == nullptr) { + loggers::get_instance().warning("json_codec_mec029::decode: Failed to access p_params (null pointer)"); + return -1; // TODO Use p_data instead of return -1 + } else { + it = p_params->find("decode_str"); + if (it == p_params->cend()) { + loggers::get_instance().warning("json_codec_mec029::decode: Failed to access p_params item (decode_str)"); + return -1; // TODO Use p_data instead of return -1 + } + loggers::get_instance().log("json_codec_mec029::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); + } + + // Remove data structure name (if present) ... + std::string str; + if ((it->second[0] != '[') && (it->second[0] != '{')) { + int idx_begin = it->second.find(":"); + int idx_end = it->second.rfind("}") - 1; // Remove the last '}' + str = it->second.substr(idx_begin + 1, idx_end - idx_begin); + } else { + str = it->second; + } + // ..and create the decoding buffer + TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); + TTCN_EncDec::clear_error(); + loggers::get_instance().log("json_codec_mec029::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); + TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + + if (it->second.find("\"lastMileTech\"") != std::string::npos) { + FixedAccessInformationServiceAPI__TypesAndValues::FaInfo fa_info; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + fa_info.decode(FixedAccessInformationServiceAPI__TypesAndValues::FaInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.faInfo() = fa_info; + } else if (it->second.find("\"OnuAlarmSubscription\"") != std::string::npos) { + FixedAccessInformationServiceAPI__TypesAndValues::OnuAlarmSubscription onu_alarm_subscription; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + onu_alarm_subscription.decode(FixedAccessInformationServiceAPI__TypesAndValues::OnuAlarmSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.onuAlarmSubscription() = onu_alarm_subscription; + } else { + return json_codec::decode(p_data, msg, p_params); + } + + loggers::get_instance().log_msg("<<< json_codec_mec029::decode: ", (const Base_Type&)msg); + return 0; +} + +json_codec_factory_mec029 json_codec_factory_mec029::_f; diff --git a/ccsrc/Protocols/Json/json_codec_mec029.hh b/ccsrc/Protocols/Json/json_codec_mec029.hh new file mode 100644 index 0000000..534542e --- /dev/null +++ b/ccsrc/Protocols/Json/json_codec_mec029.hh @@ -0,0 +1,25 @@ +#pragma once + +#include "codec_gen.hh" +#include "params.hh" + +#include "json_codec.hh" + +class Base_Type; +class TTCN_Typedescriptor_t; +class TTCN_Buffer; + +namespace LibHttp__JsonMessageBodyTypes { + class JsonBody; +} + +class json_codec_mec029: public json_codec +{ +public: + explicit json_codec_mec029() : json_codec() { }; + virtual ~json_codec_mec029() { }; + + int encode (const LibHttp__JsonMessageBodyTypes::JsonBody&, OCTETSTRING& data); + int decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody&, params* p_params = NULL); + +}; // End of class json_codec_mec029 diff --git a/ccsrc/Protocols/Json/module.mk b/ccsrc/Protocols/Json/module.mk index 27728dc..60a7071 100644 --- a/ccsrc/Protocols/Json/module.mk +++ b/ccsrc/Protocols/Json/module.mk @@ -4,7 +4,9 @@ sources := \ json_codec_mec012.cc \ json_codec_mec013.cc \ json_codec_mec030.cc \ + json_codec_mec021.cc \ json_codec_mec028.cc \ + json_codec_mec029.cc \ json_codec_mec033.cc \ json_codec_mec040.cc \ json_codec_mec046.cc \ diff --git a/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ b/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ new file mode 100644 index 0000000..7bdf80e --- /dev/null +++ b/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ @@ -0,0 +1,146 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' + +LibMec_Pics.PICS_MEC_PLAT := true + +# Application Instance ID + +# Callbacks + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_ApplicationMobiltyService/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec021)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec021)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_ApplicationMobiltyServiceAPI_TestControl.control + +# Check that the AMS service returns information about the registered application mobility services when requested +AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01 +# Check that the AMS service returns information about the a specific registered application mobility service when requested - filter +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_02 +# Check that the AMS service returns information about the a specific registered application mobility service when requested - filter +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_03 +# Check that the AMS service returns information about the a specific registered application mobility service when requested - exclude_fields +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_04 +# Check that the AMS service returns information about the registered application mobility services when requested - No registered application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_05 +# Check that the AMS service returns an error when receives a query about a registered application mobility service with wrong parameters +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_BR +# Check that the AMS service creates a new application mobility services when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_002_OK +# Check that the AMS service sends an error when it receives a malformed request to create a new application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_002_BR +# Check that the AMS service returns information about the available subscriptions when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_OK +# Check that the AMS service sends an error when it receives a malformed query about the available subscriptions +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_BR +# Check that the AMS service creates a notification subscriptions when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_004_OK +# Check that the AMS service sends an error when it receives a malformed request to create a notification subscription +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_004_BR +# Check that the AMS service returns information about a given subscription when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_005_OK +# Check that the AMS service returns an error when receives a query about a not existing subscription +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_005_NF +# Check that the AMS service deletes a given subscription when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_006_OK +# Check that the AMS service sends an error when it receives a delete request for a not existing subscription +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_006_NF +# Check that the AMS service modifies a given subscription when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_007_OK +# Check that the AMS service sends an error when it receives a malformed modify request for a given subscription +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_007_BR +# Check that the AMS service sends an error when it receives a modify request for a not existing subscription +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_007_NF +# Check that the AMS service sends an AMS notification about a mobility procedure if the AMS service has an associated subscription and the event is generated +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_008_OK +# Check that the AMS service sends an AMS notification about adjacent application instances if the AMS service has an associated subscription and the event is generated +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_009_OK +# Check that the AMS service sends an AMS notification on subscription expiration if the AMS service has an associated subscription and the event is generated +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_010_OK +# Check that the AMS service returns information about this individual application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_011_OK +# Check that the AMS service sends an error when receives a query about a not existing individual application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_011_NF +# Check that the AMS service modifies the individual application mobility service when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_012_OK +# Check that the AMS service sends an error when receives a request to modify a individual application mobility service using bad parameters +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_012_BR +# Check that the AMS service sends an error when receives a request to modify a not existing individual application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_012_NF +# Check that the AMS service de-register the individual application mobility service and delete the resource that represents the individual application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_013_OK +# Check that the AMS service sends an error when is requested to delete the resource that represents the individual application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_013_NF +# Check that the AMS service deregister an individual application mobility service on expiry of the timer associated with the service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_014_OK +# Check that the AMS service send an error when is requested to deregister a not existent individual application mobility service +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_014_NF +# Check that the AMS service returns information about the registered application mobility services when requested +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_015_OK_01 + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ b/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ new file mode 100644 index 0000000..3077a65 --- /dev/null +++ b/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ @@ -0,0 +1,133 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' + +LibMec_Pics.PICS_MEC_PLAT := true + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_FixedAccessInformationService/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec029)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec029)/TCP(debug=1,server_mode=1,use_ssl=0)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec029)/TCP(debug=1,server_mode=1,local_port=443,use_ssl=1,mutual_auth=1,mutual_tls=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_FixedAccessInformationServiceAPI_TestControl.control + +# Check that the IUT responds with the current status of the fixed access information when queried by a MEC Application +AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_001_BR +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_001_NF +# Check that the IUT responds with the current status of the device information when queried by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_002_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application + #AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_002_BR + # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_002_NF +# Check that the IUT responds with the current status of the cable line information when queried by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_003_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_003_BR +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_003_NF +# Check that the IUT responds with the current status of the optical network information when queried by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_004_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_004_BR +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_004_NF +# Check that the IUT responds with the information pertaining to one or more UEs in a particular location when queried by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_005_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_005_BR +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_005_NF +# Check that the IUT acknowledges the subscription by a MEC Application to notifications on Optical Network Unit alarm events +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_006_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_006_BR +# Check that the IUT responds with the information on a given subscription when queried by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_007_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_007_NF +# Check that the IUT updates an existing subscription when commanded by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_008_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_008_BR +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_008_NF +# Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_008_PF +# Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_009_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_009_NF +# Check that the IUT sends notification on expiry of Fixed Access Information event subscription to a MEC Application +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_010_OK +# Check that the IUT acknowledges the subscription by a MEC Application to notifications on Optical Network Unit alarm events +#AtsMec_FixedAccessInformationServiceAPI_TestCases.TC_MEC_MEC029_SRV_FAIS_011_OK + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ b/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ index f2241a6..7725345 100644 --- a/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ +++ b/etc/AtsMec_Location/AtsMec_Location_Sandbox.cf_ @@ -8,15 +8,15 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" +LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true -#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" -LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' -LibMec_Pics.PICS_MEC_PLAT := true +LibMec_Pics.PICS_MEC_PLAT := true # Mec-013 LocationAPI LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true @@ -25,7 +25,8 @@ LocationAPI_Pixits.PX_ACCESS_POINT_ID := "4g-macro-cell-6" LocationAPI_Pixits.PX_AP_COORD_LAT := 43.737087 LocationAPI_Pixits.PX_AP_COORD_LONG := 7.421007 LocationAPI_Pixits.PX_CONNECTION_TYPE := LTE -LocationAPI_Pixits.PX_USER := "4005C0A640001" +LocationAPI_Pixits.PX_USER := "10.10.0.1" +LocationAPI_Pixits.PX_USER_2 := "10.100.0.1" LocationAPI_Pixits.PX_IP_ADDRESS := "10.1.0.1" LocationAPI_Pixits.PX_IP_ADDRESS_1 := "10.100.0.1" LocationAPI_Pixits.PX_ZONE_ID_1 := "zone01" @@ -131,7 +132,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec013)/TCP(debug=1 # Check that the IUT acknowledges the UE distance subscription request when commanded by a MEC Application and notifies it when (all) the requested UE(s) is (are) within the specified distance #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided -AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR +#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR # Check that the IUT acknowledges the cancellation of UE distance notifications when commanded by a MEC Application #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_002_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application @@ -197,7 +198,7 @@ AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR # Check that the IUT acknowledges a request to modify a not existing subscription by a MEC Application #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UELOCSUB_003_NF_02 # Check that the IUT provides a test notification when requested by a MEC Application -#AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETESTNOT_001_OK +AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UETESTNOT_001_OK # Check that the IUT responds with a list zones when queried by a MEC Application #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEZONELOOK_001_OK # Check that the IUT responds with the subscription when queried by a MEC Application - Zone location Event @@ -205,10 +206,6 @@ AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEDISTSUB_001_BR # Check that the IUT responds with the subscription when queried by a MEC Application - Zone Status #AtsMec_LocationAPI_TestCases.TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_02 - - - - [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the # [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. diff --git a/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn index 931930f..61b2709 100644 --- a/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn @@ -130,7 +130,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & v_registration_info_1.appMobilityServiceId & ")", + PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")) & ")", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -192,7 +192,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,serviceConsumerId[appInstanceId]," & PX_APP_INS_ID_2 & ")", + PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,serviceConsumerId[appInstanceId]," & oct2char(unichar2oct(PX_APP_INS_ID_2, "UTF-8")) & ")", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -254,7 +254,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & v_registration_info_1.appMobilityServiceId & "&exclude_fields=[deviceInformation])", + PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")) & "&exclude_fields=[deviceInformation])", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -370,7 +370,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_URI & "?appMobilityService=" & "?filter=(appMobilityServiceId,eq," & v_registration_info_1.appMobilityServiceId & ")", // Wrong syntax + PICS_ROOT_API & PX_ME_APP_AMS_URI & "?appMobilityService=" & "?filter=(appMobilityServiceId,eq," & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")) & ")", // Wrong syntax v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -560,7 +560,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=" & v_mobility_procedure_subscription.subscriptionType, + PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=" & oct2char(unichar2oct(v_mobility_procedure_subscription.subscriptionType, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -860,7 +860,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -965,7 +965,7 @@ httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1142,7 +1142,7 @@ httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, + PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_ams_mobility_procedure_subscription( diff --git a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn index 02680c7..5bd1c8f 100644 --- a/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationPackageLifecycleAndOperationGranting/AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases.ttcn @@ -1837,7 +1837,9 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { [] httpPort_notif.receive { tc_ac.stop; - httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers))); + // Send 500 + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers, -, testcasename() & ": Receive unsollicited message"))); log("*** " & testcasename() & ": FAIL: Expected message received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); @@ -5353,7 +5355,9 @@ module AtsMec_ApplicationPackageLifecycleAndOperationGrantingAPI_TestCases { [] httpPort_notif.receive { tc_ac.stop; - httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers))); + // Send 500 + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers, -, testcasename() & ": Receive unsollicited message"))); log("*** " & testcasename() & ": FAIL: Expected message received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); diff --git a/ttcn/AtsMec_FixedAccessInformationService/module.mk b/ttcn/AtsMec_FixedAccessInformationService/module.mk index 5b3e010..902ab11 100644 --- a/ttcn/AtsMec_FixedAccessInformationService/module.mk +++ b/ttcn/AtsMec_FixedAccessInformationService/module.mk @@ -24,6 +24,9 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn b/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn index 62cb536..3dced3e 100644 --- a/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestCases.ttcn @@ -1397,6 +1397,10 @@ module AtsMec_LocationAPI_TestCases { } [] httpPort_notif.receive { log("*** " & testcasename() & ": INFO: Unsollicited message received ***"); + // Send 500 + var Headers v_headers; + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers, -, testcasename() & ": Receive unsollicited message"))); repeat; } [] tc_ac.timeout { @@ -2352,7 +2356,7 @@ module AtsMec_LocationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?event&address=" & oct2char(unichar2oct(PX_USER_2, "UTF-8")), + PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?event&address=" & oct2char(unichar2oct(PX_USER_UNKNOWN, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -2687,9 +2691,17 @@ module AtsMec_LocationAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); - log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationEventNotification ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationEventNotification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] httpPort_notif.receive { + log("*** " & testcasename() & ": INFO: Receive unsollicited message ***"); + // Send 500 + var Headers v_headers; + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers, -, testcasename() & ": Receive unsollicited message"))); + repeat + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); @@ -2830,6 +2842,14 @@ module AtsMec_LocationAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationPeriodicNotification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + [] httpPort_notif.receive { + log("*** " & testcasename() & ": INFO: Receive unsollicited message ***"); + // Send 500 + var Headers v_headers; + f_init_default_headers_list(-, -, v_headers); + httpPort_notif.send(m_http_response(m_http_response_500_internal_error(v_headers, -, testcasename() & ": Receive unsollicited message"))); + repeat + } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); @@ -3455,12 +3475,12 @@ module AtsMec_LocationAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, + v_headers, + m_http_message_body_json( m_body_json_user_location_event_subscription( - m_user_location_event_subscription( + m_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, PX_CLIENT_ID, @@ -3473,7 +3493,7 @@ module AtsMec_LocationAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( + mw_http_response_201_created( mw_http_message_body_json( mw_body_json_user_location_event_subscription( mw_user_location_event_subscription( @@ -3497,8 +3517,9 @@ module AtsMec_LocationAPI_TestCases { "?+" & PX_LOC_API_USERS_SUB_URI & "/(?*)", 0 ); - log("*** " & testcasename() & ": INFO: IUT successfully responds with a userLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); + + tc_ac.start; repeat; // Wait for test notification } } @@ -3510,7 +3531,7 @@ module AtsMec_LocationAPI_TestCases { mw_http_message_body_json( mw_body_json_test_notification( mw_test_notification( - v_response.response.body.json_body.userLocationEventNotification.links_ + { subscription := v_response.response.body.json_body.userLocationEventSubscription.links_.self_ } )))))) { tc_ac.stop; @@ -3616,9 +3637,10 @@ module AtsMec_LocationAPI_TestCases { -, -, mw_http_message_body_json( - mw_body_json_test_notification( - mw_test_notification( - v_response.response.body.json_body.userLocationEventNotification.links_ + mw_body_json_user_location_event_notification( + mw_user_location_event_notification( + -, -, + v_response.response.body.json_body.userLocationEventSubscription.links_ )))))) { tc_ac.stop; diff --git a/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestControl.ttcn b/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestControl.ttcn index 4b8c31f..93a7009 100644 --- a/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestControl.ttcn +++ b/ttcn/AtsMec_Location/AtsMec_LocationAPI_TestControl.ttcn @@ -50,7 +50,8 @@ module AtsMec_LocationAPI_TestControl { execute(TC_MEC_MEC013_SRV_UEINFLOOK_001_BR()); execute(TC_MEC_MEC013_SRV_UEINFLOOK_001_NF()); - execute(TC_MEC_MEC013_SRV_UELOCLOOK_001_OK()); + //execute(TC_MEC_MEC013_SRV_UELOCLOOK_001_OK()); + //execute(TC_MEC_MEC013_SRV_UELOCLOOK_001_BR()); execute(TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_01()); execute(TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_02()); execute(TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_03()); diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 43a6d65..80bef4d 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -44,25 +44,25 @@ module LibHttp_JsonMessageBodyTypes { // TODO Add here your custom RFCs import type union JsonBody { - UserInfo userInfo, // ETSI GS MEC 013 V3.1.1 Clause 6.2.2 Type: UserInfo - UserList userList, // ETSI GS MEC 013 V3.1.1 Clause 6.2.5 Type: UserList - LocationAPI_TypesAndValues.ZoneInfo zoneInfo, // ETSI GS MEC 013 V3.1.1 Clause 6.2.1 Zonal presence data types - AccessPointList accessPointList, // ETSI GS MEC 013 V3.1.1 Clause 6.2.1 Zonal presence data types - AccessPointInfo accessPointInfo, // ETSI GS MEC 013 V3.1.1 Clause 6.2.1 Zonal presence data types - LocationAPI_TypesAndValues.NotificationSubscriptionList notificationSubscriptionList, // ETSI GS MEC 013 V3.1.1 Clause 6.3.3 Type: NotificationSubscriptionList - UserLocationEventSubscription userLocationEventSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.4 Type: UserLocationEventSubscription - UserLocationPeriodicSubscription userLocationPeriodicSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.5 Type: UserLocationPeriodicSubscription - ZoneLocationEventSubscription zoneLocationEventSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.6 Type: ZoneLocationEventSubscription - ZoneStatusSubscription zoneStatusSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.7 Type: ZoneStatusSubscription - UserAreaSubscription userAreaSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.8 Type: UserAreaSubscription - UserDistanceSubscription userDistanceSubscription, // ETSI GS MEC 013 V3.1.1 Clause 6.3.9 Type: UserDistanceSubscription - UserAreaNotification userAreaNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.8 Type: UserAreaNotification - UserDistanceNotification userDistanceNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.9 Type: UserDistanceNotification - UserLocationEventNotification userLocationEventNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.4 Type: UserLocationEventNotification - UserLocationPeriodicNotification userLocationPeriodicNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.5 Type: UserLocationPeriodicNotification - ZoneLocationEventNotification zoneLocationEventNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.6 Type: ZoneLocationEventNotification - ZoneStatusNotification zoneStatusNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.7 Type: ZoneStatusNotification - LocationAPI_TypesAndValues.TestNotification testNotification, // ETSI GS MEC 013 V3.1.1 Clause 6.4.3 Type: TestNotification + UserInfo userInfo, // ETSI GS MEC 013 V3.2.1 Clause 6.2.2 Type: UserInfo + UserList userList, // ETSI GS MEC 013 V3.2.1 Clause 6.2.5 Type: UserList + LocationAPI_TypesAndValues.ZoneInfo zoneInfo, // ETSI GS MEC 013 V3.2.1 Clause 6.2.1 Zonal presence data types + AccessPointList accessPointList, // ETSI GS MEC 013 V3.2.1 Clause 6.2.1 Zonal presence data types + AccessPointInfo accessPointInfo, // ETSI GS MEC 013 V3.2.1 Clause 6.2.1 Zonal presence data types + LocationAPI_TypesAndValues.NotificationSubscriptionList notificationSubscriptionList, // ETSI GS MEC 013 V3.2.1 Clause 6.3.3 Type: NotificationSubscriptionList + UserLocationEventSubscription userLocationEventSubscription, // ETSI GS MEC 013 V3.2.1 Clause 6.3.4 Type: UserLocationEventSubscription + UserLocationPeriodicSubscription userLocationPeriodicSubscription, // ETSI GS MEC 013 V3.2.1 Clause 6.3.5 Type: UserLocationPeriodicSubscription + ZoneLocationEventSubscription zoneLocationEventSubscription, // ETSI GS MEC 013 V3.2.1 Clause 6.3.6 Type: ZoneLocationEventSubscription + ZoneStatusSubscription zoneStatusSubscription, // ETSI GS MEC 013 V3.2.1 Clause 6.3.7 Type: ZoneStatusSubscription + UserAreaSubscription userAreaSubscription, // ETSI GS MEC 013 V3.2.1 Clause 6.3.8 Type: UserAreaSubscription + UserDistanceSubscription userDistanceSubscription, // ETSI GS MEC 013 V3.2.1 Clause 6.3.9 Type: UserDistanceSubscription + UserAreaNotification userAreaNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.8 Type: UserAreaNotification + UserDistanceNotification userDistanceNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.9 Type: UserDistanceNotification + UserLocationEventNotification userLocationEventNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.4 Type: UserLocationEventNotification + UserLocationPeriodicNotification userLocationPeriodicNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.5 Type: UserLocationPeriodicNotification + ZoneLocationEventNotification zoneLocationEventNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.6 Type: ZoneLocationEventNotification + ZoneStatusNotification zoneStatusNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.7 Type: ZoneStatusNotification + LocationAPI_TypesAndValues.TestNotification testNotification, // ETSI GS MEC 013 V3.2.1 Clause 6.4.3 Type: TestNotification TerminalDistance terminalDistance, LibMec_TypesAndValues.ProblemDetails problemDetails, UeIdentityTagInfo ueIdentityTagInfo, -- GitLab From 46264a51ab9180a8c7d1e648e4491e23dd528b65 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 9 Jul 2025 15:24:59 +0200 Subject: [PATCH 44/54] Add missimg port setup --- .../AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn b/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn index 9a328e8..7187f2e 100644 --- a/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn @@ -55,12 +55,15 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { stop; } + // Test component configuration + f_cf_01_http_up(); + // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( - PX_FAI_FA_INFO_URI, + PICS_ROOT_API & PX_FAI_FA_INFO_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -114,7 +117,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PX_FAI_FA_INFO_URI & "?if=1", + PICS_ROOT_API & PX_FAI_FA_INFO_URI & "?if=1", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); -- GitLab From f20a18139dba7c7e8398f259fbb3e5e0e11bbac3 Mon Sep 17 00:00:00 2001 From: Muhammad Umair Khan Date: Mon, 14 Jul 2025 16:13:02 +0500 Subject: [PATCH 45/54] validate and bugfixes MEC014 using mockserver --- etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ | 90 +++++++++++++++++++ .../AtsMec_UEidentityAPI_TestCases.ttcn | 36 ++++---- .../ttcn/UEidentityAPI_Functions.ttcn | 6 +- 3 files changed, 109 insertions(+), 23 deletions(-) create mode 100644 etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ diff --git a/etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ b/etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ new file mode 100644 index 0000000..7d8a960 --- /dev/null +++ b/etc/AtsMec_UEidentity/AtsMec_UEidentity.cfg_ @@ -0,0 +1,90 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "192.168.40.7" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +#LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" + +# LibMec_Pixits +UEidentityAPI_Pixits.PX_APP_INSTANCE_ID := "APP_INSTANCE_ID" +UEidentityAPI_Pixits.PX_UE_IDENTITY_TAG := "UE_IDENTITY_TAG" + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_UEidentity/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.40.7,port=5000,use_ssl=0)" +#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" +#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_TestControl.control + +# Check that the IUT responds with the information on a UE Identity tag when queried by a MEC Application +#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Applicati +#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_BR +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_001_NF +# Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application +AtsMec_UEidentityAPI_TestCases.TC_MEC_MEC014_SRV_UETAG_002_OK + + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn index 7a85b02..f8d87cd 100644 --- a/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec_UEidentity/AtsMec_UEidentityAPI_TestCases.ttcn @@ -60,7 +60,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -115,7 +115,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/invalid/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -125,15 +125,11 @@ module AtsMec_UEidentityAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_400_bad_request( - mw_http_message_body_json( - mw_body_json_problem_details( - mw_problem_details( - -, -, 400 - )))))) { + mw_http_response_400_bad_request + )) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -170,7 +166,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -179,13 +175,13 @@ module AtsMec_UEidentityAPI_TestCases { tc_ac.start; alt { [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_problem_details( - mw_problem_details( - -, -, 404 - )))))) { + mw_http_response( + mw_http_response_404_not_found( + mw_http_message_body_json( + mw_body_json_problem_details( + mw_problem_details( + -, -, 404 + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); @@ -230,7 +226,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( @@ -304,7 +300,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( @@ -368,7 +364,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn index 7b48d64..7795a25 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Functions.ttcn @@ -39,8 +39,8 @@ module UEidentityAPI_Functions { httpPort.send( m_http_request( m_http_request_get( - "/" & PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")), - p_headers + PICS_ROOT_API & PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(p_ue_identity_tag, "UTF-8")), + p_headers ) ) ); @@ -60,7 +60,7 @@ module UEidentityAPI_Functions { for (var integer v_i := 0; v_i < lengthof(v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags); v_i := v_i + 1) { if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag == p_ue_identity_tag) { //log("Processing ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].ueIdentityTag); - //log("State ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state); + log("State ", v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state); if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == UNREGISTERED) { v_result := 0; } else if (v_response.response.body.json_body.ueIdentityTagInfo.ueIdentityTags[v_i].state == REGISTERED) { -- GitLab From 2d26d05a3a2adb5b2faf3249febba928b16bbde9 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 22 Jul 2025 12:10:41 +0200 Subject: [PATCH 46/54] Validating MEC 021; Review on MEC 040 --- ...Mec_ApplicationMobiltyService_Sandbox.cfg_ | 5 +- gs032p3-ttcn-test-suite.code-workspace | 3 + titan-test-system-framework | 2 +- ...pplicationMobiltyServiceAPI_TestCases.ttcn | 20 +++---- ...Mec_FederationEnablementAPI_TestCases.ttcn | 6 +- ...AccessInformationServiceAPI_TestCases.ttcn | 12 ++-- .../AtsMec_QoSMeasurementAPI_TestCases.ttcn | 40 ++++++------- .../AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn | 60 +++++++++---------- ...ec_SelfServiceEnablementAPI_TestCases.ttcn | 18 +++--- ...tsMec_SensorsSharingService_TestCases.ttcn | 36 +++++------ ..._BandwidthChangeEventSubAPI_TestCases.ttcn | 14 ++--- ttcn/AtsMec_TrafficManagement/module.mk | 3 + .../AtsMec_WlanInformationAPI_TestCases.ttcn | 26 ++++---- ttcn/AtsMec_WlanInformation/module.mk | 3 + ...plicationMobilityServiceAPI_Functions.ttcn | 4 +- ...tionMobilityServiceAPI_TypesAndValues.ttcn | 56 ++++++++--------- 16 files changed, 160 insertions(+), 148 deletions(-) diff --git a/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ b/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ index 7bdf80e..773ab64 100644 --- a/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ +++ b/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ @@ -8,7 +8,7 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" +LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true @@ -18,7 +18,10 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in o LibMec_Pics.PICS_MEC_PLAT := true +# LibMec/ApplicationMobilityServiceAPI # Application Instance ID +ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID := "b96f8a13-4253-4a8c-9485-33e5391f950d" +ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID_2 := "83a79787-2ceb-4b9b-ab0d-174463cb1896" # Callbacks diff --git a/gs032p3-ttcn-test-suite.code-workspace b/gs032p3-ttcn-test-suite.code-workspace index fce41bb..48713ec 100644 --- a/gs032p3-ttcn-test-suite.code-workspace +++ b/gs032p3-ttcn-test-suite.code-workspace @@ -14,6 +14,9 @@ }, { "path": "../../frameworks/titan/titan.core" + }, + { + "path": "../doc2oas" } ], "settings": { diff --git a/titan-test-system-framework b/titan-test-system-framework index e7f13cc..c0d15f4 160000 --- a/titan-test-system-framework +++ b/titan-test-system-framework @@ -1 +1 @@ -Subproject commit e7f13cca244490ee6f5fc6e80c6836384b562568 +Subproject commit c0d15f46ba5406cf788059a86743ed9b87f1044e diff --git a/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn index 61b2709..11e99b4 100644 --- a/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn @@ -1205,7 +1205,7 @@ f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1217,7 +1217,7 @@ mw_mobility_procedure_notification( v_mobility_procedure_subscription.links )))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); @@ -1226,7 +1226,7 @@ log("*** " & testcasename() & ": PASS: IUT successfully sends mobility procedure notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1262,7 +1262,7 @@ f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1274,7 +1274,7 @@ mw_adjacent_app_info_notification( v_adjacent_appInfo_subscription.links )))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); @@ -1283,7 +1283,7 @@ log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent appInfo notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1319,7 +1319,7 @@ f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1331,7 +1331,7 @@ mw_mobility_procedure_notification( v_mobility_procedure_subscription.links )))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); @@ -1349,12 +1349,12 @@ mw_body_json_expire_notification( mw_expire_notification ))))) { - tc_wait.stop; + tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully sends expiry notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } diff --git a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn index ef65914..067695a 100644 --- a/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_FederationEnablement/AtsMec_FederationEnablementAPI_TestCases.ttcn @@ -2168,7 +2168,7 @@ module AtsMec_FederationEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2182,7 +2182,7 @@ module AtsMec_FederationEnablementAPI_TestCases { mw_links_sub( { href := pattern "http?+" & PICS_ROOT_API & PX_FED_API_SUB & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2193,7 +2193,7 @@ module AtsMec_FederationEnablementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } diff --git a/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn b/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn index 7187f2e..c2d6ef1 100644 --- a/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationServiceAPI_TestCases.ttcn @@ -1451,7 +1451,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1463,7 +1463,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { mw_dev_info_subscription( PX_DEV_ALARM_SUB_CALLBACK_URI )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1474,7 +1474,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a DevInfoSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1511,7 +1511,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1523,7 +1523,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { mw_onu_alarm_subscription( PX_DEV_ALARM_SUB_CALLBACK_URI )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1534,7 +1534,7 @@ module AtsMec_FixedAccessInformationServiceAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a DevInfoSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } diff --git a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn index 56ef4ce..994de37 100644 --- a/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_QoSMeasurement/AtsMec_QoSMeasurementAPI_TestCases.ttcn @@ -1649,7 +1649,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1664,7 +1664,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { PX_MEASURING_PERIOD, mw_links )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1675,7 +1675,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1712,7 +1712,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1722,7 +1722,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { mw_http_message_body_json( mw_body_json_qos_test_notification )))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1733,7 +1733,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1772,7 +1772,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; v_expiry_timer.start(int2float(PX_EXPIRY_DEADLINE.seconds)); alt { [] httpPort_notif.receive( @@ -1788,7 +1788,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { PX_MEASURING_PERIOD, mw_links )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1797,7 +1797,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { v_headers ))); if (v_no_more_notif_expected == false) { - tc_wait.start; + tc_ac.start; repeat; } else { log("*** " & testcasename() & ": FAIL: New notif received after expiry timer ended ***"); @@ -1809,7 +1809,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { log("*** " & testcasename() & ": INFO: expiry timer ended ***"); repeat; } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": PASS: No notif received after expiry timer ended ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } @@ -2820,7 +2820,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2832,7 +2832,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { mw_qos_measure_notification( mw_links )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2843,7 +2843,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2880,7 +2880,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2893,7 +2893,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { mw_links( { href := pattern "http?+" & PICS_ROOT_API & PX_QOS_API_LIST_SUBS & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2904,7 +2904,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2943,7 +2943,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; v_expiry_timer.start(int2float(PX_EXPIRY_DEADLINE.seconds)); alt { [] httpPort_notif.receive( @@ -2958,7 +2958,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { PX_MEASURING_PERIOD, mw_links )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2967,7 +2967,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { v_headers ))); if (v_no_more_notif_expected == false) { - tc_wait.start; + tc_ac.start; repeat; } else { log("*** " & testcasename() & ": FAIL: New notif received after expiry timer ended ***"); @@ -2979,7 +2979,7 @@ module AtsMec_QoSMeasurementAPI_TestCases { log("*** " & testcasename() & ": INFO: expiry timer ended ***"); repeat; } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": PASS: No notif received after expiry timer ended ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn index 4d70ab3..4321634 100644 --- a/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec_Rnis/AtsMec_RnisAPI_TestCases.ttcn @@ -98,7 +98,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -110,7 +110,7 @@ module AtsMec_RnisAPI_TestCases { mw_cell_change_subscription( PX_CALLBACK_REFERENCE )))))) { - tc_wait.stop; + tc_ac.stop; log("*** " & testcasename() & ": INFO: IUT successfully sends cell-change notification ***"); // Send 204 No Content @@ -120,7 +120,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends cell-change notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -163,7 +163,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -180,7 +180,7 @@ module AtsMec_RnisAPI_TestCases { -, PX_QCI ))))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); @@ -189,7 +189,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB establishment notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -224,7 +224,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -242,7 +242,7 @@ module AtsMec_RnisAPI_TestCases { -, PX_QCI ))))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -250,7 +250,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB modification notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -285,7 +285,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -303,7 +303,7 @@ module AtsMec_RnisAPI_TestCases { -, PX_QCI ))))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -311,7 +311,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -346,7 +346,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -362,7 +362,7 @@ module AtsMec_RnisAPI_TestCases { PX_APP_INS_ID, -//TODO PX_E_RAB_ID ))))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -370,7 +370,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -405,7 +405,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -421,7 +421,7 @@ module AtsMec_RnisAPI_TestCases { PX_APP_INS_ID, -//TODO PX_E_RAB_ID ))))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -429,7 +429,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -464,7 +464,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -480,7 +480,7 @@ module AtsMec_RnisAPI_TestCases { PX_APP_INS_ID, -//TODO PX_E_RAB_ID ))))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -488,7 +488,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -523,7 +523,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -537,7 +537,7 @@ module AtsMec_RnisAPI_TestCases { PX_LINKS_SELF, -//mw_filter_criteria )))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -545,7 +545,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -580,7 +580,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -594,7 +594,7 @@ module AtsMec_RnisAPI_TestCases { PX_LINKS_SELF, -//mw_filter_criteria )))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -602,7 +602,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -637,7 +637,7 @@ module AtsMec_RnisAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -647,7 +647,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_message_body_json( mw_body_json_expiry_notification_rnis )))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -655,7 +655,7 @@ module AtsMec_RnisAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } diff --git a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn index eb2e0b3..2a74b77 100644 --- a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn @@ -2816,7 +2816,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2834,7 +2834,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { 5 ) )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2845,7 +2845,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2883,7 +2883,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2900,7 +2900,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { 5 ) )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2911,7 +2911,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2950,7 +2950,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2964,7 +2964,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { { seconds := 1684748494, nanoSeconds := 123456789 } ) ))))) { - tc_wait.stop; + tc_ac.stop; // Send 204 No Content httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); @@ -2972,7 +2972,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends expiry notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 963677e..84630c4 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -1703,7 +1703,7 @@ module AtsMec_SensorsSharingService_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1717,7 +1717,7 @@ module AtsMec_SensorsSharingService_TestCases { mw_links( { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1728,7 +1728,7 @@ module AtsMec_SensorsSharingService_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1765,7 +1765,7 @@ module AtsMec_SensorsSharingService_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1779,7 +1779,7 @@ module AtsMec_SensorsSharingService_TestCases { mw_links( { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1790,7 +1790,7 @@ module AtsMec_SensorsSharingService_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2302,7 +2302,7 @@ module AtsMec_SensorsSharingService_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2315,7 +2315,7 @@ module AtsMec_SensorsSharingService_TestCases { -, mw_links )))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2326,7 +2326,7 @@ module AtsMec_SensorsSharingService_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2363,7 +2363,7 @@ module AtsMec_SensorsSharingService_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2377,7 +2377,7 @@ module AtsMec_SensorsSharingService_TestCases { mw_links( { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2388,7 +2388,7 @@ module AtsMec_SensorsSharingService_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2919,7 +2919,7 @@ module AtsMec_SensorsSharingService_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2933,7 +2933,7 @@ module AtsMec_SensorsSharingService_TestCases { mw_links( { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_STATUS & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -2944,7 +2944,7 @@ module AtsMec_SensorsSharingService_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -2981,7 +2981,7 @@ module AtsMec_SensorsSharingService_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -2995,7 +2995,7 @@ module AtsMec_SensorsSharingService_TestCases { mw_links( { href := pattern "http?+" & PICS_ROOT_API & PX_SENS_LIST_SUBS_DISCOVERY & "/" & v_subscription_id} ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -3006,7 +3006,7 @@ module AtsMec_SensorsSharingService_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } diff --git a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn index ac5a2e4..21ad764 100644 --- a/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn +++ b/ttcn/AtsMec_TrafficManagement/AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn @@ -379,7 +379,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { v_bw_chg_event_subscription.callbackReference, -, mw_links( - v_bw_chg_event_subscription.links.self.href + v_bw_chg_event_subscription.links.self_.href ), mw_filter_criteria( v_bw_chg_event_subscription.filterCriteria.appInsId @@ -492,7 +492,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - \PX_BW_EVENT_SUB_CALLBACK_URI, + PX_BW_EVENT_SUB_CALLBACK_URI, -, -, m_filter_criteria @@ -750,7 +750,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type + PX_BW_Subcription_Type, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, @@ -765,7 +765,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { mw_http_message_body_json( mw_body_json_bw_chg_event_subscription( mw_bw_chg_event_subscription( - PX_BW_Subcription_Type + PX_BW_Subcription_Type, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, @@ -821,7 +821,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { m_http_message_body_json( m_body_json_bw_chg_event_subscription( m_bw_chg_event_subscription( - PX_BW_Subcription_Type + PX_BW_Subcription_Type, PX_BW_EVENT_SUB_CALLBACK_URI, -, -, @@ -988,7 +988,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { f_create_bw_chg_event_subscription(v_bw_chg_event_subscription, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_response( @@ -1006,7 +1006,7 @@ module AtsMec_BandwidthChangeEventSubAPI_TestCases { - )))))) -> value v_response { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( diff --git a/ttcn/AtsMec_TrafficManagement/module.mk b/ttcn/AtsMec_TrafficManagement/module.mk index e4c759d..8b5b3b4 100644 --- a/ttcn/AtsMec_TrafficManagement/module.mk +++ b/ttcn/AtsMec_TrafficManagement/module.mk @@ -26,6 +26,9 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/AtsMec_WlanInformation/AtsMec_WlanInformationAPI_TestCases.ttcn b/ttcn/AtsMec_WlanInformation/AtsMec_WlanInformationAPI_TestCases.ttcn index 975a420..3bd42c6 100644 --- a/ttcn/AtsMec_WlanInformation/AtsMec_WlanInformationAPI_TestCases.ttcn +++ b/ttcn/AtsMec_WlanInformation/AtsMec_WlanInformationAPI_TestCases.ttcn @@ -843,7 +843,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id, + PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & oct2char(unichar2oct(v_subscription_id, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -956,7 +956,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id, + PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & oct2char(unichar2oct(v_subscription_id, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( @@ -1030,7 +1030,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id, + PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & oct2char(unichar2oct(v_subscription_id, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( @@ -1164,7 +1164,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id, + PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & oct2char(unichar2oct(v_subscription_id, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1268,7 +1268,7 @@ module AtsMec_WlanInformationAPI_TestCases { f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body - tc_wait.start; + tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( @@ -1281,7 +1281,7 @@ module AtsMec_WlanInformationAPI_TestCases { mw_ap_identity( PX_MAC_ID ))))))) { - tc_wait.stop; + tc_ac.stop; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send( @@ -1292,7 +1292,7 @@ module AtsMec_WlanInformationAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } - [] tc_wait.timeout { + [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } @@ -1533,7 +1533,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/measurements" & "/" & v_measurement_config_id, + PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/measurements" & "/" & oct2char(unichar2oct(v_measurement_config_id, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1602,7 +1602,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/measurements"& "/" & v_measurement_config_id & "_Invalid", + PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/measurements"& "/" & oct2char(unichar2oct(v_measurement_config_id, "UTF-8")) & "_Invalid", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1657,7 +1657,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id, + PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & oct2char(unichar2oct(v_measurement_config_id, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_wlan_measurement_config( @@ -1738,7 +1738,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id & "_Invalid", + PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & oct2char(unichar2oct(v_measurement_config_id, "UTF-8")) & "_Invalid", v_headers, m_http_message_body_json( m_body_json_wlan_measurement_config( @@ -1807,7 +1807,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id, + PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & oct2char(unichar2oct(v_measurement_config_id, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1861,7 +1861,7 @@ module AtsMec_WlanInformationAPI_TestCases { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id & "_invalid", + PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & oct2char(unichar2oct(v_measurement_config_id, "UTF-8")) & "_invalid", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); diff --git a/ttcn/AtsMec_WlanInformation/module.mk b/ttcn/AtsMec_WlanInformation/module.mk index f543231..09a5427 100644 --- a/ttcn/AtsMec_WlanInformation/module.mk +++ b/ttcn/AtsMec_WlanInformation/module.mk @@ -24,6 +24,9 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ diff --git a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn index 443257a..bdbba62 100644 --- a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn +++ b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn @@ -82,7 +82,7 @@ module ApplicationMobilityServiceAPI_Functions { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(p_app_mobility_service_id, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_AMS_URI & "/" & oct2char(unichar2oct(p_app_mobility_service_id, "UTF-8")), v_headers ))); @@ -157,7 +157,7 @@ module ApplicationMobilityServiceAPI_Functions { httpPort.send( m_http_request( m_http_request_delete( - PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(p_app_instance_id, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_AMS_URI & "/" & oct2char(unichar2oct(p_app_instance_id, "UTF-8")), v_headers ))); diff --git a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn index c9b400f..3e509e4 100644 --- a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn @@ -2,7 +2,7 @@ * @author ETSI / STF569 / TTF T027 * @version $Url$ * $Id$ - * @desc Types and Values for ETSI GS MEC 021 V3.1.1 (2023-10) + * @desc Types and Values for ETSI GS MEC 021 V3.1.1 (2024-02) * @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. @@ -22,10 +22,10 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member serviceConsumerId The identifier of service consumer requesting the Application Mobility Service * @member deviceInformation Specifies the device served by the application instance which is registering the Application Mobility Service * @member expiryTime Indicates the time of Application Mobility Service expiration from the time of registration accepted - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.2.2-1: Attributes of RegistrationInfo + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.2.2-1: Attributes of RegistrationInfo */ type record RegistrationInfo { - Json.String appMobilityServiceId, + Json.String appMobilityServiceId optional, ServiceConsumerId serviceConsumerId, DeviceInformation deviceInformation optional, Json.UInteger expiryTime optional @@ -36,7 +36,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc The identifier of service consumer requesting the Application Mobility Service * @member appInstanceId Represents the identifier of the application instance registering the Application Mobility Service * @member mepId Represents the identifier of the MEC platform registering the Application Mobility Service - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.2.2-1: Attributes of RegistrationInfo + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.2.2-1: Attributes of RegistrationInfo */ type record ServiceConsumerId { Json.String appInstanceId optional, @@ -49,7 +49,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member associateId Represents the identifier of the device * @member appMobilityServiceLevel If the application is stateful, this attribute shall be included * @member contextTransferState If present, it represents the state of transferring the user context to another application instance - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.2.2-1: Attributes of RegistrationInfo + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.2.2-1: Attributes of RegistrationInfo */ type record DeviceInformation_ { Json.String associateId, @@ -60,7 +60,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc Represents the state of transferring the user context to another application instance - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.2.2-1: Attributes of RegistrationInfo + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.2.2-1: Attributes of RegistrationInfo */ type enumerated ContextTransferState { NOT_TRANSFERRED, @@ -76,7 +76,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member appInstanceCommLink It specifies the communication interface of application instance * @member mecHostInformation The MEC host where the application instance is running on * @member registeredInstanceId Identifier of the application instance that registers to the AMS, which is instantiated from the application descriptor identified by the attribute "appDId" - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.2.3-1: Attributes of AdjacentAppInstanceInfo + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.2.3-1: Attributes of AdjacentAppInstanceInfo */ type record AdjacentAppInstanceInfo { Json.String appInstanceId, @@ -96,7 +96,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Identifies a boundary after which the subscription will expire - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.2-1: Attributes of the MobilityProcedureSubscription + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.2-1: Attributes of the MobilityProcedureSubscription */ type record MobilityProcedureSubscription { Json.String subscriptionType, @@ -114,7 +114,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc Hyperlink related to the resource * @member self_ Self-referring URI - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.2-1: Attributes of the MobilityProcedureSubscription + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.2-1: Attributes of the MobilityProcedureSubscription */ type record Links { LinkType self_ @@ -126,7 +126,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member appInstanceId Identifier of the application instance that registers to the Application Mobility Service * @member associateId Identifiers to associate the information for specific UE(s) and flow(s) * @member mobilityStatus In case mobilityStatus is not included in the subscription request - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.2-1: Attributes of the MobilityProcedureSubscription + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.2-1: Attributes of the MobilityProcedureSubscription */ type record FilterCriteria { Json.String appInstanceId optional, @@ -144,7 +144,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member links Hyperlink related to the resource * @member filterCriteria List of filtering criteria for the subscription * @member expiryDeadline Identifies a boundary after which the subscription will expire - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.3-1: Attributes of the AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.3-1: Attributes of the AdjacentAppInfoSubscription */ type record AdjacentAppInfoSubscription { Json.String subscriptionType, @@ -162,7 +162,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc List of filtering criteria for the subscription * @member appInstanceId Identifier of the application instance that registers to the Application Mobility Service - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.3-1: Attributes of the AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.3-1: Attributes of the AdjacentAppInfoSubscription */ type record AdjacentFilterCriteria { Json.String appInstanceId optional @@ -172,7 +172,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc This type represents a list of links related to currently existing subscriptions for the service consumer * @member links The URI referring to the subscription * @member subscription The service consumer's subscriptions - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.4-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.4-1: Attributes of the SubscriptionLinkList */ type record SubscriptionLinkList { Links links, @@ -185,7 +185,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc The service consumer's subscriptions * @member href The URI referring to the subscription * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.3.4-1: Attributes of the SubscriptionLinkList + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.3.4-1: Attributes of the SubscriptionLinkList */ type record Subscription { Json.AnyURI href, @@ -200,7 +200,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member mobilityStatus Indicate the status of the UE mobility * @member targetAppInfo Identifiers to associate the information of target application instance * @member links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.2-1: Attributes of the MobilityProcedureNotification + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.2-1: Attributes of the MobilityProcedureNotification */ type record MobilityProcedureNotification { Json.String notificationType, @@ -217,7 +217,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc Identifiers to associate the information of target application instance * @member appInstanceId Identifiers of the target application instance * @member CommunicationInterface It specifies the communication interface of the application instance - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.2-1: Attributes of the MobilityProcedureNotification + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.2-1: Attributes of the MobilityProcedureNotification */ type record TargetAppInfo { Json.String appInstanceId, @@ -226,7 +226,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc Indicate the status of the UE mobility - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.2-1: Attributes of the MobilityProcedureNotification + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.2-1: Attributes of the MobilityProcedureNotification */ type enumerated MobilityStatus { INTERHOST_MOVEOUT_TRIGGERED (1), @@ -242,7 +242,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member timeStamp Date and time of the generation of the notification * @member adjacentAppInfo 0 to N identifiers to associate the information for adjacent application instances * @member links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.3-1: Attributes of the AdjacentAppInfoNotification + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.3-1: Attributes of the AdjacentAppInfoNotification */ type record AdjacentAppInfoNotification { Json.String notificationType, @@ -260,7 +260,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @member notificationType Shall be set to "ExpiryNotification" * @member timeStamp Date and time of the generation of the notification * @member links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.4-1: Attributes of the ExpiryNotification + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.4-1: Attributes of the ExpiryNotification */ type record ExpiryNotification { Json.String notificationType, @@ -273,7 +273,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc This data type represents the Application Mobility Service level information used in the Application Mobility Service APIs * @member appMobilityServiceLevel Provides an option for the application instance (server) to communicate with the application client before relocating this application instance to another MEC host - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.5-1: Attributes of AppMobilityServiceLevel + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.5-1: Attributes of AppMobilityServiceLevel */ type record AppMobilityServiceLevel { AppMobilityServiceLevelEnmu appMobilityServiceLevel @@ -281,7 +281,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc Provides an option for the application instance (server) to communicate with the application client before relocating this application instance to another MEC host - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.5-1: Attributes of AppMobilityServiceLevel + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.5-1: Attributes of AppMobilityServiceLevel */ type enumerated AppMobilityServiceLevelEnmu { APP_MOBILITY_NOT_ALLOWED (1), @@ -295,7 +295,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc This data type represents a notification from AMS with regards to expiry of the existing subscription * @member notificationType Shall be set to "TestNotification" * @member links Object containing hyperlinks related to the resource - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.4.6-1: Attributes of the TestNotification + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.4.6-1: Attributes of the TestNotification */ type record TestNotification { Json.String notificationType, @@ -307,7 +307,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc This type represents the communication interface of an application instance * @member ipAddresses Entry point information of the service as one or more pairs of IP address and port - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Clause 7.5.2 Type: CommunicationInterface + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Clause 7.5.2 Type: CommunicationInterface */ type record CommunicationInterface { IpAddresses ipAddresses optional @@ -317,7 +317,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc Entry point information of the service as one or more pairs of IP address and port * @member host Host portion of the address * @member port Port portion of the address - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Clause 7.5.2 Type: CommunicationInterface + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Clause 7.5.2 Type: CommunicationInterface */ type record IpAddress { Json.String host, @@ -330,7 +330,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { /** * @desc This type represents a type of link * @member href URI referring to a resource - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Clause 7.5.4 Type: LinkType + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Clause 7.5.4 Type: LinkType */ type record LinkType { Json.AnyURI href @@ -340,7 +340,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc The type represents the parameters of MEC host information * @member hostName Human-readable name of MEC host * @member hostId Deployment-specific information to identify a MEC host - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Table 7.5.5-1: Attributes of MECHostInformation + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Table 7.5.5-1: Attributes of MECHostInformation */ type record MECHostInformation { Json.String hostName optional, @@ -351,7 +351,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc This data type represents a list of key-value pairs * @member key_name * @member key_value - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Clause 6.2.5.3 Type: KeyValuePairs + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Clause 6.2.5.3 Type: KeyValuePairs */ type record KeyValuePairs { Json.String key_name, @@ -362,7 +362,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { * @desc This type represents configuration for the delivery of subscription notifications over Websockets * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested - * @see ETSI GS MEC 021 V3.1.1 (2023-10) Clause 7.5.7 Type: WebsockNotifConfig + * @see ETSI GS MEC 021 V3.1.1 (2024-02) Clause 7.5.7 Type: WebsockNotifConfig */ type record WebsockNotifConfig { Json.AnyURI websocketUri optional, -- GitLab From 24537cef7ed88cbe6e8a8b62fdca7f55f9cfc5f0 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 28 Jul 2025 16:11:16 +0200 Subject: [PATCH 47/54] Fixing issues https://forge.etsi.org/rep/mec/gs032p3-ttcn-test-suite/-/issues/26 --- ...ec_DeviceApplicationInterface_Sandbox.cfg_ | 112 ++++++++++++ ...viceApplicationInterfaceAPI_TestCases.ttcn | 166 ++++-------------- .../module.mk | 3 + 3 files changed, 154 insertions(+), 127 deletions(-) create mode 100644 etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface_Sandbox.cfg_ diff --git a/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface_Sandbox.cfg_ b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface_Sandbox.cfg_ new file mode 100644 index 0000000..337c569 --- /dev/null +++ b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface_Sandbox.cfg_ @@ -0,0 +1,112 @@ +[MODULE_PARAMETERS] +# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. + +# IUT roles + +LibCommon_Time.PX_TAC := 30.0 +#LibCommon_Time.PX_TWAIT := 30.0 +LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; +LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; + +LibHttp_Pics.PICS_HEADER_HOST := "yanngarcia.ddns.net" + +LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" + +LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' + +LibMec_Pics.PICS_MEC_PLAT := true + +# LibMec/AtsMec_DeviceApplicationInterfaceAPI +DeviceApplicationInterfaceAPI_Pixits.PX_CALLBACK_REFERENCE := "https://yanngarcia.ddns.net:36001/ams/v1" +DeviceApplicationInterfaceAPI_Pixits.PX_CALLBACK_URI := "http://yanngarcia.ddns.net:36001/ams/v1" + +[LOGGING] +# In this section you can specify the name of the log file and the classes of events +# you want to log into the file or display on console (standard error). + +LogFile := "../logs/AtsMec_DeviceApplicationInterface/%e.%h-%r.%s" +FileMask := LOG_ALL | USER | DEBUG | MATCHING +ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING +#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT +LogSourceInfo := Stack +LogEntityName:= Yes +LogEventTypes:= Yes +#TimeStampFormat := DateTime + +[TESTPORT_PARAMETERS] +# In this section you can specify parameters that are passed to Test Ports. +system.httpPort.params := "HTTP(codecs=json:json_codec_mec016)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)" +system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec016)/TCP(debug=1,server_mode=1,use_ssl=0)" + +[DEFINE] +# In this section you can create macro definitions, +# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. + +[INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[ORDERED_INCLUDE] +# To use configuration settings given in other configuration files, +# the configuration files just need to be listed in this section, with their full or relative pathnames. + +[EXTERNAL_COMMANDS] +# This section can define external commands (shell scripts) to be executed by the ETS +# whenever a control part or test case is started or terminated. + +#BeginTestCase := "" +#EndTestCase := "" +#BeginControlPart := "" +#EndControlPart := "" + +[EXECUTE] +# In this section you can specify what parts of your test suite you want to execute. +#AtsMec_DeviceApplicationInterfaceAPI_TestControl.control + +# Check that the IUT responds with the list of user applications when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_NF +# Check that the IUT responds with the list of user applications when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_BR +#Check that the IUT acknowledges the creation of the application context when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_OK +# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_BR +# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_NF +# Check that the IUT acknowledges the creation of the application context when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_BR +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_NF +# Check that the IUT deletes the application context when commanded by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_OK +# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_NF +# Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_OK +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_BR +# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application +#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_NF + +[GROUPS] +# In this section you can specify groups of hosts. These groups can be used inside the +# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. + +[COMPONENTS] +# This section consists of rules restricting the location of created PTCs. + +[MAIN_CONTROLLER] +# The options herein control the behavior of MC. +KillTimer := 10.0 +LocalAddress := 127.0.0.1 +TCPPort := 12000 +NumHCs := 1 diff --git a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn index ce71620..5e49a9f 100644 --- a/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn @@ -43,8 +43,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with the list of user applications when requested by an UE Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -70,9 +68,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_request_get( PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -101,8 +97,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -127,9 +121,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_request_get( PICS_ROOT_API & "dev_app/v1/app_list_error", v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -138,7 +130,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); @@ -156,8 +148,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with the list of user applications when requested by an UE Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -183,9 +173,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_request_get( PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "?appName=" & oct2char(unichar2oct(PX_DEVICE_APP_NAME, "UTF-8")), v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -196,7 +184,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_device_info_app_list - )))) -> value v_response { + )))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); @@ -214,8 +202,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -269,8 +255,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -295,9 +279,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_request_get( PICS_ROOT_API & PX_DEVICE_APP_LIST_URI & "appName", v_headers - ) - ) - ); + ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -306,7 +288,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); @@ -324,15 +306,13 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT acknowledges the creation of the application context when requested by an UE Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; - var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := PX_APP_INSTANCE_ID, referenceURI := "http://example.com/aeiou", appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; + var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := omit, referenceURI := omit, appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { @@ -356,7 +336,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( - -, + -, PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, @@ -368,12 +348,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { v_userAppInstanceInfo ), PX_DEVICE_APP_CALLBACK - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -389,7 +364,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_ASSOCIATE_DEV_APPID, mw_app_context_info, PX_DEVICE_APP_CALLBACK - )))))) -> value v_response { + )))))) -> value v_response { tc_ac.stop; // TODO Check presence of Location HTTP header @@ -409,8 +384,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -450,12 +423,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { omit ), PX_DEVICE_APP_CALLBACK - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -464,7 +432,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an Application Contexta correct error code ***"); @@ -482,8 +450,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -520,12 +486,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_APPD_VERSION ), PX_DEVICE_APP_CALLBACK - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -534,7 +495,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an Application Contexta correct error code ***"); @@ -552,14 +513,11 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT acknowledges the creation of the application context when requested by an UE Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AppContext v_device_info_app_context; - var HttpMessage v_response; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { @@ -593,12 +551,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_APPD_VERSION_2 ), PX_DEVICE_NEW_APP_CALLBACK - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -607,7 +560,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_204_no_content - )) -> value v_response { + )) { tc_ac.stop; // TODO Check presence of Location HTTP header @@ -627,8 +580,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -668,12 +619,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_APPD_VERSION ), PX_DEVICE_NEW_APP_CALLBACK - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -682,7 +628,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); @@ -700,8 +646,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -738,12 +682,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_APPD_VERSION ), PX_DEVICE_NEW_APP_CALLBACK - ) - ) - ) - ) - ) - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -752,7 +691,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); @@ -770,8 +709,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT deletes the application context when commanded by an UE Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -827,8 +764,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -882,8 +817,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -934,15 +867,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { m_application_location_availability( PX_ASSOCIATE_DEV_APPID, t_appLocAvail - ) - - ) - - ) - ) - ) - - ); + )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -950,13 +875,13 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - m_body_json_device_info_app_location_availability( - mw_application_location_availability( - PX_ASSOCIATE_DEV_APPID, - t_appLocAvail - )))))) { + mw_http_response_ok( + mw_http_message_body_json( + m_body_json_device_info_app_location_availability( + mw_application_location_availability( + PX_ASSOCIATE_DEV_APPID, + t_appLocAvail + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); @@ -974,8 +899,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -998,7 +921,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, + PICS_ROOT_API & PX_DEVICE_APP_LOC_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( @@ -1009,13 +932,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_UNKNOWN_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION - ) - ) - ) - ) - ) - ) - ); + ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -1024,7 +941,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); @@ -1042,8 +959,6 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application - * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json - * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v3.1.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -1066,7 +981,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_DEVICE_APP_LIST_URI, + PICS_ROOT_API & PX_DEVICE_APP_LOC_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( @@ -1076,14 +991,11 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, - PX_APPD_VERSION - ) - ) - ) - ) - ) - ) - ); + PX_APPD_VERSION, + -, -, + "http://example.com/aeiou" + + ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body @@ -1092,7 +1004,7 @@ module AtsMec_DeviceApplicationInterfaceAPI_TestCases { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found - )) { + )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); diff --git a/ttcn/AtsMec_DeviceApplicationInterface/module.mk b/ttcn/AtsMec_DeviceApplicationInterface/module.mk index a3bfbe0..20b4ef7 100644 --- a/ttcn/AtsMec_DeviceApplicationInterface/module.mk +++ b/ttcn/AtsMec_DeviceApplicationInterface/module.mk @@ -24,6 +24,9 @@ modules := ../LibCommon \ ../LibMec/ApplicationMobilityServiceAPI \ ../LibMec/FederationEnablementAPI \ ../LibMec/IoTAPI \ + ../LibMec/QoSMeasurementAPI \ + ../LibMec/SensorsSharingService \ + ../LibMec/SelfServiceEnablementAPI \ ../../titan-test-system-framework/ccsrc/Framework \ ../../titan-test-system-framework/ccsrc/loggers \ ../../titan-test-system-framework/ccsrc/Protocols/Http \ -- GitLab From 2a7dc95669c083febfc413f8499eb9539a68460c Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 30 Jul 2025 15:09:05 +0200 Subject: [PATCH 48/54] Start validation of MEC profile for CAPIF --- ccsrc/Protocols/Json/json_codec_mec011.cc | 12 + ccsrc/Protocols/Json/json_codec_mec021.cc | 19 + ...Mec_ApplicationMobiltyService_Sandbox.cfg_ | 16 +- .../AtsMec_DeviceApplicationInterface.cfg | 115 --- ...PlatformApplicationEnablement_Sandbox.cfg_ | 34 +- ..._FixedAccessInformationService_Sandbox.cf_ | 2 +- .../AtsMec_WlanInformation_Sandbox.cfg_ | 11 +- ...pplicationMobiltyServiceAPI_TestCases.ttcn | 24 +- ...ormApplicationEnablementAPI_TestCases.ttcn | 693 +++++++++++++++++- ...mApplicationEnablementAPI_TestControl.ttcn | 11 + ...plicationMobilityServiceAPI_Functions.ttcn | 4 +- .../ApplicationMobilityServiceAPI_Pixits.ttcn | 2 +- ...plicationMobilityServiceAPI_Templates.ttcn | 8 +- ...tionMobilityServiceAPI_TypesAndValues.ttcn | 8 +- ...viceApplicationInterfaceAPI_Functions.ttcn | 2 +- ...ormApplicationEnablementAPI_Functions.ttcn | 127 ++++ ...atformApplicationEnablementAPI_Pixits.ttcn | 4 +- ...ormApplicationEnablementAPI_Templates.ttcn | 244 +++++- ...plicationEnablementAPI_TypesAndValues.ttcn | 302 +++++--- .../ttcn/TrafficManagementAPI_Functions.ttcn | 2 +- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 1 + .../ttcn/LibHttp_JsonTemplates.ttcn | 16 +- 23 files changed, 1374 insertions(+), 285 deletions(-) delete mode 100644 etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg diff --git a/ccsrc/Protocols/Json/json_codec_mec011.cc b/ccsrc/Protocols/Json/json_codec_mec011.cc index a885b51..c4d3f37 100644 --- a/ccsrc/Protocols/Json/json_codec_mec011.cc +++ b/ccsrc/Protocols/Json/json_codec_mec011.cc @@ -52,6 +52,10 @@ int json_codec_mec011::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms const EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); traffic_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_service__api__description)) { + const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription& service_api_description = msg.service__api__description(); + service_api_description.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { return json_codec::encode(msg, data); } @@ -185,6 +189,14 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo__regapps() = appInfo; + } else if (it->second.find("\"serviceAPIDescriptions\"") != std::string::npos) { + EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs discovered_apis; + discovered_apis.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.discovered__apis() = discovered_apis; + } else if (it->second.find("\"apiName\"") != std::string::npos) { + EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription service_api_description; + service_api_description.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.service__api__description() = service_api_description; } else { return json_codec::decode(p_data, msg, p_params); } diff --git a/ccsrc/Protocols/Json/json_codec_mec021.cc b/ccsrc/Protocols/Json/json_codec_mec021.cc index 4c2af72..c143714 100644 --- a/ccsrc/Protocols/Json/json_codec_mec021.cc +++ b/ccsrc/Protocols/Json/json_codec_mec021.cc @@ -20,6 +20,10 @@ int json_codec_mec021::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms const ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo& registration_info = msg.registrationInfo(); registration_info.encode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mobilityProcedureSubscription)) { + const ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription& mobility_procedure_subscription = msg.mobilityProcedureSubscription(); + mobility_procedure_subscription.encode(ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { return json_codec::encode(msg, data); } @@ -73,6 +77,21 @@ int json_codec_mec021::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo registration_info.decode(ApplicationMobilityServiceAPI__TypesAndValues::RegistrationInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.registrationInfo() = registration_info; } + } else if ((it->second.find("\"subscription\"") != std::string::npos) && (it->second.find("\"_links\"") != std::string::npos)) { // SubscriptionLinkList + ApplicationMobilityServiceAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + subscription_link_list.decode(ApplicationMobilityServiceAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList__ams() = subscription_link_list; + } else if (it->second.find("\"MobilityProcedureSubscription\"") != std::string::npos) { + ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription mobility_procedure_subscription; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + mobility_procedure_subscription.decode(ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mobilityProcedureSubscription() = mobility_procedure_subscription; + } else if (it->second.find("\"MobilityProcedureNotification\"") != std::string::npos) { + ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureNotification mobility_procedure_notification; + TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); + mobility_procedure_notification.decode(ApplicationMobilityServiceAPI__TypesAndValues::MobilityProcedureNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); + msg.mobilityProcedureNotification() = mobility_procedure_notification; } else { return json_codec::decode(p_data, msg, p_params); } diff --git a/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ b/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ index 773ab64..6a37330 100644 --- a/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ +++ b/etc/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyService_Sandbox.cfg_ @@ -8,7 +8,7 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" +LibHttp_Pics.PICS_HEADER_HOST := "yanngarcia.ddns.net" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true @@ -19,11 +19,13 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in o LibMec_Pics.PICS_MEC_PLAT := true # LibMec/ApplicationMobilityServiceAPI -# Application Instance ID -ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID := "b96f8a13-4253-4a8c-9485-33e5391f950d" -ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID_2 := "83a79787-2ceb-4b9b-ab0d-174463cb1896" - +# Application Instance ID. Get them from the MEC Sandbox GUI. +ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID := "6534adc3-9732-4c4a-8d6f-18b105a3890c" +ApplicationMobilityServiceAPI_Pixits.PX_APP_INS_ID_2 := "d3ba5131-deb9-43e1-99ab-02c16d7e8c0b" +ApplicationMobilityServiceAPI_Pixits.PX_MEP_ID := "MEP1" # Callbacks +ApplicationMobilityServiceAPI_Pixits.PX_CALLBACK_REFERENCE := "https://yanngarcia.ddns.net:36001/ams/v1" +ApplicationMobilityServiceAPI_Pixits.PX_CALLBACK_URI := "http://yanngarcia.ddns.net:36001/ams/v1" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -70,7 +72,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec021)/TCP(debug=1 #AtsMec_ApplicationMobiltyServiceAPI_TestControl.control # Check that the AMS service returns information about the registered application mobility services when requested -AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01 +#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01 # Check that the AMS service returns information about the a specific registered application mobility service when requested - filter #AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_02 # Check that the AMS service returns information about the a specific registered application mobility service when requested - filter @@ -88,7 +90,7 @@ AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_001_OK_01 # Check that the AMS service returns information about the available subscriptions when requested #AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_OK # Check that the AMS service sends an error when it receives a malformed query about the available subscriptions -#AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_BR +AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_003_BR # Check that the AMS service creates a notification subscriptions when requested #AtsMec_ApplicationMobiltyServiceAPI_TestCases.TC_MEC_MEC021_SRV_AMS_004_OK # Check that the AMS service sends an error when it receives a malformed request to create a notification subscription diff --git a/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg b/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg deleted file mode 100644 index 27b44cf..0000000 --- a/etc/AtsMec_DeviceApplicationInterface/AtsMec_DeviceApplicationInterface.cfg +++ /dev/null @@ -1,115 +0,0 @@ -[MODULE_PARAMETERS] -# This section shall contain the values of all parameters that are defined in your TTCN-3 modules. - -# IUT roles - -LibCommon_Time.PX_TAC := 30.0 -#LibCommon_Time.PX_TWAIT := 30.0 -LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; -LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; - -LibHttp_Pics.PICS_HEADER_HOST := "192.168.40.50" - -LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" -LibHttp_Pics.PICS_USE_TOKEN_HEADER := true -#LibHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" - -#LibMec_Pics.PICS_ROOT_API := "/sbxnfzm34p/mep1/" - -# LibMec_Pixits -DeviceApplicationInterfaceAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" -# DeviceApplicationInterfaceAPI_Pixits.PX_APPD_ID := "onboarded-demo4" -# DeviceApplicationInterfaceAPI_Pixits.PX_APP_DESCRIPTION := "Basic HTTP" -# DeviceApplicationInterfaceAPI_Pixits.PX_APP_PROVIDER := "demo" -# DeviceApplicationInterfaceAPI_Pixits.PX_ASSOCIATE_DEV_APPID := "bcee2135-2750-4d23-b786-a3062a371c8a" - - -[LOGGING] -# In this section you can specify the name of the log file and the classes of events -# you want to log into the file or display on console (standard error). - -LogFile := "../logs/AtsMec_DeviceApplicationInterface/%e.%h-%r.%s" -FileMask := LOG_ALL | USER | DEBUG | MATCHING -ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING -#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE -#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE -LogSourceInfo := Stack -LogEntityName:= Yes -LogEventTypes:= Yes -#TimeStampFormat := DateTime - -[TESTPORT_PARAMETERS] -# In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec_mec016)/TCP(debug=1,server=192.168.40.50,port=80,use_ssl=0)" -#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)" -#system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec015)/TCP(debug=1,server_mode=1,use_ssl=0)" - -[DEFINE] -# In this section you can create macro definitions, -# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE]. - -[INCLUDE] -# To use configuration settings given in other configuration files, -# the configuration files just need to be listed in this section, with their full or relative pathnames. - -[ORDERED_INCLUDE] -# To use configuration settings given in other configuration files, -# the configuration files just need to be listed in this section, with their full or relative pathnames. - -[EXTERNAL_COMMANDS] -# This section can define external commands (shell scripts) to be executed by the ETS -# whenever a control part or test case is started or terminated. - -#BeginTestCase := "" -#EndTestCase := "" -#BeginControlPart := "" -#EndControlPart := "" - -[EXECUTE] -# In this section you can specify what parts of your test suite you want to execute. -#AtsMec_TestControl.control - -# Check that the IUT responds with the list of user applications when requested by an UE Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_001_NF -# Check that the IUT responds with the list of user applications when requested by an UE Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPS_002_BR -#Check that the IUT acknowledges the creation of the application context when requested by an UE Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_OK -# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_BR -# Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_001_NF -# Check that the IUT acknowledges the creation of the application context when requested by an UE Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_BR -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_002_NF -# Check that the IUT deletes the application context when commanded by an UE Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_OK -# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPCTX_003_NF -# Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_OK -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -#AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_BR -# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application -AtsMec_DeviceApplicationInterfaceAPI_TestCases.TC_MEC_MEC016_MEO_UEAPPLOC_001_NF - -[GROUPS] -# In this section you can specify groups of hosts. These groups can be used inside the -# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. - -[COMPONENTS] -# This section consists of rules restricting the location of created PTCs. - -[MAIN_CONTROLLER] -# The options herein control the behavior of MC. -KillTimer := 10.0 -LocalAddress := 127.0.0.1 -TCPPort := 12000 -NumHCs := 1 diff --git a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ index 7c8767b..273cc19 100644 --- a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ +++ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ @@ -19,7 +19,10 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i LibMec_Pics.PICS_MEC_PLAT := true # Application Instance ID -EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "f1e4d448-e277-496b-bf63-98391cfd20fb" # Copied from ETSI MEC Sandbox GUI +EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "52bd535e-7a3e-4fef-8678-b2c832c9be95" # Copied from ETSI MEC Sandbox GUI +# MEC APIs +EdgePlatformApplicationEnablementAPI_Pixits.PX_API_NAME := "mec015-1" # Pickup from MEC Sandbox logs console +EdgePlatformApplicationEnablementAPI_Pixits.PX_API_ID := "a6612a80-85f2-41e0-8565-4bf477483fb7" # Callbacks @@ -72,7 +75,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_BR # Check that the IUT responds with an error when a request with an unknown service is sent by a MEC Application -AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_NF +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_001_NF # Check that the IUT notifies the authorised relevant (subscribed) application instances when a new service for a given application instance is registered #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application @@ -193,6 +196,33 @@ AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_0 # Check that the IUT responds with current time when queried by a MEC Application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_TIME_002_OK +# Check that the IUT responds with all service APIs when queried by a MEC Application - No filter +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01 +# Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiName +AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02 +# Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_03 +# Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId and apiName +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05 +# Check that the IUT responds with an error when applying a malformed filter +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR +# Check that the IUT responds with an error when applying a filter on an unknown apiName +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF +# Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK +# Check that the IUT responds with an error when applying a filter on an unknown apfId +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF +# Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK +# Check that the IUT responds with an error when incorrect parameters were sent by a MEC Application - supportedFeatures shall be present +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR +# Check that the IUT responds with a serviceAPIDescription when queried by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK +# Check that the IUT responds with an error when applying a filter on an unknown apfId +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01 +# Check that the IUT responds with an error when applying a filter on an unknown serviceApiId +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02 + [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the # [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. diff --git a/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ b/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ index 3077a65..409d05a 100644 --- a/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ +++ b/etc/AtsMec_FixedAccessInformationService/AtsMec_FixedAccessInformationService_Sandbox.cf_ @@ -8,7 +8,7 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -LibHttp_Pics.PICS_HEADER_HOST := "mec-platform.etsi.org" +LibHttp_Pics.PICS_HEADER_HOST := "yanngarcia.ddns.net" LibHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibHttp_Pics.PICS_USE_TOKEN_HEADER := true diff --git a/etc/AtsMec_WlanInformation/AtsMec_WlanInformation_Sandbox.cfg_ b/etc/AtsMec_WlanInformation/AtsMec_WlanInformation_Sandbox.cfg_ index 50d1b79..482bf67 100644 --- a/etc/AtsMec_WlanInformation/AtsMec_WlanInformation_Sandbox.cfg_ +++ b/etc/AtsMec_WlanInformation/AtsMec_WlanInformation_Sandbox.cfg_ @@ -18,9 +18,10 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i LibMec_Pics.PICS_MEC_PLAT := true -WlanInformationAPI_Pixits.PX_WLAN_FILTER_VALUE := "005C0A0A0002" -WlanInformationAPI_Pixits.PX_MAC_ID := "005C07070707" -WlanInformationAPI_Pixits.PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "http://yanngarcia.ddns.net/wais/v2/assoc_sta" +# LibMec/WlanInformationAPI +WlanInformationAPI_Pixits.PX_WLAN_FILTER_VALUE := "005C0A0A0002" +WlanInformationAPI_Pixits.PX_MAC_ID := "005C07070707" +WlanInformationAPI_Pixits.PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "http://yanngarcia.ddns.net:8547/wais/v2/assoc_sta" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -87,7 +88,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec028)/TCP(debug=1 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_BR # Check that the IUT responds with an error when a request with not existing parameters is sent -#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_NF +AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_NF # Check that the IUT responds with a Notification Subscription #AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_007_OK # Check that the IUT responds with an error when an invalid Subscription request is sent @@ -111,7 +112,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec028)/TCP(debug=1 # Check that the IUT sends a notification about WLAN event notification if the MEC service has an associated subscription and the event is generated #AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_011_OK # Check that the IUT responds with the list of WLAN Access Point -AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_012_OK +#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_012_OK # Check that the IUT responds with a new measurement configuration #AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_013_OK # Check that the IUT responds with an error when an invalid request is sent diff --git a/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn b/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn index 11e99b4..a6ee0fa 100644 --- a/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn +++ b/ttcn/AtsMec_ApplicationMobiltyService/AtsMec_ApplicationMobiltyServiceAPI_TestCases.ttcn @@ -192,7 +192,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,serviceConsumerId[appInstanceId]," & oct2char(unichar2oct(PX_APP_INS_ID_2, "UTF-8")) & ")", + PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,serviceConsumerId/appInstanceId," & oct2char(unichar2oct(PX_APP_INS_ID_2, "UTF-8")) & ")", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -254,7 +254,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")) & "&exclude_fields=[deviceInformation])", + PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")) & "&Exclude_fields=deviceInformation)", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -269,12 +269,7 @@ mw_body_json_ams_registration_info_list( { *, - mw_registration_info( - v_registration_info_1.appMobilityServiceId, - mw_service_consumer_id( - PX_APP_INS_ID, - PX_MEP_ID - )), + v_registration_info_1, * } ))))) { @@ -327,7 +322,7 @@ alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok_no_body + mw_http_response_404_not_found )) { tc_ac.stop; @@ -560,7 +555,7 @@ httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=" & oct2char(unichar2oct(v_mobility_procedure_subscription.subscriptionType, "UTF-8")), + PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=mobility_proc", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -575,10 +570,15 @@ mw_body_json_ams_subscriptions( mw_subscription_link_list( v_mobility_procedure_subscription.links, - mw_subscription( + { + *, + mw_subscription( -, v_mobility_procedure_subscription.subscriptionType - ))))))) { + ), + * + } + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the list of subscriptions type MobilityProcedureSubscription ***"); diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 65eff77..5e0656e 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -4621,8 +4621,6 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; - var ServiceInfo v_service_info; - var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { @@ -4637,7 +4635,6 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -4668,7 +4665,6 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_service_info(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01 @@ -4678,6 +4674,127 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_URI & "?api-name=" & oct2char(unichar2oct(PX_API_NAME, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_discovered_apis( + mw_discovered_apis( + { + *, + mw_service_api_description( + oct2char(unichar2oct(PX_API_NAME, "UTF-8")) + ), + * + } + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02 + + /** + * @desc Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_03() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_URI & "?api-invoker-id=" & oct2char(unichar2oct(PX_API_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_discovered_apis( + mw_discovered_apis( + { + mw_service_api_description( + -, + oct2char(unichar2oct(PX_API_ID, "UTF-8")) + ) + } + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_03 + + /** + * @desc Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId and apiName + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; var ServiceInfo v_service_info; var charstring v_subscription_id; @@ -4699,7 +4816,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_ME_CAPIF_URI & "?apiName=" & oct2char(unichar2oct(PX_API_NAME, "UTF-8")), + PICS_ROOT_API & PX_ME_CAPIF_URI & "?api-name=" & oct2char(unichar2oct(PX_API_NAME, "UTF-8")) & "&api-invoker-id=" & oct2char(unichar2oct(PX_API_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -4712,10 +4829,14 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_discovered_apis( - { - ? - } - ))))) { + mw_discovered_apis( + { + mw_service_api_description( + oct2char(unichar2oct(PX_API_NAME, "UTF-8")), + oct2char(unichar2oct(PX_API_ID, "UTF-8")) + ) + } + )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); @@ -4730,7 +4851,559 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_delete_service_info(v_subscription_id); f_cf_01_http_down(); - } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02 + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05 + + /** + * @desc Check that the IUT responds with an error when applying a malformed filter + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_URI & "?apiName=" & oct2char(unichar2oct(PX_API_NAME, "UTF-8")), // Wrong query parameters + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 400 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR + + /** + * @desc Check that the IUT responds with an error when applying a filter on an unknown apiName + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_URI & "?apiName=MEC-666", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP error 404 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF + + /** + * @desc Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/service-apis", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_discovered_apis + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK + + /** + * @desc Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/service-apis", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the HTTP error 404 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF + + /** + * @desc Check that the IUT responds with all service APIs for a specific apfId when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis", + v_headers, + m_http_message_body_json( + m_body_json_service_api_description( + m_service_api_description( + v_service_info.serInstanceId, + v_service_info.serName, + { + m_aef_profile( + "12345", + { m_version }, + m_mec_transport_info_capif_ext, + HTTP_2 + ) + }, + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + v_service_info.serName, + v_service_info.serName, + v_service_info.version + )), + -, + v_service_info.serName, + { "WeatherInfo" } + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_service_api_description( + mw_service_api_description( + v_service_info.serInstanceId, + v_service_info.serName + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK + + /** + * @desc Check that the IUT responds with an error when incorrect parameters were sent by a MEC Application - supportedFeatures shall be present + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis", + v_headers, + m_http_message_body_json( + m_body_json_service_api_description( + m_service_api_description( + v_service_info.serInstanceId, + v_service_info.serName, + { + m_aef_profile( + "12345", + { m_version }, + m_mec_transport_info_capif_ext, + HTTP_2 + ) + }, + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + v_service_info.serName, + v_service_info.serName, + v_service_info.version + )), + -, + v_service_info.serName + // No supportedFeatures + )))))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR + + /** + * @desc Check that the IUT responds with a serviceAPIDescription when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_service_api_description( + mw_service_api_description( + v_service_info.serInstanceId, + v_service_info.serName + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK + + /** + * @desc Check that the IUT responds with an error when applying a filter on an unknown apfId + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId & "_unknown", "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), // Unknown apiId + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01 + + /** + * @desc Check that the IUT responds with an error when applying a filter on an unknown serviceApiId + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/666", // Unknown serviceApiId + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the HTTP error message 404 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02 } // End of group capif diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn index 2edb810..1fa24bc 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn @@ -101,6 +101,17 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestControl { execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_03()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02()); } } diff --git a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn index bdbba62..aabe432 100644 --- a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn +++ b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Functions.ttcn @@ -193,7 +193,7 @@ module ApplicationMobilityServiceAPI_Functions { m_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, - m_filter_criteria, + m_filter_criteria(PX_APP_INS_ID), -, -, -, { seconds := (f_get_current_timestamp_utc() / 1000) + 60, nanoSeconds := 0 } )))))); @@ -207,7 +207,7 @@ module ApplicationMobilityServiceAPI_Functions { mw_body_json_ams_mobility_procedure_subscription( mw_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, - mw_filter_criteria, + mw_filter_criteria(PX_APP_INS_ID), mw_links )))))) -> value v_response { tc_ac.stop; diff --git a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Pixits.ttcn b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Pixits.ttcn index 6b6d485..ccf11a2 100644 --- a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Pixits.ttcn +++ b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Pixits.ttcn @@ -20,7 +20,7 @@ module ApplicationMobilityServiceAPI_Pixits { modulepar Json.String PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID := "PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID"; - modulepar Json.String PX_CALLBACK_REFERENCE := "http://127.0.0.1/callback"; + modulepar Json.String PX_CALLBACK_REFERENCE := "http://127.0.0.1/callback"; modulepar charstring PX_CALLBACK_URI := "http://127.0.0.1/callback"; diff --git a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Templates.ttcn b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Templates.ttcn index 6426d06..5ffaa84 100644 --- a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Templates.ttcn +++ b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_Templates.ttcn @@ -121,7 +121,7 @@ module ApplicationMobilityServiceAPI_Templates { template (omit) FilterCriteria m_filter_criteria( in template (omit) Json.String p_appInstanceId := omit, in template (omit) AssociateId p_associateId := omit, - in template (omit) MobilityStatus p_mobilityStatus := omit + in template (omit) MobilityStatusList p_mobilityStatus := omit ) := { appInstanceId := p_appInstanceId, associateId := p_associateId, @@ -131,7 +131,7 @@ module ApplicationMobilityServiceAPI_Templates { template FilterCriteria mw_filter_criteria( template Json.String p_appInstanceId := *, template AssociateId p_associateId := *, - template MobilityStatus p_mobilityStatus := * + template MobilityStatusList p_mobilityStatus := * ) := { appInstanceId := p_appInstanceId, associateId := p_associateId, @@ -296,7 +296,7 @@ module ApplicationMobilityServiceAPI_Templates { template (value) ApplicationMobilityServiceAPI_TypesAndValues.SubscriptionLinkList m_subscription_link_list( in template (value) ApplicationMobilityServiceAPI_TypesAndValues.Links p_links, - in template (value) ApplicationMobilityServiceAPI_TypesAndValues.Subscription p_subscription + in template (value) ApplicationMobilityServiceAPI_TypesAndValues.Subscriptions p_subscription ) := { links := p_links, subscription := p_subscription @@ -304,7 +304,7 @@ module ApplicationMobilityServiceAPI_Templates { template (present) ApplicationMobilityServiceAPI_TypesAndValues.SubscriptionLinkList mw_subscription_link_list( template (present) ApplicationMobilityServiceAPI_TypesAndValues.Links p_links := ?, - template (present) ApplicationMobilityServiceAPI_TypesAndValues.Subscription p_subscription := ? + template (present) ApplicationMobilityServiceAPI_TypesAndValues.Subscriptions p_subscription := ? ) := { links := p_links, subscription := p_subscription diff --git a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn index 3e509e4..cb739f5 100644 --- a/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/ApplicationMobilityServiceAPI/ttcn/ApplicationMobilityServiceAPI_TypesAndValues.ttcn @@ -131,7 +131,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { type record FilterCriteria { Json.String appInstanceId optional, AssociateId associateId optional, - MobilityStatus mobilityStatus optional + MobilityStatusList mobilityStatus optional } type set of FilterCriteria FilterCriterias; @@ -176,7 +176,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { */ type record SubscriptionLinkList { Links links, - Subscription subscription + Subscriptions subscription optional } with { variant (links) "name as '_links'"; } @@ -191,6 +191,7 @@ module ApplicationMobilityServiceAPI_TypesAndValues { Json.AnyURI href, Json.String subscriptionType } + type record of Subscription Subscriptions; /** * @desc This type represents a notification from AMS with regards to mobility procedure @@ -232,9 +233,8 @@ module ApplicationMobilityServiceAPI_TypesAndValues { INTERHOST_MOVEOUT_TRIGGERED (1), INTERHOST_MOVEOUT_COMPLETED (2), INTERHOST_MOVEOUT_FAILED (3) - } with { - variant "JSON: as number" } + type record of MobilityStatus MobilityStatusList; /** * @desc This type represents a notification from AMS with regards to change on adjacent application instances information diff --git a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn index 4cf0942..9ac892f 100644 --- a/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn +++ b/ttcn/LibMec/DeviceApplicationInterfaceAPI/ttcn/DeviceApplicationInterfaceAPI_Functions.ttcn @@ -33,7 +33,7 @@ module DeviceApplicationInterfaceAPI_Functions { ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; - var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := PX_APP_INSTANCE_ID, referenceURI := "http://example.com/aeiou", appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; + var UserAppInstanceInfoList v_userAppInstanceInfo := {{appInstanceId := omit, referenceURI := omit, appLocation := {countryCode := "countryCode", civicAddressElement := {{caType := 7, caValue := "caValue"}, {caType := 7, caValue := "caValue"}}, area := {coordinates := {{{2.302136, 2.302136}, {2.302136, 2.302136}}, {{2.302136, 2.302136}, {2.302136, 2.302136}}}}}}}; f_init_default_headers_list(-, -, v_headers); httpPort.send( diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn index 08ce93a..09cb97f 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn @@ -86,6 +86,72 @@ module EdgePlatformApplicationEnablementAPI_Functions { } // End of 'alt' statement } // End of function f_create_service_info + function f_start_service_info( + in ServiceInfo p_service_info + ) runs on HttpComponent { + var Headers v_headers; + + // Send confirm_ready + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_APP_SUPPORT_URI & "/applications/" & oct2char(unichar2oct(p_service_info.serInstanceId, "UTF-8")) & "/confirm_ready", + v_headers, + m_http_message_body_json( + m_body_json_app_ready_confirmation( + { indication := "READY" } + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": INFO: IUT successfully responds with a AppReadyConf ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + } + } // End of 'alt' statement + + } // End of function f_start_service_info + + function f_stop_service_info( + in ServiceInfo p_service_info + ) runs on HttpComponent { + var Headers v_headers; + + // Send termination_confirm + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_APP_SUPPORT_URI & "/applications/" & oct2char(unichar2oct(p_service_info.serInstanceId, "UTF-8")) & "/confirm_ready", + v_headers, + m_http_message_body_json( + m_body_json_app_termination_confirmation( + { operationAction := TERMINATING } + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": INFO: IUT successfully responds with a AppReadyConf ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + } + } // End of 'alt' statement + + } // End of function f_stop_service_info + function f_create_service_info_with_liveness( out ServiceInfo p_service_info, out charstring p_subscription_id @@ -413,4 +479,65 @@ module EdgePlatformApplicationEnablementAPI_Functions { } // End of function f_app_deletion + function f_publish_api( + in ServiceInfo p_service_info, + out ServiceAPIDescription p_service_api_description + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(p_service_info.serInstanceId, "UTF-8")) & "/service-apis", + v_headers, + m_http_message_body_json( + m_body_json_service_api_description( + m_service_api_description( + p_service_info.serInstanceId, + p_service_info.serName, + { + m_aef_profile( + "12345", + { m_version }, + m_mec_transport_info_capif_ext, + HTTP_2 + ) + }, + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + p_service_info.serName, + p_service_info.serName, + p_service_info.version + )), + -, + p_service_info.serName, + { "WeatherInfo" } + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_service_api_description( + mw_service_api_description( + p_service_info.serInstanceId, + p_service_info.serName + )))))) -> value v_response { + tc_ac.stop; + + p_service_api_description := v_response.response.body.json_body.service_api_description; + log("*** " & testcasename() & ": Info: IUT successfully responds with to the service APIs: ", p_service_api_description, " ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + } + } // End of 'alt' statement + + } // End of function f_publish_api + } // End of module EdgePlatformApplicationEnablementAPI_Functions diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn index 3dab506..d89a91a 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn @@ -71,5 +71,7 @@ module EdgePlatformApplicationEnablementAPI_Pixits { modulepar charstring PX_LINK_LIV := "mec_service_mgmt/v1/resource_uri_allocated_by_MEC_platform"; modulepar Json.String PX_API_NAME := "MEC-013"; - + + modulepar Json.String PX_API_ID := "46ce37bd-b526-4781-a298-f43594aa6f40"; + } // End of module EdgePlatformApplicationEnablementAPI_Pixits diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn index 8811d3d..932121b 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn @@ -142,6 +142,30 @@ module EdgePlatformApplicationEnablementAPI_Templates { links := p_links } // End of template mw_service_info + template (value) CategoryRef m_category_ref( + in template (value) CategoryRef_Href p_href, + in template (value) CategoryRef_Id p_id, + in template (value) EdgePlatformApplicationEnablementAPI_TypesAndValues.Name p_name, + in template (value) CategoryRef_Version p_version + ) := { + href := p_href, + id := p_id, + name := p_name, + version := p_version + } // End of template m_category_ref + + template (present) CategoryRef mw_category_ref( + template (present) CategoryRef_Href p_href := ?, + template (present) CategoryRef_Id p_id := ?, + template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.Name p_name := ?, + template (present) CategoryRef_Version p_version := ? + ) := { + href := p_href, + id := p_id, + name := p_name, + version := p_version + } // End of template mw_category_ref + template (value) SubscriptionLinkList m_subscription_link_list( in template (value) Links p_links ) := { @@ -459,5 +483,223 @@ module EdgePlatformApplicationEnablementAPI_Templates { dstInterface := *, state := p_state } // End of template mw_traffic_rule - + + template (omit) DiscoveredAPIs m_discovered_apis( + in template (value) ServiceAPIDescriptions p_serviceAPIDescriptions, + in template (omit) SupportedFeatures p_suppFeat := omit + ) := { + serviceAPIDescriptions := p_serviceAPIDescriptions, + suppFeat := p_suppFeat + } // End of template m_discovered_apis + + template (present) DiscoveredAPIs mw_discovered_apis( + template (present) ServiceAPIDescriptions p_serviceAPIDescriptions := ?, + template SupportedFeatures p_suppFeat := omit + ) := { + serviceAPIDescriptions := p_serviceAPIDescriptions, + suppFeat := p_suppFeat + } // End of template mw_discovered_apis + + template (omit) ServiceAPIDescription m_service_api_description( + in template (value) Json.String p_apiName, + in template (value) Json.String p_apiId, + in template (value) AefProfiles p_aefProfiles, + in template (value) MecServiceInfoCapifExt p_mecServiceInfoCapifExt, + in template (omit) ApiStatus p_apiStatus := omit, + in template (omit) Json.String p_description := omit, + in template (omit) SupportedFeatures p_supportedFeatures := omit, + in template (omit) ShareableInformation p_shareableInfo := omit, + in template (omit) Json.String p_serviceAPICategory := omit, + in template (omit) Json.String p_ccfId := omit, + in template (omit) SupportedFeatures p_apiSuppFeats := omit, + in template (omit) PublishedApiPath p_pubApiPath := omit, + in template (omit) Json.String p_apiProvName := omit + ) := { + apiName := p_apiName, + apiId := p_apiId, + apiStatus := p_apiStatus, + aefProfiles := p_aefProfiles, + description := p_description, + supportedFeatures := p_supportedFeatures, + shareableInfo := p_shareableInfo, + serviceAPICategory := p_serviceAPICategory, + ccfId := p_ccfId, + apiSuppFeats := p_apiSuppFeats, + pubApiPath := p_pubApiPath, + apiProvName := p_apiProvName, + mecServiceInfoCapifExt := p_mecServiceInfoCapifExt + } // End of template m_service_api_description + + template (present) ServiceAPIDescription mw_service_api_description( + template (present) Json.String p_apiName := ?, + template (present) Json.String p_apiId := ?, + template (present) AefProfiles p_aefProfiles := ?, + template (present) MecServiceInfoCapifExt p_mecServiceInfoCapifExt := ?, + template ApiStatus p_apiStatus := omit, + template Json.String p_description := *, + template SupportedFeatures p_supportedFeatures := *, + template ShareableInformation p_shareableInfo := omit, + template Json.String p_serviceAPICategory := *, + template Json.String p_ccfId := omit, + template SupportedFeatures p_apiSuppFeats := omit, + template PublishedApiPath p_pubApiPath := omit, + template Json.String p_apiProvName := * + ) := { + apiName := p_apiName, + apiId := p_apiId, + apiStatus := p_apiStatus, + aefProfiles := p_aefProfiles, + description := p_description, + supportedFeatures := p_supportedFeatures, + shareableInfo := p_shareableInfo, + serviceAPICategory := p_serviceAPICategory, + ccfId := p_ccfId, + apiSuppFeats := p_apiSuppFeats, + pubApiPath := p_pubApiPath, + apiProvName := p_apiProvName, + mecServiceInfoCapifExt := p_mecServiceInfoCapifExt + } // End of template mw_service_api_description + + template (omit) AefProfile m_aef_profile( + in template (value) Json.String p_aefId, + in template (value) EdgePlatformApplicationEnablementAPI_TypesAndValues.Versions p_versions, + in template (value) MecTransportInfoCapifExt p_mecTransportInfoCapifExt, + in template (omit) Protocol p_protocol := omit, + in template (omit) DataFormat p_dataFormat := omit, + in template (omit) SecurityMethods p_securityMethods := omit, + in template (omit) Json.String p_domainName := omit, + in template (omit) InterfaceDescriptions p_interfaceDescriptions := omit, + in template (omit) AefLocation p_aefLocation := omit, + in template (omit) ServiceKpis p_serviceKpis := omit, + in template (omit) IpAddrRange p_ueIpRange := omit + ) := { + aefId := p_aefId, + versions := p_versions, + protocol := p_protocol, + dataFormat := p_dataFormat, + securityMethods := p_securityMethods, + domainName := p_domainName, + interfaceDescriptions := p_interfaceDescriptions, + aefLocation := p_aefLocation, + serviceKpis := p_serviceKpis, + ueIpRange := p_ueIpRange, + mecTransportInfoCapifExt := p_mecTransportInfoCapifExt + } // End of template m_aef_profile + + template (present) AefProfile mw_aef_profile( + template (present) Json.String p_aefId := ?, + template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.Versions p_versions := ?, + template (present) MecTransportInfoCapifExt p_mecTransportInfoCapifExt := ?, + template Protocol p_protocol := *, + template DataFormat p_dataFormat := *, + template SecurityMethods p_securityMethods := *, + template Json.String p_domainName := *, + template InterfaceDescriptions p_interfaceDescriptions := *, + template AefLocation p_aefLocation := *, + template ServiceKpis p_serviceKpis := *, + template IpAddrRange p_ueIpRange := * + ) := { + aefId := p_aefId, + versions := p_versions, + protocol := p_protocol, + dataFormat := p_dataFormat, + securityMethods := p_securityMethods, + domainName := p_domainName, + interfaceDescriptions := p_interfaceDescriptions, + aefLocation := p_aefLocation, + serviceKpis := p_serviceKpis, + ueIpRange := p_ueIpRange, + mecTransportInfoCapifExt := p_mecTransportInfoCapifExt + } // End of template mw_aef_profile + + template (omit) MecServiceInfoCapifExt m_mec_service_info_capif_ext( + in EdgePlatformApplicationEnablementAPI_TypesAndValues.SerializerType p_serializer := JSON, + in ServiceState p_state := ACTIVE, + in template (value) CategoryRef p_category, + in template (omit) LocalityType p_scopeOfLocality := omit, + in template (omit) Json.Bool p_consumedLocalOnly := omit, + in template (omit) Json.Bool p_isLocal := omit + ) := { + serializer := p_serializer, + state := p_state, + scopeOfLocality := p_scopeOfLocality, + consumedLocalOnly := p_consumedLocalOnly, + isLocal := p_isLocal, + category := p_category + } // End of template m_mec_service_info_capif_ext + + template (present) MecServiceInfoCapifExt mw_mec_service_info_capif_ext( + template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.SerializerType p_serializer := JSON, + template (present) ServiceState p_state := ACTIVE, + template (present) CategoryRef p_category, + template LocalityType p_scopeOfLocality := *, + template Json.Bool p_consumedLocalOnly := *, + template Json.Bool p_isLocal := * + ) := { + serializer := p_serializer, + state := p_state, + scopeOfLocality := p_scopeOfLocality, + consumedLocalOnly := p_consumedLocalOnly, + isLocal := p_isLocal, + category := p_category + } // End of template mw_mec_service_info_capif_ext + + template (omit) MecTransportInfoCapifExt m_mec_transport_info_capif_ext( + in template (value) Json.String p_name := "REST", + in template (value) EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportType p_type := REST_HTTP, + in template (value) Json.String p_protocol := "HTTP", + in template (value) Json.String p_version := "2.0", + in template (omit) EdgePlatformApplicationEnablementAPI_TypesAndValues.SecurityInfo p_security := omit, + in template (omit) Json.String p_description := omit + ) := { + name := p_name, + description := p_description, + type_ := p_type, + protocol := p_protocol, + version := p_version, + security := p_security, + implSpecificInfo := omit + } // End of template m_mec_transport_info_capif_ext + + template (present) MecTransportInfoCapifExt mw_mec_transport_info_capif_ext( + template (present) Json.String p_name := "REST", + template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.TransportType p_type := REST_HTTP, + template (present) Json.String p_protocol := "HTTP", + template (present) Json.String p_version := "2.0", + template EdgePlatformApplicationEnablementAPI_TypesAndValues.SecurityInfo p_security := *, + template Json.String p_description := omit + ) := { + name := p_name, + description := p_description, + type_ := p_type, + protocol := p_protocol, + version := p_version, + security := p_security, + implSpecificInfo := omit + } // End of template mw_mec_transport_info_capif_ext + + template (omit) EdgePlatformApplicationEnablementAPI_TypesAndValues.Version m_version( + in template (value) Json.String p_apiVersion := PX_SERVICE_INFO_VERSION, + in template (omit) EdgePlatformApplicationEnablementAPI_TypesAndValues.DateTime p_expiry := omit, + in template (omit) Resources p_resources := omit, + in template (omit) CustOperations p_custOperations := omit + ) := { + apiVersion := p_apiVersion, + expiry := p_expiry, + resources := p_resources, + custOperations := p_custOperations + } // End of template m_version + + template (present) EdgePlatformApplicationEnablementAPI_TypesAndValues.Version mw_version( + template (present) Json.String p_apiVersion := PX_SERVICE_INFO_VERSION, + template EdgePlatformApplicationEnablementAPI_TypesAndValues.DateTime p_expiry := *, + template Resources p_resources := *, + template CustOperations p_custOperations := * + ) := { + apiVersion := p_apiVersion, + expiry := p_expiry, + resources := p_resources, + custOperations := p_custOperations + } // End of template mw_version + } // End of module EdgePlatformApplicationEnablementAPI_Templates diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index 43f146a..2c0c69f 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -385,7 +385,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @desc Self-referring URI. */ type record Mp1SubscriptionLinkList_Links { - LinkType self_, + LinkType self_, Mp1SubscriptionLinkList_SubscriptionList subscription optional } with { variant (self_) "name as 'self'"; @@ -448,7 +448,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 6.2.2-1: Attributes of the SubscriptionLinkList */ type record Subscription_ { - Json.AnyURI href, + Json.AnyURI href, SubscriptionType subscriptionType } type record length(1..infinity) of Subscription_ Subscriptions; @@ -502,16 +502,32 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents a subscription to the notifications from the mobile edge platform regarding the availability of a mobile edge service or a list of mobile edge services. + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.4.2-1: Attributes of ServiceAvailabilityNotification */ type record SerAvailabilityNotificationSubscription { - SerAvailabilityNotificationSubscription_SubscriptionType subscriptionType, + SerAvailabilityNotificationSubscription_SubscriptionType subscriptionType, SerAvailabilityNotificationSubscription_CallbackReference callbackReference, - Self links optional, - FilteringCriteria filteringCriteria optional + Self links optional, + FilteringCriteria filteringCriteria optional } with { variant (links) "name as '_links'"; } + /** + * @desc This type represents a subscription to the notifications from the mobile edge platform regarding the availability of a mobile edge service or a list of mobile edge services. + * @see ETSI GS MEC 011 V3.3.1 Table 8.1.4.2-1: Attributes of ServiceAvailabilityNotification + */ + type record ServiceReference { + LinkType links optional, + SerName serName, + SerInstanceId serInstanceId, + ServiceState state, + ChangeType changeType + } with { + variant (links) "name as '_links'"; + } + type set of ServiceReference ServiceReferenceList; + /** * @desc Shall be set to SerAvailabilityNotificationSubscription. */ @@ -528,10 +544,10 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { */ type record FilteringCriteria { SerInstanceIdList serInstanceIds optional, - SerNameList serNames optional, - CategoryRefList serCategories optional, - ServiceStateList states optional, - Json.Bool isLocal optional + SerNameList serNames optional, + CategoryRefList serCategories optional, + ServiceStateList states optional, + Json.Bool isLocal optional } /** @@ -539,8 +555,10 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { */ type record ServiceAvailabilityNotification { SerAvailabilityNotificationSubscription_SubscriptionType notificationType, - ServiceInfoList services, - Subscription links + ServiceReferenceList serviceReferences, + Subscription links + } with { + variant (links) "name as '_links'"; } /** @@ -628,19 +646,19 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 8.1.2.2-1: Attributes of ServiceInfo */ type record ServiceInfo { - SerInstanceId serInstanceId optional, - SerName serName, - CategoryRef serCategory optional, + SerInstanceId serInstanceId optional, + SerName serName, + CategoryRef serCategory optional, ServiceInfo_Version version, - ServiceState state, - TransportId transportId optional, - TransportInfo transportInfo optional, - SerializerType serializer, - LocalityType scopeOfLocality optional, - Json.Bool consumedLocalOnly optional, - Json.Bool isLocal optional, - Json.UInteger livenessInterval optional, - ServiceInfo_Link links optional + ServiceState state, + TransportId transportId optional, + TransportInfo transportInfo optional, + SerializerType serializer, + LocalityType scopeOfLocality optional, + Json.Bool consumedLocalOnly optional, + Json.Bool isLocal optional, + Json.UInteger livenessInterval optional, + ServiceInfo_Link links optional } with { variant (links) "name as '_links'"; } @@ -722,11 +740,11 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.4-1: Attributes of TimingCaps */ type record NtpServers { - NtpServerAddrType ntpServerAddrType, - NtpServerAddr ntpServerAddr, - MinPollingInterval minPollingInterval, - MaxPollingInterval maxPollingInterval, - LocalPriority localPriority, + NtpServerAddrType ntpServerAddrType, + NtpServerAddr ntpServerAddr, + MinPollingInterval minPollingInterval, + MaxPollingInterval maxPollingInterval, + LocalPriority localPriority, AuthenticationOption authenticationOption, AuthenticationKeyNum authenticationKeyNum } @@ -736,9 +754,9 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @desc NTP server detail. */ type record TimingCaps_PtpMasters { - NtpServers_PtpMasterIpAddress ptpMasterIpAddress, + NtpServers_PtpMasterIpAddress ptpMasterIpAddress, NtpServers_PtpMasterLocalPriority ptpMasterLocalPriority, - DelayReqMaxRate delayReqMaxRate + DelayReqMaxRate delayReqMaxRate } type set of TimingCaps_PtpMasters TimingCaps_PtpMastersList; @@ -830,19 +848,19 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 7.1.5.2-1: Attributes of TrafficFilter */ type record TrafficFilter { // FIXME FSCOM Need to duplicate to prevent C++ incomplete type error - TrafficFilter_AddressList srcAddress optional, - TrafficFilter_AddressList dstAddress optional, - TrafficFilter_PortList srcPort optional, - TrafficFilter_PortList dstPort optional, - TrafficFilter_ProtocolList protocol optional, - TrafficFilter_TagList tag optional, + TrafficFilter_AddressList srcAddress optional, + TrafficFilter_AddressList dstAddress optional, + TrafficFilter_PortList srcPort optional, + TrafficFilter_PortList dstPort optional, + TrafficFilter_ProtocolList protocol optional, + TrafficFilter_TagList tag optional, TrafficFilter_TunnelAddressList srcTunnelAddress optional, TrafficFilter_TunnelAddressList tgtTunnelAddress optional, - TrafficFilter_TunnelPortList srcTunnelPort optional, - TrafficFilter_TunnelPortList dstTunnelPort optional, - TrafficFilter_QCI qCI optional, - TrafficFilter_DSCP dSCP optional, - TrafficFilter_TC tC optional + TrafficFilter_TunnelPortList srcTunnelPort optional, + TrafficFilter_TunnelPortList dstTunnelPort optional, + TrafficFilter_QCI qCI optional, + TrafficFilter_DSCP dSCP optional, + TrafficFilter_TC tC optional } type set of TrafficFilter TrafficFilterList; @@ -896,13 +914,13 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 7.1.2.2-1: Attributes of TrafficRule */ type record TrafficRule { - TrafficRule_Id trafficRuleId, - TrafficRule_FilterType filterType, - TrafficRule_Priority priority, + TrafficRule_Id trafficRuleId, + TrafficRule_FilterType filterType, + TrafficRule_Priority priority, EdgePlatformApplicationEnablementAPI_TypesAndValues.TrafficFilterList trafficFilter, - TrafficRule_Action action_, - DestinationInterfaceList dstInterface optional, - TrafficRule_State state + TrafficRule_Action action_, + DestinationInterfaceList dstInterface optional, + TrafficRule_State state } with { variant (action_) "name as 'action'"; } @@ -947,8 +965,8 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 8.1.5.3-1: Attributes of EndPointInfo */ type record EndPointInfo { - EndPointInfo_UriList uris optional, - EndPointInfo_FqdnList fqdn optional, + EndPointInfo_UriList uris optional, + EndPointInfo_FqdnList fqdn optional, EndPointInfo_AddressList addresses optional, EndPointInfo_Alternative alternative optional } @@ -967,14 +985,14 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 8.1.2.3-1: Attributes of TransportInfo */ type record TransportInfo { - TransportInfo_Id id, - TransportInfo_Name name, - TransportInfo_Description description optional, - TransportType type_, - TransportInfo_Protocol protocol, - TransportInfo_Version version, - EndPointInfo endpoint, - SecurityInfo security, + TransportInfo_Id id, + TransportInfo_Name name, + TransportInfo_Description description optional, + TransportType type_, + TransportInfo_Protocol protocol, + TransportInfo_Version version, + EndPointInfo endpoint, + SecurityInfo security, TransportInfo_ImplSpecificInfo implSpecificInfo optional } with { variant (type_) "name as 'type'"; @@ -1021,7 +1039,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI GS MEC 011 V3.3.1 Table 7.1.5.4-1: Attributes of TunnelInfo */ type record TunnelInfo { - TunnelInfo_TunnelType tunnelType, + TunnelInfo_TunnelType tunnelType, TunnelInfo_TunnelDstAddress tunnelDstAddress optional, TunnelInfo_TunnelSrcAddress tunnelSrcAddress optional } @@ -1029,10 +1047,12 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc This type represents the structured data types to be used in resource representations of the CAPIF_Discover_Service_API. * @member serviceAPIDescriptions Description of the service API as published by the service + * @member suppFeat Contains the list of supported features among the ones * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.1.4.2.2-1: Definition of type DiscoveredAPIs */ type record DiscoveredAPIs { - ServiceAPIDescription serviceAPIDescriptions optional + ServiceAPIDescriptions serviceAPIDescriptions optional, + SupportedFeatures suppFeat optional } /** @@ -1051,20 +1071,53 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.2-1: Definition of type ServiceAPIDescription */ type record ServiceAPIDescription { - Json.String apiName, - Json.String apiId optional, - ApiStatus apiStatus optional, - AefProfiles aefProfiles optional, - Json.String description optional, - SupportedFeatures supportedFeatures optional, - Json.String serviceAPICategory optional, - Json.String ccfId optional, - SupportedFeatures apiSuppFeats optional, - PublishedApiPath pubApiPath optional, - Json.String apiProvName optional + Json.String apiName, + Json.String apiId optional, + ApiStatus apiStatus optional, + AefProfiles aefProfiles optional, + Json.String description optional, + SupportedFeatures supportedFeatures optional, + ShareableInformation shareableInfo optional, + Json.String serviceAPICategory optional, + Json.String ccfId optional, + SupportedFeatures apiSuppFeats optional, + PublishedApiPath pubApiPath optional, + Json.String apiProvName optional, + MecServiceInfoCapifExt mecServiceInfoCapifExt + } with { + variant (mecServiceInfoCapifExt) "name as 'vendorSpecific-urn:etsi:mec:capifext:service-info'"; } type record length (1 .. infinity) of ServiceAPIDescription ServiceAPIDescriptions; + /** + * @desc MecServiceInfoCapifExt + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 9.1.5.1-1: Attributes of the MecServiceInfoCapifExt data type + */ + type record MecServiceInfoCapifExt { + SerializerType serializer, + ServiceState state, + LocalityType scopeOfLocality optional, + Json.Bool consumedLocalOnly optional, + Json.Bool isLocal optional, + CategoryRef category + } + + /** + * @desc MecTransportInfoCapifExt + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 9.1.5.2-1: Attributes of the MecTransportInfoCapifExt + */ + type record MecTransportInfoCapifExt { + Json.String name, + Json.String description optional, + TransportType type_, + Json.String protocol, + Json.String version, + SecurityInfo security, + Json.String implSpecificInfo optional + } with { + variant (type_) "name as 'type'"; + } + /** * @desc This type represents the API status * @member serviceAPIDescriptions Indicates the list of AEF ID(s) where the API is active @@ -1074,6 +1127,20 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { record of Json.String aefIds optional } + /** + * @desc This type represents the API status + * @member isShareable Communication type used by the custom operation + * @member capifProvDoms + * @member operations + * @member description + * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.8-1: Definition of type ShareableInformation + */ + type record ShareableInformation { + Json.Bool isShareable, + CapifProvDoms capifProvDoms optional + } + type record of Json.String CapifProvDoms; + /** * @desc This type represents the AEF profile information * @member aefId AEF identifier @@ -1089,26 +1156,27 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.4-1: Definition of type AefProfile */ type record AefProfile { - Json.String aefId, - Versions versions, - Protocol protocol optional, - DataFormat dataFormat optional, - SecurityMethods securityMethods optional, - Json.String domainName optional, - InterfaceDescriptions interfaceDescriptions optional, - AefLocation aefLocation optional, - ServiceKpis serviceKpis optional, - IpAddrRange ueIpRange optional + Json.String aefId, + Versions versions, + Protocol protocol optional, + DataFormat dataFormat optional, + SecurityMethods securityMethods optional, + Json.String domainName optional, + InterfaceDescriptions interfaceDescriptions optional, + AefLocation aefLocation optional, + ServiceKpis serviceKpis optional, + IpAddrRange ueIpRange optional, + MecTransportInfoCapifExt mecTransportInfoCapifExt + } with { + variant (mecTransportInfoCapifExt) "name as 'vendorSpecific-urn:etsi:mec:capifext:transport-info'"; } type record length (1 .. infinity) of AefProfile AefProfiles; /** - * @desc - * @see ETSI TS 129 222 V18.6.0 (2024-07) + * @desc A string used to indicate the features supported by an API + * @see ETSI TS 129 571 V18.10.0 (2025-07) */ - type record SupportedFeature { - - } + type Json.String SupportedFeature; type record length (1 .. infinity) of SupportedFeature SupportedFeatures; /** @@ -1128,9 +1196,9 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.5-1: Definition of type Version */ type record Version { - Json.String apiVersion, - DateTime expiry optional, - Resources resources optional, + Json.String apiVersion, + DateTime expiry optional, + Resources resources optional, CustOperations custOperations optional } type record of Version Versions; @@ -1180,11 +1248,11 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.3-1: Definition of type InterfaceDescription */ type record InterfaceDescription { - Ipv4Addr ipv4Addr optional, - Ipv6Addr ipv6Addr optional, - Fqdn fqdn optional, - Port port_ optional, - Json.String apiPrefix optional, + Ipv4Addr ipv4Addr optional, + Ipv6Addr ipv6Addr optional, + Fqdn fqdn optional, + Port port_ optional, + Json.String apiPrefix optional, SecurityMethods securityMethods optional } with { variant (port_) "name as 'port'"; @@ -1199,9 +1267,9 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.10-1: Definition of type AefLocation */ type record AefLocation { - CivicAddress civicAddr optional, + CivicAddress civicAddr optional, GeographicArea geoArea optional, - Json.String dcId optional + Json.String dcId optional } /** @@ -1218,12 +1286,12 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { */ type record ServiceKpi { Json.UInteger maxReqRate optional, - DurationSec maxRestime optional, + DurationSec maxRestime optional, Json.UInteger availability optional, - Json.String avalComp optional, - Json.String avalGraComp optional, - Json.String avalMem optional, - Json.String avalStor optional, + Json.String avalComp optional, + Json.String avalGraComp optional, + Json.String avalMem optional, + Json.String avalStor optional, Json.UInteger conBand optional } type record length (1 .. infinity) of ServiceKpi ServiceKpis; @@ -1238,9 +1306,9 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { */ type record CustomOperation { CommunicationType commType, - Json.String custOpName, - Operations operations, - Json.String description optional + Json.String custOpName, + Operations operations, + Json.String description optional } type record length (1 .. infinity) of CustomOperation CustOperations; @@ -1292,10 +1360,16 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { } - type record DateTime { - - } + /** + * desc String with format "date-time" as defined in OpenAPI Specification + * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + */ + type Json.String DateTime; + /** + * desc Unsigned integer identifying a period of time in units of seconds + * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + */ type Json.Number DurationSec; type record Ipv4AddressRange { @@ -1308,13 +1382,17 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { } type record length (1 .. infinity) of Ipv6AddressRange Ipv6AddressRanges; - type record Ipv4Addr { - - } - - type record Ipv6Addr { + /** + * desc String identifying a IPv4 address formatted in the "dotted decimal" notation + * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + */ + type Json.String Ipv4Addr; - } + /** + * desc String identifying a IPv6 address formatted in the "dotted decimal" notation + * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + */ + type Json.String Ipv6Addr; } with { encode "JSON" diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index b164253..84cd7a9 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -63,7 +63,7 @@ module TrafficManagementAPI_Functions { mw_bw_info( p_app_instance_id )))))) -> value v_response { - // var charstring_list v_header_location; + var charstring_list v_header_location; tc_ac.stop; log("f_create_bw_allocation_resource: BwInfo resource created: ", v_response); f_get_header(valueof(v_response.response.header), "Location", v_header_location); diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 7504f8c..ec8b2ab 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -90,6 +90,8 @@ module LibMec_Pixits { // FIXME FSCOM Split this file according to the different modulepar charstring PX_ME_CAPIF_URI := "service-apis/v1/allServiceAPIs"; + modulepar charstring PX_ME_CAPIF_PUBLISH_API_URI := "published-apis/v1"; + modulepar charstring PX_MEC_SVC_MGMT_SVC_URI := "mec_service_mgmt/v1/services"; modulepar charstring PX_ME_APP_SUPPORT_TIMING_CAPS_URI := "mec_app_support/v2/timing/timing_caps"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 9e11d8c..b3468a8 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -145,6 +145,7 @@ module LibHttp_JsonMessageBodyTypes { TimingCaps timingCaps, CurrentTime currentTime, DiscoveredAPIs discovered_apis, + ServiceAPIDescription service_api_description, DeviceApplicationInterfaceAPI_TypesAndValues.ApplicationList applicationList, DeviceApplicationInterfaceAPI_TypesAndValues.AppContext appContext_device_info, ApplicationLocationAvailability applicationLocationAvailability, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index c0025aa..461521d 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1193,10 +1193,6 @@ module LibHttp_JsonTemplates { appInfo_regapps := p_appInfo_regapps } // End of template mw_body_json_app_info_regapps - - - - template (value) JsonBody m_body_json_discovered_apis( in template (value) DiscoveredAPIs p_discovered_apis ) := { @@ -1209,9 +1205,17 @@ module LibHttp_JsonTemplates { discovered_apis := p_discovered_apis } // End of template mw_body_json_discovered_apis + template (value) JsonBody m_body_json_service_api_description( + in template (value) ServiceAPIDescription p_service_api_description + ) := { + service_api_description := p_service_api_description + } // End of template m_body_json_service_api_description - - + template (present) JsonBody mw_body_json_service_api_description( + template (present) ServiceAPIDescription p_service_api_description := ? + ) := { + service_api_description := p_service_api_description + } // End of template mw_body_json_service_api_description } // End of group app_enablement_api -- GitLab From d72baeb6ca80fb89c9dd27fa56d927982963e881 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 1 Aug 2025 15:25:43 +0200 Subject: [PATCH 49/54] CAPIF: Add new TC; Add missing types & templates for subscription --- ccsrc/Protocols/Json/json_codec_mec011.cc | 8 + ...PlatformApplicationEnablement_Sandbox.cfg_ | 13 + ...ormApplicationEnablementAPI_TestCases.ttcn | 478 ++++++++++++++++-- ...mApplicationEnablementAPI_TestControl.ttcn | 13 + ...ormApplicationEnablementAPI_Functions.ttcn | 31 ++ ...ormApplicationEnablementAPI_Templates.ttcn | 132 +++++ ...plicationEnablementAPI_TypesAndValues.ttcn | 315 +++++++++++- .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 1 + .../ttcn/LibHttp_JsonTemplates.ttcn | 12 + 9 files changed, 963 insertions(+), 40 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec011.cc b/ccsrc/Protocols/Json/json_codec_mec011.cc index c4d3f37..d2f834c 100644 --- a/ccsrc/Protocols/Json/json_codec_mec011.cc +++ b/ccsrc/Protocols/Json/json_codec_mec011.cc @@ -56,6 +56,10 @@ int json_codec_mec011::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription& service_api_description = msg.service__api__description(); service_api_description.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_service__api__description)) { + const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch& service_api_description_patch = msg.service__api__description__patch(); + service_api_description_patch.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { return json_codec::encode(msg, data); } @@ -197,6 +201,10 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription service_api_description; service_api_description.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.service__api__description() = service_api_description; + } else if (it->second.find("\"serviceAPICategory\"") != std::string::npos) { + EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch service_api_description_patch; + service_api_description_patch.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.service__api__description__patch() = service_api_description_patch; } else { return json_codec::decode(p_data, msg, p_params); } diff --git a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ index 273cc19..4da47c4 100644 --- a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ +++ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ @@ -222,6 +222,19 @@ AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROF #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01 # Check that the IUT responds with an error when applying a filter on an unknown serviceApiId #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02 +# Check that the IUT updates the publishing of a new API when queried by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF +# Check that the IUT changes the publishing of a new API when queried by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF +# Check that the IUT acknowledges the removing of a published API when queried by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF + [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 5e0656e..6128b05 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -5092,27 +5092,27 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { m_http_message_body_json( m_body_json_service_api_description( m_service_api_description( - v_service_info.serInstanceId, - v_service_info.serName, - { - m_aef_profile( - "12345", - { m_version }, - m_mec_transport_info_capif_ext, - HTTP_2 - ) - }, - m_mec_service_info_capif_ext( - -, -, - m_category_ref( - "catalogueHref", - v_service_info.serName, - v_service_info.serName, - v_service_info.version - )), - -, - v_service_info.serName, - { "WeatherInfo" } + v_service_info.serName, + v_service_info.serInstanceId, + { + m_aef_profile( + "12345", + { m_version }, + m_mec_transport_info_capif_ext, + HTTP_2 + ) + }, + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + v_service_info.serName, + v_service_info.serName, + v_service_info.version + )), + -, + v_service_info.serName, + { "WeatherInfo" } )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5121,12 +5121,12 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_service_api_description( - mw_service_api_description( - v_service_info.serInstanceId, - v_service_info.serName + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_service_api_description( + mw_service_api_description( + v_service_info.serName, + v_service_info.serInstanceId )))))) { tc_ac.stop; @@ -5140,6 +5140,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_published_api(v_service_info.serInstanceId, v_service_info.serInstanceId); f_stop_service_info(v_service_info); f_delete_service_info(v_subscription_id); f_cf_01_http_down(); @@ -5257,9 +5258,9 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test Body httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), - v_headers + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers ))); tc_ac.start; alt { @@ -5284,6 +5285,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); f_stop_service_info(v_service_info); f_delete_service_info(v_subscription_id); f_cf_01_http_down(); @@ -5320,9 +5322,9 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test Body httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId & "_unknown", "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), // Unknown apiId - v_headers + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId & "_unknown", "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), // Unknown apiId + v_headers ))); tc_ac.start; alt { @@ -5378,9 +5380,9 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test Body httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/666", // Unknown serviceApiId - v_headers + m_http_request_get( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/666", // Unknown serviceApiId + v_headers ))); tc_ac.start; alt { @@ -5405,6 +5407,410 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02 + /** + * @desc Check that the IUT updates the publishing of a new API when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_service_api_description.supportedFeatures := { "WeatherInfo", "MoonPhasesInfo" } + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_service_api_description( + v_service_api_description + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_service_api_description( + v_service_api_description + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK + + /** + * @desc Check that the IUT updates the publishing of a new API when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_service_api_description.supportedFeatures := { "WeatherInfo", "MoonPhasesInfo" } + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId & "_unknown", "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_service_api_description( + v_service_api_description + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the HTTP error 404 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF + + /** + * @desc Check that the IUT changes the publishing of a new API when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_service_api_description.supportedFeatures := { "WeatherInfo", "MoonPhasesInfo" } + httpPort.send( + m_http_request( + m_http_request_patch( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_service_api_description_patch( + m_service_api_description_patch( + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + v_service_api_description.mecServiceInfoCapifExt.category.href, + v_service_api_description.mecServiceInfoCapifExt.category.id, + v_service_api_description.mecServiceInfoCapifExt.category.version & ".1" + )))))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_service_api_description_patch( + mw_service_api_description_patch( + mw_mec_service_info_capif_ext( + -, -, + mw_category_ref( + -, -, -, + v_service_api_description.mecServiceInfoCapifExt.category.version & ".1" + )))))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with to the service APIs ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_service_api_description.supportedFeatures := { "WeatherInfo", "MoonPhasesInfo" } + httpPort.send( + m_http_request( + m_http_request_patch( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId & "_unknown", "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_service_api_description_patch( + m_service_api_description_patch( + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + v_service_api_description.mecServiceInfoCapifExt.category.href, + v_service_api_description.mecServiceInfoCapifExt.category.id, + v_service_api_description.mecServiceInfoCapifExt.category.version & ".1" + )))))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the HTTP error 404 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF + + /** + * @desc Check that the IUT acknowledges the removing of a published API when queried by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_service_api_description.supportedFeatures := { "WeatherInfo", "MoonPhasesInfo" } + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with HTTP code 204 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceInfo v_service_info; + var charstring v_subscription_id; + var ServiceAPIDescription v_service_api_description; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_service_info(v_service_info, v_subscription_id); + f_start_service_info(v_service_info); + f_publish_api(v_service_info, v_service_api_description); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_service_api_description.supportedFeatures := { "WeatherInfo", "MoonPhasesInfo" } + httpPort.send( + m_http_request( + m_http_request_patch( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(v_service_info.serInstanceId & "_unknown", "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(v_service_api_description.apiId, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_service_api_description_patch( + m_service_api_description_patch( + m_mec_service_info_capif_ext( + -, -, + m_category_ref( + "catalogueHref", + v_service_api_description.mecServiceInfoCapifExt.category.href, + v_service_api_description.mecServiceInfoCapifExt.category.id, + v_service_api_description.mecServiceInfoCapifExt.category.version & ".1" + )))))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the HTTP error 404 ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_stop_service_info(v_service_info); + f_delete_service_info(v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF + } // End of group capif } // End of module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn index 1fa24bc..876a44f 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn @@ -105,13 +105,26 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestControl { execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF()); + } } diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn index 09cb97f..1ae071e 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn @@ -540,4 +540,35 @@ module EdgePlatformApplicationEnablementAPI_Functions { } // End of function f_publish_api + function f_delete_published_api( + in Json.String p_service_instance_id, + in Json.String p_service_app_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(p_service_instance_id, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(p_service_app_id, "UTF-8")), + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": Info: IUT successfully responds with the HTTP code 204 ***"); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + } + } // End of 'alt' statement + + } // End of function f_delete_published_api + } // End of module EdgePlatformApplicationEnablementAPI_Functions diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn index 932121b..653faf2 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn @@ -702,4 +702,136 @@ module EdgePlatformApplicationEnablementAPI_Templates { custOperations := p_custOperations } // End of template mw_version + template (omit) ServiceAPIDescriptionPatch m_service_api_description_patch( + in template (value) MecServiceInfoCapifExt p_mecServiceInfoCapifExt, + in template (omit) Json.String p_serviceAPICategory := omit, + in template (omit) ShareableInformation p_shareableInfo := omit, + in template (omit) Json.String p_ccfId := omit, + in template (omit) SupportedFeatures p_apiSuppFeats := omit, + in template (omit) PublishedApiPath p_pubApiPath := omit, + in template (omit) ApiStatus p_apiStatus := omit + ) := { + shareableInfo := p_shareableInfo, + serviceAPICategory := p_serviceAPICategory, + ccfId := p_ccfId, + apiSuppFeats := p_apiSuppFeats, + pubApiPath := p_pubApiPath, + apiStatus := p_apiStatus, + mecServiceInfoCapifExt := p_mecServiceInfoCapifExt + } // End of template m_service_api_description_patch + + template (present) ServiceAPIDescriptionPatch mw_service_api_description_patch( + template (present) MecServiceInfoCapifExt p_mecServiceInfoCapifExt := ?, + template Json.String p_serviceAPICategory := *, + template ShareableInformation p_shareableInfo := omit, + template Json.String p_ccfId := omit, + template SupportedFeatures p_apiSuppFeats := omit, + template PublishedApiPath p_pubApiPath := omit, + template ApiStatus p_apiStatus := omit + ) := { + shareableInfo := p_shareableInfo, + serviceAPICategory := p_serviceAPICategory, + ccfId := p_ccfId, + apiSuppFeats := p_apiSuppFeats, + pubApiPath := p_pubApiPath, + apiStatus := p_apiStatus, + mecServiceInfoCapifExt := p_mecServiceInfoCapifExt + } // End of template mw_service_api_description_patch + + template (omit) EventSubscription m_event_subscription( + in template (value) CAPIFEvents p_events, + in template (omit) CAPIFEventFilters p_eventFilters := omit, + in template (omit) ReportingInformation p_eventReq := omit, + in template (omit) Json.Bool p_requestTestNotification := omit, + in template (omit) WebsockNotifConfig p_websockNotifConfig := omit, + in template (omit) SupportedFeatures p_supportedFeatures := omit + ) := { + events := p_events, + eventFilters := p_eventFilters, + eventReq := p_eventReq, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + supportedFeatures := p_supportedFeatures + } // End of template m_event_subscription + + template (present) EventSubscription mw_event_subscription( + template (present) CAPIFEvents p_events := ?, + template CAPIFEventFilters p_eventFilters := *, + template ReportingInformation p_eventReq := *, + template Json.Bool p_requestTestNotification := *, + template WebsockNotifConfig p_websockNotifConfig := *, + template SupportedFeatures p_supportedFeatures := * + ) := { + events := p_events, + eventFilters := p_eventFilters, + eventReq := p_eventReq, + requestTestNotification := p_requestTestNotification, + websockNotifConfig := p_websockNotifConfig, + supportedFeatures := p_supportedFeatures + } // End of template mw_event_subscription + + template (omit) CAPIFEventFilter m_capif_event_filter( + in template (omit) record of Json.String p_apiIds := omit, + in template (omit) record of Json.String p_apiInvokerIds := omit, + in template (omit) record of Json.String p_aefIds := omit + ) := { + apiIds := p_apiIds, + apiInvokerIds := p_apiInvokerIds, + aefIds := p_aefIds + } // End of template m_capif_event_filter + + template CAPIFEventFilter mw_capif_event_filter( + template record of Json.String p_apiIds := *, + template record of Json.String p_apiInvokerIds := *, + template record of Json.String p_aefIds := * + ) := { + apiIds := p_apiIds, + apiInvokerIds := p_apiInvokerIds, + aefIds := p_aefIds + } // End of template mw_capif_event_filter + + template (omit) EventSubscriptionPatch m_event_subscription_patch( + in template (value) CAPIFEvents p_events, + in template (omit) CAPIFEventFilters p_eventFilters := omit, + in template (omit) ReportingInformation p_eventReq := omit, + in template (omit) Json.AnyURI p_notificationDestination := omit + ) := { + events := p_events, + eventFilters := p_eventFilters, + eventReq := p_eventReq, + notificationDestination := p_notificationDestination + } // End of template m_event_subscription_patch + + template (present) EventSubscriptionPatch mw_event_subscription_patch( + template (present) CAPIFEvents p_events := ?, + template CAPIFEventFilters p_eventFilters := *, + template ReportingInformation p_eventReq := *, + template Json.AnyURI p_notificationDestination := * + ) := { + events := p_events, + eventFilters := p_eventFilters, + eventReq := p_eventReq, + notificationDestination := p_notificationDestination + } // End of template mw_event_subscription_patch + + template (omit) EventNotification m_event_notification( + in template (value) Json.String p_subscriptionId, + in template (value) CAPIFEvent p_events, + in template (omit) CAPIFEventDetail p_eventDetail := omit + ) := { + subscriptionId := p_subscriptionId, + events := p_events, + eventDetail := p_eventDetail + } // End of template m_event_notification + + template (present) EventNotification mw_event_notification( + template (present) Json.String p_subscriptionId := ?, + template (present) CAPIFEvent p_events := ?, + template CAPIFEventDetail p_eventDetail := * + ) := { + subscriptionId := p_subscriptionId, + events := p_events, + eventDetail := p_eventDetail + } // End of template mw_event_notification + } // End of module EdgePlatformApplicationEnablementAPI_Templates diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index 2c0c69f..e980b54 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -1063,11 +1063,13 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member aefProfiles AEF profile information, which includes the exposed API details (e.g. protocol) * @member description Text description of the API * @member supportedFeatures The supported optional features of the CAPIF API + * @member shareableInfo * @member serviceAPICategory The service API category to which the service API belongs to * @member ccfId CCF identifier which can be contacted further for discovering the details of service API information * @member apiSuppFeats Provided by the consumer to indicate the features supported by the service API * @member pubApiPath It contains the published API path within the same CAPIF provider domain * @member apiProvName Represents the API provider name + * @member vendorSpecific-urn:etsi:mec:capifext:service-info * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.2-1: Definition of type ServiceAPIDescription */ type record ServiceAPIDescription { @@ -1153,6 +1155,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member aefLocation The location information (e.g. civic address, GPS coordinates, data center ID) where the AEF providing the service API is located * @member serviceKpis Contains information about the service characteristics provided by the service API * @member ueIpRange The list of public IP ranges of UEs + * @member vendorSpecific-urn:etsi:mec:capifext:transport-info * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.2.4-1: Definition of type AefProfile */ type record AefProfile { @@ -1204,6 +1207,246 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { type record of Version Versions; type record length (1 .. infinity) of Json.String Resources; + /** + * @desc This type represents the structured data types to be used in resource representations of the CAPIF_Publish_Service_API + * @member apiName API name, it is set as {apiName} part of the URI structure + * @member apiId API identifier assigned by the CCF to the published service API + * @member apiStatus Indicates the API status + * @member serviceAPICategory The service API category to which the service API belongs to + * @member ccfId CCF identifier which can be contacted further for discovering the details of service API information + * @member apiSuppFeats Provided by the consumer to indicate the features supported by the service API + * @member pubApiPath It contains the published API path within the same CAPIF provider domain + * @member apiProvName Represents the API provider name + * @member vendorSpecific-urn:etsi:mec:capifext:service-info + * @see ETSI GS MEC 011 V3.3.1 (2024-11) Table 9.1.2.2-1: Definition of type ServiceAPIDescriptionPatch + */ + type record ServiceAPIDescriptionPatch { + ShareableInformation shareableInfo optional, + Json.String serviceAPICategory optional, + Json.String ccfId optional, + SupportedFeatures apiSuppFeats optional, + PublishedApiPath pubApiPath optional, + ApiStatus apiStatus optional, + MecServiceInfoCapifExt mecServiceInfoCapifExt + } with { + variant (mecServiceInfoCapifExt) "name as 'vendorSpecific-urn:etsi:mec:capifext:service-info'"; + } + + /** + * @desc EventSubscription + * @member events Subscribed events + * @member eventFilters Subscribed event filters + * @member eventReq Represents the reporting requirements of the event subscription + * @member requestTestNotification Set to "true" by Subscriber to request the CAPIF core function to send a test notification + * @member websockNotifConfig Configuration parameters to set up notification delivery over Websocket protocol + * @member supportedFeatures Used to negotiate the supported optional features of the API + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.2-1: Definition of type EventSubscription + */ + type record EventSubscription { + CAPIFEvents events, + CAPIFEventFilters eventFilters optional, + ReportingInformation eventReq optional, + Json.Bool requestTestNotification optional, + WebsockNotifConfig websockNotifConfig optional, + SupportedFeatures supportedFeatures optional + } + + /** + * @desc CAPIFEvent + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.3.3-1: Enumeration CAPIFEvent + */ + type enumerated CAPIFEvent { + e_SERVICE_API_AVAILABLE (0), + e_SERVICE_API_UNAVAILABLE (1), + e_SERVICE_API_UPDATE (2), + e_API_INVOKER_ONBOARDED (3), + e_API_INVOKER_OFFBOARDED (4), + e_SERVICE_API_INVOCATION_SUCCESS (5), + e_SERVICE_API_INVOCATION_FAILURE (6), + e_ACCESS_CONTROL_POLICY_UPDATE (7), + e_ACCESS_CONTROL_POLICY_UNAVAILABLE (8), + e_API_INVOKER_AUTHORIZATION_REVOKED (9), + e_API_INVOKER_UPDATED (10), + e_API_TOPOLOGY_HIDING_CREATED (11), + e_API_TOPOLOGY_HIDING_REVOKED (12) + } with { + variant "JSON: as number" // TODO FSCOM Not sure sure it is encoded as a number. If not, remove e_ + } + type record of CAPIFEvent CAPIFEvents; + + /** + * @desc CAPIFEventFilter + * @member apiIds Applicability API identifiers that the event subscriber wants to know in the interested event + * @member apiInvokerIds SAPI invokers that the event subscriber wants to know in the interested event + * @member aefIds String identifying the AEF + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.4-1: Definition of type CAPIFEventFilter + */ + type record CAPIFEventFilter { + record of Json.String apiIds optional, + record of Json.String apiInvokerIds optional, + record of Json.String aefIds optional + } + type record of CAPIFEventFilter CAPIFEventFilters; + + /** + * @desc EventSubscriptionPatch + * @member events Subscribed events + * @member eventFilters Subscribed event filters + * @member eventReq Represents the reporting requirements of the event subscription + * @member notificationDestination URI where the notification should be delivered to + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.8-1: Definition of type EventSubscriptionPatch + */ + type record EventSubscriptionPatch { + CAPIFEvents events, + CAPIFEventFilters eventFilters optional, + ReportingInformation eventReq optional, + Json.AnyURI notificationDestination optional + } + + /** + * @desc EventNotification + * @member subscriptionId Identifier of the subscription resource to which the notification is related – CAPIF resource identifier + * @member events Notifications of individual events + * @member eventDetail Detailed information for the event + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.3-1: Definition of type EventNotification + */ + type record EventNotification { + Json.String subscriptionId, + CAPIFEvent events, + CAPIFEventDetail eventDetail optional + } + + /** + * @desc CAPIFEventDetail + * @member serviceAPIDescriptions Description of the service API as published by the APF + * @member apiIds API identifiers + * @member apiInvokerIds API invokers that are onboarded/offboarded + * @member accCtrlPolList Access control policy updated list + * @member invocationLogs Invocation logs + * @member apiTopoHide Topology hiding information for a service API + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.5-1: Definition of type CAPIFEventDetail + */ + type record CAPIFEventDetail { + ServiceAPIDescriptions serviceAPIDescriptions optional, + record of Json.String apiIds optional, + record of Json.String apiInvokerIds optional, + AccessControlPolicyListExt accCtrlPolList optional, + InvocationLogs invocationLogs, + TopologyHiding apiTopoHide optional + } + + /** + * @desc AccessControlPolicyListExt + * @member apiId Identifier of the service API + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.6-1: Definition of type AccessControlPolicyListExt + */ + type record AccessControlPolicyListExt { + Json.String apiId + } + + /** + * @desc TopologyHiding + * @member apiId Identifier of the service API + * @member routingRules Routing rules + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.2.7-1: Definition of type TopologyHiding + */ + type record TopologyHiding { + Json.String apiId, + RoutingRules routingRules + } + + /** + * @desc RoutingRule + * @member ipv4AddrRanges The IPv4 address range for the API invocation source IP address + * @member ipv6AddrRanges The IPv6 address range for the API invocation source IP address + * @member aefProfile The target AEF profile + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.10.4.2.3-1: Definition of type RoutingRule + */ + type record RoutingRule { + Ipv4AddrRange ipv4AddrRanges optional, + Ipv6AddrRange ipv6AddrRanges optional, + AefProfile aefProfile + } + type record of RoutingRule RoutingRules; + + /** + * @desc Ipv4AddrRange + * @member start First value identifying the start of an IPv4 address range + * @member end Last value identifying the end of an IPv4 address range + * @see ??? + */ + type record Ipv4AddrRange { + Ipv4Addr start_, + Ipv4Addr end_ + } with { + variant (start_) "name as 'start'"; + variant (end_) "name as 'end'"; + } + + /** + * @desc Ipv6AddrRange + * @member start First value identifying the start of an IPv6 address range + * @member end Last value identifying the end of an IPv6 address range + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.10.4.2.4-1: Definition of type Ipv6AddressRange + */ + type record Ipv6AddrRange { + Ipv6Addr start_, + Ipv6Addr end_ + } with { + variant (start_) "name as 'start'"; + variant (end_) "name as 'end'"; + } + + /** + * @desc WebsockNotifConfig + * @member websocketUri Set by the SCEF to indicate to the SCS/AS the Websocket URI to be used for delivering notifications + * @member requestWebsocketUri Set by the SCS/AS to indicate that the Websocket delivery is requested + * @see ETSI TS 129 122 V16.17.0 (2024-04 Table 5.2.1.2.10-1: Definition of the WebsockNotifConfig data type + */ + type record WebsockNotifConfig { + Link websocketUri optional, + Json.Bool requestWebsocketUri optional + } + + /** + * @desc InvocationLog + * @member aefId Identity information of the API exposing function requesting logging of service API invocations + * @member apiInvokerId Identity of the API invoker which invoked the service API + * @member logs Service API invocation log + * @member supportedFeatures Used to negotiate the supported optional features of the API + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.7.4.2.2-1: Definition of type InvocationLog + */ + type record InvocationLog { + Json.String aefId, + Json.String apiInvokerId, + Logs logs, + SupportedFeature supportedFeatures optional + } + type record of InvocationLog InvocationLogs; + + /** + * @desc Log + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.7.4.2.3-1: Definition of type Log + */ + type record Log { + Json.String apiId, + Json.String apiName, + Json.String apiVersion, + Json.String resourceName, + Json.AnyURI uri optional, + Protocol protocol, + Operation operation optional, + Json.String result, + DateTime invocationTime optional, + DurationMs invocationLatency optional, + Json.String inputParameters optional, // Defined as ANY TYPE + Json.String outputParameters optional, // Defined as ANY TYPE + InterfaceDescription srcInterface optional, + InterfaceDescription dstInterface optional, + Json.String fwdInterface optional + } + type record of Log Logs; + /** * @desc This type represents the Protocol used by the API * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.3.3-1: Enumeration Protocol @@ -1360,17 +1603,43 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { } + /** + * @desc ReportingInformation + * @member immRep Indication of immediate reporting + * @member notifMethod RepreRepresents the maximum number of reports, after which the subscription ceases to existsents the notification method (periodic, one time, on event detection) + * @member maxReportNbr Represents the maximum number of reports, after which the subscription ceases to exist + * @member DateTime Represents the time at which the subscription ceases to exist + * @member repPeriod Indicates the time interval between successive event notifications + * @member sampRatio Indicates the ratio of the random subset to target UEs, event reports only relates to the subset + * @member partitionCriteria Defines criteria for partitioning the UEs in order to apply the sampling ratio for each partition + * @member grpRepTime Indicates the time during which the event reports detected for the concerned UEs are aggregated in a group in order to be reported together to the NF service consumer + * @member notifFlag Indicates the notification flag, which is used to mute/unmute notifications and to retrieve events stored during a period of muted notifications + * @see ETSI TS 129 523 V17.9.0 (2025-07) Table 5.6.2.4-1: Definition of type ReportingInformation + */ + type record ReportingInformation { + Json.Bool immRep optional, + NotificationMethod notifMethod optional, + Json.UInteger maxReportNbr optional, + DateTime monDur optional, + DurationSec repPeriod optional, + SamplingRatio sampRatio optional, + PartitioningCriteria partitionCriteria optional, + DurationSec grpRepTime optional, + NotificationFlag notifFlag optional + } + /** * desc String with format "date-time" as defined in OpenAPI Specification - * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types */ type Json.String DateTime; /** * desc Unsigned integer identifying a period of time in units of seconds - * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types */ type Json.Number DurationSec; + type Json.Number DurationMs; type record Ipv4AddressRange { @@ -1384,16 +1653,54 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * desc String identifying a IPv4 address formatted in the "dotted decimal" notation - * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types */ type Json.String Ipv4Addr; /** * desc String identifying a IPv6 address formatted in the "dotted decimal" notation - * @see ETSI TS 129 571 V16.14.0 (2024-04) Table 5.2.2-1: Simple Data Types + * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types */ type Json.String Ipv6Addr; + /** + * desc Unsigned integer indicating Sampling Ratio + * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types + */ + type Json.Integer SamplingRatio; + + /** + * desc Used to partition UEs before applying sampling + * @see ETSI TS 129 571 V18.10.0 (2025-07) 5.5.3.13 Enumeration: PartitioningCriteria + */ + type enumerated PartitioningCriteria { + TAC, + SUBPLMN, + GEOAREA, + SNSSAI, + DNN + } + + /** + * @desc NotificationMethod + * @see ETSI TS 129 508 V17.16.0 (2025-06) 5.4.3.37 Enumeration: NotificationFlag + */ + type enumerated NotificationFlag { + ACTIVATE, + DEACTIVATE, + RETRIEVAL + } + + /** + * @desc NotificationMethod + * @see ETSI TS 129 508 V17.16.0 (2025-06) 5.6.3.4 Enumeration: NotificationMethod + */ + type enumerated NotificationMethod { + PERIODIC, + ONE_TIME, + ON_EVENT_DETECTION + } + } with { encode "JSON" } // End of module EdgePlatformApplicationEnablementAPI_TypesAndValues diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index b3468a8..449123c 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -146,6 +146,7 @@ module LibHttp_JsonMessageBodyTypes { CurrentTime currentTime, DiscoveredAPIs discovered_apis, ServiceAPIDescription service_api_description, + ServiceAPIDescriptionPatch service_api_description_patch, DeviceApplicationInterfaceAPI_TypesAndValues.ApplicationList applicationList, DeviceApplicationInterfaceAPI_TypesAndValues.AppContext appContext_device_info, ApplicationLocationAvailability applicationLocationAvailability, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 461521d..1baf2a7 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1217,6 +1217,18 @@ module LibHttp_JsonTemplates { service_api_description := p_service_api_description } // End of template mw_body_json_service_api_description + template (value) JsonBody m_body_json_service_api_description_patch( + in template (value) ServiceAPIDescriptionPatch p_service_api_description_patch + ) := { + service_api_description_patch := p_service_api_description_patch + } // End of template m_body_json_service_api_description_patch + + template (present) JsonBody mw_body_json_service_api_description_patch( + template (present) ServiceAPIDescriptionPatch p_service_api_description_patch := ? + ) := { + service_api_description_patch := p_service_api_description_patch + } // End of template mw_body_json_service_api_description_patch + } // End of group app_enablement_api group ue_app_ctx { -- GitLab From 3cc3e7fa27669a23d59b6dbd3d0a36163deac8e5 Mon Sep 17 00:00:00 2001 From: garciay Date: Fri, 1 Aug 2025 15:45:26 +0200 Subject: [PATCH 50/54] Bug fixed in EdgePlatformApplicationEnablementAPI_Templates --- ...gePlatformApplicationEnablementAPI_Templates.ttcn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn index 653faf2..09c1288 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn @@ -771,9 +771,9 @@ module EdgePlatformApplicationEnablementAPI_Templates { } // End of template mw_event_subscription template (omit) CAPIFEventFilter m_capif_event_filter( - in template (omit) record of Json.String p_apiIds := omit, - in template (omit) record of Json.String p_apiInvokerIds := omit, - in template (omit) record of Json.String p_aefIds := omit + in template (omit) CAPIFEventFilter.apiIds p_apiIds := omit, + in template (omit) CAPIFEventFilter.apiInvokerIds p_apiInvokerIds := omit, + in template (omit) CAPIFEventFilter.aefIds p_aefIds := omit ) := { apiIds := p_apiIds, apiInvokerIds := p_apiInvokerIds, @@ -781,9 +781,9 @@ module EdgePlatformApplicationEnablementAPI_Templates { } // End of template m_capif_event_filter template CAPIFEventFilter mw_capif_event_filter( - template record of Json.String p_apiIds := *, - template record of Json.String p_apiInvokerIds := *, - template record of Json.String p_aefIds := * + template CAPIFEventFilter.apiIds p_apiIds := *, + template CAPIFEventFilter.apiInvokerIds p_apiInvokerIds := *, + template CAPIFEventFilter.aefIds p_aefIds := * ) := { apiIds := p_apiIds, apiInvokerIds := p_apiInvokerIds, -- GitLab From dabe77e28f4460189e0967978bac72b0a0e33148 Mon Sep 17 00:00:00 2001 From: garciay Date: Tue, 5 Aug 2025 15:54:48 +0200 Subject: [PATCH 51/54] Finalyse validation of CAPIF --- ccsrc/Protocols/Json/json_codec_mec011.cc | 25 + ...PlatformApplicationEnablement_Sandbox.cfg_ | 22 +- ...ormApplicationEnablementAPI_TestCases.ttcn | 578 ++++++++++++++++-- ...mApplicationEnablementAPI_TestControl.ttcn | 11 + ...ormApplicationEnablementAPI_Functions.ttcn | 85 +++ ...atformApplicationEnablementAPI_Pixits.ttcn | 2 + ...ormApplicationEnablementAPI_Templates.ttcn | 4 + ...plicationEnablementAPI_TypesAndValues.ttcn | 69 +-- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 2 + .../ttcn/LibHttp_JsonMessageBodyTypes.ttcn | 3 + .../ttcn/LibHttp_JsonTemplates.ttcn | 36 ++ 11 files changed, 758 insertions(+), 79 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec011.cc b/ccsrc/Protocols/Json/json_codec_mec011.cc index d2f834c..55f6216 100644 --- a/ccsrc/Protocols/Json/json_codec_mec011.cc +++ b/ccsrc/Protocols/Json/json_codec_mec011.cc @@ -60,6 +60,18 @@ int json_codec_mec011::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch& service_api_description_patch = msg.service__api__description__patch(); service_api_description_patch.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_capif__event__subscription)) { + const EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscription& capif_event_subscription = msg.capif__event__subscription(); + capif_event_subscription.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_capif__event__subscription__patch)) { + const EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscriptionPatch& capif_event_subscription_patch = msg.capif__event__subscription__patch(); + capif_event_subscription_patch.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscriptionPatch_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_capif__event__notification)) { + const EdgePlatformApplicationEnablementAPI__TypesAndValues::EventNotification& capif_event_notification = msg.capif__event__notification(); + capif_event_notification.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::EventNotification_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { return json_codec::encode(msg, data); } @@ -205,6 +217,19 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch service_api_description_patch; service_api_description_patch.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.service__api__description__patch() = service_api_description_patch; + } else if (it->second.find("\"notificationDestination\"") != std::string::npos) { + EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscription capif_event_subscription; + capif_event_subscription.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.capif__event__subscription() = capif_event_subscription; + } else if (it->second.find("\"events\"") != std::string::npos) { // FIXME FSCOM The data structures EventSubscription & EventSubscriptionPatch are simular + // There is a high potentail bug here + EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscriptionPatch capif_event_subscription_patch; + capif_event_subscription_patch.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::EventSubscriptionPatch_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.capif__event__subscription__patch() = capif_event_subscription_patch; + } else if (it->second.find("\"subscriptionId\"") != std::string::npos) { + EdgePlatformApplicationEnablementAPI__TypesAndValues::EventNotification capif_event_notification; + capif_event_notification.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::EventNotification_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.capif__event__notification() = capif_event_notification; } else { return json_codec::decode(p_data, msg, p_params); } diff --git a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ index 4da47c4..697fc9a 100644 --- a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ +++ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ @@ -19,12 +19,13 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i LibMec_Pics.PICS_MEC_PLAT := true # Application Instance ID -EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "52bd535e-7a3e-4fef-8678-b2c832c9be95" # Copied from ETSI MEC Sandbox GUI +EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" # Copied from ETSI MEC Sandbox GUI # MEC APIs EdgePlatformApplicationEnablementAPI_Pixits.PX_API_NAME := "mec015-1" # Pickup from MEC Sandbox logs console EdgePlatformApplicationEnablementAPI_Pixits.PX_API_ID := "a6612a80-85f2-41e0-8565-4bf477483fb7" # Callbacks +EdgePlatformApplicationEnablementAPI_Pixits.PX_CAPIF_NOTIF_CALLBACK_URI := "https://yanngarcia.ddns.net:36001/capif-events/v1" [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -199,7 +200,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1 # Check that the IUT responds with all service APIs when queried by a MEC Application - No filter #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_01 # Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiName -AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02 +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_02 # Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_03 # Check that the IUT responds with all service APIs when queried by a MEC Application - Filter on apiId and apiName @@ -234,7 +235,22 @@ AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROF #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF - +# Check that the IUT acknowledges the creation of a CAPIF subscription request when requested by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_NF +# Check that the IUT acknowledges the update of a CAPIF subscription request when requested by a MEC Application +AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_OK +# Check that the IUT acknowledges the update of a CAPIF subscription request when requested by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_NF +# Check that the IUT acknowledges the changes of a CAPIF subscription request when requested by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_NF +# Check that the IUT acknowledges the cancellation of a CAPIF subscription when requested by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_OK +# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_NF [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 6128b05..6519a00 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -4796,7 +4796,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { @@ -4811,7 +4811,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( @@ -4849,7 +4849,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05 @@ -5066,7 +5066,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { @@ -5081,7 +5081,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -5142,7 +5142,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_delete_published_api(v_service_info.serInstanceId, v_service_info.serInstanceId); f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK @@ -5153,7 +5153,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { @@ -5168,7 +5168,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( @@ -5223,7 +5223,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR @@ -5234,7 +5234,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5250,7 +5250,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5287,7 +5287,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK @@ -5298,7 +5298,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5314,7 +5314,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5345,7 +5345,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01 @@ -5356,7 +5356,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5372,7 +5372,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5403,7 +5403,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02 @@ -5414,7 +5414,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5430,7 +5430,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5469,7 +5469,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK @@ -5480,7 +5480,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5496,7 +5496,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5531,7 +5531,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF @@ -5542,7 +5542,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5558,7 +5558,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5609,7 +5609,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK @@ -5620,7 +5620,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5636,7 +5636,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5678,7 +5678,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Postamble f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF @@ -5689,7 +5689,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5705,7 +5705,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5736,9 +5736,8 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble - f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK @@ -5749,7 +5748,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Local variables var Headers v_headers; var ServiceInfo v_service_info; - var charstring v_subscription_id; + var charstring v_service_info_id; var ServiceAPIDescription v_service_api_description; // Test control @@ -5765,7 +5764,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_service_info(v_service_info, v_subscription_id); + f_create_service_info(v_service_info, v_service_info_id); f_start_service_info(v_service_info); f_publish_api(v_service_info, v_service_api_description); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -5806,11 +5805,516 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { } // End of 'alt' statement // Postamble + f_delete_published_api(v_service_info.serInstanceId, v_service_api_description.apiId); f_stop_service_info(v_service_info); - f_delete_service_info(v_subscription_id); + f_delete_service_info(v_service_info_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF + /** + * @desc Check that the IUT acknowledges the creation of a CAPIF subscription request when requested by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var HttpMessage v_response; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions", + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription( + m_event_subscription( + { + SERVICE_API_AVAILABLE, + SERVICE_API_UPDATE + }, + PX_CAPIF_NOTIF_CALLBACK_URI + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_capif_event_subscription( + mw_event_subscription( + { + SERVICE_API_AVAILABLE, + SERVICE_API_UPDATE + }, + PX_CAPIF_NOTIF_CALLBACK_URI + )))))) -> value v_response { + tc_ac.stop; + + // Check HTTP Location header + if (f_check_headers(v_response.response.header) == false) { + log("*** " & testcasename() & ": FAIL: IUT failed in creating service ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } else { + var charstring_list v_header_location; + f_get_header(v_response.response.header, "Location", v_header_location); + v_subscription_id := regexp( + v_header_location[0], + "?+" & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions" & "/(?*)", + 0 + ); + + // TODO how to test this as the notification is for another MEC Application? + log("*** " & testcasename() & ": PASS: IUT successfully responds with a EventSubscritpion and set notification, v_subscription_id=", v_subscription_id, " ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(-, v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions", + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription( + m_event_subscription( + { + SERVICE_API_AVAILABLE, + SERVICE_API_UPDATE + }, + PX_CAPIF_NOTIF_CALLBACK_URI + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_NF + + /** + * @desc Check that the IUT acknowledges the update of a CAPIF subscription request when requested by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_subscription(-, v_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_event_subscription.events := { SERVICE_API_AVAILABLE, SERVICE_API_UPDATE, API_INVOKER_UPDATED }; + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription( + v_event_subscription + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_capif_event_subscription( + v_event_subscription + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated EventSubscritpion ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(-, v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_OK + + /** + * @desc Check that the IUT acknowledges the update of a CAPIF subscription request when requested by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_subscription(-, v_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_event_subscription.events := { SERVICE_API_AVAILABLE, SERVICE_API_UPDATE, API_INVOKER_UPDATED }; + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions/" & v_subscription_id & "_unknown", + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription( + v_event_subscription + ))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated EventSubscritpion ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(-, v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_NF + + /** + * @desc Check that the IUT acknowledges the changes of a CAPIF subscription request when requested by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var ServiceAPIDescription v_service_api_description; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_subscription(-, v_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_event_subscription.events := { SERVICE_API_AVAILABLE, SERVICE_API_UPDATE, API_INVOKER_UPDATED }; + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_patch( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions/" & v_subscription_id, + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription_patch( + m_event_subscription_patch( + v_event_subscription.events, + -, -, + v_event_subscription.notificationDestination + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_capif_event_subscription( + v_event_subscription + + ))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a patched EventSubscritpion ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(-, v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_subscription(-, v_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + v_event_subscription.events := { SERVICE_API_AVAILABLE, SERVICE_API_UPDATE, API_INVOKER_UPDATED }; + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_patch( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions/" & v_subscription_id & "_unknown", + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription_patch( + m_event_subscription_patch( + v_event_subscription.events, + -, -, + v_event_subscription.notificationDestination + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a patched EventSubscritpion ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(-, v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_NF + + /** + * @desc Check that the IUT acknowledges the cancellation of a CAPIF subscription when requested by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_subscription(-, v_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions/" & v_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the 204 HTTP code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_OK + + /** + * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + */ + testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var Headers v_headers; + var EventSubscription v_event_subscription; + var charstring v_subscription_id; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_create_subscription(-, v_event_subscription, v_subscription_id); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions/" & v_subscription_id & "_unknown", + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found + )) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_delete_subscription(-, v_subscription_id); + f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_NF + } // End of group capif } // End of module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn index 876a44f..5777ec8 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestControl.ttcn @@ -125,6 +125,17 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestControl { execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK()); execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_NF()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_NF()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_010_NF()); + + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_OK()); + execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_011_NF()); } } diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn index 1ae071e..9a17c9f 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Functions.ttcn @@ -571,4 +571,89 @@ module EdgePlatformApplicationEnablementAPI_Functions { } // End of function f_delete_published_api + function f_create_subscription( + in Json.String p_app_instance_id := PX_APP_INSTANCE_ID, + out EventSubscription p_event_subscription, + out charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + var HttpMessage v_response; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(p_app_instance_id, "UTF-8")) & "/subscriptions", + v_headers, + m_http_message_body_json( + m_body_json_capif_event_subscription( + m_event_subscription( + { + SERVICE_API_AVAILABLE, + SERVICE_API_UPDATE + }, + PX_CAPIF_NOTIF_CALLBACK_URI + )))))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_capif_event_subscription( + mw_event_subscription( + { + SERVICE_API_AVAILABLE, + SERVICE_API_UPDATE + }, + PX_CAPIF_NOTIF_CALLBACK_URI + )))))) -> value v_response { + tc_ac.stop; + + // Extract HTTP Location header + var charstring_list v_subscription_id; + f_get_header(v_response.response.header, "Location", v_subscription_id); + // Extract HTTP subssription id + p_subscription_id := regexp( + v_subscription_id[0], + "?+" & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(p_app_instance_id, "UTF-8")) & "/subscriptions" & "/(?*)", + 0 + ); + p_event_subscription := v_response.response.body.json_body.capif_event_subscription; + log("f_create_subscrition: INFO: IUT successfully responds to the subscrition creation: p_event_subscription=", p_event_subscription); + log("f_create_subscrition: INFO: IUT successfully responds to the subscrition creation: p_subscription_id=", p_subscription_id); + } + [] tc_ac.timeout { + log("f_create_subscrition: INCONC: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_create_subscription + + function f_delete_subscription( + in Json.String p_app_instance_id := PX_APP_INSTANCE_ID, + in charstring p_subscription_id + ) runs on HttpComponent { + var Headers v_headers; + + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + PICS_ROOT_API & PX_ME_CAPIF_SUBSCRIBE_URI & "/" & oct2char(unichar2oct(p_app_instance_id, "UTF-8")) & "/subscriptions/" & p_subscription_id, + v_headers + ))); + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content + )) { + tc_ac.stop; + } + [] tc_ac.timeout { + log("f_delete_subscription: INCONC: Expected message not received"); + } + } // End of 'alt' statement + } // End of function f_delete_subscription + } // End of module EdgePlatformApplicationEnablementAPI_Functions diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn index d89a91a..dac6566 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Pixits.ttcn @@ -74,4 +74,6 @@ module EdgePlatformApplicationEnablementAPI_Pixits { modulepar Json.String PX_API_ID := "46ce37bd-b526-4781-a298-f43594aa6f40"; + modulepar Json.AnyURI PX_CAPIF_NOTIF_CALLBACK_URI := "http://www.etsi.org"; + } // End of module EdgePlatformApplicationEnablementAPI_Pixits diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn index 09c1288..24d363c 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn @@ -740,6 +740,7 @@ module EdgePlatformApplicationEnablementAPI_Templates { template (omit) EventSubscription m_event_subscription( in template (value) CAPIFEvents p_events, + in template (value) Json.AnyURI p_notificationDestination, in template (omit) CAPIFEventFilters p_eventFilters := omit, in template (omit) ReportingInformation p_eventReq := omit, in template (omit) Json.Bool p_requestTestNotification := omit, @@ -749,6 +750,7 @@ module EdgePlatformApplicationEnablementAPI_Templates { events := p_events, eventFilters := p_eventFilters, eventReq := p_eventReq, + notificationDestination := p_notificationDestination, requestTestNotification := p_requestTestNotification, websockNotifConfig := p_websockNotifConfig, supportedFeatures := p_supportedFeatures @@ -756,6 +758,7 @@ module EdgePlatformApplicationEnablementAPI_Templates { template (present) EventSubscription mw_event_subscription( template (present) CAPIFEvents p_events := ?, + template (present) Json.AnyURI p_notificationDestination := ?, template CAPIFEventFilters p_eventFilters := *, template ReportingInformation p_eventReq := *, template Json.Bool p_requestTestNotification := *, @@ -765,6 +768,7 @@ module EdgePlatformApplicationEnablementAPI_Templates { events := p_events, eventFilters := p_eventFilters, eventReq := p_eventReq, + notificationDestination := p_notificationDestination, requestTestNotification := p_requestTestNotification, websockNotifConfig := p_websockNotifConfig, supportedFeatures := p_supportedFeatures diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index e980b54..3243ae4 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -1093,7 +1093,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc MecServiceInfoCapifExt - * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 9.1.5.1-1: Attributes of the MecServiceInfoCapifExt data type + * @see ETSI GS MEC 011 V3.3.1 (2024-11) Table 9.1.5.1-1: Attributes of the MecServiceInfoCapifExt data type */ type record MecServiceInfoCapifExt { SerializerType serializer, @@ -1106,7 +1106,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { /** * @desc MecTransportInfoCapifExt - * @see ETSI TS 129 222 V18.6.0 (2024-07) Table 9.1.5.2-1: Attributes of the MecTransportInfoCapifExt + * @see ETSI GS MEC 011 V3.3.1 (2024-11) Table 9.1.5.2-1: Attributes of the MecTransportInfoCapifExt */ type record MecTransportInfoCapifExt { Json.String name, @@ -1237,6 +1237,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member events Subscribed events * @member eventFilters Subscribed event filters * @member eventReq Represents the reporting requirements of the event subscription + * @member notificationDestination URI where the notification should be delivered to * @member requestTestNotification Set to "true" by Subscriber to request the CAPIF core function to send a test notification * @member websockNotifConfig Configuration parameters to set up notification delivery over Websocket protocol * @member supportedFeatures Used to negotiate the supported optional features of the API @@ -1246,6 +1247,7 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { CAPIFEvents events, CAPIFEventFilters eventFilters optional, ReportingInformation eventReq optional, + Json.AnyURI notificationDestination, Json.Bool requestTestNotification optional, WebsockNotifConfig websockNotifConfig optional, SupportedFeatures supportedFeatures optional @@ -1256,21 +1258,19 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.3.4.3.3-1: Enumeration CAPIFEvent */ type enumerated CAPIFEvent { - e_SERVICE_API_AVAILABLE (0), - e_SERVICE_API_UNAVAILABLE (1), - e_SERVICE_API_UPDATE (2), - e_API_INVOKER_ONBOARDED (3), - e_API_INVOKER_OFFBOARDED (4), - e_SERVICE_API_INVOCATION_SUCCESS (5), - e_SERVICE_API_INVOCATION_FAILURE (6), - e_ACCESS_CONTROL_POLICY_UPDATE (7), - e_ACCESS_CONTROL_POLICY_UNAVAILABLE (8), - e_API_INVOKER_AUTHORIZATION_REVOKED (9), - e_API_INVOKER_UPDATED (10), - e_API_TOPOLOGY_HIDING_CREATED (11), - e_API_TOPOLOGY_HIDING_REVOKED (12) - } with { - variant "JSON: as number" // TODO FSCOM Not sure sure it is encoded as a number. If not, remove e_ + SERVICE_API_AVAILABLE, + SERVICE_API_UNAVAILABLE, + SERVICE_API_UPDATE, + API_INVOKER_ONBOARDED, + API_INVOKER_OFFBOARDED, + SERVICE_API_INVOCATION_SUCCESS, + SERVICE_API_INVOCATION_FAILURE, + ACCESS_CONTROL_POLICY_UPDATE, + ACCESS_CONTROL_POLICY_UNAVAILABLE, + API_INVOKER_AUTHORIZATION_REVOKED, + API_INVOKER_UPDATED, + API_TOPOLOGY_HIDING_CREATED, + API_TOPOLOGY_HIDING_REVOKED } type record of CAPIFEvent CAPIFEvents; @@ -1363,39 +1363,42 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.10.4.2.3-1: Definition of type RoutingRule */ type record RoutingRule { - Ipv4AddrRange ipv4AddrRanges optional, - Ipv6AddrRange ipv6AddrRanges optional, + Ipv4AddressRange ipv4AddrRanges optional, + Ipv6AddressRange ipv6AddrRanges optional, AefProfile aefProfile } type record of RoutingRule RoutingRules; /** - * @desc Ipv4AddrRange + * @desc Ipv4AddressRange * @member start First value identifying the start of an IPv4 address range * @member end Last value identifying the end of an IPv4 address range - * @see ??? + * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.10.4.2.4-1: Definition of type Ipv4AddressRange */ - type record Ipv4AddrRange { + type record Ipv4AddressRange { Ipv4Addr start_, Ipv4Addr end_ } with { variant (start_) "name as 'start'"; variant (end_) "name as 'end'"; } + type record of Ipv4AddressRange Ipv4AddressRanges; /** - * @desc Ipv6AddrRange + * @desc Ipv6AddressRange * @member start First value identifying the start of an IPv6 address range * @member end Last value identifying the end of an IPv6 address range * @see ETSI TS 129 222 V18.7.0 (2025-01) Table 8.10.4.2.4-1: Definition of type Ipv6AddressRange */ - type record Ipv6AddrRange { + type record Ipv6AddressRange { Ipv6Addr start_, Ipv6Addr end_ } with { variant (start_) "name as 'start'"; variant (end_) "name as 'end'"; } + type record of Ipv6AddressRange Ipv6AddressRanges; + /** * @desc WebsockNotifConfig @@ -1588,11 +1591,6 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { } type record length (1 .. infinity) of Operation Operations; - // FIXME See ETSI TS 129 222 V18.6.0 (2024-07) Table 8.2.4.1-2: Re-used Data Types - type record Fqdn { - - } - type Json.UInteger Port; type record CivicAddress { @@ -1641,16 +1639,6 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { type Json.Number DurationSec; type Json.Number DurationMs; - type record Ipv4AddressRange { - - } - type record length (1 .. infinity) of Ipv4AddressRange Ipv4AddressRanges; - - type record Ipv6AddressRange { - - } - type record length (1 .. infinity) of Ipv6AddressRange Ipv6AddressRanges; - /** * desc String identifying a IPv4 address formatted in the "dotted decimal" notation * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types @@ -1663,6 +1651,9 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { */ type Json.String Ipv6Addr; + // FIXME See ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types + type Json.String Fqdn; + /** * desc Unsigned integer indicating Sampling Ratio * @see ETSI TS 129 571 V18.10.0 (2025-07) Table 5.2.2-1: Simple Data Types diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index ec8b2ab..12f3568 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -92,6 +92,8 @@ module LibMec_Pixits { // FIXME FSCOM Split this file according to the different modulepar charstring PX_ME_CAPIF_PUBLISH_API_URI := "published-apis/v1"; + modulepar charstring PX_ME_CAPIF_SUBSCRIBE_URI := "capif-events/v1"; + modulepar charstring PX_MEC_SVC_MGMT_SVC_URI := "mec_service_mgmt/v1/services"; modulepar charstring PX_ME_APP_SUPPORT_TIMING_CAPS_URI := "mec_app_support/v2/timing/timing_caps"; diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn index 449123c..d7a8e6d 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonMessageBodyTypes.ttcn @@ -147,6 +147,9 @@ module LibHttp_JsonMessageBodyTypes { DiscoveredAPIs discovered_apis, ServiceAPIDescription service_api_description, ServiceAPIDescriptionPatch service_api_description_patch, + EventSubscription capif_event_subscription, + EventSubscriptionPatch capif_event_subscription_patch, + EventNotification capif_event_notification, DeviceApplicationInterfaceAPI_TypesAndValues.ApplicationList applicationList, DeviceApplicationInterfaceAPI_TypesAndValues.AppContext appContext_device_info, ApplicationLocationAvailability applicationLocationAvailability, diff --git a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn index 1baf2a7..9b31570 100644 --- a/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/ttcn/LibHttp_JsonTemplates.ttcn @@ -1229,6 +1229,42 @@ module LibHttp_JsonTemplates { service_api_description_patch := p_service_api_description_patch } // End of template mw_body_json_service_api_description_patch + template (value) JsonBody m_body_json_capif_event_subscription( + in template (value) EventSubscription p_capif_event_subscription + ) := { + capif_event_subscription := p_capif_event_subscription + } // End of template m_body_json_capif_event_subscription + + template (present) JsonBody mw_body_json_capif_event_subscription( + template (present) EventSubscription p_capif_event_subscription := ? + ) := { + capif_event_subscription := p_capif_event_subscription + } // End of template mw_body_json_capif_event_subscription + + template (value) JsonBody m_body_json_capif_event_subscription_patch( + in template (value) EventSubscriptionPatch p_capif_event_subscription_patch + ) := { + capif_event_subscription_patch := p_capif_event_subscription_patch + } // End of template m_body_json_capif_event_subscription_patch + + template (present) JsonBody mw_body_json_capif_event_subscription_patch( + template (present) EventSubscriptionPatch p_capif_event_subscription_patch := ? + ) := { + capif_event_subscription_patch := p_capif_event_subscription_patch + } // End of template mw_body_json_capif_event_subscription_patch + + template (value) JsonBody m_body_json_capif_event_notification( + in template (value) EventNotification p_capif_event_notification + ) := { + capif_event_notification := p_capif_event_notification + } // End of template m_body_json_capif_event_notification + + template (present) JsonBody mw_body_json_capif_event_notification( + template (present) EventNotification p_capif_event_notification := ? + ) := { + capif_event_notification := p_capif_event_notification + } // End of template mw_body_json_capif_event_notification + } // End of group app_enablement_api group ue_app_ctx { -- GitLab From e803bdc5ac3ad6ca9fa7c9e3b929d6a7af113d51 Mon Sep 17 00:00:00 2001 From: garciay Date: Wed, 6 Aug 2025 11:16:47 +0200 Subject: [PATCH 52/54] Bug fixed in AtsMec_EdgePlatformApplicationEnablement typing & codec --- ccsrc/Protocols/Json/json_codec_mec011.cc | 11 ++-- ...PlatformApplicationEnablement_Sandbox.cfg_ | 4 +- ...ormApplicationEnablementAPI_TestCases.ttcn | 8 ++- ...ormApplicationEnablementAPI_Templates.ttcn | 16 ++++++ ...plicationEnablementAPI_TypesAndValues.ttcn | 53 +++++++++++++++---- 5 files changed, 72 insertions(+), 20 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec011.cc b/ccsrc/Protocols/Json/json_codec_mec011.cc index 55f6216..4ad08f7 100644 --- a/ccsrc/Protocols/Json/json_codec_mec011.cc +++ b/ccsrc/Protocols/Json/json_codec_mec011.cc @@ -140,8 +140,11 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo service_info.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.serviceInfo() = service_info; } - } else if (it->second.find("\"security\"") != std::string::npos) { // Be careful to the order - // TODO To be refined, find("\"accessPointList\"") is not optimal + } else if (it->second.find("\"serviceAPIDescriptions\"") != std::string::npos) { + EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs discovered_apis; + discovered_apis.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.discovered__apis() = discovered_apis; + } else if ((it->second.find("\"id\"") != std::string::npos) && (it->second.find("\"security\"") != std::string::npos)) { std::size_t it_start; while ((it_start = str.find("null")) != std::string::npos) { loggers::get_instance().log("json_codec_mec011::decode: id_start=%d", it_start); @@ -205,10 +208,6 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo; appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.appInfo__regapps() = appInfo; - } else if (it->second.find("\"serviceAPIDescriptions\"") != std::string::npos) { - EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs discovered_apis; - discovered_apis.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DiscoveredAPIs_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.discovered__apis() = discovered_apis; } else if (it->second.find("\"apiName\"") != std::string::npos) { EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription service_api_description; service_api_description.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); diff --git a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ index 697fc9a..3dc67ed 100644 --- a/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ +++ b/etc/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablement_Sandbox.cfg_ @@ -22,7 +22,7 @@ LibMec_Pics.PICS_MEC_PLAT := true EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "81c51643-8c6f-4781-ad45-f8a457ca549b" # Copied from ETSI MEC Sandbox GUI # MEC APIs EdgePlatformApplicationEnablementAPI_Pixits.PX_API_NAME := "mec015-1" # Pickup from MEC Sandbox logs console -EdgePlatformApplicationEnablementAPI_Pixits.PX_API_ID := "a6612a80-85f2-41e0-8565-4bf477483fb7" +EdgePlatformApplicationEnablementAPI_Pixits.PX_API_ID := "f671a33e-9bc6-42a7-8afb-6f7edec7c357" # Callbacks EdgePlatformApplicationEnablementAPI_Pixits.PX_CAPIF_NOTIF_CALLBACK_URI := "https://yanngarcia.ddns.net:36001/capif-events/v1" @@ -240,7 +240,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1 # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_008_NF # Check that the IUT acknowledges the update of a CAPIF subscription request when requested by a MEC Application -AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_OK +#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_OK # Check that the IUT acknowledges the update of a CAPIF subscription request when requested by a MEC Application #AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_009_NF # Check that the IUT acknowledges the changes of a CAPIF subscription request when requested by a MEC Application diff --git a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn index 6519a00..fc96039 100644 --- a/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_EdgePlatformApplicationEnablement/AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.ttcn @@ -2596,7 +2596,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { PX_APP_NAME, -, -, -, -, // appInstanceId shall be provided as isInsByMec is set to true - -, -, -, -, -, + -, -, -, -, -, -, -, -, -, true )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -2656,7 +2656,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { -, -, PX_APP_D_ID, PX_APP_INSTANCE_ID, - -, -, -, -, -, + -, -, -, -, -,-, -, -, -, false )))))); @@ -5983,6 +5983,10 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases { // Test Body v_event_subscription.events := { SERVICE_API_AVAILABLE, SERVICE_API_UPDATE, API_INVOKER_UPDATED }; + v_event_subscription.eventFilters := valueof( + { + m_capif_event_filter(-, -, { PX_APP_INSTANCE_ID }) + }); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn index 24d363c..f432ca2 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_Templates.ttcn @@ -231,6 +231,10 @@ module EdgePlatformApplicationEnablementAPI_Templates { in template (omit) ServiceDependencies p_appServiceOptional := omit, in template (omit) FeatureDependencies p_appFeatureRequired := omit, in template (omit) FeatureDependencies p_appFeatureOptional := omit, + in template (omit) ScheduledCommunicationTimes p_scheds := omit, + in template (omit) ServiceArea p_svcArea := omit, + in template (omit) EASServiceKPI p_svcKpi := omit, + in template (omit) AppInfo.permLvl p_permLvl := omit, in template (omit) Json.Bool p_isInsByMec := omit, in template (omit) AppProfile p_appProfile := omit ) := { @@ -244,6 +248,10 @@ module EdgePlatformApplicationEnablementAPI_Templates { appServiceOptional := p_appServiceOptional, appFeatureRequired := p_appFeatureRequired, appFeatureOptional := p_appFeatureOptional, + scheds := p_scheds, + svcArea := p_svcArea, + svcKpi := p_svcKpi, + permLvl := p_permLvl, isInsByMec := p_isInsByMec, appProfile := p_appProfile } // End of template m_app_info @@ -259,6 +267,10 @@ module EdgePlatformApplicationEnablementAPI_Templates { template ServiceDependencies p_appServiceOptional := *, template FeatureDependencies p_appFeatureRequired := *, template FeatureDependencies p_appFeatureOptional := *, + template ScheduledCommunicationTimes p_scheds := *, + template ServiceArea p_svcArea := *, + template EASServiceKPI p_svcKpi := *, + template AppInfo.permLvl p_permLvl := *, template Json.Bool p_isInsByMec := *, template AppProfile p_appProfile := * ) := { @@ -272,6 +284,10 @@ module EdgePlatformApplicationEnablementAPI_Templates { appServiceOptional := p_appServiceOptional, appFeatureRequired := p_appFeatureRequired, appFeatureOptional := p_appFeatureOptional, + scheds := p_scheds, + svcArea := p_svcArea, + svcKpi := p_svcKpi, + permLvl := p_permLvl, isInsByMec := p_isInsByMec, appProfile := p_appProfile } // End of template mw_app_info diff --git a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn index 3243ae4..4d36d74 100644 --- a/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/EdgePlatformApplicationEnablementAPI/ttcn/EdgePlatformApplicationEnablementAPI_TypesAndValues.ttcn @@ -198,25 +198,58 @@ module EdgePlatformApplicationEnablementAPI_TypesAndValues { * @member appServiceOptional Describes services a MEC application may use if available * @member appFeatureRequired Describes features a MEC application requires to run * @member appFeatureOptional Describes features a MEC application may use if available + * @member scheds The availability schedule of the application server + * @member svcArea The list of geographical and topological areas that the application server serves + * @member svcKpi Service characteristics provided by the application server + * @member permLvl Level of service permissions supported by the application server * @member isInsByMec Indicate whether the application instance is instantiated by the MEC Management * @member appProfile Can be mapped to EAS profile as defined in ETSI TS 129 558 [19] * @see ETSI GS MEC 011 V3.3.1 7.1.2.6-1: Attributes of AppInfo */ type record AppInfo { - Json.String appName, - Json.String appProvider optional, - CategoryRef appCategory optional, - Json.String appDId optional, - Json.String appInstanceId optional, - EndPointInfo endpoint optional, - ServiceDependencies appServiceRequired optional, - ServiceDependencies appServiceOptional optional, - FeatureDependencies appFeatureRequired optional, - FeatureDependencies appFeatureOptional optional, + Json.String appName, + Json.String appProvider optional, + CategoryRef appCategory optional, + Json.String appDId optional, + Json.String appInstanceId optional, + EndPointInfo endpoint optional, + ServiceDependencies appServiceRequired optional, + ServiceDependencies appServiceOptional optional, + FeatureDependencies appFeatureRequired optional, + FeatureDependencies appFeatureOptional optional, + ScheduledCommunicationTimes scheds optional, + ServiceArea svcArea optional, + EASServiceKPI svcKpi optional, + record of Json.String permLvl optional, Json.Bool isInsByMec optional, AppProfile appProfile optional } // End of type AppInfo + /** + * @desc + * @see ETSI TS 129 222 V18.7.0 (2025-01) ??? + */ + type record ScheduledCommunicationTime { + // TODO + } // End of type ScheduledCommunicationTime + type record of ScheduledCommunicationTime ScheduledCommunicationTimes; + + /** + * @desc + * @see ETSI TS 129 558 V18.10.0 (2025-06) Table 9.1.5.2.5-1: Definition of type ServiceArea + */ + type record ServiceArea { + // TODO + } // End of type ServiceArea + + /** + * @desc + * @see ETSI TS 129 558 V18.10.0 (2025-06) Table 8.1.5.2.4-1: Definition of type EASServiceKPI + */ + type record EASServiceKPI { + // TODO + } // End of type EASServiceKPI + /** * @desc * @see ETSI TS 129 558 V17.2.0 -- GitLab From 408472e9f23e43a62a8d24a57c96a51191a5df97 Mon Sep 17 00:00:00 2001 From: Mubeena Ishaq Date: Fri, 29 Aug 2025 11:25:10 +0500 Subject: [PATCH 53/54] Validation and fixes for MEC048 using mock server --- ccsrc/Protocols/Json/json_codec_mec048.cc | 83 +++- ...ec_SelfServiceEnablementAPI_TestCases.ttcn | 449 ++++++++++-------- .../SelfServiceEnablementAPI_Functions.ttcn | 282 ++++++----- .../ttcn/SelfServiceEnablementAPI_Pixits.ttcn | 62 +-- .../SelfServiceEnablementAPI_Templates.ttcn | 12 +- ...lfServiceEnablementAPI_TypesAndValues.ttcn | 83 ++-- .../ttcn/TrafficManagementAPI_Functions.ttcn | 1 + 7 files changed, 537 insertions(+), 435 deletions(-) diff --git a/ccsrc/Protocols/Json/json_codec_mec048.cc b/ccsrc/Protocols/Json/json_codec_mec048.cc index 9d8cdf6..7afba5d 100644 --- a/ccsrc/Protocols/Json/json_codec_mec048.cc +++ b/ccsrc/Protocols/Json/json_codec_mec048.cc @@ -18,15 +18,19 @@ int json_codec_mec048::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_tenantInfo)) { const SelfServiceEnablementAPI__TypesAndValues::TenantInfo& tenant_info = msg.tenantInfo(); tenant_info.encode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"TenantInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + data = char2oct(CHARSTRING("{\"tenantInfo\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_resourceUsageSubscription)) { const SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription& resource_usage_subscription = msg.resourceUsageSubscription(); resource_usage_subscription.encode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"ResourceUsageSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + data = char2oct(CHARSTRING("{\"resourceUsageSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_siteResourceUsageSubscription)) { const SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription& site_resource_usage_subscription = msg.siteResourceUsageSubscription(); site_resource_usage_subscription.encode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"SiteResourceUsageSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + data = char2oct(CHARSTRING("{\"siteResourceUsageSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_resourceQuotaInfo)) { + const SelfServiceEnablementAPI__TypesAndValues::ResourceQuotaInfo& resource_quota_info = msg.resourceQuotaInfo(); + resource_quota_info.encode(SelfServiceEnablementAPI__TypesAndValues::ResourceQuotaInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = char2oct(CHARSTRING("{\"resourceQuotaInfo\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else { return json_codec::encode(msg, data); } @@ -35,7 +39,7 @@ int json_codec_mec048::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms return 0; } -int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +int json_codec_mec048::decode(const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) { loggers::get_instance().log_msg(">>> json_codec_mec048::decode: p_data=", p_data); @@ -62,22 +66,44 @@ int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo } else { str = it->second; } - // ..and create the decoding buffer - TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); - TTCN_EncDec::clear_error(); - loggers::get_instance().log("json_codec_mec048::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); - TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - if (it->second.find("\"tenantId\"") != std::string::npos) { // Be careful to the order - if (it->second[0] == '[') { - SelfServiceEnablementAPI__TypesAndValues::TenantInfoList tenant_info_list; - tenant_info_list.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.tenantInfoList() = tenant_info_list; + // Handle tenantInfo wrapper + std::string decoded_str; + if (str.find("\"tenantInfo\"") != std::string::npos) { + // Extract the inner JSON object + size_t start = str.find_first_of('{', str.find("\"tenantInfo\"") + 11); // Skip past "tenantInfo": + size_t end = str.rfind('}'); // Find the last closing brace + if (start != std::string::npos && end != std::string::npos && end > start) { + decoded_str = str.substr(start, end - start + 1); } else { - SelfServiceEnablementAPI__TypesAndValues::TenantInfo tenant_info; - tenant_info.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.tenantInfo() = tenant_info; + loggers::get_instance().warning("json_codec_mec048::decode: Invalid tenantInfo JSON structure: %s", str.c_str()); + return -1; } + } else if (str.find("\"resourceUsageSubscription\"") != std::string::npos) { + // Extract the inner JSON object for resourceUsageSubscription + size_t start = str.find_first_of('{', str.find("\"resourceUsageSubscription\"") + 25); // Skip past "resourceUsageSubscription": + size_t end = str.rfind('}'); // Find the last closing brace + if (start != std::string::npos && end != std::string::npos && end > start) { + decoded_str = str.substr(start, end - start + 1); + } else { + loggers::get_instance().warning("json_codec_mec048::decode: Invalid resourceUsageSubscription JSON structure: %s", str.c_str()); + return -1; + } + } else { + decoded_str = str; // Use original string if no tenantInfo wrapper + } + + // Create decoding buffer with the adjusted JSON + TTCN_Buffer decoding_buffer(OCTETSTRING(decoded_str.length(), (const unsigned char*)decoded_str.c_str())); + + if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"ResourceUsageSubscription\"") != std::string::npos)) { + SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription resource_usage_subscription; + resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.resourceUsageSubscription() = resource_usage_subscription; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SiteResourceUsageSubscription\"") != std::string::npos)) { + SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription site_resource_usage_subscription; + site_resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.siteResourceUsageSubscription() = site_resource_usage_subscription; } else if ( (it->second.find("\"_links\"") != std::string::npos) && ((it->second.find("\"subscriptions\"") != std::string::npos) || (it->second.find("\"subscriptionType\"") == std::string::npos)) @@ -85,16 +111,21 @@ int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo SelfServiceEnablementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; subscription_link_list.decode(SelfServiceEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.subscriptionLinkList__cse() = subscription_link_list; - } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"ResourceUsageSubscription\"") != std::string::npos)) { - SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription resource_usage_subscription; - resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.resourceUsageSubscription() = resource_usage_subscription; - } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SiteResourceUsageSubscription\"") != std::string::npos)) { - SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription site_resource_usage_subscription; - site_resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.siteResourceUsageSubscription() = site_resource_usage_subscription; + } else if (it->second.find("\"tenantId\"") != std::string::npos) { // Be careful to the order + if (it->second[0] == '[') { + SelfServiceEnablementAPI__TypesAndValues::TenantInfoList tenant_info_list; + tenant_info_list.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.tenantInfoList() = tenant_info_list; + } else{ + SelfServiceEnablementAPI__TypesAndValues::TenantInfo tenant_info; + tenant_info.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.tenantInfo() = tenant_info; + } } else { - return json_codec::decode(p_data, msg, p_params); + loggers::get_instance().warning("json_codec_mec048::decode: No matching structure found, assigning raw"); + // Assign raw alternative of union with full original string + msg.raw() = CHARSTRING(str.c_str()); + loggers::get_instance().log("json_codec_mec048::decode: Assigned raw='%s'", str.c_str()); } loggers::get_instance().log_msg("<<< json_codec_mec048::decode: ", (const Base_Type&)msg); diff --git a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn index 2a74b77..67b7a0f 100644 --- a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn @@ -36,7 +36,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)), valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, "Education", omit, PX_CSE_TENANT_NAME_2)), valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_3, PX_CSE_CUSTOMER_NAME_3, "Automotive", omit, PX_CSE_TENANT_NAME_3)) - }; + }; // Test control if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { @@ -67,24 +67,30 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( + mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_tenant_info_list( { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, + *, + ?, PX_CSE_TENANT_NAME_1 ), mw_tenant_info( PX_CSE_CUSTOMER_ID_2, - PX_CSE_CUSTOMER_NAME_1, + PX_CSE_CUSTOMER_NAME_2, + *, + ?, PX_CSE_TENANT_NAME_2 ), mw_tenant_info( PX_CSE_CUSTOMER_ID_3, - PX_CSE_CUSTOMER_NAME_2, - PX_CSE_TENANT_NAME_1 + PX_CSE_CUSTOMER_NAME_3, + *, + ?, + PX_CSE_TENANT_NAME_3 ) } ))))) { @@ -153,8 +159,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, + *, + ?, PX_CSE_TENANT_NAME_1 - ) + ), + mw_tenant_info( + PX_CSE_CUSTOMER_ID_3, + PX_CSE_CUSTOMER_NAME_3, + *, + ?, + PX_CSE_TENANT_NAME_3 + ) } ))))) { tc_ac.stop; @@ -221,14 +236,18 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, - PX_CSE_CUSTOMER_NAME_1, - PX_CSE_TENANT_NAME_1, PX_CSE_TENANT_NAME_1 + PX_CSE_CUSTOMER_NAME_1, + *, + ?, + PX_CSE_TENANT_NAME_1 ), mw_tenant_info( PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, + *, + ?, PX_CSE_TENANT_NAME_2 - ) + ) } ))))) { tc_ac.stop; @@ -274,17 +293,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( m_body_json_cse_tenant_info( m_tenant_info( PX_CSE_CUSTOMER_ID_2, - PX_CSE_CUSTOMER_NAME_1, + PX_CSE_CUSTOMER_NAME_2, omit, omit, - PX_CSE_TENANT_NAME_1 + PX_CSE_TENANT_NAME_2 )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -298,9 +317,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_body_json_cse_tenant_info( mw_tenant_info( PX_CSE_CUSTOMER_ID_2, - PX_CSE_CUSTOMER_NAME_1, - PX_CSE_TENANT_NAME_1 + PX_CSE_CUSTOMER_NAME_2, + *, + ?, + PX_CSE_TENANT_NAME_2 )))))) -> value v_response { + tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a TenantInfo ***"); @@ -342,10 +364,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( m_body_json_cse_tenant_info( m_tenant_info( PX_CSE_CUSTOMER_ID_1, @@ -354,7 +376,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { omit, PX_CSE_TENANT_NAME_1, m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), - m_site_info("site-001", omit) + { m_site_info(PX_CSE_SITE_ID_1, omit), + m_site_info(PX_CSE_SITE_ID_2, m_resource_info(100, 50, 50, 1024, omit, 512, 2048, 1024, omit)) } )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -424,7 +447,9 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, - PX_CSE_TENANT_NAME_1 + *, + ?, + PX_CSE_TENANT_NAME_1 ) ))))) { @@ -470,7 +495,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_get( + m_http_request_get( PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_CSE_TENANT_ID, "UTF-8")), v_headers ))); @@ -481,7 +506,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_404_not_found + mw_http_response_404_not_found )) { tc_ac.stop; @@ -527,15 +552,15 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, - v_headers, - m_http_message_body_json( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, + v_headers, + m_http_message_body_json( m_body_json_cse_tenant_info( m_tenant_info( PX_NEW_CUSTOMER_ID, PX_NEW_CUSTOMER_NAME, omit, - omit, + v_tenant_id, PX_NEW_TENANT_NAME ) ))))); @@ -552,6 +577,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_tenant_info( PX_NEW_CUSTOMER_ID, PX_NEW_CUSTOMER_NAME, + *, + ?, PX_NEW_TENANT_NAME )))))) { tc_ac.stop; @@ -598,7 +625,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), v_headers, m_http_message_body_json( - m_body_json_cse_tenant_info( + m_body_json_cse_tenant_info( m_tenant_info( PX_NEW_CUSTOMER_ID, PX_NEW_CUSTOMER_NAME, @@ -657,20 +684,20 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( - m_http_request_put( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), - v_headers, - m_http_message_body_json( - m_body_json_cse_tenant_info( - m_tenant_info( - PX_NEW_CUSTOMER_ID, - PX_NEW_CUSTOMER_NAME, - omit, - omit, - PX_NEW_TENANT_NAME, - m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), - m_site_info("site-001", omit) - ) + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_NEW_CUSTOMER_ID, + PX_NEW_CUSTOMER_NAME, + omit, + omit, + PX_NEW_TENANT_NAME, + m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), + { m_site_info(PX_CSE_SITE_ID_1, omit) } + ) ))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -848,9 +875,9 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_cse_resource_quota_info( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_resource_quota_info( mw_resource_quota_info( PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, @@ -1087,17 +1114,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( - m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", - v_headers, - m_http_message_body_json( - mw_body_json_cse_resource_quota_info( - m_resource_quota_info( - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + mw_body_json_cse_resource_quota_info( + m_resource_quota_info( + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1157,7 +1184,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", v_headers, m_http_message_body_json( m_body_json_cse_resource_quota_info( @@ -1223,7 +1250,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & v_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1237,17 +1264,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_body_json_cse_site_resource_quota_info_list( { mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ), + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ), mw_site_resource_quota_info( - PX_SITE_ID_2, - PX_CPU_QUOTA_2, - PX_MEMORY_QUOTA_2, - PX_DISK_QUOTA_2 - ), + PX_SITE_ID_2, + PX_CPU_QUOTA_2, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + ), mw_site_resource_quota_info( PX_SITE_ID_3, PX_CPU_QUOTA_3, @@ -1305,11 +1332,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/resources/quota_in_sites?siteId=" & v_site_id_list[0] & "/" & v_site_id_list[1], + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system?siteId=" & v_site_id_list[0] & "/" & v_site_id_list[1], v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1320,20 +1346,20 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info_list( - { - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ), - mw_site_resource_quota_info( - PX_SITE_ID_2, - PX_CPU_QUOTA_2, - PX_MEMORY_QUOTA_2, - PX_DISK_QUOTA_2 - ) - } + { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ), + mw_site_resource_quota_info( + PX_SITE_ID_2, + PX_CPU_QUOTA_2, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + ) + } ))))) { tc_ac.stop; @@ -1373,11 +1399,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Preamble f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1428,23 +1453,22 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_tenant_info(v_tenant_info, v_tenant_id); //TODO: change function name + f_create_tenant_info(v_tenant_info, v_tenant_id); f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1452,12 +1476,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))) -> value v_response { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { @@ -1467,7 +1491,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { var charstring_list v_location_header; f_get_header(v_response.response.header, "Location", v_location_header); // Build expected regex pattern with specific tenant ID - var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_sites/[^/]+"; + var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_system/[^/]+"; if (regexp(v_location_header[0], v_expected_pattern, 0) != "") { log("Location header matches expected pattern with tenant ID: " & v_tenant_id); } else { @@ -1516,30 +1540,34 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_create_tenant_info(v_tenant_info, v_tenant_id); f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases + httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", v_headers, m_http_message_body_json( - m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - - + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + - )))))); tc_ac.start; alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_400_bad_request - )) { - tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } } // End of 'alt' statement // Postamble @@ -1580,7 +1608,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites" & "/" & v_site_id, + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system" & "/" & v_site_id, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1592,12 +1620,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ) + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) ))))) { tc_ac.stop; @@ -1637,11 +1665,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Preamble f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_sites" & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SITE_ID, "UTF-8")), + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system" & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SITE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1700,16 +1727,16 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & v_tenant_id & "/resources/quota_in_system/" & v_site_id, + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system/" & v_site_id, v_headers, m_http_message_body_json( - m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1717,12 +1744,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_2, - PX_DISK_QUOTA_2 - )))))) -> value v_response { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header @@ -1733,7 +1760,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { var charstring_list v_location_header; f_get_header(v_response.response.header, "Location", v_location_header); // Build expected regex pattern with specific tenant ID - var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_sites/[^/]+"; + var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_system/[^/]+"; if (regexp(v_location_header[0], v_expected_pattern, 0) != "") { log("Location header matches expected pattern with tenant ID: " & v_tenant_id); } else { @@ -1794,11 +1821,11 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( //one of cpuQuota, memoryQuota and, diskQuota shall be present. - PX_SITE_ID_1, - -, - -, - - + m_site_resource_quota_info( + PX_SITE_ID_1, + -, + -, + - )))))); tc_ac.start; alt { @@ -1810,6 +1837,11 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } } // End of 'alt' statement // Postamble @@ -1855,12 +1887,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1876,7 +1908,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement + + // Postamble f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_012_NF } // End of group tenant @@ -2109,7 +2144,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { *, *, PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, + ?, m_notification_trigger ( e_tt_ten, 4, @@ -2183,8 +2218,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2207,8 +2242,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2275,10 +2310,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( - omit, + PX_CSE_SUB_CALLBACK_URI, true, omit, - -, + omit, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, m_notification_trigger ( @@ -2358,20 +2393,20 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - *, omit, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + *, omit, + -, + PX_CSE_CUSTOMER_ID_1, + ?, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) )))))) { tc_ac.stop; @@ -2488,8 +2523,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_links, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2506,21 +2541,21 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - omit, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) - )))))) -> value v_response { + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + ?, + PX_CSE_CUSTOMER_ID_1, + ?, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates the siteResourceUsageSubscription ***"); @@ -2573,8 +2608,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2638,7 +2673,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( - omit, + PX_CSE_SUB_CALLBACK_URI, true, omit, -, @@ -2825,15 +2860,15 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, mw_http_message_body_json( mw_body_json_site_resource_usage_notification( - mw_site_resource_usage_notification( - { seconds := 1684748494, nanoSeconds := 123456789 }, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - mw_site_resource_use_info( - PX_SITE_ID_1, - 5 - ) - )))))) { + mw_site_resource_usage_notification( + { seconds := 1684748494, nanoSeconds := 123456789 }, + PX_CSE_CUSTOMER_ID_1, + ?, + mw_site_resource_use_info( + PX_SITE_ID_1, + 5 + ) + )))))) { tc_ac.stop; f_init_default_headers_list(-, -, v_headers); @@ -2895,7 +2930,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_resource_usage_notification( *, PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, + ?, mw_resource_use_info ( 5 ) @@ -2960,7 +2995,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_cse_expiry_notification( mw_cse_expiry_notification( - -, + ?, { seconds := 1684748494, nanoSeconds := 123456789 } ) ))))) { diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn index d65a164..659a0d5 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn @@ -11,6 +11,7 @@ module SelfServiceEnablementAPI_Functions { // LibHttp import from LibHttp_TypesAndValues all; + import from LibHttp_JsonMessageBodyTypes all; import from LibHttp_Functions all; import from LibHttp_Templates all; import from LibHttp_JsonTemplates all; @@ -22,6 +23,7 @@ module SelfServiceEnablementAPI_Functions { import from SelfServiceEnablementAPI_Pixits all; // LibMec + import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Pics all; @@ -33,9 +35,12 @@ module SelfServiceEnablementAPI_Functions { ) runs on HttpComponent { log(">>> f_create_tenant_info_list: ", p_tenant_info_list); var charstring v_tenant_id; + p_tenant_id_list := {}; for (var integer i := 0; i < lengthof(p_tenant_info_list); i := i + 1) { f_create_tenant_info(p_tenant_info_list[i], v_tenant_id); - p_tenant_id_list := p_tenant_id_list & { v_tenant_id }; + if (lengthof(v_tenant_id) > 0) { + p_tenant_id_list := p_tenant_id_list & { v_tenant_id }; + } } } // End of function f_create_tenant_info_list @@ -55,8 +60,14 @@ module SelfServiceEnablementAPI_Functions { PICS_ROOT_API & PX_CSE_TENANTS_INFO, v_headers, m_http_message_body_json( - m_body_json_cse_tenant_info(p_tenant_info) - )))); + m_body_json_cse_tenant_info( + m_tenant_info( + p_tenant_info.customerId, + p_tenant_info.customerName, + p_tenant_info.customerCategory, + omit, + p_tenant_info.tenantName + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -65,11 +76,11 @@ module SelfServiceEnablementAPI_Functions { mw_http_message_body_json( mw_body_json_cse_tenant_info( mw_tenant_info( + p_tenant_info.customerId, + p_tenant_info.customerName, + p_tenant_info.customerCategory, ?, - ?, - ?, - ?, - ? + p_tenant_info.tenantName ) ))))) -> value v_response { tc_ac.stop; @@ -78,14 +89,16 @@ module SelfServiceEnablementAPI_Functions { var charstring_list v_tenant_id; f_get_header(v_response.response.header, "Location", v_tenant_id); // Extract HTTP tenant id - p_tenant_id := regexp( - v_tenant_id[0], - "?+" & PX_CSE_TENANTS_INFO & "/(?*)", - 0 - ); - - p_tenant_info := v_response.response.body.json_body.tenantInfo; - log("f_create_tenant_info: INFO: IUT successfully creates the Tenants: ", p_tenant_info); + if (ispresent(v_tenant_id) and lengthof(v_tenant_id) > 0) { + p_tenant_id := regexp( + v_tenant_id[0], + "?+" & PX_CSE_TENANTS_INFO & "/(?*)", + 0 + ); + + p_tenant_info := v_response.response.body.json_body.tenantInfo; + log("f_create_tenant_info: INFO: IUT successfully creates the Tenants: ", p_tenant_info); + } } [] tc_ac.timeout { log("f_create_tenant_info: INCONC: Expected message not received"); @@ -194,11 +207,12 @@ module SelfServiceEnablementAPI_Functions { ) runs on HttpComponent { log(">>> f_create_site_resource_quota_info_list: ", p_site_resource_quota_info); var charstring v_site_resource_quota_info_id; + p_site_resource_quota_info_id_list := {}; for (var integer i := 0; i < lengthof(p_site_resource_quota_info); i := i + 1) { f_create_site_resource_quota_info(p_site_resource_quota_info[i], -, p_tenant_id); p_site_resource_quota_info_id_list := p_site_resource_quota_info_id_list & { v_site_resource_quota_info_id }; } - } // End of function f_create_tenant_info_list + } // End of function f_create_site_resource_quota_info_list function f_create_site_resource_quota_info( inout SiteResourceQuotaInfo p_site_resource_quota_info, @@ -214,30 +228,30 @@ module SelfServiceEnablementAPI_Functions { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/resources/quota_in_system", v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ) + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) ))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ) + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info( + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) ))))) -> value v_response { tc_ac.stop; p_site_resource_quota_info := v_response.response.body.json_body.siteResourceQuotaInfo; @@ -271,14 +285,16 @@ module SelfServiceEnablementAPI_Functions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_LIST_SUBS, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( PX_CSE_SUB_CALLBACK_URI, - omit, omit, omit, + true, + omit, + omit, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, m_notification_trigger( @@ -292,15 +308,17 @@ module SelfServiceEnablementAPI_Functions { alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_resource_usage_subscription( - mw_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - *, - *, - ?,?,? + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ?, + ? ) ))))) -> value v_response { tc_ac.stop; @@ -325,50 +343,51 @@ module SelfServiceEnablementAPI_Functions { } // End of function f_create_resource_usage_subscription function f_create_site_resource_usage_subscription( - out SiteResourceUsageSubscription p_site_resource_usage_subscription, - out charstring p_subscription_id, - out Links p_links - ) runs on HttpComponent { + out SiteResourceUsageSubscription p_site_resource_usage_subscription, + out charstring p_subscription_id, + out Links p_links + ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_LIST_SUBS, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( m_body_json_site_resource_usage_subscription( - m_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - omit, omit, omit, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger( - e_tt_ten, - 5, - true - ) - ) - ))))); + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger( + e_tt_ten, + 5, + true + ) + )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - *, - *, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID - ) + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ? + ) ))))) -> value v_response { tc_ac.stop; @@ -403,14 +422,16 @@ module SelfServiceEnablementAPI_Functions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_LIST_SUBS, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( PX_CSE_SUB_CALLBACK_URI, - omit, omit, omit, + true, + omit, + omit, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, m_notification_trigger ( @@ -418,23 +439,22 @@ module SelfServiceEnablementAPI_Functions { 4, false ) - ) - ))))); + )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_resource_usage_subscription( - mw_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - *, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID - ) + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ? + ) ))))) -> value v_response { tc_ac.stop; @@ -472,43 +492,43 @@ module SelfServiceEnablementAPI_Functions { PICS_ROOT_API & PX_CSE_LIST_SUBS, v_headers, m_http_message_body_json( - m_body_json_site_resource_usage_subscription( - m_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, omit, - omit, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, omit, + omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - omit, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) - ) + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ?, + { mw_site_id(PX_CSE_SITE_ID_1), + mw_site_id(PX_CSE_SITE_ID_2) }, + mw_notification_trigger ( + e_tt_ten, + 4, + false + ) + ) ))))) -> value v_response { tc_ac.stop; @@ -522,11 +542,11 @@ module SelfServiceEnablementAPI_Functions { 0 ); p_site_resource_usage_subscription := v_response.response.body.json_body.siteResourceUsageSubscription; - log("f_create_site_resource_usage_subscription: INFO: IUT successfully responds to the subscription: ", p_site_resource_usage_subscription); - log("f_create_site_resource_usage_subscription: INFO: p_subscription_id: ", p_subscription_id); + log("f_create_site_resource_usage_subscription_2: INFO: IUT successfully responds to the subscription: ", p_site_resource_usage_subscription); + log("f_create_site_resource_usage_subscription_2: INFO: p_subscription_id: ", p_subscription_id); } [] tc_ac.timeout { - log("f_create_resource_usage_subscription: Expected message not received"); + log("f_create_site_resource_usage_subscription_2: Expected message not received"); } } // End of 'alt' statement } // End of function f_create_site_resource_usage_subscription diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn index 6ed7a28..e585010 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn @@ -9,63 +9,67 @@ module SelfServiceEnablementAPI_Pixits { // LibMec/SelfServiceEnablementAPI import from SelfServiceEnablementAPI_TypesAndValues all; - modulepar Json.String PX_CSE_CUSTOMER_ID_1 := "" + modulepar Json.String PX_CSE_CUSTOMER_ID_1 := "customer01" - modulepar Json.String PX_CSE_CUSTOMER_NAME_1 := "customerName"; + modulepar Json.String PX_CSE_CUSTOMER_NAME_1 := "customerName"; - modulepar Json.String PX_CSE_TENANT_ID := ""; + modulepar Json.String PX_CSE_TENANT_ID := ""; - modulepar Json.String PX_CSE_TENANT_NAME_1 := "tenantX"; + modulepar Json.String PX_CSE_TENANT_NAME_1 := "tenantX"; - modulepar Json.String PX_CSE_CUSTOMER_ID_2 := "" + modulepar Json.String PX_CSE_CUSTOMER_ID_2 := "customer02" - modulepar Json.String PX_CSE_CUSTOMER_NAME_2 := "customerName02"; + modulepar Json.String PX_CSE_CUSTOMER_NAME_2 := "customerName02"; - modulepar Json.String PX_CSE_TENANT_NAME_2 := "tenantY"; + modulepar Json.String PX_CSE_TENANT_NAME_2 := "tenantY"; - modulepar Json.String PX_CSE_CUSTOMER_ID_3 := "" + modulepar Json.String PX_CSE_CUSTOMER_ID_3 := "customer03" - modulepar Json.String PX_CSE_CUSTOMER_NAME_3 := "customerName03"; + modulepar Json.String PX_CSE_CUSTOMER_NAME_3 := "customerName03"; - modulepar Json.String PX_CSE_TENANT_NAME_3 := "tenantName03"; + modulepar Json.String PX_CSE_TENANT_NAME_3 := "tenantName03"; - modulepar Json.String PX_NON_EXISTENT_TENANT_ID := "9344"; + modulepar Json.String PX_CSE_SITE_ID_1 := "site-001"; - modulepar Json.String PX_NEW_CUSTOMER_ID := ""; + modulepar Json.String PX_CSE_SITE_ID_2 := "site-002"; - modulepar Json.String PX_NEW_CUSTOMER_NAME := "newCustomer"; + modulepar Json.String PX_NON_EXISTENT_TENANT_ID := "9344"; - modulepar Json.String PX_NEW_TENANT_NAME := "newTenat"; + modulepar Json.String PX_NEW_CUSTOMER_ID := ""; - modulepar Json.String PX_SITE_ID_1 := "209153c9-0c28-428f-930f-d61328c30ffd"; + modulepar Json.String PX_NEW_CUSTOMER_NAME := "newCustomer"; - modulepar Json.String PX_SITE_ID_2 := "77e093bc-830c-4bcc-9ad8-6c3eff048335"; + modulepar Json.String PX_NEW_TENANT_NAME := "newTenat"; + + modulepar Json.String PX_SITE_ID_1 := "209153c9-0c28-428f-930f-d61328c30ffd"; - modulepar Json.String PX_SITE_ID_3 := "7d6b6123-b3b7-413e-ae73-b8bb349bda46"; + modulepar Json.String PX_SITE_ID_2 := "77e093bc-830c-4bcc-9ad8-6c3eff048335"; - modulepar Json.Integer PX_CPU_QUOTA_1 := 4; + modulepar Json.String PX_SITE_ID_3 := "7d6b6123-b3b7-413e-ae73-b8bb349bda46"; - modulepar Json.Integer PX_MEMORY_QUOTA_1 := 2048; + modulepar Json.Integer PX_CPU_QUOTA_1 := 4; - modulepar Json.Integer PX_DISK_QUOTA_1 := 50; + modulepar Json.Integer PX_MEMORY_QUOTA_1 := 2048; - modulepar Json.Integer PX_CPU_QUOTA_2 := 4; + modulepar Json.Integer PX_DISK_QUOTA_1 := 50; - modulepar Json.Integer PX_MEMORY_QUOTA_2 := 2048; + modulepar Json.Integer PX_CPU_QUOTA_2 := 4; - modulepar Json.Integer PX_DISK_QUOTA_2 := 50; + modulepar Json.Integer PX_MEMORY_QUOTA_2 := 2048; - modulepar Json.Integer PX_CPU_QUOTA_3 := 4; + modulepar Json.Integer PX_DISK_QUOTA_2 := 50; - modulepar Json.Integer PX_MEMORY_QUOTA_3 := 2048; + modulepar Json.Integer PX_CPU_QUOTA_3 := 4; - modulepar Json.Integer PX_DISK_QUOTA_3 := 50; + modulepar Json.Integer PX_MEMORY_QUOTA_3 := 2048; - modulepar Json.String PX_NON_EXISTENT_SITE_ID := "9344"; + modulepar Json.Integer PX_DISK_QUOTA_3 := 50; - modulepar Json.AnyURI PX_CSE_SUB_CALLBACK_URI := "http://127.0.0.1/callback"; + modulepar Json.String PX_NON_EXISTENT_SITE_ID := "9344"; - modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "0787"; + modulepar Json.AnyURI PX_CSE_SUB_CALLBACK_URI := "http://127.0.0.1/callback"; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "0787"; modulepar Json.String PX_NON_EXISTENT_SUBSCRIPTION_ID := "NON_EXISTENT_SUBSCRIPTION_ID"; diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn index 8e14ba5..a0421e5 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn @@ -19,7 +19,7 @@ module SelfServiceEnablementAPI_Templates { in template (omit) Json.String p_tenantId, in Json.String p_tenantName, in template (omit) ResourceInfo p_resourceUseInfo := omit, - in template (omit) SiteInfo p_siteList := omit + in template (omit) SiteInfoList p_siteList := omit ) := { customerId := p_customerId, customerName := p_customerName, @@ -37,7 +37,7 @@ module SelfServiceEnablementAPI_Templates { template Json.String p_tenantId := *, template (present) Json.String p_tenantName := ?, template ResourceInfo p_resourceUseInfo := *, - template SiteInfo p_siteList := * + template SiteInfoList p_siteList := * ) := { customerId := p_customerId, customerName := p_customerName, @@ -333,7 +333,7 @@ module SelfServiceEnablementAPI_Templates { } // End of template mw_site_resource_use_info template (value) ExpiryNotification m_cse_expiry_notification( - in template (value) LinkExpiry p_links, + in template (value) LinksExpiry p_links, in template (value) TimeStamp p_expiryDeadline ) := { notificationType := "ExpiryNotification", @@ -342,7 +342,7 @@ module SelfServiceEnablementAPI_Templates { } // End of template m_expiry_notification template (present) ExpiryNotification mw_cse_expiry_notification( - template (present) LinkExpiry p_links := ?, + template (present) LinksExpiry p_links := ?, template (present) TimeStamp p_expiryDeadline := ? ) := { notificationType := "ExpiryNotification", @@ -467,13 +467,13 @@ module SelfServiceEnablementAPI_Templates { diskRemain := p_diskRemain } // End of template mw_resource_info - template (value) LinkExpiry m_link_expiry( + template (value) LinksExpiry m_link_expiry( in template (value) LinkType p_subscription ) := { subscription := p_subscription } //End of temaplate m_link_expiry - template (present) LinkExpiry mw_link_expiry( + template (present) LinksExpiry mw_link_expiry( template (present) LinkType p_subscription := ? ) := { subscription := p_subscription diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn index a6f9d63..668f1e0 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn @@ -3,6 +3,9 @@ module SelfServiceEnablementAPI_TypesAndValues { // JSON import from Json all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + // LibMec import from LibMec_TypesAndValues all; @@ -15,7 +18,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantName Name of the tenant * @param resourceUseInfo Resource in the MEC system that can be used by the tenant * @param siteList A list of edge sites that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.2-1: Definition of type TenantInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.2.2-1: Attributes of type TenantInfo */ type record TenantInfo { Json.String customerId, @@ -24,7 +27,7 @@ module SelfServiceEnablementAPI_TypesAndValues { Json.String tenantId optional, Json.String tenantName, ResourceInfo resourceUseInfo optional, - SiteInfo siteList optional + SiteInfoList siteList optional } type set of TenantInfo TenantInfoList; @@ -33,7 +36,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.3-1: Definition of type ResourceQuotaInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.2.3-1: Attributes of type ResourceQuotaInfo */ type record ResourceQuotaInfo { Json.Integer cpuQuota optional, @@ -47,7 +50,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.4-1: Definition of type SiteResourceQuotaInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.2.4-1: Attributes of type SiteResourceQuotaInfo */ type record SiteResourceQuotaInfo { Json.String siteId, @@ -68,7 +71,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantId Identifier of the tenant * @param notificationTrigger Set for trigger-based event notification reporting * @param expiryDeadline The expiration time of the subscription determined by the CSE - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2-1: Definition of type ResourceUsageSubscription + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Attributes of type ResourceUsageSubscription */ type record ResourceUsageSubscription { Json.String subscriptionType, @@ -95,7 +98,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantId Identifier of the tenant * @param notificationTrigger Set for trigger-based event notification reporting * @param expiryDeadline The expiration time of the subscription determined by the CSE - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.3-1: Definition of type SiteResourceUsageSubscription + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.3-1: Attributes of type SiteResourceUsageSubscription */ type record SiteResourceUsageSubscription { Json.String subscriptionType, @@ -115,7 +118,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents a list of links related to currently existing subscriptions for the service consumer * @param _links List of hyperlinks related to the resource - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.4-1: Attributes of type SubscriptionLinkList + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.4-1: Attributes of type SubscriptionLinkList */ type record SubscriptionLinkList { LinksSub links @@ -130,7 +133,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param customerId Identifier to uniquely specify the customer for the subscription * @param tenantId Identifier of the tenant * @param resourceUseInfo Resource usage in the MEC system by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.2-1: Attributes of type ResourceUsageNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.2-1: Attributes of type ResourceUsageNotification */ type record ResourceUsageNotification { Json.String notificationType, @@ -148,7 +151,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.2-1: Attributes of type ResourceUseInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.2-1: Attributes of type ResourceUseInfo */ type record ResourceUseInfo { Json.Integer cpuUsed optional, @@ -166,7 +169,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param customerId Identifier to uniquely specify the customer for the subscriptionc * @param tenantId Identifier of the tenant * @param resourceUseInfo Resource usage in the MEC system by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification */ type record SiteResourceUsageNotification { Json.String notificationType, @@ -185,7 +188,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type SiteResourceUseInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.3-1: Attributes of type SiteResourceUseInfo */ type record SiteResourceUseInfo { Json.String siteId, @@ -196,17 +199,18 @@ module SelfServiceEnablementAPI_TypesAndValues { Json.Integer diskUsed optional, Json.Integer diskRemain optional } + type set of SiteResourceUseInfo SiteResourceUseInfoList; /** * @desc This type represents a notification from CSE with regards to expiry of an existing subscription * @param notificationType Shall be set to "ExpiryNotification" * @param _links Object containing hyperlinks related to the resource * @param expiryDeadline Time stamp - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.4-1: Attributes of type ExpiryNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.4-1: Attributes of type ExpiryNotification */ type record ExpiryNotification { Json.String notificationType, - LinkExpiry links, + LinksExpiry links, TimeStamp expiryDeadline } with { variant (links) "name as '_links'"; @@ -216,13 +220,13 @@ module SelfServiceEnablementAPI_TypesAndValues { * @desc This type represents the information on an edge site * @param siteId Identifier of an edge site * @param resourceInfo Resource information in the edge site that is associated with a specific tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.2-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.2-1: Attributes of type SiteInfo */ type record SiteInfo { Json.String siteId, - ResourceInfo resourceInfo + ResourceInfo resourceInfo optional } - + type set of SiteInfo SiteInfoList; /** * @desc This type represents the resource information in an edge site or a MEC system that is associated with a tenant * @param cpuQuota Allowed number of CPUs that can be used by the tenant @@ -234,7 +238,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param diskQuota Allowed amount of disk (GB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type ResourceInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.3-1: Attributes of type ResourceInfo */ type record ResourceInfo { Json.Integer cpuQuota optional, @@ -249,10 +253,11 @@ module SelfServiceEnablementAPI_TypesAndValues { } /** - * @desc This type represents the information on an edge site - * @param siteId Identifier of an edge site - * @param resourceInfo Resource information in the edge site that is associated with a specific tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.2-1: Attributes of type SiteInfo + * @desc This type represents the set for trigger-based event notification reporting. + * @param triggerType Trigger for the notification + * @param threshold Threshold for trigger-based event reporting + * @param greaterOrLess Indicator for the triggering condition + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Attributes of type NotificationTrigger */ type record NotificationTrigger { TriggerType triggerType, @@ -262,7 +267,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Trigger for the notification - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2-1: Enumeration TriggerType + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Enumeration TriggerType */ type enumerated TriggerType { e_tt_ten (10), // 10 = Notification trigged based on the number of used CPUs @@ -277,8 +282,9 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Hyperlink related to the resource - * @member subscription URI identifying the subscription for the test notification - * @see ETSI GS MEC 048 V3.2.1 (2025-09) : Definition of type Links + * @param self Self-referring URI + * @param subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.4-1: Attributes of type LinksSub */ type record LinksSub { LinkType self_, @@ -289,9 +295,9 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc The service consumer's subscriptions - * @member href The URI referring to the subscription - * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.4-11: Type Subscription + * @param href The URI referring to the subscription + * @param subscriptionType Type of the subscription + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.4-1: Attributes of type Subscription */ type record Subscription { @@ -302,8 +308,8 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Hyperlink related to the resource - * @member subscription URI identifying the subscription for the test notification - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2: Attributes of the Links + * @param self Self-referring URI + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Attributes of type Links */ type record Links { LinkType self_ @@ -313,8 +319,8 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents a type of link - * @member href URI referring to a resource - * @see ETSI GS MEC 048 V3.2.1 (2025-09) : Definition of type LinkType + * @param href URI referring to a resource + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.6-1 : Attributes of type LinkType */ type record LinkType { Json.AnyURI href @@ -323,7 +329,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents the identifier of an edge site. * @param siteId Identifier of an edge site - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.5-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.5-1: Attributes of type SiteId */ type record SiteId { Json.String siteId @@ -332,16 +338,21 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents configuration for the delivery of subscription notifications over Websockets - * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications - * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Type: WebsockNotifConfig + * @param websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications + * @param requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.4-1 Attributes of type WebsockNotifConfig */ type record WebsockNotifConfig { Json.AnyURI websocketUri optional, Json.Bool requestWebsocketUri optional } - type record LinkExpiry { + /** + * @desc This type represents the hyperlink related to the resource. + * @param subscription URI identifying the subscription which has expired. + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.4-1: Attributes of type LinksExpiry + */ + type record LinksExpiry { LinkType subscription } diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index b164253..d8b17f4 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -66,6 +66,7 @@ module TrafficManagementAPI_Functions { // var charstring_list v_header_location; tc_ac.stop; log("f_create_bw_allocation_resource: BwInfo resource created: ", v_response); + var charstring_list v_header_location; f_get_header(valueof(v_response.response.header), "Location", v_header_location); p_bw_allocation_id := regexp( v_header_location[0], -- GitLab From 7ebe6a401ccffe3b29219c49e77819aa58bed828 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 9 Oct 2025 15:16:11 +0200 Subject: [PATCH 54/54] Minor bug fixed in TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 --- .../AtsMec_SensorsSharingService.cf_ | 12 ++++++------ .../AtsMec_SensorsSharingService_TestCases.ttcn | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ index a8e0c22..0d555c4 100644 --- a/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ +++ b/etc/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService.cf_ @@ -16,9 +16,9 @@ LibHttp_Pics.PICS_USE_TOKEN_HEADER := true LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign in on https://mec-platform.etsi.org/, section 'Try-it from your MEC application' -SensorsSharingService_Pixits.PX_SENS_SUB_CALLBACK_URI := "http://yanngarcia.ddns.net/sens/v1/notif" -SensorsSharingService_Pixits.PX_SENS_DISCOVERY_TYPE := "" -SensorsSharingService_Pixits.PX_SENS_DISCOVERY_PROPERTY_LIST := "SAREF" # Could be [], string or [string1 string2] +SensorsSharingService_Pixits.PX_SENS_SUB_CALLBACK_URI := "http://yanngarcia.ddns.net:8547/sens/v1/notif" +SensorsSharingService_Pixits.PX_SENS_DISCOVERY_TYPE := "CNT" +SensorsSharingService_Pixits.PX_SENS_DISCOVERY_PROPERTY_LIST := "saref:any" # Could be [], string or [string1 string2] SensorsSharingService_Pixits.PX_SENSOR_IDENTIFIER := "cnt8WkyGNcEDV" [LOGGING] @@ -66,9 +66,9 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec046)/TCP(debug=1 #AtsMec_SensorsSharingService_TestControl.control # Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application -#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 +AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 # Check that the IUT responds with the list of SensorDiscoveryInfo when queried by a MEC Application - Using type filter -#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_01 +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid filter #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSDISCOVERY_001_BR # Check that the IUT responds with an error when the IUT does not have sensor(s) @@ -96,7 +96,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec046)/TCP(debug=1 # Check that the IUT responds with an error when the IUT does not have sensor(s) #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_002_NF # Check that the IUT responds with the list of SensorData when queried by a MEC Application -AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK +#AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_SensorsSharingService_TestCases.TC_MEC_MEC046_SRV_SENSLOOKUP_003_BR # Check that the IUT responds with an error when the IUT does not have sensor(s) diff --git a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn index 84630c4..5c4ea65 100644 --- a/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn +++ b/ttcn/AtsMec_SensorsSharingService/AtsMec_SensorsSharingService_TestCases.ttcn @@ -48,7 +48,7 @@ module AtsMec_SensorsSharingService_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_SENS_DISCOVERY & "?type=" & PX_SENSOR_IDENTIFIER, + PICS_ROOT_API & PX_SENS_DISCOVERY & "?type=" & PX_SENSOR_IDENTIFIER & "&sensorPropertyList=" & PX_SENS_DISCOVERY_PROPERTY_LIST, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); -- GitLab