diff --git a/.github/workflows/ciimage.yml b/.github/workflows/ciimage.yml deleted file mode 100644 index 40cd808534..0000000000 --- a/.github/workflows/ciimage.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build CI Image - -## Will only run on pushes to the CI folder -on: - push: - paths: - - ci/deb/** - -env: - IMAGE_NAME: fiware/orion-ci:deb - -jobs: - deploy: - - runs-on: ubuntu-22.04 - if: github.event_name == 'push' - - steps: - - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ci/deb/ - load: true - tags: ${{ env.IMAGE_NAME }} - file: ci/deb/Dockerfile - - - name: Push - run: docker push ${{ env.IMAGE_NAME }} diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 0697dfa26f..d2cb2c5e00 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: functional: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 5d44faf352..ac8ca557f8 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: unit: diff --git a/.github/workflows/valgrind-nocache.yml b/.github/workflows/valgrind-nocache.yml index bb0cc853b0..849b744748 100644 --- a/.github/workflows/valgrind-nocache.yml +++ b/.github/workflows/valgrind-nocache.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: valgrind: diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index aa2916a16c..8f01905cf9 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - TEST_IMAGE_NAME: fiware/orion-ci:deb + TEST_IMAGE_NAME: telefonicaiot/fiware-orion:ci jobs: valgrind: diff --git a/.readthedocs.yml b/.readthedocs.yml index b287e6e4b9..75480d72a6 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,11 @@ version: 2 mkdocs: configuration: mkdocs.yml +build: + os: ubuntu-22.04 + tools: + python: "3.8" + python: - version: 3.8 install: - requirements: doc/requirements.txt diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 9f405677cf..c3b7ccea03 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,15 +1,9 @@ -- Hardening: upgrade microhttpd dependency from 0.9.73 to 0.9.76 -- Add: subject.condition.notifyOnMetadataChange field to subscriptions, so only-metadata changes doesn't trigger notifications (#3727) -- Add: new simplifiedNormalized and simplifiedKeyvalues for attrsFormat (#4286) -- Add: -mqttTimeout (env var ORION_MQTT_TIMEOUT) for MQTT broker connection timeout -- Fix: alterationType with entityDelete not working if condition.attrs is empty (#4326) -- Fix: $set/$unset update operator not working properly when the key has dots (#4315) -- Fix: queue workers deadlock when MQTT broker was not responding to connection attemp -- Fix: Ngsiv2-AttrsFormat header set to "normalized" in NGSI patching custom notification -- Fix: memory access potential problem in GET /log/trace request when tracelevel 255 is enabled -- Fix: Orion should return error and refuse to start when port is negative (#3875) -- Fix: subscription autodisable based on maxFailsLimit not working when fails does not happen within the same csubs cache refresh cycle -- Fix: incorrectly sum stale failsCounter from database when subscription has started to work again (only when csubs cache is enabled) -- Fix: MQTT disconnection when MQTT publish fail (so re-connection is forced at next MQTT notification) -- Fix: lineMaxSize and infoPayloadMaxSize in the log admin REST API (#3707) -- Fix: check for service database name too long at cache sync logic (#2848) +- Add: servicePath field to builtin attributes (#2877) +- Add: notification.mqtt.retain and notification.mqttCustom.retain flag for MQTT retain in notifications (#4388) +- Fix: logDeprecate not working correctly (`geo:json` wrongly considered as deprecated) +- Fix: improve error traces (#4387) +- Add: CLI parameter -dbUri / env var ORION_MONGO_URI (#3794) +- Fix: improve logs in MongoDB query logic +- Upgrade Debian version from 11.6 to 12.1 in Dockerfile +- Hardening: upgrade libmongoc dependency from 1.23.1 to 1.24.3 +- Reference distribution changed from Debian 11 to Debian 12 diff --git a/CMakeLists.txt b/CMakeLists.txt index 694bbe0f8a..b260ad8faa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,6 +171,12 @@ endif (${CMAKE_BUILD_TYPE} STREQUAL DEBUG) # set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable") #endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +# Enables some some #ifdef in the code for compiling in old system +# FIXME: cleanup OLD_SSL_VERSION_FORMAT stuff after consolidating the change to Debian 12+ +IF(${DISTRO} MATCHES "Debian_11.*") + ADD_DEFINITIONS(-DOLD_SSL_VERSION_FORMAT) +ENDIF() + # # Libraries # @@ -220,8 +226,8 @@ SET (BOOST_MT # See http://mongoc.org/libmongoc/current/tutorial.html#cmake # This find_package() command provides the mongo::mongoc_static used in -# SET for common static libs. We use 1.23.1 as reference version. -find_package (mongoc-1.0 1.23.1 EXACT) +# SET for common static libs. We use 1.24.3 as reference version. +find_package (mongoc-1.0 1.24.3 EXACT) # Static libs common to contextBroker and unitTest binaries SET (COMMON_STATIC_LIBS diff --git a/Changelog b/Changelog index 3321eea48b..016b846508 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,42 @@ +3.10.0 (June 12th, 2023) + +- Add: option to change deprecate log setting in the REST management API +- Fix: decimal rounding in some cases was generating wrong JSON in query responses and notifications (#4346) +- Fix: pagination support in request query forwarding to Context Providers (#4149, #847, #1647) +- Fix: count option not working when georel=near was in use (500 error was returned) +- Fix: maxFailsLimit didn't work in some cases when update subscription is done just after cache refresh (only when csubs cache is enabled) +- Fix: conditions.notifyOnMetadataChange false not working if condition.attrs is empty +- Deprecate: `geo:json`, `geo:line`, `geo:box` and `geo:polygon` attribute types (use `geo:json` instead) +- Remove: all NGSIv1 operations (deprecated in Orion 2.0.0) except the following ones + - PUT /v1/contextEntities/{id} + - DELETE /v1/contextEntities/{id} + - GET /v1/contextEntities/{id}/attributes/{name} + - POST /v1/updateContext + - POST /NGSI10/updateContext + - POST /v1/queryContext + - POST /NGSI10/queryContext + +3.9.0 (June 2th, 2023) + +- Add: new simplifiedNormalized and simplifiedKeyvalues for attrsFormat (#4286) +- Add: subject.condition.notifyOnMetadataChange field to subscriptions, so only-metadata changes doesn't trigger notifications (#3727) +- Add: support for update operators ($set, $addToSet, etc.) in entity creation and replace (#3814, reopnened) +- Add: -mqttTimeout (env var ORION_MQTT_TIMEOUT) for MQTT broker connection timeout +- Add: -disableNgsiv1 (env var ORION_DISABLE_NGSIV1) to disable NGSIv1 API requests +- Add: -logDeprecate (env var ORION_LOG_DEPRECATE) to log deprecate usages at WARN level +- Fix: alterationType with entityDelete not working if condition.attrs is empty (#4326) +- Fix: $set/$unset update operator not working properly when the key has dots (#4315) +- Fix: queue workers deadlock when MQTT broker was not responding to connection attemp +- Fix: Ngsiv2-AttrsFormat header set to "normalized" in NGSI patching custom notification +- Fix: memory access potential problem in GET /log/trace request when tracelevel 255 is enabled +- Fix: Orion should return error and refuse to start when port is negative (#3875) +- Fix: subscription autodisable based on maxFailsLimit not working when fails does not happen within the same csubs cache refresh cycle +- Fix: incorrectly sum stale failsCounter from database when subscription has started to work again (only when csubs cache is enabled) +- Fix: MQTT disconnection when MQTT publish fail (so re-connection is forced at next MQTT notification) +- Fix: lineMaxSize and infoPayloadMaxSize in the log admin REST API (#3707) +- Fix: check for service database name too long at cache sync logic (#2848) +- Hardening: upgrade microhttpd dependency from 0.9.73 to 0.9.76 + 3.8.0 (January 12th, 2023) - Add: json field in httpCustom and mqttCustom subscriptions to implement JSON-based payloads in notifications (#2560) diff --git a/README.md b/README.md index 6e93215a58..47282d99be 100644 --- a/README.md +++ b/README.md @@ -92,8 +92,8 @@ recommended to have a look to the brief ### Introductory presentations - Orion Context Broker - [(en)](https://www.slideshare.net/fermingalan/orion-context-broker-20221220) - [(jp)](https://www.slideshare.net/fisuda/orion-context-broker-20221220-254969123) + [(en)](https://www.slideshare.net/fermingalan/orion-context-broker-20230606) + [(jp)](https://www.slideshare.net/fisuda/orion-context-broker-20230606-258279602) - NGSIv2 Overview for Developers That Already Know NGSIv1 [(en)](https://www.slideshare.net/fermingalan/orion-context-broker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20220523) [(jp)](https://www.slideshare.net/fisuda/orion-context-broker-ngsiv2-overview-for-developers-that-already-know-ngsiv1-20220526) diff --git a/ci/README.jp.md b/ci/README.jp.md index d203e05297..645730f11e 100644 --- a/ci/README.jp.md +++ b/ci/README.jp.md @@ -1,13 +1,13 @@ ## 概要 このリポジトリでは GitHub Actions が有効になっているため、マージを許可する前に各プルリクエストがチェックされます。 -このシステムは、新しい PR がマスターに到達するたびにマスターブランチから構築される `fiware/orion-ci:deb` に基づいており、 +このシステムは、新しい PR がマスターに到達するたびにマスターブランチから構築される `telefonicaiot/fiware-orion:ci` に基づいており、 すべてのビルド依存関係がオンボードにあるクリーンな環境を提供します。この Docker のビルドに使用される Dockerfile は、 `ci/deb` ディレクトリにあります。 -テスト対象の PR ブランチが変更されたため、`fiware/orion-ci:deb` は再構築されないことに注意してください。したがって、 +テスト対象の PR ブランチが変更されたため、`telefonicaiot/fiware-orion:ci` は再構築されないことに注意してください。したがって、 新しいライブラリまたはベースシステムを必要とする機能を開発している場合は、そのようなライブラリまたはベースシステムを `ci/deb/build-dep.sh` および/または `Dockerfile` に追加する PR を*最初に*実行する必要があります。その PR がマスターに -マージされ、`fiware/orion-ci:deb` が再構築されると (Docker Hub の https://hub.docker.com/r/fiware/orion-ci/builds +マージされ、`telefonicaiot/fiware-orion:ci` が再構築されると (Docker Hub の https://hub.docker.com/r/telefonicaiot/fiware-orion/builds で進行状況を確認)、新しい機能は、GitHub アクションでテストする準備ができています。 GitHub Actions チェックは段階に分かれており、 "サポートされているテスト" セクションで説明されています。 @@ -31,7 +31,7 @@ CI の現在のバージョンは以下をサポートします: イメージをダウンロードするには: ``` -docker pull fiware/orion-ci:deb +docker pull telefonicaiot/fiware-orion:ci ``` たとえば、GitHub Actions と同じ方法でイメージを実行するには、次のようにします: @@ -39,7 +39,7 @@ docker pull fiware/orion-ci:deb ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb build -miqts functional +docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci build -miqts functional ``` インタラクティブな bash を使用してイメージを実行するには: @@ -47,7 +47,7 @@ docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/o ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host -ti -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb bash +docker run --network host -ti -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci bash ``` bash シェルを起動したら、同様の実行を行うことができます: diff --git a/ci/README.md b/ci/README.md index d6eb527d88..5871fa62ce 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,13 +1,13 @@ ## Overview GitHub Actions is enabled in this repository so each pull request is checked before being allowed to merge. -The system is based on `fiware/orion-ci:deb` which is built from master branch each time a new PR lands in master, +The system is based on `telefonicaiot/fiware-orion:ci` which is built from master branch each time a new PR lands in master, providing a clean environment with all build dependencies onboard. The Dockerfile used to build this docker is available in the `ci/deb` directory. -Note that `fiware/orion-ci:deb` is *not* rebuilt due to changes in the PR branch under test. Thus, if you are developing +Note that `telefonicaiot/fiware-orion:ci` is *not* rebuilt due to changes in the PR branch under test. Thus, if you are developing a functionality that requires a new library or base system you need to do *first* a PR adding such library or base system -to `ci/deb/build-dep.sh` and/or `Dockerfile`. Once that PR gets merged into master and `fiware/orion-ci:deb` gets rebuild -(checking progress in Dockerhub at: https://hub.docker.com/r/fiware/orion-ci/builds) your PR branch with the new +to `ci/deb/build-dep.sh` and/or `Dockerfile`. Once that PR gets merged into master and `telefonicaiot/fiware-orion:ci` gets rebuild +(checking progress in Dockerhub at: https://hub.docker.com/r/telefonicaiot/fiware-orion/builds) your PR branch with the new functionality is ready to be tested with GitHub Actions. The GitHub Actions checks are divided into stages, which are described in "Supported tests" section. @@ -30,7 +30,7 @@ the following cheatsheet can be useful: To download the image: ``` -docker pull fiware/orion-ci:deb +docker pull telefonicaiot/fiware-orion:ci ``` To run the image in the same way that GitHub Actions does, for instance: @@ -38,7 +38,7 @@ To run the image in the same way that GitHub Actions does, for instance: ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb build -miqts functional +docker run --network host --rm -e CB_NO_CACHE=ON -e FT_FROM_IX=1201 -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci build -miqts functional ``` To run the image using an interactive bash on it @@ -46,7 +46,7 @@ To run the image using an interactive bash on it ``` # Check that MongoDB server is running in your localhost:27017 cd /path/to/fiware-orion -docker run --network host -ti -v $(pwd):/opt/fiware-orion fiware/orion-ci:deb bash +docker run --network host -ti -v $(pwd):/opt/fiware-orion telefonicaiot/fiware-orion:ci bash ``` Once have a bash shell, you can do the same execution: diff --git a/ci/deb/Dockerfile b/ci/deb/Dockerfile index 3b6a2fa86d..42a635fd3e 100644 --- a/ci/deb/Dockerfile +++ b/ci/deb/Dockerfile @@ -1,8 +1,9 @@ -FROM debian:11.6-slim +FROM debian:12.1-slim ADD build.sh /opt/bin/ ADD build-dep.sh /opt/bin/ ADD makefile /opt/archive/ +ADD fuse_gtest_files.py.patch /opt/archive/ RUN ln -s /opt/bin/build.sh /usr/local/bin/build \ && /opt/bin/build-dep.sh diff --git a/ci/deb/build-dep.sh b/ci/deb/build-dep.sh index 894eb44fa0..5ee98b8e5e 100755 --- a/ci/deb/build-dep.sh +++ b/ci/deb/build-dep.sh @@ -25,15 +25,14 @@ # Install security updates apt-get -y update apt-get -y upgrade -# FIXME: python2 required by an installation script in GMock. Sad but true :( # Install dependencies apt-get -y install \ curl \ gnupg \ - python2 \ python3 \ python3-pip \ - netcat \ + python3-venv \ + netcat-traditional \ bc \ valgrind \ cmake \ @@ -50,7 +49,11 @@ apt-get -y install \ libsasl2-dev \ libgcrypt-dev +## FIXME: check note in build_source.md about the libssl1 installation hack. It will be no longer needed from MongoDB 6.0 on echo "INSTALL: MongoDB shell" \ +&& curl -L http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb --output libssl1.1_1.1.1f-1ubuntu2_amd64.deb \ +&& dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb \ +&& rm libssl1.1_1.1.1f-1ubuntu2_amd64.deb \ && curl -L https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - \ && echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \ && apt-get -y update \ @@ -58,19 +61,18 @@ echo "INSTALL: MongoDB shell" \ echo "INSTALL: python special dependencies" \ && cd /opt \ -&& pip3 install virtualenv \ -&& virtualenv /opt/ft_env --python=/usr/bin/python3 \ +&& python3 -m venv /opt/ft_env \ && . /opt/ft_env/bin/activate \ && pip install Flask==2.0.2 \ && pip install paho-mqtt==1.6.1 \ -&& pip install amqtt==0.10.1 \ +&& pip install amqtt==0.11.0b1 \ && deactivate # Recommended setting for DENABLE_AUTOMATIC_INIT_AND_CLEANUP, to be removed in 2.0.0 # see http://mongoc.org/libmongoc/current/init-cleanup.html#deprecated-feature-automatic-initialization-and-cleanup -echo "INSTALL: mongodb c driver (required by mongo c++ driver)" \ -&& curl -L https://github.com/mongodb/mongo-c-driver/releases/download/1.23.1/mongo-c-driver-1.23.1.tar.gz | tar xzC /opt/ \ -&& cd /opt/mongo-c-driver-1.23.1 \ +echo "INSTALL: mongodb c driver" \ +&& curl -L https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz | tar xzC /opt/ \ +&& cd /opt/mongo-c-driver-1.24.3 \ && mkdir cmake-build \ && cd cmake-build \ && cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. \ @@ -88,11 +90,10 @@ echo "INSTALL: libmicrohttpd" \ && make \ && make install -# FIXME: if sometimes python2 goes away the fuse_gtest_files.py would need to be migrated to python3 echo "INSTALL: gmock" \ && curl -L https://src.fedoraproject.org/repo/pkgs/gmock/gmock-1.5.0.tar.bz2/d738cfee341ad10ce0d7a0cc4209dd5e/gmock-1.5.0.tar.bz2 | tar xjC /opt/ \ && cd /opt/gmock-1.5.0 \ -&& sed -i 's/env python/env python2/' gtest/scripts/fuse_gtest_files.py \ +&& patch -p1 gtest/scripts/fuse_gtest_files.py < /opt/archive/fuse_gtest_files.py.patch \ && ./configure \ && make \ && make install @@ -109,7 +110,7 @@ echo "INSTALL: mosquitto" \ ldconfig apt-get -y clean \ -&& rm -Rf /opt/mongo-c-driver-1.23.1 \ +&& rm -Rf /opt/mongo-c-driver-1.24.3 \ && rm -Rf /opt/rapidjson-1.1.0 \ && rm -Rf /opt/libmicrohttpd-0.9.76 \ && rm -Rf /opt/mosquitto-2.0.15 \ diff --git a/ci/deb/fuse_gtest_files.py.patch b/ci/deb/fuse_gtest_files.py.patch new file mode 100644 index 0000000000..8cc5960853 --- /dev/null +++ b/ci/deb/fuse_gtest_files.py.patch @@ -0,0 +1,95 @@ +This patch adapt the original fuse_gest_files.py to Python 3 +Check build_source.md file to see how it is used + +--- fuse_gtest_files.py.orig 2023-09-01 11:26:02.036070350 +0200 ++++ fuse_gtest_files.py 2023-09-01 11:39:16.422565989 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Copyright 2009, Google Inc. + # All rights reserved. +@@ -60,7 +60,6 @@ + + import os + import re +-import sets + import sys + + # We assume that this file is in the scripts/ directory in the Google +@@ -90,8 +89,8 @@ + """ + + if not os.path.isfile(os.path.join(directory, relative_path)): +- print 'ERROR: Cannot find %s in directory %s.' % (relative_path, +- directory) ++ print ('ERROR: Cannot find %s in directory %s.' % (relative_path, ++ directory)) + print ('Please either specify a valid project root directory ' + 'or omit it on the command line.') + sys.exit(1) +@@ -123,7 +122,7 @@ + (relative_path, output_dir)) + answer = sys.stdin.readline().strip() + if answer not in ['y', 'Y']: +- print 'ABORTED.' ++ print ('ABORTED.') + sys.exit(1) + + # Makes sure the directory holding the output file exists; creates +@@ -146,8 +145,8 @@ + def FuseGTestH(gtest_root, output_dir): + """Scans folder gtest_root to generate gtest/gtest.h in output_dir.""" + +- output_file = file(os.path.join(output_dir, GTEST_H_OUTPUT), 'w') +- processed_files = sets.Set() # Holds all gtest headers we've processed. ++ output_file = open(os.path.join(output_dir, GTEST_H_OUTPUT), 'w') ++ processed_files = set() # Holds all gtest headers we've processed. + + def ProcessFile(gtest_header_path): + """Processes the given gtest header file.""" +@@ -159,7 +158,7 @@ + processed_files.add(gtest_header_path) + + # Reads each line in the given gtest header. +- for line in file(os.path.join(gtest_root, gtest_header_path), 'r'): ++ for line in open(os.path.join(gtest_root, gtest_header_path), 'r'): + m = INCLUDE_GTEST_FILE_REGEX.match(line) + if m: + # It's '#include ' - let's process it recursively. +@@ -175,7 +174,7 @@ + def FuseGTestAllCcToFile(gtest_root, output_file): + """Scans folder gtest_root to generate gtest/gtest-all.cc in output_file.""" + +- processed_files = sets.Set() ++ processed_files = set() + + def ProcessFile(gtest_source_file): + """Processes the given gtest source file.""" +@@ -187,7 +186,7 @@ + processed_files.add(gtest_source_file) + + # Reads each line in the given gtest source file. +- for line in file(os.path.join(gtest_root, gtest_source_file), 'r'): ++ for line in open(os.path.join(gtest_root, gtest_source_file), 'r'): + m = INCLUDE_GTEST_FILE_REGEX.match(line) + if m: + if 'include/' + m.group(1) == GTEST_SPI_H_SEED: +@@ -218,7 +217,7 @@ + def FuseGTestAllCc(gtest_root, output_dir): + """Scans folder gtest_root to generate gtest/gtest-all.cc in output_dir.""" + +- output_file = file(os.path.join(output_dir, GTEST_ALL_CC_OUTPUT), 'w') ++ output_file = open(os.path.join(output_dir, GTEST_ALL_CC_OUTPUT), 'w') + FuseGTestAllCcToFile(gtest_root, output_file) + output_file.close() + +@@ -242,7 +241,7 @@ + # fuse_gtest_files.py GTEST_ROOT_DIR OUTPUT_DIR + FuseGTest(sys.argv[1], sys.argv[2]) + else: +- print __doc__ ++ print (__doc__) + sys.exit(1) + + diff --git a/doc/manuals.jp/admin/build_source.md b/doc/manuals.jp/admin/build_source.md index f9352c40a9..d494a40200 100644 --- a/doc/manuals.jp/admin/build_source.md +++ b/doc/manuals.jp/admin/build_source.md @@ -1,18 +1,18 @@ # ソースからのビルド -Orion Context Broker のリファレンス配布は Debian 11 です。これは、broker を他のディストリビューションに組み込むことができないことを意味しません (実際には可能です)。このセクションでは、他のディストリビューションをビルドする方法についても説明しています。Debian を使用していない人に役立つかもしれません。ただし、"公式にサポートされている" 唯一の手順は Debian 11 用の手順です。他のものは "現状のまま" 提供され、随時時代遅れになる可能性があります。 +Orion Context Broker のリファレンス配布は Debian 12 です。これは、broker を他のディストリビューションに組み込むことができないことを意味しません (実際には可能です)。このセクションでは、他のディストリビューションをビルドする方法についても説明しています。Debian を使用していない人に役立つかもしれません。ただし、"公式にサポートされている" 唯一の手順は Debian 12 用の手順です。他のものは "現状のまま" 提供され、随時時代遅れになる可能性があります。 -## Debian 11 (正式サポート) +## Debian 12 (正式サポート) Orion Context Broker は、以下のライブラリをビルドの依存関係として使用します : * boost: 1.74 * libmicrohttpd: 0.9.76 (ソースから) -* libcurl: 7.74.0 -* openssl: 1.1.1n -* libuuid: 2.36.1 +* libcurl: 7.88.1 +* openssl: 3.0.9 +* libuuid: 2.38.1 * libmosquitto: 2.0.15 (ソースから) -* Mongo C driver: 1.23.1 (ソースから) +* Mongo C driver: 1.24.3 (ソースから) * rapidjson: 1.1.0 (ソースから) * gtest (`make unit_test` ビルディング・ターゲットのみ) : 1.5 (ソースから) * gmock (`make unit_test` ビルディング・ターゲットのみ) : 1.5 (ソースから) @@ -29,9 +29,9 @@ Orion Context Broker は、以下のライブラリをビルドの依存関係 * ソースから Mongo Driver をインストールします - wget https://github.com/mongodb/mongo-c-driver/releases/download/1.23.1/mongo-c-driver-1.23.1.tar.gz - tar xfvz mongo-c-driver-1.23.1.tar.gz - cd mongo-c-driver-1.23.1 + wget https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz + tar xfvz mongo-c-driver-1.24.3.tar.gz + cd mongo-c-driver-1.24.3 mkdir cmake-build cd cmake-build cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. @@ -94,19 +94,25 @@ Orion Context Broker には、次の手順に従って実行できる一連の * ソースから GoogleTest/Mock をインストールします。以前の URL は http://googlemock.googlecode.com/files/gmock-1.5.0.tar.bz2 でしたが、Google は2016年8月下旬にそのパッケージを削除し、機能しなくなりました。 - sudo apt-get install python2 wget https://nexus.lab.fiware.org/repository/raw/public/storage/gmock-1.5.0.tar.bz2 tar xfvj gmock-1.5.0.tar.bz2 cd gmock-1.5.0 ./configure - sed -i 's/env python/env python2/' gtest/scripts/fuse_gtest_files.py # little hack to make installation to work on Debian 11 + # システム内の fiware-orion リポジトリのローカル・コピーの場所に応じて、次の行の /path/to/fiware-orion を調整します。 + patch -p1 gtest/scripts/fuse_gtest_files.py < /path/to/fiware-orion/test/unittests/fuse_gtest_files.py.patch make sudo make install # installation puts .h files in /usr/local/include and library in /usr/local/lib sudo ldconfig # just in case... it doesn't hurt :) aarch64 アーキテクチャの場合、apt-get を使用して libxslt をインストールし、`--build=arm-linux` オプションを指定して `/configure` を実行します。 -* MongoDB をインストールします (テストはローカルホストで実行されている mongod に依存します)。詳細については、[MongoDB の公式ドキュメント](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/)を確認してください。推奨バージョンは 4.4 です (以前のバージョンで動作する可能性がありますが、お勧めしません)。 +* MongoDB をインストールします (テストはローカル・ホストで実行されている mongod に依存します)。詳細については、[MongoDB の公式ドキュメント](hhttps://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/) を確認してください。推奨バージョンは 4.4 です (以前のバージョンでも動作する可能性がありますが、お勧めしません)。 + * mongo レガシー・シェル (`mongo` コマンド) は MongoDB 5 で非推奨となり、MongoDB 6 では新しいシェル (`mongosh` コマンド) が優先されて削除されたことに注意してください。一部の機能テスト (ftest) は、`mongosh` ではなく `mongo` を使用しているため、MongoDB 6 以降を使用している場合、これが原因で失敗します。 + * Debian 12 は libssl3 に移行しましたが、一部の MongoDB バージョンでは libssl1 が必要な場合があります。`Depends: libssl1.1 (>= 1.1.1) but it is not installable` エラーが発生した場合は、次のことをテストできます ([こちら](https://askubuntu.com/a/1421959) を参照)) + + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb + sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb + rm libssl1.1_1.1.1f-1ubuntu2_amd64.deb # optional, for cleanness * ユニット・テストを実行します @@ -114,8 +120,7 @@ aarch64 アーキテクチャの場合、apt-get を使用して libxslt をイ * 機能テストと valgrind テストに必要な追加のツールをインストールします: - sudo apt-get install curl nc valgrind bc python3 python3-pip - sudo pip3 install virtualenv + sudo apt-get install curl netcat-traditional valgrind bc python3 python3-pip mosquitto * テスト・ハーネスのための環境を準備します。基本的には、`accumulator-server.py` スクリプトをコントロールの下にあるパスにインストールしなければならず、`~/bin` が推奨です。また、`/usr/bin` のようなシステム・ディレクトリにインストールすることもできますが、他のプログラムと衝突する可能性がありますので、お勧めしません。さらに、ハーネス・スクリプト (`scripts/testEnv.sh` ファイル参照) で使用されるいくつかの環境変数を設定し、必要な Python パッケージを使用して virtualenv 環境を作成します。 @@ -123,9 +128,9 @@ aarch64 アーキテクチャの場合、apt-get を使用して libxslt をイ export PATH=~/bin:$PATH make install_scripts INSTALL_DIR=~ . scripts/testEnv.sh - virtualenv /opt/ft_env --python=/usr/bin/python3 + python3 -m venv /opt/ft_env # or 'virtualenv /opt/ft_env --python=/usr/bin/python3' in some systems . /opt/ft_env/bin/activate - pip install Flask==2.0.2 paho-mqtt==1.6.1 amqtt==0.10.1 + pip install Flask==2.0.2 paho-mqtt==1.6.1 amqtt==0.11.0b1 * この環境でテスト・ハーネスを実行してください (時間がかかりますので、気をつけてください) @@ -139,7 +144,7 @@ aarch64 アーキテクチャの場合、apt-get を使用して libxslt をイ * lcov ツールをインストールします - sudo apt-get install lcov + sudo apt-get install lcov xsltproc * まず、unit_test と functional_test の成功パスを実行して、すべてが正常であることを確認します (上記参照) diff --git a/doc/manuals.jp/admin/cli.md b/doc/manuals.jp/admin/cli.md index bf75181dc6..076b43d4e3 100644 --- a/doc/manuals.jp/admin/cli.md +++ b/doc/manuals.jp/admin/cli.md @@ -32,6 +32,9 @@ broker はデフォルトでバックグラウンドで実行されるため、 - **-ipv6** : broker を IPv6 専用モードで実行します。デフォルトでは、broker は IPv4 と IPv6 の両方で動作します。-ipv4 と同時に使用することはできません。 - **-multiservice** : マルチサービス/マルチテナントモードを有効にします。[マルチ・テナンシーのセクション](../orion-api.md#multi-tenancy)を参照してください - **-db ** : 使用する MogoDB データベース、または (`-multiservice` を使用している場合) サービス単位/テナント単位のデータベースのプレフィックス ([マルチ・テナンシー](../orion-api.md#multi-tenancy)のセクションを参照してください) です。このフィールドは最大10文字までです +- **-dbURI ** : 使用する MongoDB を URI で指定します。 + URI に文字列 `${PWD}` がある場合は `-dbpwd` または環境変数 `ORION_MONGO_PASSWORD` で指定したパスワードで置き換えられます。 + このオプションは `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, `-dbAuthMech`, `-dbAuthDb`, `-dbSSL`, `-dbDisableRetryWrites` と組み合わせできません。(組み合わせた場合、Orion は起動時にエラーで終了します) - **-dbhost ** : 使用する MongoDB のホストとポートです。たとえば、`-dbhost localhost:12345` です - **-rplSet ** : 指定すれば、Orion CB が MongoDB レプリカセット (スタンドアロン MongoDB インスタンスではなく) に接続されます。使用するレプリカセットの名前は、パラメータの値です。この場合、-dbhost パラメーターは、レプリカ・セットのシードとして使用されるホスト ("," で区切られた) のリストにすることができます - **-dbTimeout ** : レプリカセット (-rplSet) を使用する場合にのみ使用され、それ以外の場合は無視されます。レプリカセットへの接続のタイムアウトをミリ秒単位で指定します @@ -107,8 +110,12 @@ broker はデフォルトでバックグラウンドで実行されるため、 - **-logLineMaxSize** : ログ行の最大長 (超過すると、Orion は `LINE TOO LONG` をログ・トレースとして出力します)。最小許容値:100バイト。デフォルト値:32キロバイト。Orion の起動後に [log admin REST API](management_api.md#log-configs-and-trace-levels) の `lineMaxSize` フィールドで変更できます - **-logInfoPayloadMaxSize** : リクエストおよび/またはレスポンス・ペイロードを出力する INFO レベルのログ・トレースの場合、これはそれらのペイロードに許可される最大サイズです。ペイロード・サイズがこの設定より大きい場合、最初の `-logInfoPayloadMaxSize` バイトのみが含まれます (そして、`(...)` の形式の省略記号がトレースに表示されます)。デフォルト値:5キロバイト。Orion の起動後に [log admin REST API](management_api.md#log-configs-and-trace-levels) で `infoPayloadMaxSize` フィールドを使用して変更できます。 - **-disableMetrics** : 'metrics' 機能をオフにします。メトリックの収集は、システムコールやセマフォが関与するため、少しコストがかかります。メトリックオーバーヘッドなしで broker を起動するには、このパラメータを使用します +- **-disableNgsiv1** : NGSIv1 操作をオフにします。 API エンドポイントのみが無効になることに注意してください。 + [`"attrsFormat": "legacy"`](../orion-api.md#subscriptionnotification) を使用する通知や、 + [`"legacyForwarding": true`](../orion-api.md#registrationprovider) を使用するレジストレーションに対応するリクエスト転送は機能します - **-insecureNotif** : 既知の CA 証明書で認証できないピアへの HTTPS 通知を許可する。これは、curl コマンドのパラメータ `-k` または `--insecureparameteres` に似ています - **-mqttMaxAge** : 未使用の MQTT 接続が保持される最大時間 (分単位)。デフォルト値: 60 +- **-logDeprecate** : 非推奨の使用法を警告として記録します。詳細については、[ドキュメントのこのセクション](../deprecated.md#log-deprecation-warnings) を参照してください。デフォルトは false です。これは、Orion の起動後に [log admin REST API](management_api.md#log-configs-and-trace-levels) を使用して `deprecated` フィールドを使用して変更できます ## 環境変数を使用した設定 @@ -135,6 +142,7 @@ Orion は、環境変数を使用した引数の受け渡しをサポートし | ORION_LOCALIP | localIp | | ORION_PORT | port | | ORION_PID_PATH | pidpath | +| ORION_MONGO_URI | dbURI | | ORION_MONGO_HOST | dbhost | | ORION_MONGO_REPLICA_SET | rplSet | | ORION_MONGO_USER | dbuser | @@ -182,6 +190,7 @@ Orion は、環境変数を使用した引数の受け渡しをサポートし | ORION_LOG_LINE_MAX_SIZE | logLineMaxSize | | ORION_LOG_INFO_PAYLOAD_MAX_SIZE | logInfoPayloadMaxSize | | ORION_DISABLE_METRICS | disableMetrics | +| ORION_DISABLE_NGSIV1 | disableNgsiv1 | | ORION_INSECURE_NOTIF | insecureNotif | | ORION_NGSIV1_AUTOCAST | ngsiv1Autocast | | ORION_MQTT_MAX_AGE | mqttMaxAge | diff --git a/doc/manuals.jp/admin/database_model.md b/doc/manuals.jp/admin/database_model.md index da821688da..52081b2be8 100644 --- a/doc/manuals.jp/admin/database_model.md +++ b/doc/manuals.jp/admin/database_model.md @@ -49,7 +49,7 @@ Orion Context Broker は、データベース内で次のサブセクション `location.coordsin` については、いくつかの形式を使用することができます : -* ポイントを表します (geo:point で使用されるもの) : +* ポイントを表します: ``` { @@ -58,7 +58,7 @@ Orion Context Broker は、データベース内で次のサブセクション } ``` -* ラインを表します (geo:line で使用されているもの) : +* ラインを表します: ``` { @@ -67,7 +67,7 @@ Orion Context Broker は、データベース内で次のサブセクション } ``` -* ポリゴンを表します (geo:box と geo:polygon で使用されるもの) : +* ポリゴンを表します: ``` { @@ -78,7 +78,7 @@ Orion Context Broker は、データベース内で次のサブセクション * 最後に、`location.coords` は、[GeoJSON](http://www.macwright.org/2015/03/23/geojson-second-bite.html) 形式で場所を表現する任意の JSON オブジェクトを保持できます。任意の GeoJSON は geo:json 属性型で使用でき、有効なオブジェクトを導入するのはユーザの責任です。上記3つのケースは、実際には "fixed" ケースの GeoJSON 表現です。 -座標ペアは、[geo-location API](../orion-api.md#simple-location-format) で使用されている順序とは反対の経度-緯度順 (longitude-latitude order) を使用することに注意してください。これは内部の [MongoDB ジオロケーション実装](http://docs.mongodb.org/manual/tutorial/query-a-2dsphere-index/) (GeoJSON に基づいています) が経度-緯度順を使用するためです。しかし、ユーザに近い他のシステム (Google マップなど) では、緯度-経度形式 (latitude-longitude format) を使用しているため、後者を API に使用しています。 +座標ペアでは経度-緯度 (longitude-latitude) の順序が使用されますが、これは[地理的クエリ (Geographical Queries)](../orion-api.md#geographica-queries)で使用される順序とは逆であることに注意してください。これは、[MongoDB の地理位置情報の内部実装](http://docs.mongodb.org/manual/tutorial/query-a-2dsphere-index/) (GeoJSON に基づく) が経度-緯度 (longitude-latitude) の順序を使用するためです。 ただし、ユーザに近い他のシステム (GoogleMaps など) は緯度経度形式 (latitude-longitude format) を使用するため、Geographical Queries API には後者を使用しました。 サンプルドキュメント : @@ -213,8 +213,9 @@ Orion Context Broker は、データベース内で次のサブセクション - **lastNotification** : 最後の通知が送信された時刻です (整数、秒を意味します)。これは、通知が送信されるたびに更新され、スロットリング違反を回避します - **throttling** : 通知の最小間隔です。0または -1 は、スロットリングがないことを意味します - **reference** : 通知の URL です。HTTPまたはMQTTのいずれかを指定します -- **mqttTopic**: MQTTトピック (MQTT 通知のみ) -- **mqttQoS**: MQTT QoS 値 (MQTT 通知のみ) +- **topic**: MQTTトピック (MQTT 通知のみ) +- **qos**: MQTT QoS 値 (MQTT 通知のみ) +- **retain**: MQTT retain 値 (MQTT 通知のみ) - **entities** : エンティティの配列 (必須) です。各エンティティの JSON には、**id**, **type**, **isPattern** および **isTypePattern** が含まれています。従来の理由から、**isPattern** は `"true"` または `"false"` (テキスト) で、**isTypePattern** は `true` または `false` (ブール値) であることに注意してください - **attrs** : 属性名の配列 (文字列) (オプション) です - **blacklist** : `attrs` をホワイトリスト (もし `blacklist` が `false` また存在しない場合) またはブラックリスト (もし `blackslist` が `true` の場合) として解釈する必要があるかどうかを指定するブール値フィールドです diff --git a/doc/manuals.jp/admin/install.md b/doc/manuals.jp/admin/install.md index c29306aff9..cd73b7ec67 100644 --- a/doc/manuals.jp/admin/install.md +++ b/doc/manuals.jp/admin/install.md @@ -26,8 +26,8 @@ Docker hub で公式の Orion docker コンテナを使用してインストー 必要なソースから ビルドした Orion をインストールする場合: -* オペレーティングシステム: Debian。リファレンス・オペレーティングシステムは Debian 11.6 ですが、それ以降の - Debian 11 バージョンでも動作するはずです +* オペレーティングシステム: Debian。リファレンス・オペレーティングシステムは Debian 12.1 ですが、それ以降の + Debian 12 バージョンでも動作するはずです * データベース: MongoDB は、Orion Context Broker がインストールされるのと同じホストで実行するか、ネットワーク経由で アクセスできる別のホストで実行する必要があります。推奨される MongoDB バージョンは 4.4 です (Orion は古いバージョンで 動作する可能性がありますが、まったくお勧めしません!) diff --git a/doc/manuals.jp/admin/logs.md b/doc/manuals.jp/admin/logs.md index 46178e9372..65898ed564 100644 --- a/doc/manuals.jp/admin/logs.md +++ b/doc/manuals.jp/admin/logs.md @@ -7,7 +7,8 @@ * [サマリ・トレース](#summary-traces) * [ログ・ローテーション](#log-rotation) * [HTTP 通知トランザクションのログの例](#log-examples-for-http-notification-transactions) -* [ログに関連するコマンドライン・オプション](#command-line-options-related-with-logs) +* [非推奨の使用法をログに記録](#log-deprecated-usages) +* [ログに関連するその他のオプション](#other-options-related-with-logs) ## ログ・ファイル @@ -146,9 +147,10 @@ time=2020-10-22T19:51:03.565Z | lvl=INFO | corr=eabce3e2-149f-11eb-a2e8-000c29df いくつかの追加の考慮事項: -* `-logInfoPayloadMaxSize` 設定は、上記のトレースのペイロードが持つ可能性のある最大サイズを指定するために - 使用されます。ペイロードがこの制限を超えると、最初の `-logInfoPayloadMaxSize` バイトのみが出力されます - (`(...)` の形式の省略記号がトレースに表示されます)。デフォルト値:5キロバイト +* `-logInfoPayloadMaxSize` CLI 設定 (または、[log admin REST API](management_api.md#log-configs-and-trace-levels) + の `-logInfoPayloadMaxSize` パラメータ) は、上記のトレース内のペイロードの最大サイズを指定するために使用されます。 + ペイロードがこの制限を超える場合、最初の情報ペイロードの最大サイズのバイトのみが出力されます (そして、`(...)` + の形式の省略記号がトレースに表示されます)。デフォルト値: 5KB * ノーティフィケーションおよびフォワーディング・トレースのレスポンス・コードは、番号 (ノーティフィケーションまたはフォワードされたリクエストの HTTP レスポンス・コードに対応) または接続の問題が発生した場合の文字列のいずれかになります。 例えば: @@ -338,13 +340,46 @@ time=2020-10-26T15:06:14.642Z | lvl=INFO | corr=c4a3192e-179c-11eb-ac8f-000c29df [トップ](#top) -## ログに関連するコマンドライン・オプション + +## 非推奨の使用法をログに記録 -このドキュメントですでに説明されているもの (`-logDir`, `-logAppend`, `-logLevel`, `-t`, `-logInfoPayloadMaxSize`, `-relogAlarms` and `-logSummary`) とは別に、次のコマンドライン・オプションはログに関連しています: +`-logDeprecate` CLI 設定 (または [ログ管理 REST API](management_api.md#log-configs-and-trace-levels) の `deprecate` パラメータ) +が使用されている場合、次の WARN トレースが生成されます: + +* NGSIv1 リクエスト (ペイロードありとペイロードなしの両方)。 注: これには、[`"attrsFormat": "legacy"`](../orion-api.md#subscriptionnotification) + を使用した通知や、[`"legacyForwarding": true`](../orion-api.md#registrationprovider) + を使用したレジストレーションに対応する転送リクエストは含まれないことに注意してください)。例えば: + +``` +time=2023-05-25T14:27:45.958Z | lvl=WARN | corr=513bd10e-fb08-11ed-8ad7-000c29583ca5 | trans=1685024865-125-00000000001 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=logTracing.cpp[171]:logInfoRequestWithPayload | msg=Deprecated NGSIv1 request received: POST /v1/queryContext, request payload (48 bytes): { "entities": [ { "type": "T1", "id": "E1" } ] }, response code: 200 +time=2023-05-25T14:27:46.041Z | lvl=WARN | corr=51490536-fb08-11ed-9782-000c29583ca5 | trans=1685024865-125-00000000002 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=logTracing.cpp[114]:logInfoRequestWithoutPayload | msg=Deprecated NGSIv1 request received: GET /v1/contextEntities/E, response code: 200 +``` + +* 位置メタデータの NGSIv1 での使用。例: + +``` +time=2023-06-08T15:14:20.999Z | lvl=WARN | corr=24fd2acc-060f-11ee-94cc-000c29583ca5 | trans=1686237259-703-00000000003 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=location.cpp[329]:getGeoJson | msg=Deprecated usage of metadata location coords detected in attribute location at entity update, please use geo:json instead +``` + +* `geo:point`, `geo:line`, `geo:box` また `geo:line` の使用 + +``` +time=2023-06-08T15:14:21.176Z | lvl=WARN | corr=2518249e-060f-11ee-9e76-000c29583ca5 | trans=1686237259-703-00000000004 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=location.cpp[353]:getGeoJson | msg=Deprecated usage of geo:point detected in attribute location at entity update, please use geo:json instead +``` + +非推奨の機能とその解決方法の詳細については、[非推奨ドキュメント](../deprecated.md) を参照してください。 + +[トップ](#top) + + +## ログに関連するその他のオプション + +このドキュメントですでに説明されているもの (`-logDir`, `-logAppend`, `-logLevel`, `-t`, `-logInfoPayloadMaxSize`, `-logDeprecate`, `-relogAlarms` および `-logSummary`) とは別に、次のコマンドライン・オプションはログに関連しています: * `-logForHumans` -* `-logLineMaxSize` +* `-logLineMaxSize` (または [ログ管理 REST API](management_api.md#log-configs-and-trace-levels) の `lineMaxSize` パラメータ) 詳細については、[コマンドライン・オプションのドキュメント](cli.md)を参照してください。 [トップ](#top) + diff --git a/doc/manuals.jp/admin/management_api.md b/doc/manuals.jp/admin/management_api.md index 63f532e9c9..761c2ac340 100644 --- a/doc/manuals.jp/admin/management_api.md +++ b/doc/manuals.jp/admin/management_api.md @@ -10,6 +10,7 @@ Orion Context Broker は、NGSI インターフェースの他に、ログ設定 curl -X PUT :/admin/log?level= curl -X PUT :/admin/log?infoPayloadMaxSize= curl -X PUT :/admin/log?lineMaxSize= +curl -X PUT :/admin/log?deprecate=true|false ``` ログ設定を取得するには : @@ -24,7 +25,8 @@ curl ::/admin/log { "infoPayloadMaxSize": 5120, "level": "DEBUG", - "lineMaxSize": 32768 + "lineMaxSize": 32768, + "deprecate": false } ``` diff --git a/doc/manuals.jp/deprecated.md b/doc/manuals.jp/deprecated.md index 467731c7d1..aa0004c89b 100644 --- a/doc/manuals.jp/deprecated.md +++ b/doc/manuals.jp/deprecated.md @@ -8,6 +8,7 @@ 推奨されなくなった機能のリストと、廃止された機能のバージョンは次のとおりです : +* Orion 3.10.0 での `geo:point`, `geo:line`, `geo:box` および `geo:polygon` 属性タイプ。代わりに `geo:json` を使用してください * Orion 3.8.0 での `GET /v2` 操作。この操作はかなり役に立たず、実際には使用されません。 * Orion 3.1.0 のサブスクリプションでの初期通知 (`skipInitialNotification` オプションと共に)。(Orion 3.2.0 で削除)。初期通知の 対象となる結果は非常に大きくなる可能性があり、ここではページネーションを適用できません (`GET/v2/entity` @@ -18,6 +19,14 @@ * Orion 2.0.0 での NGSIv1 (関連する CLI パラメータ : `-strictNgsiv1Ids`, `-ngsiv1Autocast`)。代わりに NGSIv2 API を使用してください * Orion 2.0.0 の NGSIv1 の一部としてのコンテキスト・アベイラビリティ・サブスクリプション (別名 NGSI9 サブスクリプション) (Orion 2.6.0 で削除) + * 次の操作を除く、他のすべての NGSIv1 操作は Orion 3.10.0 で削除されました: + * `PUT /v1/contextEntities/{id}` + * `DELETE /v1/contextEntities/{id}` + * `GET /v1/contextEntities/{id}/attributes/{name}` + * `POST /v1/updateContext` + * `POST /NGSI10/updateContext` + * `POST /v1/queryContext` + * `POST /NGSI10/queryContext` * `POST /v2/op/query` の `attributes` フィールドは、Orion 1.15.0 にあります。これらの属性を持つエンティティのみを返すためには、クエリに対するレスポンスにどの属性を含めるかを選択する `attrs` と、`expression` 内の `q` の単項属性フィルタ (unary attribute filter) の組み合わせです。それらを代わりに指定していください * Orion 1.14.0 では `POST /v2/op/update` の `APPEND`, `APPEND_STRICT`, `UPDATE`, `DELETE`, `REPLACE` の使用は非推奨です。`append`, `appendStrict`, `update`, `delete`, `replace` を代わりに使ってください * Orion 1.13.0 ではメタデータ ID が推奨されていません (Orion 2.2.0 で削除されました)。一方、この機能は NGSIv2 と互換性がありません。JSON 表現形式の属性名は JSON オブジェクトのキーとして使用されるため、名前を複製することはできません。一方、IDs は、属性名にプレフィックス/サフィックスを使用して簡単に実装することができます。たとえば、`temperature:ground` および `temperature:ceiling` です。 この非推奨の結果、次のオペレーションも非推奨になりました : @@ -31,7 +40,7 @@ * Orion 1.5.0 では、NGSIv2 で `dateCreated` および/または `dateModified` 属性を含めるために `optionsURL` パラメータ使用することは推奨されていません。代わりに `attrs`URI パラメータを使用してください * パス・プレフィックスとして /ngsi10 そして /ngsi9URL は、orion 1.2.0 で廃止されました。代わりに `/v1` と `/v1/registry` を使用してください * `/ngsi9` URL パスは Orion 3.8.0 で削除されました -* エンティティの場所を指定する `location` メタデータは、Orion 1.1.0 では非推奨です。エンティティの場所を指定する新しい方法は、属性の `geo:point` 型を使用することです。[Orion API の対応するセクション](orion-api.md#geospatial-properties-of-entities)を参照してください) +* エンティティの場所を指定する `location` メタデータは、Orion 1.1.0 では非推奨です。エンティティの場所を指定する新しい方法は、属性の `geo:json` 型を使用することです。[Orion API の対応するセクション](orion-api.md#geospatial-properties-of-entities)を参照してください) * Orion 0.26.1 のコマンドライン引数は廃止されました。Orion 1.0.0 で削除されました * **--silent** : エラー以外のすべてのログ出力を抑止します。代わりに `-logLevel ERROR` を使用してください * ONTIMEINTERVAL サブスクリプションは Orion 0.26.0 以降で廃止されました。Orion 1.0.0 では削除されました。ONTIMEINTERVAL サブスクリプションにはいくつかの問題があります。CB に状態 (state) を導入するため、水平スケーリングの設定をより困難にし、ページネーション/フィルタリングの導入を困難にします。実際には、ONTIMEINTERVAL 通知に基づくユース・ケースは、レセプタが queryContext を同じ頻度で実行する等価なユース・ケースに変換できるため、実際には必要ありません。ページ区切りやフィルタリングなどの queryContext の機能を利用してください @@ -43,6 +52,15 @@ * Configuration Manager のロールは、0.21.0 で非推奨になり、0.25.0 で削除されました * Associations は、0.21.0 で非推奨になり、0.25.0 で削除されました + + +## 非推奨の警告をログに記録 + +非推奨の機能の一部 (すべてではない) の使用状況は、WARN ログ・レベルで `-logDeprecate` [CLI flag](admin/cli.md) +フラグ (またはログ管理 REST API の `deprecate` パラメータ) を使用してログに記録できます。 + +詳細については、[ドキュメントのこのセクション](admin/logs.md#log-deprecated-usages)を参照してください。 + ## 古い Orion バージョンの使用 常に最新の Orion バージョンを使用することをお勧めしますが、古いバージョンを使用する場合は、次の情報を考慮してください : @@ -59,13 +77,14 @@ | **削除された機能** | **機能をサポートする Orion ラスト・バージョン** | **バージョンのリリース日** | |--------------------------------------------------------------------------------------|-------------------------------------------------|----------------------------| -| NGSIv1 (関連する CLI パラメータ : `-strictNgsiv1Ids`, `-ngsiv1Autocast`) | まだ定義されていません | まだ定義されていません | | `POST /v2/entities` オペレーションの `attributes` フィールド | まだ定義されていません | まだ定義されていません | | `APPEND`, `UPDATE`, など。`POST /v2/op/update` でのアクション・タイプ | まだ定義されていません | まだ定義されていません | | URI パラメータでの `dateCreated` および `dateModified` | まだ定義されていません | まだ定義されていません | -| `/ngsi10` および `/ngsi9` URL プレフィックス | 3.7.0 (*) | 2022年5月26日 | | エンティティのロケーションを指定する `location` メタデータ | まだ定義されていません | まだ定義されていません | | `GET /v2` 操作 | まだ定義されていません | まだ定義されていません | +| `geo:point`, `geo:line`, `geo:box` および `geo:polygon` 属性タイプ | まだ定義されていません | まだ定義されていません | +| NGSIv1 (関連する CLI パラメータ : `-strictNgsiv1Ids`, `-ngsiv1Autocast`) | 3.9.0 (*) | 2023年6月2日 | +| `/ngsi10` および `/ngsi9` URL プレフィックス | 3.7.0 (*) | 2022年5月26日 | |サブスクリプションの作成または更新時の初期通知 | 3.1.0 | 2021年6月9日 | | NGSIv1 コンテキスト・アベイラビリティ・サブスクリプション (NGSI9 サブスクリプション) | 2.5.2 | 2020年12月17日 | | Rush (関連する CLI パラメータ : `-rush`) | 2.2.0 | 2019年2月21日 | diff --git a/doc/manuals.jp/devel/README.md b/doc/manuals.jp/devel/README.md index 5e6ce4994e..ffde791c49 100644 --- a/doc/manuals.jp/devel/README.md +++ b/doc/manuals.jp/devel/README.md @@ -1,6 +1,6 @@ # 開発マニュアル -*注 : このドキュメントでは、リリース 3.8.x の Orion Context Broker について説明しています。* +*注 : このドキュメントでは、リリース 3.10.x の Orion Context Broker について説明しています。* ## 対象読者 diff --git a/doc/manuals.jp/devel/cookbook.md b/doc/manuals.jp/devel/cookbook.md index 12433e1008..5da690df72 100644 --- a/doc/manuals.jp/devel/cookbook.md +++ b/doc/manuals.jp/devel/cookbook.md @@ -193,7 +193,7 @@ Orion の機能テストは、`.test` のサフィックスを持つ、テキス 2. NAME セクション 3. SHELL-INIT セクション 4. SHELL セクション -5. EXPECT/REGEXPECT セクション +5. REGEXPECT セクション 6. TEARDOWN セクション 各セクション (ファイルの先頭から始まる著作権プリアンブルを除く) には、すべてのセクションが開始/終了する機能テスト・ハーネスを示すヘッダが必要です : @@ -201,11 +201,9 @@ Orion の機能テストは、`.test` のサフィックスを持つ、テキス * `--NAME--` * `--SHELL-INIT--` * `--SHELL--` -* `--REGEXPECT--` / `--EXPECT--` +* `--REGEXPECT--` * `--TEARDOWN--` -`--REGEXPECT--` が使用されていて、 `--EXPECT--` でなければ、期待されるセクションは正規表現を許可します。これは、これら2つの間で唯一異なるものです。 - ### 著作権のセクション このセクションは単に著作権のヘッダです。古いものをコピーしてください。必要に応じて、年を変更することを忘れないでください。 @@ -278,7 +276,7 @@ echo "0x. description of test step 0x" echo "===============================" ``` -これらのステップは、現在のステップを出力の次のものから分離するために、`echo` を2回呼び出すことで終了します。 これは非常に重要なことです。出力を読むのがずっと**簡単**です。それは、**EXPECT/REGEXPECT** セクションに続くセクションに一致する必要があります。 +これらのステップは、現在のステップを出力の次のものから分離するために、`echo` を2回呼び出すことで終了します。 これは非常に重要なことです。出力を読むのがずっと**簡単**です。それは、**REGEXPECT** セクションに続くセクションに一致する必要があります。 エンティティの作成などの典型的なステップは次のようになります : @@ -303,22 +301,16 @@ echo echo ``` -### EXPECT/REGEXPECT セクション +### REGEXPECT セクション まず、テストハーネス (`test/functionalTest/testHarness.sh`) は、2つのタイプの 'expect sections' を認めます。いずれか : ``` ---EXPECT-- -``` - -または - -``` ---REG-EXPECT-- +--REGEXPECT-- ``` -**1つを選ぶ**必要があります。ほとんど**すべて**の現在の functests が、この `--REG-EXPECT--` タイプを使用します。 --REG-EXPECT-- の利点は、正規表現を `REGEX()` 構文を使用して追加できることです。これは日付の比較や Orion によって作成され、レジストレーション id や 相関器 (correlator)、単純なタイムスタンプのような、レスポンスで返された IDs の比較にとって非常に重要です。重要な制限は、REG-EXPECT セクションには、1行に **REGEX** が1つしかないということです。 +正規表現を `REGEX()` 構文を使用して追加できることです。これは日付の比較や Orion によって作成され、レジストレーション id や 相関器 (correlator)、単純なタイムスタンプのような、レスポンスで返された IDs の比較にとって非常に重要です。重要な制限は、REGEXPECT セクションには、1行に **REGEX** が1つしかないということです。 -つまり、REG-EXPECT セクションでは、問題のテスト・ステップからの予想される出力を追加します。たとえば、SHELL セクションについての上記のサブ・チャプターの例 "01. Create entity E1 with attribute A1" は、 +つまり、問題のテスト・ステップからの予想される出力を追加します。たとえば、SHELL セクションについての上記のサブ・チャプターの例 "01. Create entity E1 with attribute A1" は、 この対応する部分を --REGEXPECT-- セクションに置いてください : ``` @@ -341,6 +333,8 @@ Date: REGEX(.*) * 相関器 (correlator) は36文字の文字列で、ハイフンを含む16進数です。この正規表現は、各ハイフンがどこに来なければならないかを正確に知るようになりましたが、実際には必要ではありません * `Date` HTTP ヘッダの2番目の REGEX もより詳細に記述できます。また必要ありません +REGEXPECT セクションにはコメントを含めることができます。`--REGEXPECT--` セクション内の `##` で始まる行は無視されます。 + ### TEARDOWN セクション ここでプロセスが強制終了され、データベースが削除されるため、次のテスト・ケースがクリーン・スレートで開始されます。最も一般的なコマンドは次のとおりです : diff --git a/doc/manuals.jp/orion-api.md b/doc/manuals.jp/orion-api.md index 6d102c54e9..b2687f966b 100644 --- a/doc/manuals.jp/orion-api.md +++ b/doc/manuals.jp/orion-api.md @@ -31,7 +31,6 @@ - [組み込み名に一致するユーザ属性またはメタデータ (User attributes or metadata matching builtin name)](#user-attributes-or-metadata-matching-builtin-name) - [Datetime サポート](#datetime-support) - [エンティティの地理空間プロパティ (Geospatial properties of entities)](#geospatial-properties-of-entities) - - [シンプル・ロケーション・フォーマット (Simple Location Format)](#simple-location-format) - [GeoJSON](#geojson) - [シンプル・クエリ言語 (Simple Query Language)](#simple-query-language) - [地理的クエリ (Geographical Queries)](#geographical-queries) @@ -50,8 +49,7 @@ - [`$unset`](#unset) - [`$set` と `$unset` の組み合わせ](#combining-set-and-unset) - [Orion が演算子を処理する方法](#how-orion-deals-with-operators) - - [現在の制限](#current-limitations) - - [エンティティの作成または置換](#create-or-replace-entities) + - [エンティティの作成または置換操作での使用法](#usage-in-create-or-replace-entity-operations) - [属性とメタデータのフィルタリング (Filtering out attributes and metadata)](#filtering-out-attributes-and-metadata) - [メタデータ更新のセマンティクス (Metadata update semantics)](#metadata-update-semantics) - [`overrideMetadata` オプション](#overridemetadata-option) @@ -80,6 +78,7 @@ - [変更タイプに基づくサブスクリプション (Subscriptions based in alteration type)](#subscriptions-based-in-alteration-type) - [ページネーション (Pagination)](#pagination) - [結果の順序付け (Ordering Results)](#ordering-results) + - [同値 (Ties)](#ties) - [API ルート (API Routes)](#api-routes) - [エンティティの操作 (Entities Operations)](#entities-operations) - [エンティティのリスト (Entities List)](#entities-list) @@ -602,7 +601,7 @@ Orion は階層スコープをサポートしているため、エンティテ - `DateTime`: ISO8601 形式で日付を識別します。これらの属性は、クエリ演算子の greater-than, less-than, greater-or-equal, less-or-equal および range で使用できます。詳細については、このドキュメントの [Datetime サポート](#datetime-support)のセクションを確認してください -- `geo:point`, `geo:line`, `geo:box`, `geo:polygon` および `geo:json`。それらには、エンティティの場所に関連する特別な +- `geo:json`。それには、エンティティの場所に関連する特別な セマンティクスがあります。`null` 値を持つ属性は地理クエリでは考慮されず、エンティティごとに1つの地理空間属性の制限に カウントされません。[エンティティの地理空間プロパティ](#geospatial-properties-of-entities)のセクションを 参照してください @@ -645,9 +644,9 @@ Orion は階層スコープをサポートしているため、エンティテ - `entityUpdate`: 通知をトリガーする更新が更新であったが、実際の変更ではなかった場合 - `entityChange`: 通知をトリガーする更新が実際の変更を伴う更新であった場合、または実際の変更ではなく `forcedUpdate` が使用された場合 - - `entityDelete`: 通知をトリガーする更新がエンティティの削除操作であった場合。この場合、 - [`condition`](#subscriptionsubjectcondition) 内の `attrs` フィールドは無視されます (エンティティを削除する通常 - の方法、たとえば `DELETE /v2/entities/E` には属性が含まれないことに注意してください) + - `entityDelete`: 通知をトリガーする更新がエンティティの削除操作であった場合 + +- `servicePath` (タイプ: `Text`): エンティティが属する[サービス・パス](#service-path)を指定します。 通常の属性と同様に、`q` フィルタと `orderBy` (`alterationType` を除く) で使用できます。 ただし、リソース URLs では使用できません。 @@ -666,7 +665,7 @@ Orion は階層スコープをサポートしているため、エンティテ 無視します。Orion は一般的に属性タイプを無視するため、このメタデータはほとんどの場合必要ありませんが、属性タイプが Orion の特別なセマンティックを持つ 2 つのケースがあることに注意してください: - `DateTime` - - Geo-location types (`geo:point`, `geo:line`, `geo:box`, `geo:polygon` および `geo:json`) + - `geo:json` 現時点では、'ignoreType' は地理位置情報タイプに対してのみサポートされており、この方法により、エンティティごとに1つの 地理位置情報のみという制限を克服するメカニズムが可能になります @@ -833,9 +832,8 @@ Orion は常に `YYYY-MM-DDThh:mm:ss.sssZ` の形式を使用して日時属性/ コンテキストのエンティティの地理空間プロパティは、通常のコンテキスト属性を用いて表すことができます。地理空間的 プロパティの提供は、地理的クエリの解決を可能にします。 -Orion では 2 つの異なる構文がサポートされています: +Orion では、次の構文がサポートされています: -- *Simple Location Format*。これは、開発者とユーザが既存のエンティティに素早く簡単に追加できる、非常に軽量な形式です - *GeoJSON*。[GeoJSON](https://tools.ietf.org/html/draft-butler-geojson-06) は、JSON (JavaScript Object Notation) に 基づく地理空間データ交換フォーマットです。GeoJSON は、より高度な柔軟性を提供し、ポイント高度またはより複雑な 地理空間形状、たとえば、 @@ -891,64 +889,6 @@ Orion は、バックエンド・データベースによって課されるリ メタデータに設定されていない場所であることを考慮してください (上記の例では `location` 属性)。`ignoreType` を `true` に設定して定義されたすべての場所は Orion によって無視され、この意味で地理クエリには影響しません。 - - -### シンプル・ロケーション・フォーマット (Simple Location Format) - -シンプル・ロケーション・フォーマットは、基本的なジオメトリ (*point*, *line*, *box*, *polygon*) をサポートし、 -地理的位置をエンコードする際の典型的な使用例をカバーしています。[GeoRSS Simple](http://www.georss.org/simple.html) -に触発されています。 - -シンプル・ロケーション・フォーマットは、地球表面上の複雑な位置を表すことを意図していないことに注目してください。 -たとえば、高度座標を取得する必要のあるアプリケーションでは、GeoJSON をそのエンティティの地理空間プロパティの表現形式 -として使用する必要があります。 - -シンプル・ロケーション・フォーマットでエンコードされたロケーションを表すコンテキスト属性は、次の構文に準拠している必要が -あります: - -- 属性型は、(`geo:point`, `geo:line`, `geo:box`, `geo:polygon`) のいずれかの値でなければなりません -- 属性値は座標のリストでなければなりません。既定では、座標は、 - [WGS84 Lat Long](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84), - [EPSG::4326](http://www.opengis.net/def/crs/EPSG/0/4326) 座標リファレンス・システム (CRS) を使用して定義され、 - 緯度と経度の単位は小数です。このような座標リストは、`type` 属性で指定されたジオメトリをエンコードすることを可能に - し、以下で定義される特定の規則に従ってエンコードされます: - - `geo:point` 型: 属性値には有効な緯度経度のペアをカンマで区切った文字列を含める必要があります - - `geo:line` 型: 属性値に有効な緯度経度ペアの文字列配列を含める必要があります。少なくとも2つのペアが必要です - - `geo:polygon` 型: 属性値に有効な緯度経度ペアの文字列配列を含める必要があります。少なくとも4つのペアが存在 - しなければならず、最後のペアは最初のものと同一であるため、ポリゴンには最低 3つの実際のポイントがあります。 - ポリゴンを構成する線分が定義された領域の外縁に残るように、座標ペアを適切に順序付けする必要があります。たとえば、 - 次のパス ```[0,0], [0,2], [2,0], [2, 2]``` は無効なポリゴン定義の例です。Orion は、入力データが前者の条件を - 満たさない場合にエラーを発生させる必要があります - - `geo:box` 型: バウンディング・ボックスは矩形領域であり、地図の範囲や関心のある大まかな領域を定義するためによく - 使用されます。ボックスは、緯度経度ペアの2つの長さの文字列配列によって表現されます。最初のペアは下のコーナー、 - 2番目のペアは上のコーナーです - -注: [この文献](https://github.com/geojson/geojson-spec/wiki/Proposal---Circles-and-Ellipses-Geoms#discussion-notes)で、 -実装のさまざまな欠点を説明しているように、サークル・ジオメトリはサポートされていません。 - -以下の例は、参照される構文を示しています: - -``` -{ - "location": { - "value": "41.3763726, 2.186447514", - "type": "geo:point" - } -} -``` - -``` -{ - "location": { - "value": [ - "40.63913831188419, -8.653321266174316", - "40.63881265804603, -8.653149604797363" - ], - "type": "geo:box" - } -} -``` - ### GeoJSON @@ -1134,8 +1074,8 @@ color を一致させます。また、`q=title=='20'` は文字列 "20" にマ - `georel=disjoint`。一致するエンティティは、リファレンス・参照ジオメトリと**交差しない**エンティティであることを 示します -`geometry` はクエリを解決する際に使われるリファレンス・シェイプを定義することを可能にします。次のジオメトリ (シンプル・ -ロケーション・フォーマットを参照) をサポートする必要があります。 +`geometry` はクエリを解決する際に使われるリファレンス・シェイプを定義することを可能にします。次のジオメトリ +をサポートします: - `geometry=point` は、地球表面上の点を定義します - `geometry=line` は、折れ線を定義します @@ -1171,7 +1111,7 @@ Orion が地理的なクエリを解決できない場合、レスポンスの H 地理的クエリを解決する際には、シンプル・クエリ言語を介して、API 実装は、マッチング目的で使用される地理的位置を含む エンティティ属性を決定する責任があります。この目的のために、以下の規則を遵守しなければなりません。 -- エンティティに、GeoJSON または、シンプル・ロケーション・フォーマットとしてエンコードされた場所に対応する属性がない +- エンティティに、GeoJSON としてエンコードされた場所に対応する属性がない 場合、そのようなエンティティは地理空間プロパティを宣言せず、地理的なクエリに一致しません - エンティティがロケーションに対応する1つの属性のみを公開する場合、そのような属性は地理的クエリを解決する際に使用 されます @@ -1588,46 +1528,18 @@ PUT /v2/entities/E/attrs/A "1つの演算子のみを使用する" ルールの唯一の例外は、[上記のように](#combining-set-and-unset)、 一緒に使用できる `$set` と `$unset` の場合です。 - - -### 現在の制限 - - - -#### エンティティの作成または置換 - -更新演算子は、エンティティの作成または置換操作では使用できません。たとえば、この方法で -エンティティを作成する場合: - -``` -POST /v2/entities -{ - "id": "E", - "type": "T", - "A": { - "value": { "$inc": 2 }, - "type": "Number" - } -} -``` - -作成されたばかりのエンティティの属性Aは、(文字通り) 次の JSON オブジェクトを値として持ちます -: `{ "$inc": 2 }` + -ただし、既存のエンティティに新しい属性を追加する場合は機能することに注意してください。 -たとえば、属性AとBを持つエンティティEがすでにあり、この方法でCを追加する場合: +### エンティティの作成または置換操作での使用法 -``` -POST /v2/entities/E/attrs -{ - "C": { - "value": { "$inc": 2 }, - "type": "Number" - } -} -``` +更新演算子は、エンティティの作成または置換操作で使用できます。特に: -Cは値 `2` で作成されます。 +* 数値演算子は 0 を基準とします。たとえば、`{"$inc": 4}` の結果は 4、`{$mul: 1000}` の結果は 0 になります +* `$set` は空のオブジェクト (`{}`) を参照として受け取ります。たとえば、`"$set": {"X": 1}` は単に `{"X": 1}` になります +* `$push` と `$addToSet` は空の配列 (`[]`) を参照として受け取ります。たとえば、`{"$push": 4}` は `[ 4 ]` になります +* `$pull`、`$pullAll`、および `$unset` は無視されます。これは、演算子が使用される属性がエンティティ内に作成されないことを意味します。 + たとえば、2つの属性を持つエンティティを作成すると、最初の属性には演算子 `"A": {"value": {"$unset": 1}, ... }"` が含まれ、2番目の属性には + `"B" が含まれます。 {"value": 3, ...}` (通常のもの) は、属性 `B` を1つだけ持つエンティティになります @@ -2622,6 +2534,48 @@ GET /v2/entities?orderBy=temperature,!humidity 5. Array 6. Boolean + + +### 同値 (Ties) + +同値 (ties) の場合、Orion は `orderBy` を使用した同じクエリが同じ結果シーケンスをもたらすことを保証しないことに +注意してください。つまり、同じクエリが繰り返されると、関連付けられた結果が異なる相対順序で返される可能性があります。 +これは、MongoDB (Orion によって使用される基礎となる DB) が実装する動作と同じです +([この MongoDB ドキュメント](https://www.mongodb.com/docs/manual/reference/method/cursor.sort/) を参照) + +これはページネーションの場合に問題となる可能性があることに注意してください。次の例で説明してみましょう。 +4つのエンティティ (E1~E4) があるとします: + +* E1, 属性 `colour` を `blue` に設定 +* E2, 属性 `colour` を `blue` に設定 +* E3, 属性 `colour` を `red` に設定 +* E4, 属性 `colour` を `red` に設定 + +`GET /v2/entities?orderBy=colour` の最初の実行では `E1, E2, E3, E4` が返される可能性がありますが、クエリの2回目の実行では +`E2, E1, E4, E3` が返され、3回目の実行では `E1, E2, E4, E3` などが返される可能性があります。 + +次のような典型的なページ分割された一連のクエリを考えてみましょう: + +``` +GET /v2/entities?orderBy=colour&limit=3&offset=0 +GET /v2/entities?orderBy=colour&limit=3&offset=3 +``` + +クエリ間で同じ結果の順序が保証されていないため、最初のクエリでは順序が `E1, E2, E3, E4` になる可能性があります (したがって、 +クライアントは `E1, E2, E3` を取得します)。2回目のクエリでは、シーケンスが (`E1、E2、E4、E3`) のようになる可能性があります。 +したがって、クライアントは (予期された `E4` ではなく) 再び `E3` を取得します。 + +別の同様の (より複雑なケース) については、[この issue](https://github.com/telefonicaid/fiware-orion/issues/4394) +で説明しています。 + +解決策は、別の属性を `orderBy` に追加して、同値が発生しないことを保証することです。この意味で、`dateCreated` +[組み込み属性](#builtin-attributes) は非常に良い候補であるため、上記のクエリは次のように適応できます: + +``` +GET /v2/entities?orderBy=colour,dateCreated&limit=3&offset=0 +GET /v2/entities?orderBy=colour,dateCreated&limit=3&offset=3 +``` + # API ルート (API Routes) @@ -2793,8 +2747,11 @@ _**リクエスト・ペイロード**_ "value": 60 }, "location": { - "value": "41.3763726, 2.1864475", - "type": "geo:point", + "value": { + "type": "Point", + "coordinates": [2.1864475, 41.3763726] + }, + "type": "geo:json", "metadata": { "crs": { "value": "WGS84" @@ -2891,8 +2848,11 @@ _**レスポンス・ペイロード**_ "type": "Number" }, "location": { - "value": "41.3763726, 2.1864475", - "type": "geo:point", + "value": { + "type": "Point", + "coordinates": [2.1864475, 41.3763726] + }, + "type": "geo:json", "metadata": { "crs": { "value": "WGS84", @@ -2972,8 +2932,11 @@ _**レスポンス・ペイロード**_ "type": "Number" }, "location": { - "value": "41.3763726, 2.1864475", - "type": "geo:point", + "value": { + "type": "Point", + "coordinates": [2.1864475, 41.3763726] + }, + "type": "geo:json", "metadata": { "crs": { "value": "WGS84", @@ -3797,13 +3760,14 @@ time=... | lvl=WARN | corr=... | trans=... | from=... | srv=... | subsrv=... | c `mqtt` オブジェクトには、次のサブフィールドが含まれています: -| パラメータ | オプション | タイプ | 説明 | -|------------|------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------| -| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | -| `topic` | | string | 使用する MQTT トピックを表します | -| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | -| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | -| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | +| パラメータ | オプション | タイプ | 説明 | +|------------|------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------| +| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | +| `topic` | | string | 使用する MQTT トピックを表します | +| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | +| `retain` | ✓ | boolean | MQTT は、サブスクリプションに関連付けられた通知で使用する値を保持します (`true` または `false`)。 省略した場合は、retain には `false` が使用されます | +| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | +| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | MQTT 通知の詳細については、[MQTT 通知](user/mqtt_notifications.md)のドキュメントを参照してください。 @@ -3834,16 +3798,17 @@ MQTT 通知の詳細については、[MQTT 通知](user/mqtt_notifications.md) `mqttCustom` オブジェクトには、次のサブフィールドが含まれています: -| パラメータ | オプション | タイプ | 説明 | -|------------|------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | -| `topic` | | string | 使用する MQTT トピックを表します。このフィールドに対してもマクロ置換が実行されます (つまり、属性に基づくトピック) | -| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | -| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | -| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | -| `payload` | ✓ | string | 通知で使用されるテキスト・ベースのペイロード。空の文字列または省略された場合、デフォルトのペイロード ([通知メッセージ](#notification-messages)のセクションを参照) が使用されます。`null` の場合、通知にはペイロードは含まれません | -| `json` | ✓ | object | 通知で使用される JSON ベースのペイロード。詳細については、[JSON ペイロード](#json-payloads) セクションを参照してください | -| `ngsi` | ✓ | object | 通知で使用されるペイロードの NGSI パッチ。詳細については、[NGSI ペイロードのパッチ適用](#ngsi-payload-patching) セクションを参照してください | +| パラメータ | オプション | タイプ | 説明 | +|------------|------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `url` | | string | 使用するMQTT ブローカーのエンドポイントを表します。URL は `mqtt://` で始まる必要があり、パスを含めることはできません (ホストとポートのみが含まれます) | +| `topic` | | string | 使用する MQTT トピックを表します。このフィールドに対してもマクロ置換が実行されます (つまり、属性に基づくトピック) | +| `qos` | ✓ | number | サブスクリプションに関連付けられた通知で使用する MQTT QoS 値 (0, 1, または 2)。省略した場合、QoS 0 が使用されます | +| `retain` | ✓ | boolean | MQTT は、サブスクリプションに関連付けられた通知で使用する値を保持します (`true` または `false`)。 省略した場合は、retain には `false` が使用されます | +| `user` | ✓ | string | ブローカーとの接続を認証するために使用されるユーザ名 | +| `passwd` | ✓ | string | ブローカー認証のパスフレーズ。サブスクリプション情報を取得するときは常に難読化されます (例: `GET /v2/subscriptions`) | +| `payload` | ✓ | string | 通知で使用されるテキスト・ベースのペイロード。空の文字列または省略された場合、デフォルトのペイロード ([通知メッセージ](#notification-messages)のセクションを参照) が使用されます。`null` の場合、通知にはペイロードは含まれません | +| `json` | ✓ | object | 通知で使用される JSON ベースのペイロード。詳細については、[JSON ペイロード](#json-payloads) セクションを参照してください | +| `ngsi` | ✓ | object | 通知で使用されるペイロードの NGSI パッチ。詳細については、[NGSI ペイロードのパッチ適用](#ngsi-payload-patching) セクションを参照してください | `payload`, `json` または `ngsi` は同時に使用できません。相互に排他的です。 diff --git a/doc/manuals.jp/user/context_providers.md b/doc/manuals.jp/user/context_providers.md index 559e3262ac..3ec8694e4e 100644 --- a/doc/manuals.jp/user/context_providers.md +++ b/doc/manuals.jp/user/context_providers.md @@ -122,3 +122,21 @@ POST http://sensor48.mycity.com/v2/op/query `GET /v2/entities?options=skipForwarding`)。この場合、クエリは CB ローカル・コンテキスト情報のみを使用して評価 されます。`skipForwarding` を転送しても効果がないことに注意してください (更新をローカルで CB に解釈する場合は、 追加/作成セマンティクスを使用して更新要求を使用するだけです)。 + +## コンテキスト・プロバイダによるページネーション + +エンティティ・クエリ (`GET /v2/entities`) の [pagination](../orion-api.md#pagination) 機能は、コンテキスト・プロバイダでも機能します。 +`limit` パラメータと `offset` パラメータは、次の順序でエンティティに適用されます: + +* まず、コンテキスト・プロバイダ自体に格納されるエンティティ +* 次に、コンテキスト・プロバイダに格納されているエンティティがレジストレーション時間順に並べられます (つまり、レジストレーション時間の + 短いコンテキスト・プロバイダのエンティティが、レジストレーション時間の長いコンテキスト・プロバイダのエンティティの前に並べられます) + +これがどのように機能するかの詳細な例については、[このテスト ケース](../../test/functionalTest/cases/4149_pagination_for_request_forwarding/pagination_for_request_forwarding.test) +を参照してください。 + +追加の考慮事項: + +* `fiware-total-count` ヘッダで返されるカウントには、Context Broker と コンテキスト・プロバイダに保存されているエンティティの合計が含まれます +* この場合、`orderBy` は機能しないことに注意してください。 +* NGSIv2 ベースのコンテキスト・プロバイダでのみ動作します (NGSIv1 CPr は非推奨です) diff --git a/doc/manuals.jp/user/mqtt_notifications.md b/doc/manuals.jp/user/mqtt_notifications.md index c355abd1e3..26d85437af 100644 --- a/doc/manuals.jp/user/mqtt_notifications.md +++ b/doc/manuals.jp/user/mqtt_notifications.md @@ -27,6 +27,7 @@ HTTP 通知とは別に、Orion は MQTT を使用して通知できます。こ * `topic` に、使用する MQTT トピックを指定します * `qos`: サブスクリプションに関連付けられた通知 (0, 1 または 2) で使用する MQTTQoS 値を指定します。 これはオプションのフィールドです。省略した場合、QoS0 が使用されます +* `retain`: サブスクリプションに関連付けられた通知で使用する MQTT 保持値を指定します (`true` または `false`)。これはオプションのフィールドで、省略した場合は retain には `false` が使用されます * `user` および `passwd`: MQTT broker がユーザ/パスワードベースの認証を必要とする場合に使用される オプションのフィールド。使用する場合は、両方のフィールドを一緒に使用する必要があります。セキュリティ上の理由から、 サブスクリプション情報を取得するときは常にパスワードが使用されないことに注意してください (例: `GET /v2/subscriptions`) @@ -48,7 +49,7 @@ MQTT サブスクリプションのカスタム通知 ([Orion API 仕様のカ * `httpCustom` の代わりに `mqttCustom` が使用されます * `mqtt` で使用されているのと同じフィールドを `mqttCustom` で使用できます * `headers`, `qs` と `method` は MQTT で同等ではないため、使用できません -* マクロ置換は `topic` および `payload` フィールドで実行されます。`url`, `qos`, `user` と `passwd` は固定値です +* マクロ置換は `topic` および `payload` フィールドで実行されます。`url`, `qos`, `retain`, `user` と `passwd` は固定値です ## 接続管理 @@ -83,3 +84,11 @@ TLS を使用して公開するには (Orion ではまだサポートされて ``` mosquitto_pub -d --insecure --cafile file.pem -h -p 1883 -u -P -t '/topic' -m 'payload' ``` + +Mosquitto Broker に保持されているすべてのメッセージをクリアするには: + +``` +sudo service mosquitto stop +sudo rm /var/lib/mosquitto/mosquitto.db +sudo systemctl start mosquitto.service +``` diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index 1d764d2a5b..67a6ed6f48 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -1,18 +1,18 @@ # Building from sources -Orion Context Broker reference distribution is Debian 11. This doesn't mean that the broker cannot be built in other distributions (actually, it can). This section also includes indications on how to build in other distributions, just in the case it may help people that don't use Debian. However, note that the only "officially supported" procedure is the one for Debian 11; the others are provided "as is" and can get obsolete from time to time. +Orion Context Broker reference distribution is Debian 12. This doesn't mean that the broker cannot be built in other distributions (actually, it can). This section also includes indications on how to build in other distributions, just in the case it may help people that don't use Debian. However, note that the only "officially supported" procedure is the one for Debian 12; the others are provided "as is" and can get obsolete from time to time. -## Debian 11 (officially supported) +## Debian 12 (officially supported) The Orion Context Broker uses the following libraries as build dependencies: * boost: 1.74 * libmicrohttpd: 0.9.76 (from source) -* libcurl: 7.74.0 -* openssl: 1.1.1n -* libuuid: 2.36.1 +* libcurl: 7.88.1 +* openssl: 3.0.9 +* libuuid: 2.38.1 * libmosquitto: 2.0.15 (from source) -* Mongo C driver: 1.23.1 (from source) +* Mongo C driver: 1.24.3 (from source) * rapidjson: 1.1.0 (from source) * gtest (only for `make unit_test` building target): 1.5 (from sources) * gmock (only for `make unit_test` building target): 1.5 (from sources) @@ -30,9 +30,9 @@ commands that require root privilege): * Install the Mongo Driver from source. - wget https://github.com/mongodb/mongo-c-driver/releases/download/1.23.1/mongo-c-driver-1.23.1.tar.gz - tar xfvz mongo-c-driver-1.23.1.tar.gz - cd mongo-c-driver-1.23.1 + wget https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz + tar xfvz mongo-c-driver-1.24.3.tar.gz + cd mongo-c-driver-1.24.3 mkdir cmake-build cd cmake-build cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. @@ -93,19 +93,25 @@ The Orion Context Broker comes with a suite of unit, valgrind and end-to-end tes * Install Google Test/Mock from sources. Previously the URL was http://googlemock.googlecode.com/files/gmock-1.5.0.tar.bz2 but Google removed that package in late August 2016 and it is no longer working. - sudo apt-get install python2 wget https://nexus.lab.fiware.org/repository/raw/public/storage/gmock-1.5.0.tar.bz2 tar xfvj gmock-1.5.0.tar.bz2 cd gmock-1.5.0 ./configure - sed -i 's/env python/env python2/' gtest/scripts/fuse_gtest_files.py # little hack to make installation to work on Debian 11 + # Adjust /path/to/fiware-orion in the next line accordingly to where you local copy of fiware-orion repo is in your system + patch -p1 gtest/scripts/fuse_gtest_files.py < /path/to/fiware-orion/ci/deb/fuse_gtest_files.py.patch make sudo make install # installation puts .h files in /usr/local/include and library in /usr/local/lib sudo ldconfig # just in case... it doesn't hurt :) In the case of the aarch64 architecture, install libxslt using apt-get, and run `./configure` with `--build=arm-linux` option. -* Install MongoDB (tests rely on mongod running in localhost). Check [the official MongoDB documentation](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/) for details. Recommended version is 4.4 (it may work with previous versions, but we don't recommend it). +* Install MongoDB (tests rely on mongod running in localhost). Check [the official MongoDB documentation](hhttps://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/) for details. Recommended version is 4.4 (it may work with previous versions, but we don't recommend it). + * Note that mongo legacy shell (the `mongo` command) has been deprecated in MongoDB 5 and removed in MongoDB 6 in favour of the new shell (`mongosh` command). Some functional tests (ftest) will fail due to this if you use MongoDB 6 or beyond, as they are suited to use `mongo` and not `mongosh`. + * Debian 12 has stepped to libssl3 but some MongoDB versions may require libssl1. In the case you get a `Depends: libssl1.1 (>= 1.1.1) but it is not installable` error, you can test the following (reference [here](https://askubuntu.com/a/1421959)) + + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb + sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb + rm libssl1.1_1.1.1f-1ubuntu2_amd64.deb # optional, for cleanness * Run unit test @@ -113,8 +119,7 @@ In the case of the aarch64 architecture, install libxslt using apt-get, and run * Install additional required tools for functional and valgrind tests: - sudo apt-get install curl nc valgrind bc python3 python3-pip - sudo pip3 install virtualenv + sudo apt-get install curl netcat-traditional valgrind bc python3 python3-pip mosquitto * Prepare the environment for test harness. Basically, you have to install the `accumulator-server.py` script and in a path under your control, `~/bin` is the recommended one. Alternatively, you can install them in a system directory such as `/usr/bin` but it could collide with an other programs, thus it is not recommended. In addition, you have to set several environment variables used by the harness script (see `scripts/testEnv.sh` file) and create a virtualenv environment with the required Python packages. @@ -122,9 +127,9 @@ In the case of the aarch64 architecture, install libxslt using apt-get, and run export PATH=~/bin:$PATH make install_scripts INSTALL_DIR=~ . scripts/testEnv.sh - virtualenv /opt/ft_env --python=/usr/bin/python3 + python3 -m venv /opt/ft_env # or 'virtualenv /opt/ft_env --python=/usr/bin/python3' in some systems . /opt/ft_env/bin/activate - pip install Flask==2.0.2 paho-mqtt==1.6.1 amqtt==0.10.1 + pip install Flask==2.0.2 paho-mqtt==1.6.1 amqtt==0.11.0b1 * Run test harness in this environment (it takes some time, please be patient). @@ -138,7 +143,7 @@ You can generate coverage reports for the Orion Context Broker using the followi * Install the lcov tool - sudo apt-get install lcov + sudo apt-get install lcov xsltproc * Do first a successful pass for unit_test and functional_test, to check that everything is ok (see above) diff --git a/doc/manuals/admin/cli.md b/doc/manuals/admin/cli.md index 102f0732a4..0899b45255 100644 --- a/doc/manuals/admin/cli.md +++ b/doc/manuals/admin/cli.md @@ -46,6 +46,12 @@ The list of available options is the following: [service/tenant database separation](../orion-api.md#multi-tenancy). This field is restricted to 10 characters max length. +- **-dbURI ** : The URI to use the MongoDB. + If the URI contains the string `${PWD}`, it will be replaced with the password + specified in `-dbpwd` or the environment variable `ORION_MONGO_PASSWORD`. + This option cannot be combined with `-dbhost`, `-rplSet`, `-dbTimeout`, `-dbuser`, + `-dbAuthMech`, `-dbAuthDb`, `-dbSSL` and `-dbDisableRetryWrites` (if you attempt to do that + Orion will exit with an error on startup). - **-dbhost **. The MongoDB host and port to use, e.g. `-dbhost localhost:12345`. - **-rplSet **. If used, Orion CB connnects to a @@ -178,9 +184,13 @@ The list of available options is the following: - **-logInfoPayloadMaxSize**. For those log traces at INFO level that print request and/or response payloads, this is the maximum allowed size for those payloads. If the payload size is greater than this setting, then only the first `-logInfoPayloadMaxSize` bytes are included (and an ellipsis in the form of `(...)` is shown in trace). Default value: 5 KBytes. It can be changed after Orion startup with the [log admin REST API](management_api.md#log-configs-and-trace-levels), with the `infoPayloadMaxSize` field. - **-disableMetrics**. To turn off the 'metrics' feature. Gathering of metrics is a bit costly, as system calls and semaphores are involved. Use this parameter to start the broker without metrics overhead. +- **-disableNgsiv1**. To turn off NGSIv1 operations. Note that only API endpoints are disabled, notifications using + [`"attrsFormat": "legacy"`](../orion-api.md#subscriptionnotification) or forward requests corresponding to registrations + using [`"legacyForwarding": true`](../orion-api.md#registrationprovider) will work. - **-insecureNotif**. Allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates. This is similar to the `-k` or `--insecure` parameteres of the curl command. - **-mqttMaxAge**. Max time (in minutes) that an unused MQTT connection is kept. Default: 60 +- **-logDeprecate**. Log deprecation usages as warnings. More information in [this section of the documentation](../deprecated.md#log-deprecation-warnings). Default is: false. It can be changed after Orion startup with the [log admin REST API](management_api.md#log-configs-and-trace-levels), with the `deprecated` field ## Configuration using environment variables @@ -207,6 +217,7 @@ Two facts have to be taken into account: | ORION_LOCALIP | localIp | | ORION_PORT | port | | ORION_PID_PATH | pidpath | +| ORION_MONGO_URI | dbURI | | ORION_MONGO_HOST | dbhost | | ORION_MONGO_REPLICA_SET | rplSet | | ORION_MONGO_USER | dbuser | @@ -254,6 +265,8 @@ Two facts have to be taken into account: | ORION_LOG_LINE_MAX_SIZE | logLineMaxSize | | ORION_LOG_INFO_PAYLOAD_MAX_SIZE | logInfoPayloadMaxSize | | ORION_DISABLE_METRICS | disableMetrics | +| ORION_DISABLE_NGSIV1 | disableNgsiv1 | | ORION_INSECURE_NOTIF | insecureNotif | | ORION_NGSIV1_AUTOCAST | ngsiv1Autocast | | ORION_MQTT_MAX_AGE | mqttMaxAge | +| ORION_LOG_DEPRECATE | logDeprecate | diff --git a/doc/manuals/admin/database_model.md b/doc/manuals/admin/database_model.md index 9cc19811af..ae438dbef6 100644 --- a/doc/manuals/admin/database_model.md +++ b/doc/manuals/admin/database_model.md @@ -89,7 +89,7 @@ Fields: Regarding `location.coords` in can use several formats: -* Representing a point (the one used by geo:point): +* Representing a point: ``` { @@ -98,7 +98,7 @@ Regarding `location.coords` in can use several formats: } ``` -* Representing a line (the one used by geo:line): +* Representing a line: ``` { @@ -107,7 +107,7 @@ Regarding `location.coords` in can use several formats: } ``` -* Representing a polygon (the one used by geo:box and geo:polygon): +* Representing a polygon: ``` { @@ -123,10 +123,10 @@ Regarding `location.coords` in can use several formats: "fixed" cases. Note that coordinate pairs use the longitude-latitude order, which is opposite to the order used -in the [Simple Location Format](../orion-api.md#simple-location-format). This is due to the internal +in the [Geographical Queries](../orion-api.md#geographica-queries). This is due to the internal [MongoDB geolocation implementation](http://docs.mongodb.org/manual/tutorial/query-a-2dsphere-index/), (which is based in GeoJSON) uses longitude-latitude order. However, other systems closer -to users (e.g. GoogleMaps) use latitude-longitude format, so we have used the latter for the API. +to users (e.g. GoogleMaps) use latitude-longitude format, so we have used the latter for the Geographical Queries API. Example document: @@ -283,8 +283,9 @@ Fields: is updated each time a notification is sent, to avoid violating throttling. - **throttling**: minimum interval between notifications. 0 or -1 means no throttling. - **reference**: the URL for notifications, either HTTP or MQTT -- **mqttTopic**: MQTT topic (only in MQTT notifications) -- **mqttQoS**: MQTT QoS value (only in MQTT notifications) +- **topic**: MQTT topic (only in MQTT notifications) +- **qos**: MQTT QoS value (only in MQTT notifications) +- **retain**: MQTT retain value (only in MQTT notifications) - **entities**: an array of entities (mandatory). The JSON for each entity contains **id**, **type**, **isPattern** and **isTypePattern**. Note that, due to legacy reasons, **isPattern** may be `"true"` or `"false"` (text) while diff --git a/doc/manuals/admin/install.md b/doc/manuals/admin/install.md index a915685d79..80fdf6b09f 100644 --- a/doc/manuals/admin/install.md +++ b/doc/manuals/admin/install.md @@ -23,8 +23,8 @@ In the case you install using the official Orion docker container at Dockerhub, In the case you are installing Orion building from sources you need: -* Operating system: Debian. The reference operating system is Debian 11.6 - but it should work also in any later Debian 11 version. +* Operating system: Debian. The reference operating system is Debian 12.1 + but it should work also in any later Debian 12 version. * Database: MongoDB is required to run either in the same host where Orion Context Broker is to be installed or in a different host accessible through the network. The recommended MongoDB version is 4.4 (Orion may work with older versions but we don't recommend it at all!). diff --git a/doc/manuals/admin/logs.md b/doc/manuals/admin/logs.md index e856eba33f..192e835dbe 100644 --- a/doc/manuals/admin/logs.md +++ b/doc/manuals/admin/logs.md @@ -7,7 +7,8 @@ * [Summary traces](#summary-traces) * [Log rotation](#log-rotation) * [Log examples for HTTP notification transactions](#log-examples-for-http-notification-transactions) -* [Command line options related with logs](#command-line-options-related-with-logs) +* [Log deprecated usages](#log-deprecated-usages) +* [Other options related with logs](#other-options-related-with-logs) ## Log file @@ -190,8 +191,9 @@ time=2020-10-22T19:51:03.565Z | lvl=INFO | corr=eabce3e2-149f-11eb-a2e8-000c29df Some additional considerations: -* The `-logInfoPayloadMaxSize` setting is used to specify the maximum size that the payloads in the - above traces may have. If the payload overpasses this limit, then only the first `-logInfoPayloadMaxSize` +* The `-logInfoPayloadMaxSize` CLI setting (or `infoPayloadMaxSize` parameter in the [log admin REST API](management_api.md#log-configs-and-trace-levels)) + is used to specify the maximum size that the payloads in the + above traces may have. If the payload overpasses this limit, then only the first info payload max size bytes are printed (and an ellipsis in the form of `(...)` is shown in traces). Default value: 5 Kbytes. * The response code in notifications and forwarding traces can be either a number (corresponding to the HTTP response code of the notification or forwarded request) or a string when some connectivity problem @@ -398,12 +400,44 @@ time=2020-10-26T15:06:14.642Z | lvl=INFO | corr=c4a3192e-179c-11eb-ac8f-000c29df [Top](#top) -## Command line options related with logs -Apart from the ones already described in this document (`-logDir`, `-logAppend`, `-logLevel`, `-t`, `-logInfoPayloadMaxSize`, `-relogAlarms` and `-logSummary`), the following command line options are related with logs: +## Log deprecated usages + +If `-logDeprecate` CLI setting is used (or `deprecate` parameter in the [log admin REST API](management_api.md#log-configs-and-trace-levels)) the +following WARN traces are generated: + +* NGSIv1 requests (both with and without payload). Note this doesn't + include notifications using [`"attrsFormat": "legacy"`](../orion-api.md#subscriptionnotification) or forward requests corresponding + to registrations using [`"legacyForwarding": true`](../orion-api.md#registrationprovider)). For instance: + +``` +time=2023-05-25T14:27:45.958Z | lvl=WARN | corr=513bd10e-fb08-11ed-8ad7-000c29583ca5 | trans=1685024865-125-00000000001 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=logTracing.cpp[171]:logInfoRequestWithPayload | msg=Deprecated NGSIv1 request received: POST /v1/queryContext, request payload (48 bytes): { "entities": [ { "type": "T1", "id": "E1" } ] }, response code: 200 +time=2023-05-25T14:27:46.041Z | lvl=WARN | corr=51490536-fb08-11ed-9782-000c29583ca5 | trans=1685024865-125-00000000002 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=logTracing.cpp[114]:logInfoRequestWithoutPayload | msg=Deprecated NGSIv1 request received: GET /v1/contextEntities/E, response code: 200 +``` + +* Usages NGSIv1 usages of location metadata. Example: + +``` +time=2023-06-08T15:14:20.999Z | lvl=WARN | corr=24fd2acc-060f-11ee-94cc-000c29583ca5 | trans=1686237259-703-00000000003 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=location.cpp[329]:getGeoJson | msg=Deprecated usage of metadata location coords detected in attribute location at entity update, please use geo:json instead +``` + +* Usages of `geo:point`, `geo:line`, `geo:box` or `geo:line`. + +``` +time=2023-06-08T15:14:21.176Z | lvl=WARN | corr=2518249e-060f-11ee-9e76-000c29583ca5 | trans=1686237259-703-00000000004 | from=127.0.0.1 | srv=s1 | subsrv=/A | comp=Orion | op=location.cpp[353]:getGeoJson | msg=Deprecated usage of geo:point detected in attribute location at entity update, please use geo:json instead +``` + +Get more information about deprecated features and how to overcome them in the [deprecation documentation](../deprecated.md). + +[Top](#top) + + +## Other options related with logs + +Apart from the ones already described in this document (`-logDir`, `-logAppend`, `-logLevel`, `-t`, `-logInfoPayloadMaxSize`, `-logDeprecate`, `-relogAlarms` and `-logSummary`), the following command line options are related with logs: * `-logForHumans` -* `-logLineMaxSize` +* `-logLineMaxSize` (or `lineMaxSize` parameter in the [log admin REST API](management_api.md#log-configs-and-trace-levels)) Please have a look to the [command line options documentation](cli.md) for more information about them. diff --git a/doc/manuals/admin/management_api.md b/doc/manuals/admin/management_api.md index ae0921e6e9..0ae196cefb 100644 --- a/doc/manuals/admin/management_api.md +++ b/doc/manuals/admin/management_api.md @@ -11,6 +11,7 @@ To change the log config: curl -X PUT :/admin/log?level= curl -X PUT :/admin/log?infoPayloadMaxSize= curl -X PUT :/admin/log?lineMaxSize= +curl -X PUT :/admin/log?deprecate=true|false ``` To retrieve the log config: @@ -25,7 +26,8 @@ which response follows the following pattern: { "infoPayloadMaxSize": 5120, "level": "DEBUG", - "lineMaxSize": 32768 + "lineMaxSize": 32768, + "deprecate": false } ``` diff --git a/doc/manuals/deprecated.md b/doc/manuals/deprecated.md index 26690cff98..a786106392 100644 --- a/doc/manuals/deprecated.md +++ b/doc/manuals/deprecated.md @@ -15,6 +15,7 @@ not maintained or evolved any longer. In particular: A list of deprecated features and the version in which they were deprecated follows: +* `geo:point`, `geo:line`, `geo:box` and `geo:polygon` attribute types in Orion 3.10.0. Use `geo:json` instead. * `GET /v2` operation in Orion 3.8.0. This operation is pretty useless and not actually used. * Initial notification in subscriptions (along with `skipInitialNotification` option) in Orion 3.1.0. (removed in Orion 3.2.0). The results covered by initial notification can be very large and we cannot apply pagination here @@ -27,6 +28,14 @@ A list of deprecated features and the version in which they were deprecated foll Use NGSIv2 API instead. * Context availability subscriptions (AKA NGSI9 subscriptions), as part of NGSIv1, in Orion 2.0.0 (removed in Orion 2.6.0) + * All the other NGSIv1 operations removed in Orion 3.10.0, except the following ones: + * `PUT /v1/contextEntities/{id}` + * `DELETE /v1/contextEntities/{id}` + * `GET /v1/contextEntities/{id}/attributes/{name}` + * `POST /v1/updateContext` + * `POST /NGSI10/updateContext` + * `POST /v1/queryContext` + * `POST /NGSI10/queryContext` * `attributes` field in `POST /v2/op/query` is in Orion 1.15.0. It is a combination of `attrs` (to select which attributes to include in the response to the query) and unary attribute filter in `q` within `expression` (to return only entities which have these attributes). Use them instead. @@ -50,7 +59,7 @@ A list of deprecated features and the version in which they were deprecated foll use `/v1` and `/v1/registry` instead. * `/ngsi9` URL paths removed in Orion 3.8.0 * `location` metadata to specify entity location is deprecated in Orion 1.1.0. The new way - of specifying entity location is to use `geo:point` type for the attribute (see details in + of specifying entity location is to use `geo:json` type for the attribute (see details in [the corresponding section of the Orion API specification](orion-api.md#geospatial-properties-of-entities). * Deprecated command line argument in Orion 0.26.1 (removed in Orion 1.0.0). * **--silent**. Suppress all log output except errors (Please use *-logLevel ERROR* instead) @@ -68,6 +77,14 @@ A list of deprecated features and the version in which they were deprecated foll * Configuration Manager role (deprecated in 0.21.0, removed in 0.25.0) * Associations (deprecated in 0.21.0, removed in 0.25.0). +## Log deprecation warnings + +Some (not all) usages of deprecated features can be logged using the `-logDeprecate` [CLI flag](admin/cli.md) +(or `deprecate` parameter in the [log admin REST API](admin/management_api.md#log-configs-and-trace-levels)) +in the WARN log level). + +Have a look to [this section of the documentation](admin/logs.md#log-deprecated-usages) for more detail about this. + ## Using old Orion versions Although you are encouraged to use always the newest Orion version, take into account the following @@ -90,15 +107,16 @@ The following table provides information about the last Orion version supporting | **Removed feature** | **Last Orion version supporting feature** | **That version release date** | |----------------------------------------------------------------------------|-------------------------------------------|---------------------------------| -| NGSIv1 API (along with CLI: `-strictNgsiv1Ids` and `-ngsiv1Autocast`) | Not yet defined | Not yet defined | | `attributes` field in `POST /v2/entities` operation | Not yet defined | Not yet defined | | `APPEND`, `UPDATE`, etc. action types in `POST /v2/op/update` | Not yet defined | Not yet defined | | `dateCreated` and `dateModified` in `options` URI parameter | Not yet defined | Not yet defined | -| `/ngsi10` and `/ngsi9` URL prefixes | 3.7.0 (*) | May 26th, 2022 | | `location` metadata to specify entity location | Not yet defined | Not yet defined | | `GET /v2` operation | Not yet defined | Not yet defined | +| `geo:point`, `geo:line`, `geo:box` and `geo:polygon` attribute types | Not yet defined | Not yet defined | +| NGSIv1 API (along with CLI: `-strictNgsiv1Ids` and `-ngsiv1Autocast`) | 3.9.0 (*) | June 2nd, 2023 | +| `/ngsi10` and `/ngsi9` URL prefixes | 3.7.0 (*) | May 26th, 2022 | | Initial notification upon subscription creation or update | 3.1.0 | June 9th, 2021 | -| NGSIv1 Context availability subscriptions (NGSI9 suscriptions) | 2.5.2 | December 17th, 2020 | +| NGSIv1 Context availability subscriptions (NGSI9 suscriptions) | 2.5.2 | December 17th, 2020 | | Rush (along with CLI: `-rush`) | 2.2.0 | February 21st, 2019 | | `id` metadata (and associated NGSIv1 operations) | 2.1.0 | December 19th, 2018 | | XML API | 0.28.0 | February 29th, 2016 | diff --git a/doc/manuals/devel/README.md b/doc/manuals/devel/README.md index d5a095dcf4..3fb3a8bbe8 100644 --- a/doc/manuals/devel/README.md +++ b/doc/manuals/devel/README.md @@ -1,6 +1,6 @@ # Development Manual -*Note: This document describes Orion Context Broker as of release 3.8.x.* +*Note: This document describes Orion Context Broker as of release 3.10.x.* ## Intended audience The intended audience of this manual is developers that need to understand the internals of the Orion Context Broker diff --git a/doc/manuals/devel/cookbook.md b/doc/manuals/devel/cookbook.md index 100a163302..5d75a4ddff 100644 --- a/doc/manuals/devel/cookbook.md +++ b/doc/manuals/devel/cookbook.md @@ -187,7 +187,7 @@ A functional test file contains six sections: 2. NAME section 3. SHELL-INIT section 4. SHELL section -5. EXPECT/REGEXPECT section +5. REGEXPECT section 6. TEARDOWN section Each section (except the Copyright preamble, that starts at the beginning of the file) must have a header, that tells the functional test harness where every section starts/ends: @@ -195,11 +195,9 @@ Each section (except the Copyright preamble, that starts at the beginning of the * `--NAME--` * `--SHELL-INIT--` * `--SHELL--` -* `--REGEXPECT--` / `--EXPECT--` +* `--REGEXPECT--` * `--TEARDOWN--` -If `--REGEXPECT--` is used (and not `--EXPECT--`), then the expected section permits regular expressions. That is the only different between these two. - ### Copyright section This section is simply for the Copyright header. Copy an old one. Try to remember to change the year, if necessary. @@ -275,7 +273,7 @@ echo "0x. description of test step 0x" echo "===============================" ``` -and the steps end with two calls to `echo`, to separate the current step from the next in the output. This is pretty important as it makes it **so much** easier to read the output, which must match what is in the section that follows, the **EXPECT/REGEXPECT** section. +and the steps end with two calls to `echo`, to separate the current step from the next in the output. This is pretty important as it makes it **so much** easier to read the output, which must match what is in the section that follows, the **REGEXPECT** section. A typical step (e.g. to create an entity) looks like this: @@ -300,22 +298,16 @@ echo echo ``` -### EXPECT/REGEXPECT Section +### REGEXPECT Section First of all, the test harness (`test/functionalTest/testHarness.sh`) admits two types of 'expect sections'. Either ``` ---EXPECT-- -``` - -or - -``` ---REG-EXPECT-- +--REGEXPECT-- ``` -You have to **pick one**. Pretty much **all** current functests use the `--REG-EXPECT--` type. The advantage with --REG-EXPECT-- is that it permits to add regular expressions using the `REGEX()` syntax, which is very important for the comparison of dates, or IDs created by Orion and returned in the response, like a registration id or a correlator or a simple timestamp. An important limitation is that there can only be **one REGEX** per line in the REG-EXPECT section. +It permits to add regular expressions using the `REGEX()` syntax, which is very important for the comparison of dates, or IDs created by Orion and returned in the response, like a registration id or a correlator or a simple timestamp. An important limitation is that there can only be **one REGEX** per line in the REGEXPECT section. -That said, in the REG-EXPECT section, just add what is the expected output from the test step in question. For example, the example "01. Create entity E1 with attribute A1" from the above sub-chapter about the SHELL section would +That said, just add what is the expected output from the test step in question. For example, the example "01. Create entity E1 with attribute A1" from the above sub-chapter about the SHELL section would have this corresponding piece in the --REGEXPECT-- section: ``` @@ -339,6 +331,8 @@ Note the two occurrences of `REGEX()`, for the correlator and the date: where each hyphen must come, however, it's not really necesary. * The second REGEX, for the `Date` HTTP header could also be more elaborated. Also not necessary. +You can include comments in the REGEXPECT section. Any line starting with `##` in the `--REGEXPECT--` section is ignored. + ### TEARDOWN Section This is where processes are killed and databases are removed, so that the following test case will start with a clean slate. The most typical commands used are: diff --git a/doc/manuals/orion-api.md b/doc/manuals/orion-api.md index 60f9ed9865..23ecd1f5c0 100644 --- a/doc/manuals/orion-api.md +++ b/doc/manuals/orion-api.md @@ -31,7 +31,6 @@ - [User attributes or metadata matching builtin name](#user-attributes-or-metadata-matching-builtin-name) - [Datetime support](#datetime-support) - [Geospatial properties of entities](#geospatial-properties-of-entities) - - [Simple Location Format](#simple-location-format) - [GeoJSON](#geojson) - [Simple Query Language](#simple-query-language) - [Geographical Queries](#geographical-queries) @@ -50,8 +49,7 @@ - [`$unset`](#unset) - [Combining `$set` and `$unset`](#combining-set-and-unset) - [How Orion deals with operators](#how-orion-deals-with-operators) - - [Current limitations](#current-limitations) - - [Create or replace entities](#create-or-replace-entities) + - [Usage in create or replace entity operations](#usage-in-create-or-replace-entity-operations) - [Filtering out attributes and metadata](#filtering-out-attributes-and-metadata) - [Metadata update semantics](#metadata-update-semantics) - [`overrideMetadata` option](#overridemetadata-option) @@ -80,6 +78,7 @@ - [Subscriptions based in alteration type](#subscriptions-based-in-alteration-type) - [Pagination](#pagination) - [Ordering Results](#ordering-results) + - [Ties](#ties) - [API Routes](#api-routes) - [Entities Operations](#entities-operations) - [Entities List](#entities-list) @@ -629,7 +628,7 @@ meaning: operators greater-than, less-than, greater-or-equal, less-or-equal and range. For further information check the section [Datetime support](#datetime-support) of this documentation. -* `geo:point`, `geo:line`, `geo:box`, `geo:polygon` and `geo:json`. They have special semantics +* `geo:json`. It has special semantics related with entity location. Attributes with `null` value will not be taken into account in geo-queries and they doesn't count towards the limit of one geospatial attribute per entity. See [Geospatial properties of entities](#geospatial-properties-of-entities) section. @@ -676,6 +675,8 @@ the subscriptions based in alteration type features (see [Subscription based in * `entityChange` if the update that triggers the notification was an update with an actual change or not an actual change but with `forcedUpdate` in use * `entityDelete` if the update that triggers the notification was a entity delete operation +* `servicePath` (type: `Text`): specifies the [service path](#service-path) to which the entity belongs. + Like regular attributes, they can be used in `q` filters and in `orderBy` (except `alterationType`). However, they cannot be used in resource URLs. @@ -694,7 +695,7 @@ semantics associated to the attribute type. Note that Orion ignored attribute ty this metadata is not needed most of the cases, but there are two cases in which attribute type has an special semantic for Orion: * `DateTime` - * Geo-location types (`geo:point`, `geo:line`, `geo:box`, `geo:polygon` and `geo:json`) + * `geo:json` At the present moment `ignoreType` is supported only for geo-location types, this way allowing a mechanism to overcome the limit of only one geo-location per entity (more details @@ -862,10 +863,7 @@ The geospatial properties of a context entity can be represented by means of reg context attributes. The provision of geospatial properties enables the resolution of geographical queries. -Two different syntaxes are supported by Orion: - -* *Simple Location Format*. It is meant as a very lightweight format for developers and users to - quickly and easily add to their existing entities. +The following syntax is supported by Orion: * *GeoJSON*. [GeoJSON](https://tools.ietf.org/html/draft-butler-geojson-06) is a geospatial data interchange format based on the JavaScript Object Notation (JSON). @@ -924,73 +922,6 @@ is the one without `ignoreType` set to `true` metadata (`location` attribute in the locations defined with `ignoreType` set to `true` are ignored by Orion and, in this sense, doesn't take part in geo-queries. -### Simple Location Format - -Simple Location Format supports basic geometries ( *point*, *line*, *box*, *polygon* ) and covers -the typical use cases when encoding geographical locations. It has been inspired by -[GeoRSS Simple](http://www.georss.org/simple.html). - -It is noteworthy that the Simple Location Format is not intended to represent complex positions on -Earth surface. -For instance, applications that require to capture altitude coordinates will have to use GeoJSON as -representation format for the geospatial properties of their entities. - -A context attribute representing a location encoded with the Simple Location Format -must conform to the following syntax: - -* The attribute type must be one of the following values: (`geo:point`, `geo:line`, `geo:box` or - `geo:polygon`). -* The attribute value must be a list of coordinates. By default, coordinates are defined - using the [WGS84 Lat Long](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84), - [EPSG::4326](http://www.opengis.net/def/crs/EPSG/0/4326) coordinate reference system (CRS), - with latitude and longitude units of decimal degrees. Such coordinate list allow to encode - the geometry specified by the `type` attribute and are encoded according to the specific - rules defined below: - - * Type `geo:point`: the attribute value must contain a string containing a - valid latitude-longitude pair, separated by comma. - * Type `geo:line`: the attribute value must contain a string array of - valid latitude-longitude pairs. There must be at least two pairs. - * Type `geo:polygon`: the attribute value must contain a string array - of valid latitude-longitude pairs. - There must be at least four pairs, with the last being identical to the first - (so a polygon has a minimum of three actual points). - Coordinate pairs should be properly ordered so that the line segments - that compose the polygon remain on the outer edge of the defined area. - For instance, the following path, ```[0,0], [0,2], [2,0], [2, 2]```, is an example of an invalid - polygon definition. - Orion should raise an error when none of the former conditions are met by input data. - * Type `geo:box`: A bounding box is a rectangular region, often used to define the extents of - a map or a rough area of interest. A box is represented by a two-length string array of - latitude-longitude pairs. - The first pair is the lower corner, the second is the upper corner. - -Note: Circle geometries are not supported, as the [literature](https://github.com/geojson/geojson-spec/wiki/Proposal---Circles-and-Ellipses-Geoms#discussion-notes) -describes different shortcomings for implementations. - -The examples below illustrate the referred syntax: - -``` -{ - "location": { - "value": "41.3763726, 2.186447514", - "type": "geo:point" - } -} -``` - -``` -{ - "location": { - "value": [ - "40.63913831188419, -8.653321266174316", - "40.63881265804603, -8.653149604797363" - ], - "type": "geo:box" - } -} -``` - ### GeoJSON A context attribute representing a location encoded using GeoJSON must conform to the following @@ -1191,7 +1122,7 @@ provide more information about the relationship. The following values are recogn reference geometry. `geometry` allows to define the reference shape to be used when resolving the query. - The following geometries (see [Simple Location Format](#simple-location-format)) must be supported: + The following geometries are supported: + `geometry=point`, defines a point on the Earth surface. + `geometry=line`, defines a polygonal line. @@ -1229,8 +1160,8 @@ the API implementation is responsible for determining which entity attribute contains the geographical location to be used for matching purposes. To this aim, the following rules must be followed: -* If an entity has no attribute corresponding to a location (encoded as GeoJSON or the - Simple Location Format), then such an entity has not declared any geospatial property and will not +* If an entity has no attribute corresponding to a location (encoded as GeoJSON), + then such an entity has not declared any geospatial property and will not match any geographical query. * If an entity only exposes one attribute corresponding to a location, then such an attribute will @@ -1629,41 +1560,19 @@ So be careful of avoiding these situations. The only exception to "use only one operator" rule is the case of `$set` and `$unset`, that can be used together [as described above](#combining-set-and-unset). -### Current limitations - -#### Create or replace entities - -Update operators cannot be used in entity creation or replace operations. For instance if -you create an entity this way: - -``` -POST /v2/entities -{ - "id": "E", - "type": "T", - "A": { - "value": { "$inc": 2 }, - "type": "Number" - } -} -``` +### Usage in create or replace entity operations -the attribute A in the just created entity will have as value (literally) this JSON object: `{ "$inc": 2 }`. +Update operators can be used in entity creation or replace operations. In particular: -However, note that the case of adding new attributes to existing entities will work. For instance if -we already have an entity E with attributes A and B and we append C this way: - -``` -POST /v2/entities/E/attrs -{ - "C": { - "value": { "$inc": 2 }, - "type": "Number" - } -} -``` - -then C will be created with value `2`. +* Numeric operators takes 0 as reference. For instance, `{"$inc": 4}` results in 4, + `{$mul: 1000}` results in 0, etc. +* `$set` takes the empty object (`{}`) as reference. For instance, `"$set": {"X": 1}` results in just `{"X": 1}` +* `$push` and `$addToSet` take the empty array (`[]`) as reference. For instance, `{"$push": 4}` + results in `[ 4 ]`. +* `$pull`, `$pullAll` and `$unset` are ignored. This means that the attribute in which the operator is used + is not created in the entity. For instance, creating an entity with 2 attributes, the first one containing an operator + `"A": {"value": {"$unset": 1}, ... }"` and the second one `"B": {"value": 3, ...}`, just a normal one, will result in an + entity with just one attribute, `B`. ## Filtering out attributes and metadata @@ -2644,6 +2553,42 @@ From lowest to highest: 5. Array 6. Boolean +### Ties + +Note that in the cases of ties, Orion doesn't guarantee that the same query using `orderBy` will result in the same +results sequence. In other words, the tied results could be returned in different relative order when the same query is +repeated. This is the same behaviour that MongoDB (the underlying DB used by Orion) implements (see [this MongoDB documentation](https://www.mongodb.com/docs/manual/reference/method/cursor.sort/). + +Note this may be problematic in the case of pagination. Let's illustrate with the following example. Consider we have four entities (E1 to E4) + +* E1, with attribute `colour` set to `blue` +* E2, with attribute `colour` set to `blue` +* E3, with attribute `colour` set to `red` +* E4, with attribute `colour` set to `red` + +A first execution of `GET /v2/entities?orderBy=colour` could return `E1, E2, E3, E4` but a second execution of the query +could `E2, E1, E4, E3`, a third execution could return `E1, E2, E4, E3`, etc. + +Let's consider a typical paginated sequence of queries like this: + +``` +GET /v2/entities?orderBy=colour&limit=3&offset=0 +GET /v2/entities?orderBy=colour&limit=3&offset=3 +``` + +The same sequence of results is not guaranteed among queries, so in the first query the sequence could be `E1, E2, E3, E4` (so +client would get `E1, E2, E3`) but in the second query it could be (`E1, E2, E4, E3`) so the client will get `E3` again +(instead of the expected `E4`). + +Another similar (more complex case) is described in [this issue](https://github.com/telefonicaid/fiware-orion/issues/4394)). + +The solution is to add an attribute to `orderBy` to guarantee that ties doesn't occur. In this sense, `dateCreated` [builtin attributes](#builtin-attributes) is a very good candidate, so the above queries could be adapted the following way: + +``` +GET /v2/entities?orderBy=colour,dateCreated&limit=3&offset=0 +GET /v2/entities?orderBy=colour,dateCreated&limit=3&offset=3 +``` + # API Routes ## Entities Operations @@ -2801,8 +2746,11 @@ Example: "value": 60 }, "location": { - "value": "41.3763726, 2.1864475", - "type": "geo:point", + "value": { + "type": "Point", + "coordinates": [2.1864475, 41.3763726] + }, + "type": "geo:json", "metadata": { "crs": { "value": "WGS84" @@ -2894,8 +2842,11 @@ Example: "type": "Number" }, "location": { - "value": "41.3763726, 2.1864475", - "type": "geo:point", + "value": { + "type": "Point", + "coordinates": [2.1864475, 41.3763726] + }, + "type": "geo:json", "metadata": { "crs": { "value": "WGS84", @@ -2974,8 +2925,11 @@ Example: "type": "Number" }, "location": { - "value": "41.3763726, 2.1864475", - "type": "geo:point", + "value": { + "type": "Point", + "coordinates": [2.1864475, 41.3763726] + }, + "type": "geo:json", "metadata": { "crs": { "value": "WGS84", @@ -3759,6 +3713,7 @@ A `mqtt` object contains the following subfields: | `url` | | string | Represent the MQTT broker endpoint to use. URL must start with `mqtt://` and never contains a path (it only includes host and port) | | `topic` | | string | Represent the MQTT topic to use | | `qos` | ✓ | number | MQTT QoS value to use in the notifications associated to the subscription (0, 1 or 2). If omitted then QoS 0 is used. | +| `retain` | ✓ | boolean | MQTT retain value to use in the notifications associated to the subscription (`true` or `false`). If omitted then retain `false` is used. | | `user` | ✓ | string | User name used to authenticate the connection with the broker. | | `passwd` | ✓ | string | Passphrase for the broker authentication. It is always obfuscated when retrieving subscription information (e.g. `GET /v2/subscriptions`). | @@ -3792,6 +3747,7 @@ A `mqttCustom` object contains the following subfields. | `url` | | string | Represent the MQTT broker endpoint to use. URL must start with `mqtt://` and never contains a path (it only includes host and port) | | `topic` | | string | Represent the MQTT topic to use. Macro replacement is also performed for this field (i.e: a topic based on an attribute ) | | `qos` | ✓ | number | MQTT QoS value to use in the notifications associated to the subscription (0, 1 or 2). If omitted then QoS 0 is used. | +| `retain` | ✓ | boolean | MQTT retain value to use in the notifications associated to the subscription (`true` or `false`). If omitted then retain `false` is used. | | `user` | ✓ | string | User name used to authenticate the connection with the broker. | | `passwd` | ✓ | string | Passphrase for the broker authentication. It is always obfuscated when retrieving subscription information (e.g. `GET /v2/subscriptions`). | | `payload` | ✓ | string | Text-based payload to be used in notifications. In case of empty string or omitted, the default payload (see [Notification Messages](#notification-messages) sections) is used. If `null`, notification will not include any payload. | diff --git a/doc/manuals/user/context_providers.md b/doc/manuals/user/context_providers.md index 025a22c44a..9b8848c50f 100644 --- a/doc/manuals/user/context_providers.md +++ b/doc/manuals/user/context_providers.md @@ -160,3 +160,20 @@ Some additional comments: forwarding to CPrs. In this case, the query is evaluated using exclusively CB local context information. Note that in forwarding `skipForwarding` has no effect (if you want an update to be interpreted locally to the CB just use an update request with append/creation semantics). + +## Pagination with Context Providers + +The [pagination](../orion-api.md#pagination) functionality in entity queries (`GET /v2/entities`) also works with Context Providers. The +`limit` and `offset` parameters are applied to entities ordered as follow: + +* First, entities stored in Context Broker itself. +* Next, entities stored in Context Providers, ordered by registration time (i.e. the entities from the Context Provider with lesser + registration time are ordered before the entities of the Context Provider with greater registration time). + +Please have a look to [this test case](../../test/functionalTest/cases/4149_pagination_for_request_forwarding/pagination_for_request_forwarding.test) for a detailed example on how this works. + +Some additional considerations: + +* The count returned in `fiware-total-count` header includes the sum of entities stored in Context Broker and in the Context Providers +* Note that `orderBy` doesn't work in this case. +* It only works with NGSIv2 based Context Providers (NGSIv1 CPrs are deprecated) diff --git a/doc/manuals/user/mqtt_notifications.md b/doc/manuals/user/mqtt_notifications.md index 08f7bd5654..a106e90010 100644 --- a/doc/manuals/user/mqtt_notifications.md +++ b/doc/manuals/user/mqtt_notifications.md @@ -30,6 +30,8 @@ The following elements can be used within `mqtt`: * `topic` to specify the MQTT topic to use * `qos`: to specify the MQTT QoS value to use in the notifications associated to the subscription (0, 1 or 2). This is an optional field, if omitted then QoS 0 is used. +* `retain`: to specify the MQTT retain value to use in the notifications associated to the subscription + (`true` or `false`). This is an optional field, if omitted then retain `false` is used. * `user` and `passwd`: optional fields, to be used in the case MQTT broker needs user/password based authentication. If used, both fields have to be used together. Note that for security reasons, the password is always offuscated when retrieving subscription information (e.g. `GET /v2/subscriptions`). @@ -52,7 +54,7 @@ in MQTT subscriptions work the same as in HTTP subscriptions, taking into accoun * `mqttCustom` is used instead of `httpCustom` * The same fields used in `mqtt` can be used in `mqttCustom`. * `headers`, `qs` and `method`cannot be used, as they doesn’t have equivalence in MQTT -* Macro replacement is performed in `topic` and `payload` fields. `url`, `qos`, `user` and `passwd` are fixed values +* Macro replacement is performed in `topic` and `payload` fields. `url`, `qos`, `retain`, `user` and `passwd` are fixed values ## Connection management @@ -88,3 +90,11 @@ To publish using TLS (not yet supported by Orion, pending on [this issue](https: mosquitto_pub -d --insecure --cafile file.pem -h -p 1883 -u -P -t '/topic' -m 'payload' ``` + +To clear all mosquitto broker retained messages: + +``` +sudo service mosquitto stop +sudo rm /var/lib/mosquitto/mosquitto.db +sudo systemctl start mosquitto.service +``` diff --git a/doc/requirements.txt b/doc/requirements.txt index 6a0c8dce19..e3e604003a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,4 @@ mkdocs==1.2.3 -Pygments==2.9.0 +Pygments==2.15.0 Markdown==3.3.4 jinja2==3.0.0 \ No newline at end of file diff --git a/doc/roadmap.md b/doc/roadmap.md index 3fbfe2ddc2..9dbf7b976f 100644 --- a/doc/roadmap.md +++ b/doc/roadmap.md @@ -17,7 +17,7 @@ any time. Disclaimer: -* This section has been last updated in March 2022. Please take into account its +* This section has been last updated in August 2023. Please take into account its content could be obsolete. * Note we develop this software in Agile way, so development plan is continuously under review. Thus, this roadmap has to be understood as rough plan of features @@ -32,12 +32,12 @@ Disclaimer: The following list of features are planned to be addressed in the short term, and incorporated into the coming release(s) of the product: +- MQTT Retain flag [#4388](https://github.com/telefonicaid/fiware-orion/issues/4388) - Allow multiple types in entity to support UNE 178503 requirements ([#3638](https://github.com/telefonicaid/fiware-orion/issues/3638)) -- ~New subscripition modes (create only, update only, delete only and combinations)~ ([#1494](https://github.com/telefonicaid/fiware-orion/issues/1494) - Pattern/filter batch updates ([#2389](https://github.com/telefonicaid/fiware-orion/issues/2389)) - Notification endpoint alias ([#3655](https://github.com/telefonicaid/fiware-orion/issues/3655)) - Aggregation operations API ([#3816](https://github.com/telefonicaid/fiware-orion/issues/3816)) -- ~Custom notifications: simplifying sending JSON requests~ ([#2560](https://github.com/telefonicaid/fiware-orion/issues/2560)) +- Rework commands (and deprecate registration API) ([#4397](https://github.com/telefonicaid/fiware-orion/issues/4397)) ## Medium term @@ -46,16 +46,20 @@ The following list of features are planned to be addressed in the medium term, typically within the subsequent release(s) generated in the next **9 months** after next planned release: - -- Advanced query language -- Signed entities +- Advanced query language ([#4395](https://github.com/telefonicaid/fiware-orion/issues/4395)) +- Signed entities ([#4398](https://github.com/telefonicaid/fiware-orion/issues/4398)) - Dynamic / high order attribute values (e.g. an attribute being a sum of two other attributes) supported by a Expressions Language - help wanted ([#4004](https://github.com/telefonicaid/fiware-orion/issues/4004)), ([#3815](https://github.com/telefonicaid/fiware-orion/issues/3815)) -- Rework commands - Service provisioning API (pools, etc.) (based in [#3843](https://github.com/telefonicaid/fiware-orion/issues/3843)) +- Advanced subscription management + - Subscription debug mode (precise statistics consolidation, keep recent history of notifications sent, etc.) ([#4399](https://github.com/telefonicaid/fiware-orion/issues/4399)) + - Custom ID subscription ([#4400](https://github.com/telefonicaid/fiware-orion/issues/4400)) + - Query Subscrition by fields (endpoint, attributes...) ([#4392](https://github.com/telefonicaid/fiware-orion/issues/4392)) + - Flag to disable metadata in subscriptions ([#4401](https://github.com/telefonicaid/fiware-orion/issues/4401)) +- Remove registration API ([#4402](https://github.com/telefonicaid/fiware-orion/pull/4402)) ## Long term @@ -71,6 +75,8 @@ you wish to get involved in the implementation or influence the roadmap The following list contains all features that were in the roadmap and have already been implemented. +- Custom notifications: simplifying sending JSON requests ([#2560](https://github.com/telefonicaid/fiware-orion/issues/2560)) ([3.8.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.8.0)) +- New subscripition modes (create only, update only, delete only and combinations) ([#1494](https://github.com/telefonicaid/fiware-orion/issues/1494)) ([3.7.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.7.0)) - Per sub/reg HTTP timeout ([#3842](https://github.com/telefonicaid/fiware-orion/issues/3842)) ([3.3.0](https://github.com/telefonicaid/fiware-orion/releases/tag/3.3.0)) - Attribute update operators (inc, push, etc.) ([#3814](https://github.com/telefonicaid/fiware-orion/issues/3814)) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5d5912f05b..8e2809b368 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,7 +19,7 @@ # iot_support at tid dot es # -ARG IMAGE_TAG=11.6-slim +ARG IMAGE_TAG=12.1-slim FROM debian:${IMAGE_TAG} ARG GITHUB_ACCOUNT=telefonicaid @@ -80,9 +80,9 @@ RUN \ ldconfig && \ # Install mongodb driver from source cd /opt && \ - curl -kOL https://github.com/mongodb/mongo-c-driver/releases/download/1.23.1/mongo-c-driver-1.23.1.tar.gz && \ - tar xfvz mongo-c-driver-1.23.1.tar.gz && \ - cd mongo-c-driver-1.23.1 && \ + curl -kOL https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz && \ + tar xfvz mongo-c-driver-1.24.3.tar.gz && \ + cd mongo-c-driver-1.24.3 && \ mkdir cmake-build && \ cd cmake-build && \ # Different from ci/deb/build-dep.sh and build from source documentation, we add here also @@ -120,8 +120,8 @@ RUN \ /opt/libmicrohttpd-0.9.76 \ /opt/mosquitto-2.0.15.tar.gz \ /opt/mosquitto-2.0.15 \ - /opt/mongo-c-driver-1.23.1.tar.gz \ - /opt/mongo-c-driver-1.23.1 \ + /opt/mongo-c-driver-1.24.3.tar.gz \ + /opt/mongo-c-driver-1.24.3 \ /usr/local/include/mongo \ /usr/local/lib/libmongoclient.a \ /opt/rapidjson-1.1.0 \ @@ -146,8 +146,7 @@ RUN \ apt-get -y autoremove --purge && \ # The above apt removal erases some dependencies needed by contextBroker. So we reinstall it apt-get -y install \ - libicu67 \ - libcurl4 \ + libicu72 \ libboost-thread1.74.0 && \ # Don't need old log files inside docker images rm -f /var/log/*log diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index 701af90741..5ab7222703 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -19,6 +19,9 @@ # iot_support at tid dot es # +# FIXME the change from mongoc driver 1.23.1 to 1.24.1 (PR https://github.com/telefonicaid/fiware-orion/pull/4415) +# has not been actually tested. Remove this FIXME mark after succesfull test + ARG IMAGE_TAG=3.16.0 FROM alpine:${IMAGE_TAG} @@ -82,9 +85,9 @@ RUN \ #ldconfig && \ # Install mongodb driver from source cd /opt && \ - curl -kOL https://github.com/mongodb/mongo-c-driver/releases/download/1.23.1/mongo-c-driver-1.23.1.tar.gz && \ - tar xfvz mongo-c-driver-1.23.1.tar.gz && \ - cd mongo-c-driver-1.23.1 && \ + curl -kOL https://github.com/mongodb/mongo-c-driver/releases/download/1.24.3/mongo-c-driver-1.24.3.tar.gz && \ + tar xfvz mongo-c-driver-1.24.3.tar.gz && \ + cd mongo-c-driver-1.24.3 && \ mkdir cmake-build && \ cd cmake-build && \ # Different from ci/deb/build-dep.sh and build from source documentation, we add here also @@ -125,8 +128,8 @@ RUN \ /opt/libmicrohttpd-0.9.76 \ /opt/mosquitto-2.0.15.tar.gz \ /opt/mosquitto-2.0.15 \ - /opt/mongo-c-driver-1.23.1.tar.gz \ - /opt/mongo-c-driver-1.23.1 \ + /opt/mongo-c-driver-1.24.3.tar.gz \ + /opt/mongo-c-driver-1.24.3 \ /usr/local/include/mongo \ /usr/local/lib/libmongoclient.a \ /opt/rapidjson-1.1.0 \ diff --git a/docker/README.jp.md b/docker/README.jp.md index e8e006546b..efce59448a 100644 --- a/docker/README.jp.md +++ b/docker/README.jp.md @@ -43,7 +43,7 @@ Orion Context Broker を試してみたいし、データベースについて > `--nojournal` に関しては、それはプロダクション利用では推奨されていませんが、Orion コンテナが高速で、DB が見つからず準備ができていない場合に、mongo コンテナの起動を高速化し、いくつかの競合状態の問題を回避します。 -数秒後に、Context broker を実行し、ポート1026でリッスンする必要があります。 +数秒後、Context Broker が実行され、ポート 1026 をリッスンします。 以下を実行し、動作することを確認します。 diff --git a/makefile b/makefile index a279b0adfb..594f21f2d3 100644 --- a/makefile +++ b/makefile @@ -234,6 +234,7 @@ ftd: functional_test_debug test: unit_test functional_test coverage: install_coverage + # FIXME #4418: the functional test part of this target is not working properly. Check issue for details. # Init coverage echo "Initializing coverage files" mkdir -p coverage @@ -291,6 +292,7 @@ coverage_unit_test: build_unit_test genhtml -o coverage coverage/broker.info coverage_functional_test: install_coverage + # FIXME #4418: this target is not working properly. Check issue for details. # Init coverage echo "Initializing coverage files" mkdir -p coverage diff --git a/scripts/check_files_compliance.py b/scripts/check_files_compliance.py index 9c81db6399..0555aee3c1 100755 --- a/scripts/check_files_compliance.py +++ b/scripts/check_files_compliance.py @@ -129,7 +129,7 @@ def ignore(root, file): return True # Apib files have an "inline" license, so they are ignored - extensions_to_ignore = [ 'apib', 'md' ] + extensions_to_ignore = [ 'apib', 'md', 'patch'] if os.path.splitext(file)[1][1:] in extensions_to_ignore: return True diff --git a/scripts/utils/counters_sum.py b/scripts/utils/counters_sum.py new file mode 100755 index 0000000000..2c873587b2 --- /dev/null +++ b/scripts/utils/counters_sum.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# Usage: +# counters_sum.py file1.json file2.json ... fileN.json +# +# (Maybe you need to use 'PYTHONIOENCODING=utf8 python counter_sum.py ...' if you are going to redirect the output of this +# script to a file) + +# This script is designed to aggregate information coming of several CB instances running in parallel in HA or +# horizontal scaling scenarios. The files passed to the script as arguments are the response of the +# operation GET /v2/statistics?options=fullCounters +# +# Some notes to take into account: +# +# - All .json files have to have a regular structure (i.e. all with the same structural keys in the JSON object) +# Thus, it is a must to use ?option=fullCounter in the GET operation +# - At the present moment this script only aggregates information in the "counters" section, but it would be +# easily extended to take into account other sections + +# Configuration +# PRUNE: if true remove entries with 0 +PRUNE = True + +__author__ = 'fermin' + +import sys +import json + +# Grab all files into JSON dicts +files = [] +for f in sys.argv[1:]: + files.append(json.load(open(f))) + +# Initialize accumulator with first file +accum = files[0]['counters'] + +# Accum the rest of the files +for f in files[1:]: + counters = f['counters'] + + # Request types + request_types = ['requests', 'requestsLegacy'] + + # Update summaries + summary_fields = [ + 'jsonRequests', + 'textRequests', + 'noPayloadRequests', + 'missedVerb', + 'invalidRequests', + 'registrationUpdateErrors', + 'discoveryErrors', + 'notificationsSent' + ] + + for field in summary_fields: + accum[field] += counters[field] + + # Process request blocks + for field in request_types: + for url in accum[field]: + for verb in accum[field][url]: + accum[field][url][verb] += counters[field][url][verb] + +if PRUNE: + for field in request_types: + # First pass: prune verbs with 0 + for url in accum[field].keys(): + to_delete = [] + for verb in accum[field][url].keys(): + if accum[field][url][verb] == 0: + to_delete.append(verb) + for verb in to_delete: + accum[field][url].pop(verb) + # Second pass: prune URL without content + to_delete = [] + for url in accum[field].keys(): + if len(accum[field][url].keys()) == 0: + to_delete.append(url) + for url in to_delete: + accum[field].pop(url) + +print(json.dumps(accum)) diff --git a/src/app/contextBroker/contextBroker.cpp b/src/app/contextBroker/contextBroker.cpp index 476ed64980..bf81abec8f 100644 --- a/src/app/contextBroker/contextBroker.cpp +++ b/src/app/contextBroker/contextBroker.cpp @@ -148,6 +148,7 @@ char authMech[64]; char authDb[64]; bool dbSSL; bool dbDisableRetryWrites; +char dbURI[1024]; char pidPath[256]; bool harakiri; bool useOnlyIPv4; @@ -192,6 +193,7 @@ bool logForHumans; unsigned long logLineMaxSize; unsigned long logInfoPayloadMaxSize; bool disableMetrics; +bool disableNgsiv1; bool disableFileLog; int reqTimeout; bool insecureNotif; @@ -204,6 +206,8 @@ unsigned long fcMaxInterval; int mqttMaxAge; +bool logDeprecate; + /* **************************************************************************** @@ -266,11 +270,14 @@ int mqttMaxAge; #define LOG_FOR_HUMANS_DESC "human readible log to screen" #define LOG_LINE_MAX_SIZE_DESC "log line maximum size (in bytes)" #define LOG_INFO_PAYLOAD_MAX_SIZE_DESC "maximum length for request or response payload in INFO log level (in bytes)" -#define METRICS_DESC "turn off the 'metrics' feature" +#define DISABLE_METRICS_DESC "turn off the 'metrics' feature" +#define DISABLE_NGSIV1_DESC "turn off NGSIv1 request endpoints" #define REQ_TMO_DESC "connection timeout for REST requests (in seconds)" -#define INSECURE_NOTIF "allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates" -#define NGSIV1_AUTOCAST "automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations" +#define INSECURE_NOTIF_DESC "allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates" +#define NGSIV1_AUTOCAST_DESC "automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations" #define MQTT_MAX_AGE_DESC "max time (in minutes) that an unused MQTT connection is kept, default: 60" +#define LOG_DEPRECATE_DESC "log deprecation usages as warnings" +#define DBURI_DESC "complete URI for database connection" @@ -290,6 +297,7 @@ PaArgument paArgs[] = { "-port", &port, "PORT", PaInt, PaOpt, 1026, 1, 65535, PORT_DESC }, { "-pidpath", pidPath, "PID_PATH", PaString, PaOpt, PIDPATH, PaNL, PaNL, PIDPATH_DESC }, + { "-dbURI", dbURI, "MONGO_URI", PaString, PaOpt, _i "", PaNL, PaNL, DBURI_DESC }, { "-dbhost", dbHost, "MONGO_HOST", PaString, PaOpt, LOCALHOST, PaNL, PaNL, DBHOST_DESC }, { "-rplSet", rplSet, "MONGO_REPLICA_SET", PaString, PaOpt, _i "", PaNL, PaNL, RPLSET_DESC }, { "-dbuser", user, "MONGO_USER", PaString, PaOpt, _i "", PaNL, PaNL, DBUSER_DESC }, @@ -352,14 +360,17 @@ PaArgument paArgs[] = { "-logLineMaxSize", &logLineMaxSize, "LOG_LINE_MAX_SIZE", PaLong, PaOpt, (32 * 1024), 100, PaNL, LOG_LINE_MAX_SIZE_DESC }, { "-logInfoPayloadMaxSize", &logInfoPayloadMaxSize, "LOG_INFO_PAYLOAD_MAX_SIZE",PaLong, PaOpt, (5 * 1024), 0, PaNL, LOG_INFO_PAYLOAD_MAX_SIZE_DESC }, - { "-disableMetrics", &disableMetrics, "DISABLE_METRICS", PaBool, PaOpt, false, false, true, METRICS_DESC }, + { "-disableMetrics", &disableMetrics, "DISABLE_METRICS", PaBool, PaOpt, false, false, true, DISABLE_METRICS_DESC }, + { "-disableNgsiv1", &disableNgsiv1, "DISABLE_NGSIV1", PaBool, PaOpt, false, false, true, DISABLE_NGSIV1_DESC }, - { "-insecureNotif", &insecureNotif, "INSECURE_NOTIF", PaBool, PaOpt, false, false, true, INSECURE_NOTIF }, + { "-insecureNotif", &insecureNotif, "INSECURE_NOTIF", PaBool, PaOpt, false, false, true, INSECURE_NOTIF_DESC }, - { "-ngsiv1Autocast", &ngsiv1Autocast, "NGSIV1_AUTOCAST", PaBool, PaOpt, false, false, true, NGSIV1_AUTOCAST }, + { "-ngsiv1Autocast", &ngsiv1Autocast, "NGSIV1_AUTOCAST", PaBool, PaOpt, false, false, true, NGSIV1_AUTOCAST_DESC }, { "-mqttMaxAge", &mqttMaxAge, "MQTT_MAX_AGE", PaInt, PaOpt, 60, PaNL, PaNL, MQTT_MAX_AGE_DESC }, + { "-logDeprecate", &logDeprecate, "LOG_DEPRECATE", PaBool, PaOpt, false, false, true, LOG_DEPRECATE_DESC }, + PA_END_OF_ARGS }; @@ -1205,7 +1216,7 @@ int main(int argC, char* argV[]) alarmMgr.init(relogAlarms); mqttMgr.init(mqttTimeout); orionInit(orionExit, ORION_VERSION, policy, statCounters, statSemWait, statTiming, statNotifQueue, strictIdv1); - mongoInit(dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, dbDisableRetryWrites, mtenant, dbTimeout, writeConcern, dbPoolSize, statSemWait); + mongoInit(dbURI, dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, dbDisableRetryWrites, mtenant, dbTimeout, writeConcern, dbPoolSize, statSemWait); metricsMgr.init(!disableMetrics, statSemWait); logSummaryInit(&lsPeriod); @@ -1282,6 +1293,7 @@ int main(int argC, char* argV[]) allowedOrigin, maxAge, reqTimeout, + disableNgsiv1, httpsPrivateServerKey, httpsCertificate); @@ -1300,6 +1312,7 @@ int main(int argC, char* argV[]) allowedOrigin, maxAge, reqTimeout, + disableNgsiv1, NULL, NULL); } diff --git a/src/app/contextBroker/orionRestServices.cpp b/src/app/contextBroker/orionRestServices.cpp index 7ed1aee607..f29b9a897a 100644 --- a/src/app/contextBroker/orionRestServices.cpp +++ b/src/app/contextBroker/orionRestServices.cpp @@ -145,6 +145,38 @@ * getServiceV - */ static RestService getServiceV[] = +{ + { EntryPointsRequest, 1, { "v2" }, entryPointsTreat }, + { EntitiesRequest, 2, { "v2", "entities" }, getEntities }, + { EntityRequest, 3, { "v2", "entities", "*" }, getEntity }, + { EntityRequest, 4, { "v2", "entities", "*", "attrs" }, getEntity }, + { EntityAttributeValueRequest, 6, { "v2", "entities", "*", "attrs", "*", "value" }, getEntityAttributeValue }, + { EntityAttributeRequest, 5, { "v2", "entities", "*", "attrs", "*" }, getEntityAttribute }, + { EntityTypeRequest, 3, { "v2", "types", "*" }, getEntityType }, + { EntityAllTypesRequest, 2, { "v2", "types" }, getEntityAllTypes }, + { SubscriptionsRequest, 2, { "v2", "subscriptions" }, getAllSubscriptions }, + { SubscriptionRequest, 3, { "v2", "subscriptions", "*" }, getSubscription }, + { RegistrationRequest, 3, { "v2", "registrations", "*" }, getRegistration }, + { RegistrationsRequest, 2, { "v2", "registrations" }, getRegistrations }, + { LogTraceRequest, 2, { "log", "trace" }, logTraceTreat }, + { StatisticsRequest, 1, { "statistics" }, statisticsTreat }, + { StatisticsRequest, 2, { "cache", "statistics" }, statisticsCacheTreat }, + { VersionRequest, 1, { "version" }, versionTreat }, + { LogLevelRequest, 2, { "admin", "log" }, getLogConfig }, + { SemStateRequest, 2, { "admin", "sem" }, semStateTreat }, + { MetricsRequest, 2, { "admin", "metrics" }, getMetrics }, + +#ifdef DEBUG + { ExitRequest, 2, { "exit", "*" }, exitTreat }, + { ExitRequest, 1, { "exit" }, exitTreat }, + { LeakRequest, 2, { "leak", "*" }, leakTreat }, + { LeakRequest, 1, { "leak" }, leakTreat }, +#endif + + ORION_REST_SERVICE_END +}; + +static RestService getServiceVlegacy[] = { { EntryPointsRequest, 1, { "v2" }, entryPointsTreat }, { EntitiesRequest, 2, { "v2", "entities" }, getEntities }, @@ -165,31 +197,32 @@ static RestService getServiceV[] = //{ ContextEntityTypes, 3, { "ngsi9", "contextEntityTypes", "*" }, getContextEntityTypes }, //{ ContextEntityTypeAttributeContainer, 4, { "ngsi9", "contextEntityTypes", "*", "attributes" }, getContextEntityTypes }, //{ ContextEntityTypeAttribute, 5, { "ngsi9", "contextEntityTypes", "*", "attributes", "*" }, getContextEntityTypeAttribute }, - { ContextEntitiesByEntityId, 4, { "v1", "registry", "contextEntities", "*" }, getContextEntitiesByEntityId }, - { ContextEntityAttributes, 5, { "v1", "registry", "contextEntities", "*", "attributes" }, getContextEntityAttributes }, - { EntityByIdAttributeByName, 6, { "v1", "registry", "contextEntities", "*", "attributes", "*" }, getEntityByIdAttributeByName }, - { ContextEntityTypes, 4, { "v1", "registry", "contextEntityTypes", "*" }, getContextEntityTypes }, - { ContextEntityTypeAttributeContainer, 5, { "v1", "registry", "contextEntityTypes", "*", "attributes" }, getContextEntityTypes }, - { ContextEntityTypeAttribute, 6, { "v1", "registry", "contextEntityTypes", "*", "attributes", "*" }, getContextEntityTypeAttribute }, - { IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, getIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, getIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, getIndividualContextEntityAttribute }, - { Ngsi10ContextEntityTypes, 3, { "ngsi10", "contextEntityTypes", "*" }, getNgsi10ContextEntityTypes }, - { Ngsi10ContextEntityTypesAttributeContainer, 4, { "ngsi10", "contextEntityTypes", "*", "attributes" }, getNgsi10ContextEntityTypes }, - { Ngsi10ContextEntityTypesAttribute, 5, { "ngsi10", "contextEntityTypes", "*", "attributes", "*" }, getNgsi10ContextEntityTypesAttribute }, - { IndividualContextEntity, 3, { "v1", "contextEntities", "*" }, getIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, getIndividualContextEntity }, + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //{ ContextEntitiesByEntityId, 4, { "v1", "registry", "contextEntities", "*" }, getContextEntitiesByEntityId }, + //{ ContextEntityAttributes, 5, { "v1", "registry", "contextEntities", "*", "attributes" }, getContextEntityAttributes }, + //{ EntityByIdAttributeByName, 6, { "v1", "registry", "contextEntities", "*", "attributes", "*" }, getEntityByIdAttributeByName }, + //{ ContextEntityTypes, 4, { "v1", "registry", "contextEntityTypes", "*" }, getContextEntityTypes }, + //{ ContextEntityTypeAttributeContainer, 5, { "v1", "registry", "contextEntityTypes", "*", "attributes" }, getContextEntityTypes }, + //{ ContextEntityTypeAttribute, 6, { "v1", "registry", "contextEntityTypes", "*", "attributes", "*" }, getContextEntityTypeAttribute }, + //{ IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, getIndividualContextEntity }, + //{ IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, getIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, getIndividualContextEntityAttribute }, + //{ Ngsi10ContextEntityTypes, 3, { "ngsi10", "contextEntityTypes", "*" }, getNgsi10ContextEntityTypes }, + //{ Ngsi10ContextEntityTypesAttributeContainer, 4, { "ngsi10", "contextEntityTypes", "*", "attributes" }, getNgsi10ContextEntityTypes }, + //{ Ngsi10ContextEntityTypesAttribute, 5, { "ngsi10", "contextEntityTypes", "*", "attributes", "*" }, getNgsi10ContextEntityTypesAttribute }, + //{ IndividualContextEntity, 3, { "v1", "contextEntities", "*" }, getIndividualContextEntity }, + //{ IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, getIndividualContextEntity }, { IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, getIndividualContextEntityAttribute }, - { Ngsi10ContextEntityTypes, 3, { "v1", "contextEntityTypes", "*" }, getNgsi10ContextEntityTypes }, - { Ngsi10ContextEntityTypesAttributeContainer, 4, { "v1", "contextEntityTypes", "*", "attributes" }, getNgsi10ContextEntityTypes }, - { Ngsi10ContextEntityTypesAttribute, 5, { "v1", "contextEntityTypes", "*", "attributes", "*" }, getNgsi10ContextEntityTypesAttribute }, - { EntityTypes, 2, { "v1", "contextTypes" }, getEntityTypes }, - { AttributesForEntityType, 3, { "v1", "contextTypes", "*" }, getAttributesForEntityType }, - { AllContextEntities, 2, { "v1", "contextEntities" }, getAllContextEntities }, - { AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, getAllEntitiesWithTypeAndId }, - { IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, getIndividualContextEntityAttributeWithTypeAndId }, - { ContextEntitiesByEntityIdAndType, 7, { "v1", "registry", "contextEntities", "type", "*", "id", "*" }, getContextEntitiesByEntityIdAndType }, - { EntityByIdAttributeByNameIdAndType, 9, { "v1", "registry", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, getEntityByIdAttributeByNameWithTypeAndId }, + //{ Ngsi10ContextEntityTypes, 3, { "v1", "contextEntityTypes", "*" }, getNgsi10ContextEntityTypes }, + //{ Ngsi10ContextEntityTypesAttributeContainer, 4, { "v1", "contextEntityTypes", "*", "attributes" }, getNgsi10ContextEntityTypes }, + //{ Ngsi10ContextEntityTypesAttribute, 5, { "v1", "contextEntityTypes", "*", "attributes", "*" }, getNgsi10ContextEntityTypesAttribute }, + //{ EntityTypes, 2, { "v1", "contextTypes" }, getEntityTypes }, + //{ AttributesForEntityType, 3, { "v1", "contextTypes", "*" }, getAttributesForEntityType }, + //{ AllContextEntities, 2, { "v1", "contextEntities" }, getAllContextEntities }, + //{ AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, getAllEntitiesWithTypeAndId }, + //{ IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, getIndividualContextEntityAttributeWithTypeAndId }, + //{ ContextEntitiesByEntityIdAndType, 7, { "v1", "registry", "contextEntities", "type", "*", "id", "*" }, getContextEntitiesByEntityIdAndType }, + //{ EntityByIdAttributeByNameIdAndType, 9, { "v1", "registry", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, getEntityByIdAttributeByNameWithTypeAndId }, { LogTraceRequest, 2, { "log", "trace" }, logTraceTreat }, // FIXME: disable administrative API routes not aligned with documentation in Orion 3.8.0, // to be definetively removed at some point of the future @@ -222,6 +255,19 @@ static RestService getServiceV[] = * postServiceV - */ static RestService postServiceV[] = +{ + { EntitiesRequest, 2, { "v2", "entities" }, postEntities }, + { EntityRequest, 4, { "v2", "entities", "*", "attrs" }, postEntity }, + { NotifyContext, 3, { "v2", "op", "notify" }, postNotifyContext }, + { BatchQueryRequest, 3, { "v2", "op", "query" }, postBatchQuery }, + { BatchUpdateRequest, 3, { "v2", "op", "update" }, postBatchUpdate }, + { SubscriptionsRequest, 2, { "v2", "subscriptions" }, postSubscriptions }, + { RegistrationsRequest, 2, { "v2", "registrations" }, postRegistration }, + + ORION_REST_SERVICE_END +}; + +static RestService postServiceVlegacy[] = { { EntitiesRequest, 2, { "v2", "entities" }, postEntities }, { EntityRequest, 4, { "v2", "entities", "*", "attrs" }, postEntity }, @@ -233,17 +279,19 @@ static RestService postServiceV[] = // FIXME: disable NGSI9 API routes in Orion 3.8.0, to be definetively removed at some point of the future //{ RegisterContext, 2, { "ngsi9", "registerContext" }, postRegisterContext }, //{ DiscoverContextAvailability, 2, { "ngsi9", "discoverContextAvailability" }, postDiscoverContextAvailability }, - { RegisterContext, 3, { "v1", "registry", "registerContext" }, postRegisterContext }, - { DiscoverContextAvailability, 3, { "v1", "registry", "discoverContextAvailability" }, postDiscoverContextAvailability }, + // FIXME: disable NGSI9 API routes in Orion 3.8.0, to be definetively removed at some point of the future + //{ RegisterContext, 3, { "v1", "registry", "registerContext" }, postRegisterContext }, + //{ DiscoverContextAvailability, 3, { "v1", "registry", "discoverContextAvailability" }, postDiscoverContextAvailability }, // FIXME: disable NGSI9 API routes in Orion 3.8.0, to be definetively removed at some point of the future //{ RegisterContext, 2, { "ngsi9", "registerContext" }, postRegisterContext }, //{ DiscoverContextAvailability, 2, { "ngsi9", "discoverContextAvailability" }, postDiscoverContextAvailability }, { UpdateContext, 2, { "v1", "updateContext" }, (RestTreat) postUpdateContext }, { QueryContext, 2, { "v1", "queryContext" }, postQueryContext }, - { SubscribeContext, 2, { "v1", "subscribeContext" }, postSubscribeContext }, - { UpdateContextSubscription, 2, { "v1", "updateContextSubscription" }, postUpdateContextSubscription }, - { UnsubscribeContext, 2, { "v1", "unsubscribeContext" }, postUnsubscribeContext }, - { NotifyContext, 2, { "v1", "notifyContext" }, postNotifyContext }, + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //{ SubscribeContext, 2, { "v1", "subscribeContext" }, postSubscribeContext }, + //{ UpdateContextSubscription, 2, { "v1", "updateContextSubscription" }, postUpdateContextSubscription }, + //{ UnsubscribeContext, 2, { "v1", "unsubscribeContext" }, postUnsubscribeContext }, + //{ NotifyContext, 2, { "v1", "notifyContext" }, postNotifyContext }, // FIXME: disable NGSI9 API routes in Orion 3.8.0, to be definetively removed at some point of the future //{ ContextEntitiesByEntityId, 3, { "ngsi9", "contextEntities", "*" }, postContextEntitiesByEntityId }, //{ ContextEntityAttributes, 4, { "ngsi9", "contextEntities", "*", "attributes" }, postContextEntityAttributes }, @@ -251,37 +299,37 @@ static RestService postServiceV[] = //{ ContextEntityTypes, 3, { "ngsi9", "contextEntityTypes", "*" }, postContextEntityTypes }, //{ ContextEntityTypeAttributeContainer, 4, { "ngsi9", "contextEntityTypes", "*", "attributes" }, postContextEntityTypes }, //{ ContextEntityTypeAttribute, 5, { "ngsi9", "contextEntityTypes", "*", "attributes", "*" }, postContextEntityTypeAttribute }, - { ContextEntitiesByEntityId, 4, { "v1", "registry", "contextEntities", "*" }, postContextEntitiesByEntityId }, - { ContextEntityAttributes, 5, { "v1", "registry", "contextEntities", "*", "attributes" }, postContextEntityAttributes }, - { EntityByIdAttributeByName, 6, { "v1", "registry", "contextEntities", "*", "attributes", "*" }, postEntityByIdAttributeByName }, - { ContextEntityTypes, 4, { "v1", "registry", "contextEntityTypes", "*" }, postContextEntityTypes }, - { ContextEntityTypeAttributeContainer, 5, { "v1", "registry", "contextEntityTypes", "*", "attributes" }, postContextEntityTypes }, - { ContextEntityTypeAttribute, 6, { "v1", "registry", "contextEntityTypes", "*", "attributes", "*" }, postContextEntityTypeAttribute }, - { IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, postIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, postIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, postIndividualContextEntityAttribute }, - { SubscribeContext, 2, { "ngsi10", "contextSubscriptions" }, postSubscribeContextConvOp }, - { IndividualContextEntity, 3, { "v1", "contextEntities", "*" }, postIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, postIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, postIndividualContextEntityAttribute }, - { SubscribeContext, 2, { "v1", "contextSubscriptions" }, postSubscribeContextConvOp }, - { AllContextEntities, 2, { "v1", "contextEntities" }, postIndividualContextEntity }, - { AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, postAllEntitiesWithTypeAndId }, - { IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, postIndividualContextEntityAttributeWithTypeAndId }, - { ContextEntitiesByEntityIdAndType, 7, { "v1", "registry", "contextEntities", "type", "*", "id", "*" }, postContextEntitiesByEntityIdAndType }, - { EntityByIdAttributeByNameIdAndType, 9, { "v1", "registry", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, postEntityByIdAttributeByNameWithTypeAndId }, + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //{ ContextEntitiesByEntityId, 4, { "v1", "registry", "contextEntities", "*" }, postContextEntitiesByEntityId }, + //{ ContextEntityAttributes, 5, { "v1", "registry", "contextEntities", "*", "attributes" }, postContextEntityAttributes }, + //{ EntityByIdAttributeByName, 6, { "v1", "registry", "contextEntities", "*", "attributes", "*" }, postEntityByIdAttributeByName }, + //{ ContextEntityTypes, 4, { "v1", "registry", "contextEntityTypes", "*" }, postContextEntityTypes }, + //{ ContextEntityTypeAttributeContainer, 5, { "v1", "registry", "contextEntityTypes", "*", "attributes" }, postContextEntityTypes }, + //{ ContextEntityTypeAttribute, 6, { "v1", "registry", "contextEntityTypes", "*", "attributes", "*" }, postContextEntityTypeAttribute }, + //{ IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, postIndividualContextEntity }, + //{ IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, postIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, postIndividualContextEntityAttribute }, + //{ SubscribeContext, 2, { "ngsi10", "contextSubscriptions" }, postSubscribeContextConvOp }, + //{ IndividualContextEntity, 3, { "v1", "contextEntities", "*" }, postIndividualContextEntity }, + //{ IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, postIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, postIndividualContextEntityAttribute }, + //{ SubscribeContext, 2, { "v1", "contextSubscriptions" }, postSubscribeContextConvOp }, + //{ AllContextEntities, 2, { "v1", "contextEntities" }, postIndividualContextEntity }, + //{ AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, postAllEntitiesWithTypeAndId }, + //{ IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, postIndividualContextEntityAttributeWithTypeAndId }, + //{ ContextEntitiesByEntityIdAndType, 7, { "v1", "registry", "contextEntities", "type", "*", "id", "*" }, postContextEntitiesByEntityIdAndType }, + //{ EntityByIdAttributeByNameIdAndType, 9, { "v1", "registry", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, postEntityByIdAttributeByNameWithTypeAndId }, { UpdateContext, 2, { "ngsi10", "updateContext" }, (RestTreat) postUpdateContext }, { QueryContext, 2, { "ngsi10", "queryContext" }, postQueryContext }, - { SubscribeContext, 2, { "ngsi10", "subscribeContext" }, postSubscribeContext }, - { UpdateContextSubscription, 2, { "ngsi10", "updateContextSubscription" }, postUpdateContextSubscription }, - { UnsubscribeContext, 2, { "ngsi10", "unsubscribeContext" }, postUnsubscribeContext }, - { NotifyContext, 2, { "ngsi10", "notifyContext" }, postNotifyContext }, + //{ SubscribeContext, 2, { "ngsi10", "subscribeContext" }, postSubscribeContext }, + //{ UpdateContextSubscription, 2, { "ngsi10", "updateContextSubscription" }, postUpdateContextSubscription }, + //{ UnsubscribeContext, 2, { "ngsi10", "unsubscribeContext" }, postUnsubscribeContext }, + //{ NotifyContext, 2, { "ngsi10", "notifyContext" }, postNotifyContext }, ORION_REST_SERVICE_END }; - /* **************************************************************************** * * putServiceV - @@ -291,16 +339,28 @@ static RestService putServiceV[] = { EntityRequest, 4, { "v2", "entities", "*", "attrs" }, putEntity }, { EntityAttributeValueRequest, 6, { "v2", "entities", "*", "attrs", "*", "value" }, putEntityAttributeValue }, { EntityAttributeRequest, 5, { "v2", "entities", "*", "attrs", "*" }, putEntityAttribute }, - { IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, putIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, putIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, putIndividualContextEntityAttribute }, - { Ngsi10SubscriptionsConvOp, 3, { "ngsi10", "contextSubscriptions", "*" }, putSubscriptionConvOp }, + { LogTraceRequest, 3, { "log", "trace", "*" }, logTraceTreat }, + { LogLevelRequest, 2, { "admin", "log" }, changeLogConfig }, + + ORION_REST_SERVICE_END +}; + +static RestService putServiceVlegacy[] = +{ + { EntityRequest, 4, { "v2", "entities", "*", "attrs" }, putEntity }, + { EntityAttributeValueRequest, 6, { "v2", "entities", "*", "attrs", "*", "value" }, putEntityAttributeValue }, + { EntityAttributeRequest, 5, { "v2", "entities", "*", "attrs", "*" }, putEntityAttribute }, + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //{ IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, putIndividualContextEntity }, + //{ IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, putIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, putIndividualContextEntityAttribute }, + //{ Ngsi10SubscriptionsConvOp, 3, { "ngsi10", "contextSubscriptions", "*" }, putSubscriptionConvOp }, { IndividualContextEntity, 3, { "v1", "contextEntities", "*" }, putIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, putIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, putIndividualContextEntityAttribute }, - { Ngsi10SubscriptionsConvOp, 3, { "v1", "contextSubscriptions", "*" }, putSubscriptionConvOp }, - { AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, putAllEntitiesWithTypeAndId }, - { IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, putIndividualContextEntityAttributeWithTypeAndId }, + //{ IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, putIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, putIndividualContextEntityAttribute }, + //{ Ngsi10SubscriptionsConvOp, 3, { "v1", "contextSubscriptions", "*" }, putSubscriptionConvOp }, + //{ AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, putAllEntitiesWithTypeAndId }, + //{ IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, putIndividualContextEntityAttributeWithTypeAndId }, // FIXME: disable administrative API routes not aligned with documentation in Orion 3.8.0, // to be definetively removed at some point of the future { LogTraceRequest, 3, { "log", "trace", "*" }, logTraceTreat }, @@ -313,7 +373,6 @@ static RestService putServiceV[] = }; - /* **************************************************************************** * * patchServiceV - @@ -327,7 +386,6 @@ static RestService patchServiceV[] = }; - /* **************************************************************************** * * deleteServiceV - @@ -338,16 +396,32 @@ static RestService deleteServiceV[] = { EntityAttributeRequest, 5, { "v2", "entities", "*", "attrs", "*" }, deleteEntity }, { SubscriptionRequest, 3, { "v2", "subscriptions", "*" }, deleteSubscription }, { RegistrationRequest, 3, { "v2", "registrations", "*" }, deleteRegistration }, - { IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, deleteIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, deleteIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, deleteIndividualContextEntityAttribute }, - { Ngsi10SubscriptionsConvOp, 3, { "ngsi10", "contextSubscriptions", "*" }, deleteSubscriptionConvOp }, + { LogTraceRequest, 2, { "log", "trace" }, logTraceTreat }, + { LogTraceRequest, 3, { "log", "trace", "*" }, logTraceTreat }, + { StatisticsRequest, 1, { "statistics" }, statisticsTreat }, + { StatisticsRequest, 2, { "cache", "statistics" }, statisticsCacheTreat }, + { MetricsRequest, 2, { "admin", "metrics" }, deleteMetrics }, + + ORION_REST_SERVICE_END +}; + +static RestService deleteServiceVlegacy[] = +{ + { EntityRequest, 3, { "v2", "entities", "*" }, deleteEntity }, + { EntityAttributeRequest, 5, { "v2", "entities", "*", "attrs", "*" }, deleteEntity }, + { SubscriptionRequest, 3, { "v2", "subscriptions", "*" }, deleteSubscription }, + { RegistrationRequest, 3, { "v2", "registrations", "*" }, deleteRegistration }, + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //{ IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, deleteIndividualContextEntity }, + //{ IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, deleteIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, deleteIndividualContextEntityAttribute }, + //{ Ngsi10SubscriptionsConvOp, 3, { "ngsi10", "contextSubscriptions", "*" }, deleteSubscriptionConvOp }, { IndividualContextEntity, 3, { "v1", "contextEntities", "*" }, deleteIndividualContextEntity }, - { IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, deleteIndividualContextEntity }, - { IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, deleteIndividualContextEntityAttribute }, - { Ngsi10SubscriptionsConvOp, 3, { "v1", "contextSubscriptions", "*" }, deleteSubscriptionConvOp }, - { AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, deleteAllEntitiesWithTypeAndId }, - { IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, deleteIndividualContextEntityAttributeWithTypeAndId }, + //{ IndividualContextEntityAttributes, 4, { "v1", "contextEntities", "*", "attributes" }, deleteIndividualContextEntity }, + //{ IndividualContextEntityAttribute, 5, { "v1", "contextEntities", "*", "attributes", "*" }, deleteIndividualContextEntityAttribute }, + //{ Ngsi10SubscriptionsConvOp, 3, { "v1", "contextSubscriptions", "*" }, deleteSubscriptionConvOp }, + //{ AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, deleteAllEntitiesWithTypeAndId }, + //{ IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, deleteIndividualContextEntityAttributeWithTypeAndId }, // FIXME: disable administrative API routes not aligned with documentation in Orion 3.8.0, // to be definetively removed at some point of the future { LogTraceRequest, 2, { "log", "trace" }, logTraceTreat }, @@ -368,12 +442,42 @@ static RestService deleteServiceV[] = }; - /* **************************************************************************** * * badVerbV - */ static RestService badVerbV[] = +{ + { EntryPointsRequest, 1, { "v2" }, badVerbGetOnly }, + { EntitiesRequest, 2, { "v2", "entities" }, badVerbGetPostOnly }, + { EntityRequest, 3, { "v2", "entities", "*" }, badVerbGetDeleteOnly }, + { EntityRequest, 4, { "v2", "entities", "*", "attrs" }, badVerbAllNotDelete }, + { EntityAttributeValueRequest, 6, { "v2", "entities", "*", "attrs", "*", "value" }, badVerbGetPutOnly }, + { EntityAttributeRequest, 5, { "v2", "entities", "*", "attrs", "*" }, badVerbGetPutDeleteOnly }, + { EntityTypeRequest, 3, { "v2", "types", "*" }, badVerbGetOnly }, + { EntityAllTypesRequest, 2, { "v2", "types" }, badVerbGetOnly }, + { SubscriptionsRequest, 2, { "v2", "subscriptions" }, badVerbGetPostOnly }, + { SubscriptionRequest, 3, { "v2", "subscriptions", "*" }, badVerbGetDeletePatchOnly }, + { BatchQueryRequest, 3, { "v2", "op", "query" }, badVerbPostOnly }, + { BatchUpdateRequest, 3, { "v2", "op", "update" }, badVerbPostOnly }, + { RegistrationRequest, 3, { "v2", "registrations", "*" }, badVerbGetDeleteOnly }, + { RegistrationsRequest, 2, { "v2", "registrations" }, badVerbGetPostOnly }, + { LogTraceRequest, 2, { "log", "trace" }, badVerbGetDeleteOnly }, + { LogTraceRequest, 3, { "log", "trace", "*" }, badVerbPutDeleteOnly }, + { StatisticsRequest, 1, { "statistics" }, badVerbGetDeleteOnly }, + { StatisticsRequest, 2, { "cache", "statistics" }, badVerbGetDeleteOnly }, + { VersionRequest, 1, { "version" }, badVerbGetOnly }, + { LogLevelRequest, 2, { "admin", "log" }, badVerbPutOnly }, + { SemStateRequest, 2, { "admin", "sem" }, badVerbGetOnly }, + { MetricsRequest, 2, { "admin", "metrics" }, badVerbGetDeleteOnly }, + + { InvalidRequest, 0, { "*", "*", "*", "*", "*", "*" }, badRequest }, + { InvalidRequest, 0, { }, NULL }, + + ORION_REST_SERVICE_END +}; + +static RestService badVerbVlegacy[] = { { EntryPointsRequest, 1, { "v2" }, badVerbGetOnly }, { EntitiesRequest, 2, { "v2", "entities" }, badVerbGetPostOnly }, @@ -415,7 +519,7 @@ static RestService badVerbV[] = { EntityByIdAttributeByName, 6, { "v1", "registry", "contextEntities", "*", "attributes", "*" }, badVerbGetPostOnly }, { ContextEntityTypes, 4, { "v1", "registry", "contextEntityTypes", "*" }, badVerbGetPostOnly }, { ContextEntityTypeAttributeContainer, 5, { "v1", "registry", "contextEntityTypes", "*", "attributes" }, badVerbGetPostOnly }, - { ContextEntityTypeAttribute, 6, { "v1", "registry", "contextEntityTypes", "*", "attributes", "*" }, badVerbGetPostOnly }, + { ContextEntityTypeAttribute, 6, { "v1", "registry", "contextEntityTypes", "*", "attributes", "*" }, badVerbGetPostOnly }, { IndividualContextEntity, 3, { "ngsi10", "contextEntities", "*" }, badVerbAllFour }, { IndividualContextEntityAttributes, 4, { "ngsi10", "contextEntities", "*", "attributes" }, badVerbAllFour }, { IndividualContextEntityAttribute, 5, { "ngsi10", "contextEntities", "*", "attributes", "*" }, badVerbAllFour }, @@ -436,7 +540,7 @@ static RestService badVerbV[] = { AttributesForEntityType, 3, { "v1", "contextTypes", "*" }, badVerbGetOnly }, { AllContextEntities, 2, { "v1", "contextEntities" }, badVerbGetPostOnly }, { AllEntitiesWithTypeAndId, 6, { "v1", "contextEntities", "type", "*", "id", "*" }, badVerbAllFour }, - { IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, badVerbAllFour }, + { IndividualContextEntityAttributeWithTypeAndId, 8, { "v1", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, badVerbAllFour }, { ContextEntitiesByEntityIdAndType, 7, { "v1", "registry", "contextEntities", "type", "*", "id", "*" }, badVerbGetPostOnly }, { EntityByIdAttributeByNameIdAndType, 9, { "v1", "registry", "contextEntities", "type", "*", "id", "*", "attributes", "*" }, badVerbGetPostOnly }, // FIXME: disable administrative API routes not aligned with documentation in Orion 3.8.0, @@ -518,6 +622,7 @@ void orionRestServicesInit const char* allowedOrigin, int corsMaxAge, int mhdTimeoutInSeconds, + bool disableNgsiv1, const char* httpsKey, const char* httpsCert ) @@ -525,23 +630,47 @@ void orionRestServicesInit // Use options service vector (optionsServiceV) only when CORS is enabled RestService* optionsServiceV = (strlen(allowedOrigin) > 0) ? optionsV : NULL; - restInit(getServiceV, - putServiceV, - postServiceV, - patchServiceV, - deleteServiceV, - optionsServiceV, - badVerbV, - ipVersion, - bindAddress, - port, - multitenant, - connectionMemory, - maxConnections, - mhdThreadPoolSize, - allowedOrigin, - corsMaxAge, - mhdTimeoutInSeconds, - httpsKey, - httpsCert); + if (disableNgsiv1) + { + restInit(getServiceV, + putServiceV, + postServiceV, + patchServiceV, + deleteServiceV, + optionsServiceV, + badVerbV, + ipVersion, + bindAddress, + port, + multitenant, + connectionMemory, + maxConnections, + mhdThreadPoolSize, + allowedOrigin, + corsMaxAge, + mhdTimeoutInSeconds, + httpsKey, + httpsCert); + } + else + { + restInit(getServiceVlegacy, + putServiceVlegacy, + postServiceVlegacy, + patchServiceV, + deleteServiceVlegacy, + optionsServiceV, + badVerbVlegacy, + ipVersion, + bindAddress, + port, + multitenant, + connectionMemory, + maxConnections, + mhdThreadPoolSize, + allowedOrigin, + corsMaxAge, + mhdTimeoutInSeconds, + httpsKey, + httpsCert); } } diff --git a/src/app/contextBroker/orionRestServices.h b/src/app/contextBroker/orionRestServices.h index 2f2ff2c4cd..038ffdcbb5 100644 --- a/src/app/contextBroker/orionRestServices.h +++ b/src/app/contextBroker/orionRestServices.h @@ -53,6 +53,7 @@ extern void orionRestServicesInit const char* _allowedOrigin, int _corsMaxAge, int _mhdTimeoutInSeconds, + bool _disableNgsiv1, const char* _httpsKey, const char* _httpsCert ); diff --git a/src/app/contextBroker/version.h b/src/app/contextBroker/version.h index 5bbca655b4..5937a761b9 100644 --- a/src/app/contextBroker/version.h +++ b/src/app/contextBroker/version.h @@ -28,6 +28,6 @@ -#define ORION_VERSION "3.8.0-next" +#define ORION_VERSION "3.10.0-next" #endif // SRC_APP_CONTEXTBROKER_VERSION_H_ diff --git a/src/lib/apiTypesV2/Entity.cpp b/src/lib/apiTypesV2/Entity.cpp index 8449e77e44..7c3fd7abba 100644 --- a/src/lib/apiTypesV2/Entity.cpp +++ b/src/lib/apiTypesV2/Entity.cpp @@ -772,6 +772,17 @@ void Entity::fill(const QueryContextResponse& qcrs, OrionError* oeP) +/* **************************************************************************** +* +* Entity::applyUpdateOperators - +*/ +void Entity::applyUpdateOperators(void) +{ + attributeVector.applyUpdateOperators(); +} + + + /* **************************************************************************** * * Entity::release - diff --git a/src/lib/apiTypesV2/Entity.h b/src/lib/apiTypesV2/Entity.h index 459d3d86a2..e4906bb998 100644 --- a/src/lib/apiTypesV2/Entity.h +++ b/src/lib/apiTypesV2/Entity.h @@ -100,6 +100,8 @@ class Entity std::string check(ApiVersion apiVersion, RequestType requestType); + void applyUpdateOperators(void); + void release(void); void fill(const std::string& id, diff --git a/src/lib/apiTypesV2/MqttInfo.cpp b/src/lib/apiTypesV2/MqttInfo.cpp index 22958f93eb..d46b9e4507 100644 --- a/src/lib/apiTypesV2/MqttInfo.cpp +++ b/src/lib/apiTypesV2/MqttInfo.cpp @@ -68,6 +68,7 @@ std::string MqttInfo::toJson() jh.addString("url", this->url); jh.addString("topic", this->topic); jh.addNumber("qos", (long long) this->qos); + jh.addBool("retain", this->retain); if (providedAuth) { @@ -117,6 +118,7 @@ void MqttInfo::fill(const orion::BSONObj& bo) this->url = bo.hasField(CSUB_REFERENCE)? getStringFieldF(bo, CSUB_REFERENCE) : ""; this->topic = bo.hasField(CSUB_MQTTTOPIC)? getStringFieldF(bo, CSUB_MQTTTOPIC) : ""; this->qos = bo.hasField(CSUB_MQTTQOS)? getIntFieldF(bo, CSUB_MQTTQOS) : 0; + this->retain = bo.hasField(CSUB_MQTTRETAIN)? getBoolFieldF(bo, CSUB_MQTTRETAIN) : false; this->custom = bo.hasField(CSUB_CUSTOM)? getBoolFieldF(bo, CSUB_CUSTOM) : false; // both user and passwd have to be used at the same time @@ -228,6 +230,7 @@ void MqttInfo::fill(const MqttInfo& _mqttInfo) this->url = _mqttInfo.url; this->topic = _mqttInfo.topic; this->qos = _mqttInfo.qos; + this->retain = _mqttInfo.retain; this->custom = _mqttInfo.custom; this->payload = _mqttInfo.payload; this->payloadType = _mqttInfo.payloadType; diff --git a/src/lib/apiTypesV2/MqttInfo.h b/src/lib/apiTypesV2/MqttInfo.h index 8465d1c663..738e73c6a9 100644 --- a/src/lib/apiTypesV2/MqttInfo.h +++ b/src/lib/apiTypesV2/MqttInfo.h @@ -44,6 +44,7 @@ struct MqttInfo std::string url; std::string topic; unsigned int qos; // 0, 1 or 2 + bool retain; bool custom; std::string payload; // either payload, json or ngsi is used (depending on payloadType) diff --git a/src/lib/cache/subCache.cpp b/src/lib/cache/subCache.cpp index 936e9ef7cc..5f27c0cd9d 100644 --- a/src/lib/cache/subCache.cpp +++ b/src/lib/cache/subCache.cpp @@ -291,6 +291,12 @@ int subCacheItems(void) */ static bool attributeMatch(CachedSubscription* cSubP, const std::vector& attrV) { + // If the list of attributes to check is empty, then no match + if (attrV.size() == 0) + { + return false; + } + if (cSubP->notifyConditionV.size() == 0) { return true; diff --git a/src/lib/common/globals.h b/src/lib/common/globals.h index c328782e7f..73c68c7187 100644 --- a/src/lib/common/globals.h +++ b/src/lib/common/globals.h @@ -95,6 +95,7 @@ #define DATE_MODIFIED "dateModified" #define DATE_EXPIRES "dateExpires" #define ALTERATION_TYPE "alterationType" +#define SERVICE_PATH "servicePath" #define ALL_ATTRS "*" @@ -233,6 +234,7 @@ extern unsigned long fcStepDelay; extern unsigned long fcMaxInterval; extern unsigned long logInfoPayloadMaxSize; +extern bool logDeprecate; /* **************************************************************************** diff --git a/src/lib/common/logTracing.cpp b/src/lib/common/logTracing.cpp index 092964fc9e..26904d5628 100644 --- a/src/lib/common/logTracing.cpp +++ b/src/lib/common/logTracing.cpp @@ -29,6 +29,19 @@ #include "logMsg/logMsg.h" + + +/* **************************************************************************** +* +* isNgsiV1Url +*/ +inline bool isNgsiV1Url(const char* url) +{ + return (strstr(url, "v1") || strcasestr(url, "ngsi10") || strcasestr(url, "ngsi9")); +} + + + /* **************************************************************************** * * logInfoNotification - rc as int @@ -95,9 +108,15 @@ void logInfoRequestWithoutPayload ) { LM_I(("Request received: %s %s, response code: %d", verb, url, rc)); + + if (logDeprecate && isNgsiV1Url(url)) + { + LM_W(("Deprecated NGSIv1 request received: %s %s, response code: %d", verb, url, rc)); + } } + /* **************************************************************************** * * truncatePayload - @@ -147,6 +166,11 @@ void logInfoRequestWithPayload LM_I(("Request received: %s %s, request payload (%d bytes): %s, response code: %d", verb, url, strlen(payload), effectivePayload, rc)); + if (logDeprecate && isNgsiV1Url(url)) + { + LM_W(("Deprecated NGSIv1 request received: %s %s, request payload (%d bytes): %s, response code: %d", verb, url, strlen(payload), effectivePayload, rc)); + } + if (cleanAfterUse) { free(effectivePayload); diff --git a/src/lib/common/statistics.cpp b/src/lib/common/statistics.cpp index 1da9e1d029..de902948ff 100644 --- a/src/lib/common/statistics.cpp +++ b/src/lib/common/statistics.cpp @@ -79,59 +79,62 @@ UrlCounter noOfRequestCounters[] = {VersionRequest, "version", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, {MetricsRequest, "admin", -1, -1, -1, -1, -1, -1, true, false, false, false, true, false}, + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future // v1 and ngsi10 legacy GET POST PATCH PUT DELET OPT - {ContextEntitiesByEntityId, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {ContextEntityAttributes, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {EntityByIdAttributeByName, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {ContextEntityTypes, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {ContextEntityTypeAttributeContainer, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {ContextEntityTypeAttribute, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{ContextEntitiesByEntityId, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{ContextEntityAttributes, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{EntityByIdAttributeByName, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{ContextEntityTypes, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{ContextEntityTypeAttributeContainer, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{ContextEntityTypeAttribute, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {IndividualContextEntity, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, - {IndividualContextEntity, "ngsi10", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntity, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntity, "ngsi10", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + {IndividualContextEntity, "v1", -1, -1, -1, -1, -1, -1, false, false, false, true, true, false}, - {IndividualContextEntityAttributes, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, - {IndividualContextEntityAttributes, "ngsi10", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntityAttributes, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntityAttributes, "ngsi10", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false},ç - {IndividualContextEntityAttribute, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, - {IndividualContextEntityAttribute, "ngsi10", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntityAttribute, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntityAttribute, "ngsi10", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + {IndividualContextEntityAttribute, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10ContextEntityTypes, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10ContextEntityTypes, "ngsi10", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{Ngsi10ContextEntityTypes, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{Ngsi10ContextEntityTypes, "ngsi10", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10ContextEntityTypesAttributeContainer, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10ContextEntityTypesAttributeContainer, "ngsi10", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{Ngsi10ContextEntityTypesAttributeContainer, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{Ngsi10ContextEntityTypesAttributeContainer, "ngsi10", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10ContextEntityTypesAttribute, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10ContextEntityTypesAttribute, "ngsi10", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{Ngsi10ContextEntityTypesAttribute, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{Ngsi10ContextEntityTypesAttribute, "ngsi10", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {Ngsi10SubscriptionsConvOp, "v1", -1, -1, -1, -1, -1, -1, false, false, false, true, true, false}, - {Ngsi10SubscriptionsConvOp, "ngsi10", -1, -1, -1, -1, -1, -1, false, false, false, true, true, false}, + //{Ngsi10SubscriptionsConvOp, "v1", -1, -1, -1, -1, -1, -1, false, false, false, true, true, false}, + //{Ngsi10SubscriptionsConvOp, "ngsi10", -1, -1, -1, -1, -1, -1, false, false, false, true, true, false}, - {EntityTypes, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {AttributesForEntityType, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, - {AllContextEntities, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {AllEntitiesWithTypeAndId, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, - {IndividualContextEntityAttributeWithTypeAndId, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, - {ContextEntitiesByEntityIdAndType, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {EntityByIdAttributeByNameIdAndType, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{EntityTypes, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{AttributesForEntityType, "v1", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, + //{AllContextEntities, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{AllEntitiesWithTypeAndId, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{IndividualContextEntityAttributeWithTypeAndId, "v1", -1, -1, -1, -1, -1, -1, true, true, false, true, true, false}, + //{ContextEntitiesByEntityIdAndType, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, + //{EntityByIdAttributeByNameIdAndType, "v1", -1, -1, -1, -1, -1, -1, true, true, false, false, false, false}, - {RegisterContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, - {DiscoverContextAvailability, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, + //{RegisterContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, + //{DiscoverContextAvailability, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, {UpdateContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, {UpdateContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, {QueryContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, {QueryContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, - {SubscribeContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // two URLs: subscribeContext and contextSubscriptions - {SubscribeContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // two URLs: subscribeContext and contextSubscriptions - {UpdateContextSubscription, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, - {UpdateContextSubscription, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, - {UnsubscribeContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, - {UnsubscribeContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, - - {NotifyContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // also in v2 - {NotifyContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // also in v2 + //{SubscribeContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // two URLs: subscribeContext and contextSubscriptions + //{SubscribeContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // two URLs: subscribeContext and contextSubscriptions + //{UpdateContextSubscription, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, + //{UpdateContextSubscription, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, + //{UnsubscribeContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, + //{UnsubscribeContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, + + //{NotifyContext, "v1", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // also in v2 + //{NotifyContext, "ngsi10", -1, -1, -1, -1, -1, -1, false, true, false, false, false, false}, // also in v2 // Special ones (LeakRequest MUST be always the last one in the array. See statisticsUpdate() and resetStatistics() comments {ExitRequest, "exit", -1, -1, -1, -1, -1, -1, true, false, false, false, false, false}, diff --git a/src/lib/common/string.cpp b/src/lib/common/string.cpp index 37f44d3e52..2bfc72e99a 100644 --- a/src/lib/common/string.cpp +++ b/src/lib/common/string.cpp @@ -996,6 +996,14 @@ std::string double2string(double f) } } + /* At this point a value like 7.999999999536117 ends as "8." in buf + * which is not a legal JSON (see issue #4346). This check will remove + * the trailing dot in this case */ + if (buf[strlen(buf) - 1] == '.') + { + buf[strlen(buf) - 1] = 0; + } + return std::string(buf); } diff --git a/src/lib/jsonParseV2/parseSubscription.cpp b/src/lib/jsonParseV2/parseSubscription.cpp index a70821df72..f68e11c259 100644 --- a/src/lib/jsonParseV2/parseSubscription.cpp +++ b/src/lib/jsonParseV2/parseSubscription.cpp @@ -649,6 +649,31 @@ static std::string parseMqttQoS(ConnectionInfo* ciP, SubscriptionUpdate* subsP, +/* **************************************************************************** +* +* parseMqttRetain - +*/ +static std::string parseMqttRetain(ConnectionInfo* ciP, SubscriptionUpdate* subsP, const Value& mqtt) +{ + Opt retainOpt = getBoolOpt(mqtt, "retain"); + if (!retainOpt.ok()) + { + return badInput(ciP, retainOpt.error); + } + if (retainOpt.given) + { + subsP->notification.mqttInfo.retain = retainOpt.value; + } + else + { + subsP->notification.mqttInfo.retain = 0; + } + + return ""; +} + + + /* **************************************************************************** * * parseMqttTopic - @@ -1035,6 +1060,13 @@ static std::string parseNotification(ConnectionInfo* ciP, SubscriptionUpdate* su return r; } + // retain + r = parseMqttRetain(ciP, subsP, mqtt); + if (!r.empty()) + { + return r; + } + // topic r = parseMqttTopic(ciP, subsP, mqtt); if (!r.empty()) @@ -1076,6 +1108,13 @@ static std::string parseNotification(ConnectionInfo* ciP, SubscriptionUpdate* su return r; } + // retain + r = parseMqttRetain(ciP, subsP, mqttCustom); + if (!r.empty()) + { + return r; + } + // topic (same as in not custom mqtt) r = parseMqttTopic(ciP, subsP, mqttCustom); if (!r.empty()) diff --git a/src/lib/mongoBackend/MongoCommonSubscription.cpp b/src/lib/mongoBackend/MongoCommonSubscription.cpp index c5f6c7a1e0..dd6bcf3101 100644 --- a/src/lib/mongoBackend/MongoCommonSubscription.cpp +++ b/src/lib/mongoBackend/MongoCommonSubscription.cpp @@ -286,12 +286,14 @@ void setNotificationInfo(const Subscription& sub, orion::BSONObjBuilder* b) b->append(CSUB_REFERENCE, sub.notification.mqttInfo.url); b->append(CSUB_MQTTTOPIC, sub.notification.mqttInfo.topic); b->append(CSUB_MQTTQOS, (int) sub.notification.mqttInfo.qos); + b->append(CSUB_MQTTRETAIN, sub.notification.mqttInfo.retain); b->append(CSUB_CUSTOM, sub.notification.mqttInfo.custom); - LM_T(LmtMongo, ("Subscription reference: %s", sub.notification.mqttInfo.url.c_str())); - LM_T(LmtMongo, ("Subscription mqttTopic: %s", sub.notification.mqttInfo.topic.c_str())); - LM_T(LmtMongo, ("Subscription mqttQos: %d", sub.notification.mqttInfo.qos)); - LM_T(LmtMongo, ("Subscription custom: %s", sub.notification.mqttInfo.custom? "true" : "false")); + LM_T(LmtMongo, ("Subscription reference: %s", sub.notification.mqttInfo.url.c_str())); + LM_T(LmtMongo, ("Subscription mqttTopic: %s", sub.notification.mqttInfo.topic.c_str())); + LM_T(LmtMongo, ("Subscription mqttQos: %d", sub.notification.mqttInfo.qos)); + LM_T(LmtMongo, ("Subscription mqttRetain: %s", sub.notification.mqttInfo.retain? "true": "false")); + LM_T(LmtMongo, ("Subscription custom: %s", sub.notification.mqttInfo.custom? "true" : "false")); if (sub.notification.mqttInfo.providedAuth) { diff --git a/src/lib/mongoBackend/MongoCommonUpdate.cpp b/src/lib/mongoBackend/MongoCommonUpdate.cpp index f14ee53427..e00218931b 100644 --- a/src/lib/mongoBackend/MongoCommonUpdate.cpp +++ b/src/lib/mongoBackend/MongoCommonUpdate.cpp @@ -316,7 +316,7 @@ static bool attrValueChanges(const orion::BSONObj& attr, ContextAttribute* caP, return caP->valueType != orion::ValueTypeNull; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str())); return false; } } @@ -405,6 +405,7 @@ static ChangeType mergeAttrInfo // value is omitted from toSet in the case some operator ($inc, etc.) is used if (!isSomeCalculatedOperatorUsed(caP)) { + // FIXME P7: boolean return value should be managed? caP->valueBson(composedName + "." + ENT_ATTRS_VALUE, toSet, getStringFieldF(attr, ENT_ATTRS_TYPE), ngsiv1Autocast && (apiVersion == V1)); } } @@ -441,7 +442,7 @@ static ChangeType mergeAttrInfo break; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), caP->name.c_str())); } } @@ -663,6 +664,7 @@ static bool updateAttribute newAttr.append(ENT_ATTRS_CREATION_DATE, now); newAttr.append(ENT_ATTRS_MODIFICATION_DATE, now); + // FIXME P7: boolean return value should be managed? caP->valueBson(std::string(ENT_ATTRS_VALUE), &newAttr, attrType, ngsiv1Autocast && (apiVersion == V1)); /* Custom metadata */ @@ -742,6 +744,7 @@ static bool appendAttribute // value is omitted from toSet in the case some operator ($inc, etc.) is used if (!isSomeCalculatedOperatorUsed(caP)) { + // FIXME P7: boolean return value should be managed? caP->valueBson(composedName + "." + ENT_ATTRS_VALUE, toSet, caP->type, ngsiv1Autocast && (apiVersion == V1)); } @@ -1694,6 +1697,8 @@ static bool addTriggeredSubscriptions_noCache } else if ((targetAltType == ngsiv2::EntityChange) || (targetAltType == ngsiv2::EntityCreate)) { + // Skip if: 1) there is no change in the *value* of attributes listed in conditions.attrs and 2) there is no change + // in the *metadata* of the attributes listed in conditions.attrs (the 2) only if notifyOnMetadtaChange is true) if (!condValueAttrMatch(sub, attrsWithModifiedValue) && !(notifyOnMetadataChange && condValueAttrMatch(sub, attrsWithModifiedMd))) { continue; @@ -2022,8 +2027,9 @@ static unsigned int processSubscriptions continue; } - orion::BSONObjBuilder bobQuery; - if (!processAreaScopeV2(&geoScope, &bobQuery, true)) + orion::BSONObjBuilder bobQuery; // used only to keep processAreaScopeV2() signature + orion::BSONObjBuilder bobCountQuery; + if (!processAreaScopeV2(&geoScope, &bobQuery, &bobCountQuery)) { // Error in processAreaScopeV2 is interpreted as no-match (conservative approach) continue; @@ -2039,12 +2045,12 @@ static unsigned int processSubscriptions std::string type = notifyCerP->entity.type; std::string sp = notifyCerP->entity.servicePath; - bobQuery.append(keyId, id); - bobQuery.append(keyType, type); - bobQuery.append(keySp, sp); + bobCountQuery.append(keyId, id); + bobCountQuery.append(keyType, type); + bobCountQuery.append(keySp, sp); unsigned long long n; - if (!orion::collectionCount(composeDatabaseName(tenant), COL_ENTITIES, bobQuery.obj(), &n, &filterErr)) + if (!orion::collectionCount(composeDatabaseName(tenant), COL_ENTITIES, bobCountQuery.obj(), &n, &filterErr)) { // Error in database access is interpreted as no-match (conservative approach) continue; @@ -2930,12 +2936,17 @@ static bool createEntity attrType = attrsV[ix]->type; } + if (!attrsV[ix]->valueBson(std::string(ENT_ATTRS_VALUE), &bsonAttr, attrType, ngsiv1Autocast && (apiVersion == V1))) + { + // nothing added to bsonAttr, so attribute is not going to be included in the update to the MongoDB + // (for example, when $unset:1 is used) + continue; + } + bsonAttr.append(ENT_ATTRS_TYPE, attrType); bsonAttr.append(ENT_ATTRS_CREATION_DATE, now); bsonAttr.append(ENT_ATTRS_MODIFICATION_DATE, now); - attrsV[ix]->valueBson(std::string(ENT_ATTRS_VALUE), &bsonAttr, attrType, ngsiv1Autocast && (apiVersion == V1)); - std::string effectiveName = dbEncode(attrsV[ix]->name); LM_T(LmtMongo, ("new attribute: {name: %s, type: %s, value: %s}", @@ -4407,7 +4418,6 @@ unsigned int processContextElement /* Successful creation: send potential notifications */ std::map subsToNotify; std::vector attrNames; - std::vector attributes; for (unsigned int ix = 0; ix < eP->attributeVector.size(); ++ix) { @@ -4438,6 +4448,7 @@ unsigned int processContextElement // one item, so it should be safe to get item 0 // ContextElementResponse* notifyCerP = new ContextElementResponse(eP, apiVersion == V2); + notifyCerP->applyUpdateOperators(); // Set action type setActionType(notifyCerP, NGSI_MD_ACTIONTYPE_APPEND); diff --git a/src/lib/mongoBackend/MongoGlobal.cpp b/src/lib/mongoBackend/MongoGlobal.cpp index 5813561550..599d69af8d 100644 --- a/src/lib/mongoBackend/MongoGlobal.cpp +++ b/src/lib/mongoBackend/MongoGlobal.cpp @@ -104,6 +104,7 @@ bool mongoMultitenant(void) */ void mongoInit ( + const char* dbURI, const char* dbHost, const char* rplSet, std::string dbName, @@ -123,7 +124,8 @@ void mongoInit // Set the global multitenant variable multitenant = mtenant; - if (orion::mongoConnectionPoolInit(dbHost, + if (orion::mongoConnectionPoolInit(dbURI, + dbHost, dbName.c_str(), rplSet, user, @@ -836,6 +838,11 @@ static std::string sortCriteria(const std::string& sortToken) return ENT_MODIFICATION_DATE; } + if (sortToken == SERVICE_PATH) + { + return std::string("_id.") + ENT_SERVICE_PATH; + } + if (sortToken == ENT_ENTITY_ID) { return std::string("_id.") + ENT_ENTITY_ID; @@ -855,9 +862,19 @@ static std::string sortCriteria(const std::string& sortToken) * * processAreaScopeV2 - * -* Returns true if areaQueryP was filled, false otherwise +* Returns true if queryP/countQueryP were filled, false otherwise +* +* Most of the cases queryP and countQueryP are filled the same way. However, in the case of near georel they +* are different. This is due to: +* +* - we need to use $near in the query used to search (queryP), due to the alternative using $geoWithin +* (described in https://stackoverflow.com/a/76416103/1485926) doesn't sort result by center proximity, so +* ?orderBy=distance will break +* - we cannot use $near in the query used to count (countQueryP) as it doesn't work with modern count functions +* (see the aforementioned link). +* */ -bool processAreaScopeV2(const Scope* scoP, orion::BSONObjBuilder* queryP, bool avoidNearUsage) +bool processAreaScopeV2(const Scope* scoP, orion::BSONObjBuilder* queryP, orion::BSONObjBuilder* countQueryP) { // FIXME #3774: previously this part was based in streamming instead of append() @@ -964,119 +981,115 @@ bool processAreaScopeV2(const Scope* scoP, orion::BSONObjBuilder* queryP, bool a orion::BSONObjBuilder bobArea; if (scoP->georel.type == "near") { - if (avoidNearUsage) - { - // $near operation is problematic in countDocument() - // operation (see https://stackoverflow.com/questions/66143435/countdocuments-with-geo-queries-using-mindistance-semantics) - // In abscence of a better alternative I have used a solution as the one - // described at https://jira.mongodb.org/browse/DOCS-12834 - // This works as far as we don't have any other $and field in the query, in which - // case the array for $and here needs to be combined with other items - // - // Why don't use this query style without $near all the time? Because $near provides - // ordering of results based in distance to the center, so in regular find() is the one - // we want to use - // - // Note that and empty query $and: [ ] could not happen, as the parsing logic check that - // at least minDistance or maxDistance are there. Check functional tests - // - // * 1177_geometry_and_coords/geometry_and_coords_errors.test, step 7 - // * 1677_geo_location_for_api_v2/geo_location_for_api_v2_error_cases.test, step 6 - - orion::BSONArrayBuilder andArray; - - orion::BSONArrayBuilder coordsBuilder; - coordsBuilder.append(scoP->point.longitude()); - coordsBuilder.append(scoP->point.latitude()); - orion::BSONArray coords = coordsBuilder.arr(); - - if (scoP->georel.maxDistance >= 0) - { - orion::BSONObjBuilder andToken; + // 1. query used for count (without $near) - orion::BSONObjBuilder geoWithinMax; - orion::BSONArrayBuilder centerMax; - centerMax.append(coords); - centerMax.append(scoP->georel.maxDistance / EARTH_RADIUS_METERS); - geoWithinMax.append("$centerSphere", centerMax.arr()); + // This works as far as we don't have any other $and field in the query, in which + // case the array for $and here needs to be combined with other items. Currently, + // users of processAreaScopesV2() doesn't do add any new $and clause. + // + // Note that and empty query $and: [ ] could not happen, as the parsing logic check that + // at least minDistance or maxDistance are there. Check functional tests + // + // * 1177_geometry_and_coords/geometry_and_coords_errors.test, step 7 + // * 1677_geo_location_for_api_v2/geo_location_for_api_v2_error_cases.test, step 6 - orion::BSONObjBuilder loc; - loc.append("$geoWithin", geoWithinMax.obj()); + orion::BSONArrayBuilder andArray; - andToken.append(keyLoc, loc.obj()); + orion::BSONArrayBuilder coordsBuilder; + coordsBuilder.append(scoP->point.longitude()); + coordsBuilder.append(scoP->point.latitude()); + orion::BSONArray coords = coordsBuilder.arr(); - andArray.append(andToken.obj()); - } + if (scoP->georel.maxDistance >= 0) + { + orion::BSONObjBuilder andToken; - if (scoP->georel.minDistance == 0) - { - // This is somehow a degenerate case, as any point in the space is - // more than 0 distance than any other point :). In this case we only - // check for existance of the location - orion::BSONObjBuilder existTrue; - existTrue.append("$exists", true); + orion::BSONObjBuilder geoWithinMax; + orion::BSONArrayBuilder centerMax; + centerMax.append(coords); + centerMax.append(scoP->georel.maxDistance / EARTH_RADIUS_METERS); + geoWithinMax.append("$centerSphere", centerMax.arr()); - orion::BSONObjBuilder andToken; - andToken.append(keyLoc, existTrue.obj()); + orion::BSONObjBuilder loc; + loc.append("$geoWithin", geoWithinMax.obj()); - andArray.append(andToken.obj()); - } - else if (scoP->georel.minDistance > 0) - { - orion::BSONObjBuilder andToken; + andToken.append(keyLoc, loc.obj()); - orion::BSONObjBuilder geoWithinMin; - orion::BSONArrayBuilder centerMin; - centerMin.append(coords); - centerMin.append(scoP->georel.minDistance / EARTH_RADIUS_METERS); - geoWithinMin.append("$centerSphere", centerMin.arr()); + andArray.append(andToken.obj()); + } - orion::BSONObjBuilder loc; - loc.append("$geoWithin", geoWithinMin.obj()); + if (scoP->georel.minDistance == 0) + { + // This is somehow a degenerate case, as any point in the space is + // more than 0 distance than any other point :). In this case we only + // check for existance of the location + orion::BSONObjBuilder existTrue; + existTrue.append("$exists", true); - orion::BSONObjBuilder notx; - notx.append("$not", loc.obj()); + orion::BSONObjBuilder andToken; + andToken.append(keyLoc, existTrue.obj()); - andToken.append(keyLoc, notx.obj()); + andArray.append(andToken.obj()); + } + else if (scoP->georel.minDistance > 0) + { + orion::BSONObjBuilder andToken; - andArray.append(andToken.obj()); - } + orion::BSONObjBuilder geoWithinMin; + orion::BSONArrayBuilder centerMin; + centerMin.append(coords); + centerMin.append(scoP->georel.minDistance / EARTH_RADIUS_METERS); + geoWithinMin.append("$centerSphere", centerMin.arr()); + + orion::BSONObjBuilder loc; + loc.append("$geoWithin", geoWithinMin.obj()); + + orion::BSONObjBuilder notx; + notx.append("$not", loc.obj()); + + andToken.append(keyLoc, notx.obj()); - queryP->append("$and", andArray.arr()); + andArray.append(andToken.obj()); } - else - { - orion::BSONObjBuilder near; - near.append("$geometry", geometry); + countQueryP->append("$and", andArray.arr()); - if (scoP->georel.maxDistance >= 0) - { - near.append("$maxDistance", scoP->georel.maxDistance); - } + // 2. Query used for count (with $near) - if (scoP->georel.minDistance >= 0) - { - near.append("$minDistance", scoP->georel.minDistance); - } + orion::BSONObjBuilder near; - bobArea.append("$near", near.obj()); - queryP->append(keyLoc, bobArea.obj()); + near.append("$geometry", geometry); + + if (scoP->georel.maxDistance >= 0) + { + near.append("$maxDistance", scoP->georel.maxDistance); + } + + if (scoP->georel.minDistance >= 0) + { + near.append("$minDistance", scoP->georel.minDistance); } + + bobArea.append("$near", near.obj()); + queryP->append(keyLoc, bobArea.obj()); } else if (scoP->georel.type == "coveredBy") { orion::BSONObjBuilder bobGeom; bobGeom.append("$geometry", geometry); bobArea.append("$geoWithin", bobGeom.obj()); + queryP->append(keyLoc, bobArea.obj()); + countQueryP->append(keyLoc, bobArea.obj()); } else if (scoP->georel.type == "intersects") { orion::BSONObjBuilder bobGeom; bobGeom.append("$geometry", geometry); bobArea.append("$geoIntersects", bobGeom.obj()); + queryP->append(keyLoc, bobArea.obj()); + countQueryP->append(keyLoc, bobArea.obj()); } else if (scoP->georel.type == "disjoint") { @@ -1088,10 +1101,12 @@ bool processAreaScopeV2(const Scope* scoP, orion::BSONObjBuilder* queryP, bool a bobArea.append("$not", bobNot.obj()); queryP->append(keyLoc, bobArea.obj()); + countQueryP->append(keyLoc, bobArea.obj()); } else if (scoP->georel.type == "equals") { queryP->append(keyLoc, geometry); + countQueryP->append(keyLoc, geometry); } else { @@ -1305,6 +1320,11 @@ void addBuiltins(ContextElementResponse* cerP, const std::string& alterationType addIfNotPresentAttr(&cerP->entity, ALTERATION_TYPE, DEFAULT_ATTR_STRING_TYPE, alterationType); } + // servicePath + if (!cerP->entity.servicePath.empty()) + { + addIfNotPresentAttr(&cerP->entity, SERVICE_PATH, DEFAULT_ATTR_STRING_TYPE, cerP->entity.servicePath); + } for (unsigned int ix = 0; ix < cerP->entity.attributeVector.size(); ix++) { @@ -1401,6 +1421,7 @@ bool entitiesQuery */ orion::BSONObjBuilder finalQuery; + orion::BSONObjBuilder finalCountQuery; orion::BSONArrayBuilder orEnt; /* Part 1: entities - avoid $or in the case of a single element */ @@ -1410,6 +1431,7 @@ bool entitiesQuery fillQueryEntity(&bob, enV[0]); orion::BSONObj entObj = bob.obj(); finalQuery.appendElements(entObj); + finalCountQuery.appendElements(entObj); LM_T(LmtMongo, ("Entity single query token: '%s'", entObj.toString().c_str())); } @@ -1425,12 +1447,14 @@ bool entitiesQuery LM_T(LmtMongo, ("Entity query token: '%s'", entObj.toString().c_str())); } finalQuery.append("$or", orEnt.arr()); + finalCountQuery.append("$or", orEnt.arr()); } /* Part 2: service path */ if (servicePathFilterNeeded(servicePath)) { finalQuery.appendElements(fillQueryServicePath("_id." ENT_SERVICE_PATH, servicePath)); + finalCountQuery.appendElements(fillQueryServicePath("_id." ENT_SERVICE_PATH, servicePath)); } /* Part 3: attributes */ @@ -1464,6 +1488,7 @@ bool entitiesQuery orion::BSONObjBuilder bob; bob.append("$in", attrs.arr()); finalQuery.append(ENT_ATTRNAMES, bob.obj()); + finalCountQuery.append(ENT_ATTRNAMES, bob.obj()); } /* Part 5: scopes */ @@ -1492,7 +1517,7 @@ bool entitiesQuery { if (scopeP->type == FIWARE_LOCATION_V2) { - processAreaScopeV2(scopeP, &finalQuery); + processAreaScopeV2(scopeP, &finalQuery, &finalCountQuery); } else // FIWARE Location NGSIv1 (legacy) { @@ -1507,6 +1532,7 @@ bool entitiesQuery for (unsigned int ix = 0; ix < scopeP->stringFilterP->mongoFilters.size(); ++ix) { finalQuery.appendElements(scopeP->stringFilterP->mongoFilters[ix]); + finalCountQuery.appendElements(scopeP->stringFilterP->mongoFilters[ix]); } } } @@ -1517,6 +1543,7 @@ bool entitiesQuery for (unsigned int ix = 0; ix < scopeP->mdStringFilterP->mongoFilters.size(); ++ix) { finalQuery.appendElements(scopeP->mdStringFilterP->mongoFilters[ix]); + finalCountQuery.appendElements(scopeP->mdStringFilterP->mongoFilters[ix]); } } } @@ -1530,6 +1557,7 @@ bool entitiesQuery for (unsigned int ix = 0; ix < filters.size(); ++ix) { finalQuery.appendElements(filters[ix]); + finalCountQuery.appendElements(filters[ix]); } LM_T(LmtPagination, ("Offset: %d, Limit: %d, countP: %p", offset, limit, countP)); @@ -1538,6 +1566,7 @@ bool entitiesQuery orion::DBCursor cursor; orion::BSONObj query = finalQuery.obj(); + orion::BSONObj countQuery = finalCountQuery.obj(); orion::BSONObj sort; if (sortOrderList.empty()) @@ -1584,7 +1613,7 @@ bool entitiesQuery TIME_STAT_MONGO_READ_WAIT_START(); orion::DBConnection connection = orion::getMongoConnection(); - if (!orion::collectionRangedQuery(connection, composeDatabaseName(tenant), COL_ENTITIES, query, sort, limit, offset, &cursor, countP, err)) + if (!orion::collectionRangedQuery(connection, composeDatabaseName(tenant), COL_ENTITIES, query, countQuery, sort, limit, offset, &cursor, countP, err)) { orion::releaseMongoConnection(connection); TIME_STAT_MONGO_READ_WAIT_STOP(); @@ -2113,7 +2142,7 @@ bool registrationsQuery orion::BSONObjBuilder bobSort; bobSort.append("_id", 1); - if (!orion::collectionRangedQuery(connection, composeDatabaseName(tenant), COL_REGISTRATIONS, query, bobSort.obj(), limit, offset, &cursor, countP, err)) + if (!orion::collectionRangedQuery(connection, composeDatabaseName(tenant), COL_REGISTRATIONS, query, query, bobSort.obj(), limit, offset, &cursor, countP, err)) { orion::releaseMongoConnection(connection); TIME_STAT_MONGO_READ_WAIT_STOP(); @@ -2197,6 +2226,12 @@ bool condValueAttrMatch(const orion::BSONObj& sub, const std::vector conds = getFieldF(sub, CSUB_CONDITIONS).Array(); + // If the list of attributes to check is empty, then no match + if (modifiedAttrs.size() == 0) + { + return false; + } + if (conds.size() == 0) { // ONANYCHANGE case: always match diff --git a/src/lib/mongoBackend/MongoGlobal.h b/src/lib/mongoBackend/MongoGlobal.h index 6ce1cf54a6..9b750e01b5 100644 --- a/src/lib/mongoBackend/MongoGlobal.h +++ b/src/lib/mongoBackend/MongoGlobal.h @@ -71,6 +71,7 @@ extern bool mongoMultitenant(void); */ void mongoInit ( + const char* dbURI, const char* dbHost, const char* rplSet, std::string dbName, @@ -214,7 +215,7 @@ extern bool includedAttribute(const std::string& attrName, const StringList& att * processAreaScopeV2 - * */ -extern bool processAreaScopeV2(const Scope* scoP, orion::BSONObjBuilder* queryP, bool avoidNearUsasge = false); +extern bool processAreaScopeV2(const Scope* scoP, orion::BSONObjBuilder* queryP, orion::BSONObjBuilder* countQueryP); diff --git a/src/lib/mongoBackend/dbConstants.h b/src/lib/mongoBackend/dbConstants.h index 92b798e3c4..b55cf29925 100644 --- a/src/lib/mongoBackend/dbConstants.h +++ b/src/lib/mongoBackend/dbConstants.h @@ -128,6 +128,7 @@ #define CSUB_MQTTTOPIC "topic" #define CSUB_MQTTQOS "qos" +#define CSUB_MQTTRETAIN "retain" #define CSUB_USER "user" #define CSUB_PASSWD "passwd" @@ -153,4 +154,19 @@ #define UPDATE_OPERATORS_NUMBER 6 const std::string UPDATE_OPERATORS[UPDATE_OPERATORS_NUMBER] = { "$inc", "$min", "$max", "$mul", "$push", "$pull" }; +#define UPDATE_OPERATORS_NUMBER_ALL 10 +const std::string UPDATE_OPERATORS_ALL[UPDATE_OPERATORS_NUMBER_ALL] = { "$inc", "$min", "$max", "$mul", "$push", "$pull", "$set", "$unset", "$addToSet", "$pullAll" }; + +inline bool isUpdateOperator(const std::string& s) +{ + for (unsigned ix = 0; ix < UPDATE_OPERATORS_NUMBER_ALL; ix++) + { + if (s == UPDATE_OPERATORS_ALL[ix]) + { + return true; + } + } + return false; +} + #endif // SRC_LIB_MONGOBACKEND_DBCONSTANTS_H_ diff --git a/src/lib/mongoBackend/location.cpp b/src/lib/mongoBackend/location.cpp index c043964820..e683c320ad 100644 --- a/src/lib/mongoBackend/location.cpp +++ b/src/lib/mongoBackend/location.cpp @@ -324,6 +324,11 @@ static bool getGeoJson // This corresponds to the legacy way in NGSIv1 based in metadata // The block is the same that for GEO_POINT but it is clearer if we keep it separated + if (logDeprecate) + { + LM_W(("Deprecated usage of metadata location %s detected in attribute %s at entity update, please use geo:json instead", caP->type.c_str(), caP->name.c_str())); + } + double aLat; double aLong; @@ -343,6 +348,11 @@ static bool getGeoJson return true; } + if ((logDeprecate) && ((caP->type == GEO_POINT) || (caP->type == GEO_LINE) || (caP->type == GEO_BOX) || (caP->type == GEO_POLYGON))) + { + LM_W(("Deprecated usage of %s detected in attribute %s at entity update, please use geo:json instead", caP->type.c_str(), caP->name.c_str())); + } + if (caP->type == GEO_POINT) { double aLat; @@ -391,6 +401,7 @@ static bool getGeoJson else { // Autocast doesn't make sense in this context, strings2numbers enabled in the case of NGSIv1 + // FIXME P7: boolean return value should be managed? caP->valueBson(std::string(ENT_ATTRS_VALUE), &bo, "", true, apiVersion == V1); geoJson->appendElements(getObjectFieldF(bo.obj(), ENT_ATTRS_VALUE)); } diff --git a/src/lib/mongoBackend/mongoGetSubscriptions.cpp b/src/lib/mongoBackend/mongoGetSubscriptions.cpp index 2c94fee6bd..e82588166d 100644 --- a/src/lib/mongoBackend/mongoGetSubscriptions.cpp +++ b/src/lib/mongoBackend/mongoGetSubscriptions.cpp @@ -339,6 +339,7 @@ void mongoListSubscriptions composeDatabaseName(tenant), COL_CSUBS, q, + q, sortBy.obj(), limit, offset, diff --git a/src/lib/mongoBackend/mongoQueryContext.cpp b/src/lib/mongoBackend/mongoQueryContext.cpp index ad89ce71d4..fd8f1799b5 100644 --- a/src/lib/mongoBackend/mongoQueryContext.cpp +++ b/src/lib/mongoBackend/mongoQueryContext.cpp @@ -430,7 +430,7 @@ HttpStatusCode mongoQueryContext /* Special case: request with attributes. In that case, entitiesQuery() may have captured some local attribute, but * the list needs to be completed. Note that in the case of having this request someContextElementNotFound() is always false - * so we efficient not invoking registrationQuery() too much times + * so we efficient not invoking registrationsQuery() too much times */ if (requestP->attributeList.size() == 0) { diff --git a/src/lib/mongoBackend/mongoRegistrationGet.cpp b/src/lib/mongoBackend/mongoRegistrationGet.cpp index 1bfe6a661b..09f93abd34 100644 --- a/src/lib/mongoBackend/mongoRegistrationGet.cpp +++ b/src/lib/mongoBackend/mongoRegistrationGet.cpp @@ -363,7 +363,7 @@ void mongoRegistrationsGet TIME_STAT_MONGO_READ_WAIT_START(); orion::DBConnection connection = orion::getMongoConnection(); - if (!orion::collectionRangedQuery(connection, composeDatabaseName(tenant), COL_REGISTRATIONS, q, bSort.obj(), limit, offset, &cursor, countP, &err)) + if (!orion::collectionRangedQuery(connection, composeDatabaseName(tenant), COL_REGISTRATIONS, q, q, bSort.obj(), limit, offset, &cursor, countP, &err)) { orion::releaseMongoConnection(connection); TIME_STAT_MONGO_READ_WAIT_STOP(); diff --git a/src/lib/mongoBackend/mongoSubCache.cpp b/src/lib/mongoBackend/mongoSubCache.cpp index af37929ac8..dbf10cb6ea 100644 --- a/src/lib/mongoBackend/mongoSubCache.cpp +++ b/src/lib/mongoBackend/mongoSubCache.cpp @@ -315,6 +315,8 @@ int mongoSubCacheItemInsert long long lastSuccessCode, long long count, long long failsCounter, + long long failsCounterFromDb, + bool failsCounterFromDbValid, long long expirationTime, const std::string& status, double statusLastChange, @@ -419,6 +421,8 @@ int mongoSubCacheItemInsert cSubP->lastSuccessCode = lastSuccessCode; cSubP->count = count; cSubP->failsCounter = failsCounter; + cSubP->failsCounterFromDb = failsCounterFromDb; + cSubP->failsCounterFromDbValid = failsCounterFromDbValid; cSubP->status = status; cSubP->statusLastChange = statusLastChange; diff --git a/src/lib/mongoBackend/mongoSubCache.h b/src/lib/mongoBackend/mongoSubCache.h index 5b24a81573..d2184f4ae4 100644 --- a/src/lib/mongoBackend/mongoSubCache.h +++ b/src/lib/mongoBackend/mongoSubCache.h @@ -63,6 +63,8 @@ extern int mongoSubCacheItemInsert long long lastSuccessCode, long long count, long long failsCounter, + long long failsCounterFromDb, + bool failsCounterFromDbValid, long long expirationTime, const std::string& status, double statusLastChange, diff --git a/src/lib/mongoBackend/mongoUpdateSubscription.cpp b/src/lib/mongoBackend/mongoUpdateSubscription.cpp index 2f07d3c6e2..c967b03519 100644 --- a/src/lib/mongoBackend/mongoUpdateSubscription.cpp +++ b/src/lib/mongoBackend/mongoUpdateSubscription.cpp @@ -69,6 +69,7 @@ void setNotificationInfo(const Subscription& sub, orion::BSONObjBuilder* setB, o { unsetB->append(CSUB_MQTTTOPIC, 1); unsetB->append(CSUB_MQTTQOS, 1); + unsetB->append(CSUB_MQTTRETAIN, 1); unsetB->append(CSUB_USER, 1); unsetB->append(CSUB_PASSWD, 1); @@ -231,6 +232,8 @@ static void updateInCache long long lastSuccessCode; long long count; long long failsCounter; + long long failsCounterFromDb; + bool failsCounterFromDbValid; std::string status; double statusLastChange; @@ -243,6 +246,8 @@ static void updateInCache lastSuccessCode = subCacheP->lastSuccessCode; count = subCacheP->count; failsCounter = subCacheP->failsCounter; + failsCounterFromDb = subCacheP->failsCounterFromDb; + failsCounterFromDbValid = subCacheP->failsCounterFromDbValid; status = subCacheP->status; statusLastChange = subCacheP->statusLastChange; } @@ -255,6 +260,8 @@ static void updateInCache lastSuccessCode = -1; count = 0; failsCounter = 0; + failsCounterFromDb = 0; + failsCounterFromDbValid = false; status = ""; statusLastChange = -1; } @@ -278,6 +285,8 @@ static void updateInCache lastSuccessCode, count, failsCounter, + failsCounterFromDb, + failsCounterFromDbValid, doc.hasField(CSUB_EXPIRATION)? getLongFieldF(doc, CSUB_EXPIRATION) : 0, effectiveStatus, effectiveStatusLastChante, diff --git a/src/lib/mongoDriver/connectionOperations.cpp b/src/lib/mongoDriver/connectionOperations.cpp index 98893c3b89..d0f5ca0b9f 100644 --- a/src/lib/mongoDriver/connectionOperations.cpp +++ b/src/lib/mongoDriver/connectionOperations.cpp @@ -36,6 +36,7 @@ #include "mongoDriver/BSONObjBuilder.h" #include "mongoDriver/BSONArrayBuilder.h" #include "mongoDriver/mongoConnectionPool.h" +#include "mongoDriver/safeMongo.h" @@ -115,6 +116,11 @@ bool orion::collectionQuery * Different from others, this function doesn't use getMongoConnection() and * releaseMongoConnection(). It is assumed that the caller will do, as the * connection cannot be released before the cursor has been used. +* +* Note we have _q (query for search) and _countQuery (query for count) given that +* in some rare occasions they may be different (in particular, when geo-queries are +* used, see processAreaScopeV2 function for more detail). However, most of the times +* this function is called with same value for _q and _countQuery */ bool orion::collectionRangedQuery ( @@ -122,6 +128,7 @@ bool orion::collectionRangedQuery const std::string& db, const std::string& col, const orion::BSONObj& _q, + const orion::BSONObj& _countQuery, const orion::BSONObj& _sort, int limit, int offset, @@ -143,18 +150,23 @@ bool orion::collectionRangedQuery } // Getting low level driver object - bson_t* q = _q.get(); + bson_t* q = _q.get(); + bson_t* qc = _countQuery.get(); + bson_t* sort = _sort.get(); + char* bsonStr = bson_as_relaxed_extended_json(q, NULL); + char* bsonStrCount = bson_as_relaxed_extended_json(qc, NULL); + char* bsonStrSort = bson_as_relaxed_extended_json(sort, NULL); - LM_T(LmtMongo, ("query() in '%s' collection limit=%d, offset=%d: '%s'", - ns.c_str(), limit, offset, bsonStr)); + LM_T(LmtMongo, ("query() in '%s' collection limit=%d, offset=%d, query='%s', count='%s', sort='%s'", + ns.c_str(), limit, offset, bsonStr, bsonStrCount, bsonStrSort)); mongoc_collection_t *collection = mongoc_client_get_collection(connection, db.c_str(), col.c_str()); // First, set countP (if used). In the case of error, we return early and the actual query doesn't take place if (count != NULL) { bson_error_t error; - long long n = mongoc_collection_count_documents(collection, q, NULL, NULL, NULL, &error); + long long n = mongoc_collection_count_documents(collection, qc, NULL, NULL, NULL, &error); if (n >= 0) { *count = n; @@ -162,7 +174,7 @@ bool orion::collectionRangedQuery else { std::string msg = std::string("collection: ") + ns.c_str() + - " - count_documents(): " + bsonStr + + " - count_documents: " + bsonStrCount + " - exception: " + error.message; *err = "Database Error (" + msg + ")"; @@ -170,6 +182,8 @@ bool orion::collectionRangedQuery mongoc_collection_destroy(collection); bson_free(bsonStr); + bson_free(bsonStrCount); + bson_free(bsonStrSort); return false; } @@ -177,7 +191,7 @@ bool orion::collectionRangedQuery // Build the options document bson_t* opt = bson_new(); - BSON_APPEND_DOCUMENT(opt, "sort", _sort.get()); + BSON_APPEND_DOCUMENT(opt, "sort", sort); BSON_APPEND_INT32(opt, "limit", limit); BSON_APPEND_INT32(opt, "skip", offset); @@ -193,7 +207,8 @@ bool orion::collectionRangedQuery if (mongoc_cursor_error(c, &error)) { std::string msg = std::string("collection: ") + ns + - " - query(): " + bsonStr + + " - query: " + bsonStr + + " - opt: " + bsonOptStr + " - exception: " + error.message; *err = "Database Error (" + msg + ")"; @@ -212,6 +227,8 @@ bool orion::collectionRangedQuery } bson_free(bsonStr); + bson_free(bsonStrCount); + bson_free(bsonStrSort); bson_free(bsonOptStr); return r; @@ -318,7 +335,7 @@ bool orion::collectionFindOne *err = ""; - if (!collectionRangedQuery(connection, db, col, _q, orion::BSONObj(), 1, 0, &cursor, NULL, err)) + if (!collectionRangedQuery(connection, db, col, _q, orion::BSONObj(), orion::BSONObj(), 1, 0, &cursor, NULL, err)) { orion::releaseMongoConnection(connection); TIME_STAT_MONGO_READ_WAIT_STOP(); diff --git a/src/lib/mongoDriver/connectionOperations.h b/src/lib/mongoDriver/connectionOperations.h index 4259818ac6..0644488015 100644 --- a/src/lib/mongoDriver/connectionOperations.h +++ b/src/lib/mongoDriver/connectionOperations.h @@ -61,6 +61,7 @@ extern bool collectionRangedQuery const std::string& db, const std::string& col, const BSONObj& q, + const BSONObj& countQuery, const BSONObj& sort, int limit, int offset, diff --git a/src/lib/mongoDriver/mongoConnectionPool.cpp b/src/lib/mongoDriver/mongoConnectionPool.cpp index 281b1c472c..ed0d1db07c 100644 --- a/src/lib/mongoDriver/mongoConnectionPool.cpp +++ b/src/lib/mongoDriver/mongoConnectionPool.cpp @@ -316,6 +316,7 @@ static void mongoDriverLogger */ static std::string composeMongoUri ( + const char* dbURI, const char* host, const char* rplSet, const char* username, @@ -329,54 +330,82 @@ static std::string composeMongoUri { // Compose the mongoUri, taking into account all information - std::string uri = "mongodb://"; + std::string uri; - // Add auth parameter if included - if (strlen(username) != 0 && strlen(passwd) != 0) + if (strlen(dbURI) != 0) { - uri += username + std::string(":") + passwd + "@"; - } + if (strlen(username) != 0 || strlen(authDb) != 0 || strlen(rplSet) != 0 || strlen(mechanism) != 0 || dbSSL || dbDisableRetryWrites || timeout > 0) + { + LM_X(1, ("Invalid Command Line Options: -dbURI cannot be combined with -dbhost, -rplSet, -dbTimeout, -dbuser, -dbAuthMech, -dbAuthDb, -dbSSL and -dbDisableRetryWrites")); + } - uri += host + std::string("/"); + const char* pwd = strstr(dbURI, "${PWD}"); + if (pwd != NULL) + { + if (strlen(passwd) == 0) + { + LM_X(1, ("Invalid Command Line Options: -dbURI is used with a password substitution, but no password (-dbpwd) is supplied")); + } - if (strlen(authDb) != 0) - { - uri += authDb; + // +6 is the length of the "${PWD}" + uri = std::string(dbURI, pwd - dbURI) + passwd + (pwd + 6); + } + else + { + uri = dbURI; + } } + else + { + uri = "mongodb://"; - // First option prefix is '?' symbol - std::string optionPrefix = "?"; + // Add auth parameter if included + if (strlen(username) != 0 && strlen(passwd) != 0) + { + uri += username + std::string(":") + passwd + "@"; + } - if (strlen(rplSet) != 0) - { - uri += optionPrefix + "replicaSet=" + rplSet; - optionPrefix = "&"; - } + uri += host + std::string("/"); - if (strlen(mechanism) != 0) - { - uri += optionPrefix + "authMechanism=" + mechanism; - optionPrefix = "&"; - } + if (strlen(authDb) != 0) + { + uri += authDb; + } - if (dbSSL) - { - uri += optionPrefix + "tls=true&tlsAllowInvalidCertificates=true"; - optionPrefix = "&"; - } + // First option prefix is '?' symbol + std::string optionPrefix = "?"; - if (dbDisableRetryWrites) - { - uri += optionPrefix + "retryWrites=false"; - optionPrefix = "&"; - } + if (strlen(rplSet) != 0) + { + uri += optionPrefix + "replicaSet=" + rplSet; + optionPrefix = "&"; + } - if (timeout > 0) - { - char buf[STRING_SIZE_FOR_LONG]; - i2s(timeout, buf, sizeof(buf)); - uri += optionPrefix + "connectTimeoutMS=" + buf; - optionPrefix = "&"; + if (strlen(mechanism) != 0) + { + uri += optionPrefix + "authMechanism=" + mechanism; + optionPrefix = "&"; + } + + if (dbSSL) + { + uri += optionPrefix + "tls=true&tlsAllowInvalidCertificates=true"; + optionPrefix = "&"; + } + + if (dbDisableRetryWrites) + { + uri += optionPrefix + "retryWrites=false"; + optionPrefix = "&"; + } + + if (timeout > 0) + { + char buf[STRING_SIZE_FOR_LONG]; + i2s(timeout, buf, sizeof(buf)); + uri += optionPrefix + "connectTimeoutMS=" + buf; + optionPrefix = "&"; + } } LM_T(LmtMongo, ("MongoDB connection URI: '%s'", offuscatePassword(uri, passwd).c_str())); @@ -392,6 +421,7 @@ static std::string composeMongoUri */ int orion::mongoConnectionPoolInit ( + const char* dbURI, const char* host, const char* db, const char* rplSet, @@ -421,7 +451,7 @@ int orion::mongoConnectionPoolInit atexit(shutdownClient); // Set mongo Uri to connect - std::string uri = composeMongoUri(host, rplSet, username, passwd, mechanism, authDb, dbSSL, dbDisableRetryWrites, timeout); + std::string uri = composeMongoUri(dbURI, host, rplSet, username, passwd, mechanism, authDb, dbSSL, dbDisableRetryWrites, timeout); #ifdef UNIT_TEST /* Basically, we are mocking all the DB pool with a single connection. The getMongoConnection() and mongoReleaseConnection() methods diff --git a/src/lib/mongoDriver/mongoConnectionPool.h b/src/lib/mongoDriver/mongoConnectionPool.h index 79ca14c9e3..0dddc183ae 100644 --- a/src/lib/mongoDriver/mongoConnectionPool.h +++ b/src/lib/mongoDriver/mongoConnectionPool.h @@ -46,6 +46,7 @@ extern void mongoVersionGet(int* mayor, int* minor); */ extern int mongoConnectionPoolInit ( + const char* dbURI, const char* host, const char* db, const char* rplSet, diff --git a/src/lib/mqtt/MqttConnectionManager.cpp b/src/lib/mqtt/MqttConnectionManager.cpp index 7477b22cdf..00ef88b9a0 100644 --- a/src/lib/mqtt/MqttConnectionManager.cpp +++ b/src/lib/mqtt/MqttConnectionManager.cpp @@ -366,7 +366,7 @@ MqttConnection* MqttConnectionManager::getConnection(const std::string& host, in * * MqttConnectionManager::sendMqttNotification - */ -bool MqttConnectionManager::sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos) +bool MqttConnectionManager::sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos, bool retain) { std::string endpoint = getEndpoint(host, port); @@ -394,7 +394,7 @@ bool MqttConnectionManager::sendMqttNotification(const std::string& host, int po int id; bool retval; - int resultCode = mosquitto_publish(mosq, &id, topic.c_str(), (int) strlen(msg), msg, qos, false); + int resultCode = mosquitto_publish(mosq, &id, topic.c_str(), (int) strlen(msg), msg, qos, retain); if (resultCode != MOSQ_ERR_SUCCESS) { retval = false; diff --git a/src/lib/mqtt/MqttConnectionManager.h b/src/lib/mqtt/MqttConnectionManager.h index 97f8788c82..f80e1c25f6 100644 --- a/src/lib/mqtt/MqttConnectionManager.h +++ b/src/lib/mqtt/MqttConnectionManager.h @@ -69,7 +69,7 @@ class MqttConnectionManager const char* semGet(void); - bool sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos); + bool sendMqttNotification(const std::string& host, int port, const std::string& user, const std::string& passwd, const std::string& content, const std::string& topic, unsigned int qos, bool retain); void cleanup(double maxAge); private: diff --git a/src/lib/ngsi/ContextAttribute.cpp b/src/lib/ngsi/ContextAttribute.cpp index 2dd1e8d11d..f2aade9e7b 100644 --- a/src/lib/ngsi/ContextAttribute.cpp +++ b/src/lib/ngsi/ContextAttribute.cpp @@ -133,18 +133,146 @@ void ContextAttribute::bsonAppendAttrValue break; default: - LM_E(("Runtime Error (unknown attribute type: %d)", valueType)); + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); } } +/* **************************************************************************** +* +* ContextAttribute::calculateOperator - +* +* Return true if the some append was done in bsonAttr, false otherwise +*/ +bool ContextAttribute::calculateOperator +( + const std::string& valueKey, + orion::CompoundValueNode* upOp, + orion::BSONObjBuilder* bsonAttr, + bool strings2numbers +) const +{ + std::string op = upOp->name; + if (op == "$inc") + { + bsonAttr->append(valueKey, upOp->numberValue); + } + else if (op == "$min") + { + if (upOp->numberValue > 0) + { + bsonAttr->append(valueKey, 0); + } + else + { + bsonAttr->append(valueKey, upOp->numberValue); + } + } + else if (op == "$max") + { + if (upOp->numberValue > 0) + { + bsonAttr->append(valueKey, upOp->numberValue); + } + else + { + bsonAttr->append(valueKey, 0); + } + } + else if (op == "$mul") + { + bsonAttr->append(valueKey, 0); + } + else if ((op == "$push") || (op == "$addToSet")) + { + orion::BSONArrayBuilder ba; + orion::BSONArrayBuilder ba2; + switch (upOp->valueType) + { + case orion::ValueTypeString: + ba.append(upOp->stringValue); + break; + + case orion::ValueTypeNumber: + ba.append(upOp->numberValue); + break; + + case orion::ValueTypeBoolean: + ba.append(upOp->boolValue); + break; + + case orion::ValueTypeNull: + ba.appendNull(); + break; + + case orion::ValueTypeVector: + case orion::ValueTypeObject: + compoundValueBson(compoundValueP->childV, ba2, strings2numbers); + ba.append(ba2.arr()); + break; + + case orion::ValueTypeNotGiven: + LM_E(("Runtime Error (value not given in compound value)")); + return false; + + default: + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); + return false; + } + + bsonAttr->append(valueKey, ba.arr()); + } + else if (op == "$set") + { + orion::BSONObjBuilder bo; + switch (upOp->valueType) + { + case orion::ValueTypeString: + case orion::ValueTypeNumber: + case orion::ValueTypeBoolean: + case orion::ValueTypeNull: + case orion::ValueTypeVector: + // Nothing to do in the case of inconsisent $set, e.g. {$set: 1} + // FIXME P4: this could be detected at parsing stage and deal with it as Bad Input, but it is harder... + break; + + case orion::ValueTypeObject: + compoundValueBson(upOp->childV, bo, strings2numbers); + bsonAttr->append(valueKey, bo.obj()); + break; + + case orion::ValueTypeNotGiven: + LM_E(("Runtime Error (value not given in compound value)")); + return false; + + default: + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", valueType, name.c_str())); + return false; + } + } + else if ((op == "$unset") || (op == "$pull") || (op == "$pullAll")) + { + // By returning false we signal that attribute must be removed (by the caller) + return false; + } + else + { + LM_E(("Runtime Error (unknown operator: %s)", op.c_str())); + return false; + } + + return true; +} + + /* **************************************************************************** * * ContextAttribute::valueBson - * +* Return true if some append operation was done bsonAttr, false otherwise */ -void ContextAttribute::valueBson +bool ContextAttribute::valueBson ( const std::string& valueKey, orion::BSONObjBuilder* bsonAttr, @@ -167,10 +295,21 @@ void ContextAttribute::valueBson } else if (compoundValueP->valueType == orion::ValueTypeObject) { - orion::BSONObjBuilder b; - - compoundValueBson(compoundValueP->childV, b, strings2numbers); - bsonAttr->append(valueKey, b.obj()); + // Special processing of update operators + if ((compoundValueP->childV.size() > 0) && (isUpdateOperator(compoundValueP->childV[0]->name))) + { + if (!calculateOperator(valueKey, compoundValueP->childV[0], bsonAttr, strings2numbers)) + { + // in this case we return without generating any BSON + return false; + } + } + else + { + orion::BSONObjBuilder b; + compoundValueBson(compoundValueP->childV, b, strings2numbers); + bsonAttr->append(valueKey, b.obj()); + } } else if (compoundValueP->valueType == orion::ValueTypeString) { @@ -195,12 +334,16 @@ void ContextAttribute::valueBson else if (compoundValueP->valueType == orion::ValueTypeNotGiven) { LM_E(("Runtime Error (value not given in compound value)")); + return false; } else { LM_E(("Runtime Error (Unknown type in compound value)")); + return false; } } + + return true; } diff --git a/src/lib/ngsi/ContextAttribute.h b/src/lib/ngsi/ContextAttribute.h index 82072d6943..ba3a474df7 100644 --- a/src/lib/ngsi/ContextAttribute.h +++ b/src/lib/ngsi/ContextAttribute.h @@ -122,7 +122,7 @@ typedef struct ContextAttribute std::string getName(void); /* Used to render attribute value to BSON */ - void valueBson(const std::string& valueKey, + bool valueBson(const std::string& valueKey, orion::BSONObjBuilder* bsonAttr, const std::string& attrType, bool autocast, @@ -146,6 +146,10 @@ typedef struct ContextAttribute bool hasIgnoreType(void) const; + bool calculateOperator(const std::string& valueKey, + orion::CompoundValueNode* upOp, + orion::BSONObjBuilder* bsonAttr, + bool strings2numbers) const; } ContextAttribute; diff --git a/src/lib/ngsi/ContextAttributeVector.cpp b/src/lib/ngsi/ContextAttributeVector.cpp index 7b47958863..812f8c9af8 100644 --- a/src/lib/ngsi/ContextAttributeVector.cpp +++ b/src/lib/ngsi/ContextAttributeVector.cpp @@ -389,7 +389,7 @@ void ContextAttributeVector::fill break; default: - LM_E(("Runtime Error (unknown attribute value type in DB: %d)", getFieldF(attr, ENT_ATTRS_VALUE).type())); + LM_E(("Runtime Error (unknown attribute value type in DB: %d on attribute %s)", getFieldF(attr, ENT_ATTRS_VALUE).type(), ca.name.c_str())); } } @@ -536,6 +536,7 @@ void ContextAttributeVector::toBson bsonAttr.append(ENT_ATTRS_MODIFICATION_DATE, now); } + // FIXME P7: boolean return value should be managed? this->vec[ix]->valueBson(std::string(ENT_ATTRS_VALUE), &bsonAttr, attrType, ngsiv1Autocast && (apiVersion == V1)); std::string effectiveName = dbEncode(this->vec[ix]->name); @@ -560,3 +561,174 @@ void ContextAttributeVector::toBson attrNamesToAdd->append(this->vec[ix]->name); } } + + + +/* **************************************************************************** +* +* ContextAttributeVector::applyUpdateOperators - +*/ +void ContextAttributeVector::applyUpdateOperators(void) +{ + std::vector toErase; + + for (unsigned int ix = 0; ix < vec.size(); ++ix) + { + if (vec[ix]->compoundValueP != NULL) + { + if ((vec[ix]->compoundValueP->valueType == orion::ValueTypeObject) && (vec[ix]->compoundValueP->childV.size() > 0) && (isUpdateOperator(vec[ix]->compoundValueP->childV[0]->name))) + { + orion::CompoundValueNode* upOp = vec[ix]->compoundValueP->childV[0]; + std::string op = upOp->name; + if (op == "$inc") + { + vec[ix]->valueType = orion::ValueTypeNumber; + vec[ix]->numberValue = upOp->numberValue; + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = NULL; + } + else if (op == "$min") + { + vec[ix]->valueType = orion::ValueTypeNumber; + if (upOp->numberValue > 0) + { + vec[ix]->numberValue = 0; + } + else + { + vec[ix]->numberValue = upOp->numberValue; + } + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = NULL; + } + else if (op == "$max") + { + vec[ix]->valueType = orion::ValueTypeNumber; + if (upOp->numberValue > 0) + { + vec[ix]->numberValue = upOp->numberValue; + } + else + { + vec[ix]->numberValue = 0; + } + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = NULL; + } + else if (op == "$mul") + { + vec[ix]->valueType = orion::ValueTypeNumber; + vec[ix]->numberValue = 0; + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = NULL; + } + else if ((op == "$push") || (op == "$addToSet")) + { + orion::CompoundValueNode* v = new orion::CompoundValueNode(orion::ValueTypeVector); + orion::CompoundValueNode* inner; + vec[ix]->valueType = orion::ValueTypeVector; + + switch (upOp->valueType) + { + case orion::ValueTypeString: + v->add(orion::ValueTypeString, "", upOp->stringValue); + break; + + case orion::ValueTypeNumber: + v->add(orion::ValueTypeNumber, "", upOp->numberValue); + break; + + case orion::ValueTypeBoolean: + v->add(orion::ValueTypeBoolean, "", upOp->boolValue); + break; + + case orion::ValueTypeNull: + v->add(orion::ValueTypeNull, "", ""); + break; + + case orion::ValueTypeVector: + inner = new orion::CompoundValueNode(orion::ValueTypeVector); + for (unsigned int jx = 0; jx < upOp->childV.size(); jx++) + { + inner->add(upOp->childV[jx]->clone()); + } + v->add(inner); + break; + + case orion::ValueTypeObject: + inner = new orion::CompoundValueNode(orion::ValueTypeObject); + for (unsigned int jx = 0; jx < upOp->childV.size(); jx++) + { + inner->add(upOp->childV[jx]->clone()); + } + v->add(inner); + break; + + case orion::ValueTypeNotGiven: + LM_E(("Runtime Error (value not given in compound value)")); + break; + + default: + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); + } + + // Replace old compound value (with $push) with the new one ([]) + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = v; + } + else if (op == "$set") + { + orion::CompoundValueNode* o = new orion::CompoundValueNode(orion::ValueTypeObject); + //orion::CompoundValueNode* inner; + vec[ix]->valueType = orion::ValueTypeObject; + + switch (upOp->valueType) + { + case orion::ValueTypeString: + case orion::ValueTypeNumber: + case orion::ValueTypeBoolean: + case orion::ValueTypeNull: + case orion::ValueTypeVector: + // Nothing to do in the case of inconsisent $set, e.g. {$set: 1} + // FIXME P4: this could be detected at parsing stage and deal with it as Bad Input, but it is harder... + break; + + case orion::ValueTypeObject: + for (unsigned int jx = 0; jx < upOp->childV.size(); jx++) + { + o->add(upOp->childV[jx]->clone()); + } + break; + + case orion::ValueTypeNotGiven: + LM_E(("Runtime Error (value not given in compound value)")); + break; + + default: + LM_E(("Runtime Error (unknown attribute value type: %d on attribute %s)", upOp->valueType, vec[ix]->name.c_str())); + } + + // Replace old compound value (with $push) with the new one ([]) + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = o; + + } + else if ((op == "$unset") || (op == "$pull") || (op == "$pullAll")) + { + // FIXME P5: we are forcing shadowed semantics here. It could be a problem if the attribute used in the update + // triggering the notification (eg. A: {$unset: 1}) is also in the notifications.attrs list (note that shadowed + // was designed for built-in attributes, and they are included if splicitelly included in notifications.attr). + // However, this case would be *very rare* and the alternative (to keep track of items in vec[] to be removed + // at the end of 'for' processing) would be much more complex + vec[ix]->shadowed = true; + delete vec[ix]->compoundValueP; + vec[ix]->compoundValueP = NULL; + } + else + { + LM_E(("Runtime Error (unknown operator: %s", op.c_str())); + } + } + } + } +} diff --git a/src/lib/ngsi/ContextAttributeVector.h b/src/lib/ngsi/ContextAttributeVector.h index 22e35fddd1..05cc96c260 100644 --- a/src/lib/ngsi/ContextAttributeVector.h +++ b/src/lib/ngsi/ContextAttributeVector.h @@ -76,6 +76,8 @@ typedef struct ContextAttributeVector orion::BSONArrayBuilder* attrNamesToAdd, ApiVersion apiVersion) const; + void applyUpdateOperators(void); + } ContextAttributeVector; #endif // SRC_LIB_NGSI_CONTEXTATTRIBUTEVECTOR_H_ diff --git a/src/lib/ngsi/ContextElementResponse.cpp b/src/lib/ngsi/ContextElementResponse.cpp index cb0b7c489e..17671098a2 100644 --- a/src/lib/ngsi/ContextElementResponse.cpp +++ b/src/lib/ngsi/ContextElementResponse.cpp @@ -229,6 +229,17 @@ std::string ContextElementResponse::toJson +/* **************************************************************************** +* +* ContextElementResponse::applyUpdateOperators - +*/ +void ContextElementResponse::applyUpdateOperators(void) +{ + entity.applyUpdateOperators(); +} + + + /* **************************************************************************** * * ContextElementResponse::release - diff --git a/src/lib/ngsi/ContextElementResponse.h b/src/lib/ngsi/ContextElementResponse.h index 40ba3d9e36..999dd50a48 100644 --- a/src/lib/ngsi/ContextElementResponse.h +++ b/src/lib/ngsi/ContextElementResponse.h @@ -86,6 +86,8 @@ typedef struct ContextElementResponse const std::vector& metadataFilter, std::map* replacementsP); + void applyUpdateOperators(void); + void release(void); std::string check(ApiVersion apiVersion, diff --git a/src/lib/ngsi/Request.cpp b/src/lib/ngsi/Request.cpp index bb9e2735be..b81db82c7d 100644 --- a/src/lib/ngsi/Request.cpp +++ b/src/lib/ngsi/Request.cpp @@ -172,35 +172,87 @@ std::string requestTypeForCounter(RequestType rt, const std::string& _prefix) } // pure v1 - case RegisterContext: return "/v1/registry/registerContext"; - case ContextEntitiesByEntityId: return "/v1/registry/contextEntities/{id}"; - case ContextEntitiesByEntityIdAndType: return "/v1/registry/contextEntities/type/{type}/id/{id}"; - case ContextEntityAttributes: return "/v1/registry/contextEntities/{id}/attributes"; - case ContextEntityTypeAttribute: return "/v1/registry/contextEntityTypes/{type}/attributes/{name}"; - case ContextEntityTypeAttributeContainer: return "/v1/registry/contextEntityTypes/{type}/attributes"; - case ContextEntityTypes: return "/v1/registry/contextEntityTypes/{type}"; - case DiscoverContextAvailability: return "/v1/registry/discoverContextAvailability"; - case EntityByIdAttributeByName: return "/v1/registry/contextEntities/{id}/attributes/{name}"; - case EntityByIdAttributeByNameIdAndType: return "/v1/registry/contextEntities/type/{type}/id/{id}/attributes/{name}"; - case EntityTypes: return "/v1/contextTypes"; + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //case RegisterContext: return "/v1/registry/registerContext"; + //case ContextEntitiesByEntityId: return "/v1/registry/contextEntities/{id}"; + //case ContextEntitiesByEntityIdAndType: return "/v1/registry/contextEntities/type/{type}/id/{id}"; + //case ContextEntityAttributes: return "/v1/registry/contextEntities/{id}/attributes"; + //case ContextEntityTypeAttribute: return "/v1/registry/contextEntityTypes/{type}/attributes/{name}"; + //case ContextEntityTypeAttributeContainer: return "/v1/registry/contextEntityTypes/{type}/attributes"; + //case ContextEntityTypes: return "/v1/registry/contextEntityTypes/{type}"; + //case DiscoverContextAvailability: return "/v1/registry/discoverContextAvailability"; + //case EntityByIdAttributeByName: return "/v1/registry/contextEntities/{id}/attributes/{name}"; + //case EntityByIdAttributeByNameIdAndType: return "/v1/registry/contextEntities/type/{type}/id/{id}/attributes/{name}"; + //case EntityTypes: return "/v1/contextTypes"; + case RegisterContext: + case ContextEntitiesByEntityId: + case ContextEntitiesByEntityIdAndType: + case ContextEntityAttributes: + case ContextEntityTypeAttribute: + case ContextEntityTypeAttributeContainer: + case ContextEntityTypes: + case DiscoverContextAvailability: + case EntityByIdAttributeByName: + case EntityByIdAttributeByNameIdAndType: + case EntityTypes: + return "skip"; // v1 or NGSI10; - case AllContextEntities: return prefix + "/contextEntitites"; - case AllEntitiesWithTypeAndId: return prefix + "/contextEntities/type/{type}/id/{id}"; - case AttributesForEntityType: return prefix + "/contextType/{type}"; - case IndividualContextEntity: return prefix + "/contextEntities/{id}"; - case IndividualContextEntityAttribute: return prefix + "/contextEntities/{id}/attributes/{name}"; - case IndividualContextEntityAttributes: return prefix + "/contextEntities/{id}/attributes/"; - case IndividualContextEntityAttributeWithTypeAndId: return prefix + "/contextEntities/type/{type}/id/{id}/attributes/{name}"; - case Ngsi10ContextEntityTypes: return prefix + "/contextEntityTypes/{type}"; - case Ngsi10ContextEntityTypesAttribute: return prefix + "/contextEntityTypes/{type}/attributes/{name}"; - case Ngsi10ContextEntityTypesAttributeContainer: return prefix + "/contextEntityTypes/{type}/attributes/"; - case Ngsi10SubscriptionsConvOp: return prefix + "/contextSubscriptions/{id}"; + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //case AllContextEntities: return prefix + "/contextEntitites"; + //case AllEntitiesWithTypeAndId: return prefix + "/contextEntities/type/{type}/id/{id}"; + //case AttributesForEntityType: return prefix + "/contextType/{type}"; + //case IndividualContextEntity: return prefix + "/contextEntities/{id}"; + case IndividualContextEntity: + if (prefix == "/v1") + { + return "/v1/contextEntities/{id}"; + } + else + { + // ngsi10 case + return "skip"; + } + + //case IndividualContextEntityAttribute: return prefix + "/contextEntities/{id}/attributes/{name}"; + case IndividualContextEntityAttribute: + if (prefix == "/v1") + { + return "/v1/contextEntities/{id}/attributes/{name}"; + } + else + { + // ngsi10 case + return "skip"; + } + //case IndividualContextEntityAttributes: return prefix + "/contextEntities/{id}/attributes/"; + //case IndividualContextEntityAttributeWithTypeAndId: return prefix + "/contextEntities/type/{type}/id/{id}/attributes/{name}"; + //case Ngsi10ContextEntityTypes: return prefix + "/contextEntityTypes/{type}"; + //case Ngsi10ContextEntityTypesAttribute: return prefix + "/contextEntityTypes/{type}/attributes/{name}"; + //case Ngsi10ContextEntityTypesAttributeContainer: return prefix + "/contextEntityTypes/{type}/attributes/"; + //case Ngsi10SubscriptionsConvOp: return prefix + "/contextSubscriptions/{id}"; case QueryContext: return prefix + "/queryContext"; - case SubscribeContext: return prefix + "/subscribeContext|contextSubscriptions"; - case UnsubscribeContext: return prefix + "/unsubscribeContext"; + //case SubscribeContext: return prefix + "/subscribeContext|contextSubscriptions"; + //case UnsubscribeContext: return prefix + "/unsubscribeContext"; case UpdateContext: return prefix + "/updateContext"; - case UpdateContextSubscription: return prefix + "/updateContextSubscription"; + //case UpdateContextSubscription: return prefix + "/updateContextSubscription"; + case AllContextEntities: + case AllEntitiesWithTypeAndId: + case AttributesForEntityType: + //case IndividualContextEntity: + //case IndividualContextEntityAttribute: + case IndividualContextEntityAttributes: + case IndividualContextEntityAttributeWithTypeAndId: + case Ngsi10ContextEntityTypes: + case Ngsi10ContextEntityTypesAttribute: + case Ngsi10ContextEntityTypesAttributeContainer: + case Ngsi10SubscriptionsConvOp: + //case QueryContext: + case SubscribeContext: + case UnsubscribeContext: + //case UpdateContext: + case UpdateContextSubscription: + return "skip"; // v2, v1 or NGSIv2 case NotifyContext: @@ -210,7 +262,9 @@ std::string requestTypeForCounter(RequestType rt, const std::string& _prefix) } else // v1 or NGSI10 case { - return prefix + "/notifyContext"; + // FIXME: disable unused NGSv1 API routes in Orion 3.9.0, to be definetively removed at some point of the future + //return prefix + "/notifyContext"; + return "skip"; } default: diff --git a/src/lib/ngsiNotify/Notifier.cpp b/src/lib/ngsiNotify/Notifier.cpp index e76bf237fb..75865a4f4f 100644 --- a/src/lib/ngsiNotify/Notifier.cpp +++ b/src/lib/ngsiNotify/Notifier.cpp @@ -531,6 +531,7 @@ static SenderThreadParams* buildSenderParamsCustom paramsP->registration = false; paramsP->subscriptionId = subscriptionId.get(); paramsP->qos = notification.mqttInfo.qos; // unspecified in case of HTTP notifications + paramsP->retain = notification.mqttInfo.retain; // unspecified in case of HTTP notifications paramsP->timeout = notification.httpInfo.timeout; // unspecified in case of MQTT notifications paramsP->user = notification.mqttInfo.user; // unspecified in case of HTTP notifications paramsP->passwd = notification.mqttInfo.passwd; // unspecified in case of HTTP notifications @@ -714,6 +715,7 @@ SenderThreadParams* Notifier::buildSenderParams paramsP->subscriptionId = ncr.subscriptionId.get(); paramsP->registration = false; paramsP->qos = notification.mqttInfo.qos; // unspecified in case of HTTP notifications + paramsP->retain = notification.mqttInfo.retain; // unspecified in case of HTTP notifications paramsP->timeout = notification.httpInfo.timeout; // unspecified in case of MQTT notifications paramsP->user = notification.mqttInfo.user; // unspecified in case of HTTP notifications paramsP->passwd = notification.mqttInfo.passwd; // unspecified in case of HTTP notifications diff --git a/src/lib/ngsiNotify/doNotify.cpp b/src/lib/ngsiNotify/doNotify.cpp index e2785ce781..7598643047 100644 --- a/src/lib/ngsiNotify/doNotify.cpp +++ b/src/lib/ngsiNotify/doNotify.cpp @@ -158,7 +158,7 @@ static void doNotifyMqtt(SenderThreadParams* params) // Note that we use in subNotificationErrorStatus() statusCode -1 and failureReson "" to avoid using // lastFailureReason and lastSuccessCode in MQTT notifications (they don't have sense in this case) - if (mqttMgr.sendMqttNotification(params->ip, params->port, params->user, params->passwd, params->content, params->resource, params->qos)) + if (mqttMgr.sendMqttNotification(params->ip, params->port, params->user, params->passwd, params->content, params->resource, params->qos, params->retain)) { // MQTT transaction is logged only in the case it was actually published. Upon successful publishing // mqttOnPublishCallback is called (by the moment we are not doing nothing there, just printing in diff --git a/src/lib/ngsiNotify/senderThread.h b/src/lib/ngsiNotify/senderThread.h index 5141ab8b78..662902e0ed 100644 --- a/src/lib/ngsiNotify/senderThread.h +++ b/src/lib/ngsiNotify/senderThread.h @@ -60,6 +60,7 @@ typedef struct SenderThreadParams std::string xauthToken; std::string resource; // path for HTTP notifications, topic for MQTT notifications unsigned int qos; // used only in MQTT notifications + unsigned int retain; // used only in MQTT notifications std::string user; // for user/pass auth connections (only MQTT at the present moment) std::string passwd; // for user/pass auth connections (only MQTT at the present moment) std::string content_type; diff --git a/src/lib/rest/StringFilter.cpp b/src/lib/rest/StringFilter.cpp index 52da7d858b..9ac0a26c76 100644 --- a/src/lib/rest/StringFilter.cpp +++ b/src/lib/rest/StringFilter.cpp @@ -1835,6 +1835,10 @@ bool StringFilter::mongoFilterPopulate(std::string* errorStringP) { k = ENT_MODIFICATION_DATE; } + else if (left == SERVICE_PATH) + { + k = std::string("_id.") + ENT_SERVICE_PATH; + } else if (left == itemP->attributeName + "." + ENT_ATTRS_MD "." + NGSI_MD_DATECREATED) { k = std::string(ENT_ATTRS) + "." + itemP->attributeName + "." + ENT_ATTRS_CREATION_DATE; diff --git a/src/lib/rest/httpRequestSend.cpp b/src/lib/rest/httpRequestSend.cpp index 00661e0242..707687cb65 100644 --- a/src/lib/rest/httpRequestSend.cpp +++ b/src/lib/rest/httpRequestSend.cpp @@ -258,7 +258,9 @@ int httpRequestSend long long* statusCodeP, const std::map& extraHeaders, const std::string& acceptFormat, - long timeoutInMilliseconds + long timeoutInMilliseconds, + int providerLimit, + int providerOffset ) { CURL* curl; @@ -575,6 +577,13 @@ int httpRequestSend } url = protocol + url + ":" + portAsString + (resource.at(0) == '/'? "" : "/") + resource; + if ((providerLimit >= 0) && (providerOffset >=0)) + { + std::string pLimit = std::to_string(providerLimit); + std::string pOffset = std::to_string(providerOffset); + url += "?limit=" + pLimit + "&offset=" + pOffset + "&options=count"; + } + if (insecureNotif) { curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); // ignore self-signed certificates for SSL end-points diff --git a/src/lib/rest/httpRequestSend.h b/src/lib/rest/httpRequestSend.h index 813461b6ff..4aac9c5b31 100644 --- a/src/lib/rest/httpRequestSend.h +++ b/src/lib/rest/httpRequestSend.h @@ -68,7 +68,9 @@ extern int httpRequestSend long long* statusCodeP, const std::map& extraHeaders, const std::string& acceptFormat = "", - long timeoutInMilliseconds = -1 + long timeoutInMilliseconds = -1, + int providerLimit = -1, + int providerOffset = -1 ); diff --git a/src/lib/rest/uriParamNames.h b/src/lib/rest/uriParamNames.h index 4ce4e6e2c7..4e99db831c 100644 --- a/src/lib/rest/uriParamNames.h +++ b/src/lib/rest/uriParamNames.h @@ -55,6 +55,7 @@ #define URI_PARAM_LEVEL "level" #define URI_PARAM_PAYLOAD_SIZE "infoPayloadMaxSize" #define URI_PARAM_LOG_SIZE "lineMaxSize" +#define URI_PARAM_DEPRECATE "deprecate" diff --git a/src/lib/serviceRoutines/postQueryContext.cpp b/src/lib/serviceRoutines/postQueryContext.cpp index 6a567333e0..c92c029af3 100644 --- a/src/lib/serviceRoutines/postQueryContext.cpp +++ b/src/lib/serviceRoutines/postQueryContext.cpp @@ -86,6 +86,39 @@ static char* jsonPayloadClean(const char* payload) +/* *************************************************************************** +* +* getProviderCount - +* +* getProviderCount is created for extracting the 'Fiware-Total-Count' header value so that we can add the same into total count, +* And we can get the actualTotalCount value that includes total Entities of CP+CB. +* +* FIXME: this functions relies in text-based processing of the HTTP response stream (which includes headers). +* It would be smarted to parse all the response headers in the response (for instance in a std::map) in the part +* of the code dealing with response processing, so in this part we can just access to 'fiware-total-count' easily +* using something like reponseHeaders["fiware-total-count"] +*/ +static void getProviderCount(std::string cpResponse, long long* totalCount) +{ + std::string token1 = "Fiware-Total-Count", token2 = "\n", token3 = " ", cpCount, tempStr; + size_t pos1 = 0; + + pos1 = cpResponse.find(token1); + cpCount = cpResponse.substr(0, pos1); + cpResponse.erase(0, cpCount.length()); + + pos1 = cpResponse.find(token2); + cpCount = cpResponse.substr(0, pos1); + + pos1 = cpCount.find(token3); + tempStr = cpCount.substr(0, pos1); + cpCount.erase(0, tempStr.length()); + + *totalCount += std::stoll(cpCount.c_str()); +} + + + /* **************************************************************************** * * queryForward - @@ -107,6 +140,9 @@ static bool queryForward ConnectionInfo* ciP, QueryContextRequest* qcrP, const std::string& regId, + int providerLimit, + int providerOffset, + long long* totalCount, unsigned int correlatorCounter, QueryContextResponse* qcrsP ) @@ -270,6 +306,7 @@ static bool queryForward snprintf(portV, sizeof(portV), "%d", port); url = ip + ":" + portV + resource; + // Note that pagination is activated only in the case of NGSIv2-based CPrs r = httpRequestSend(NULL, "regId: " + regId, fromIp, // thread variable @@ -288,7 +325,10 @@ static bool queryForward &out, &statusCode, noHeaders, - mimeType); + mimeType, + -1, // default timeout + qcrP->providerFormat == PfJson? -1 : providerLimit, + qcrP->providerFormat == PfJson? -1 : providerOffset); if (r != 0) { @@ -321,6 +361,11 @@ static bool queryForward logInfoFwdRequest(regId.c_str(), verb.c_str(), (qcrP->contextProvider + op).c_str(), payload.c_str(), cleanPayload, statusCode); + if (ciP->apiVersion == V2 && strstr(out.c_str(), "Fiware-Total-Count")) + { + getProviderCount(out.c_str(), totalCount); + } + if (qcrP->providerFormat == PfJson) { std::string s; @@ -484,20 +529,14 @@ std::string postQueryContext // For API version 1, if the URI parameter 'details' is set to 'on', then the total of local // entities is returned in the errorCode of the payload. // - // In API version 2, this has changed completely. Here, the total count of local entities is returned - // if the URI parameter 'count' is set to 'true', and it is returned in the HTTP header Fiware-Total-Count. - // - if ((ciP->apiVersion == V2) && (ciP->uriParamOptions["count"])) - { - countP = &count; - } - else if ((ciP->apiVersion == V1) && (ciP->uriParam["details"] == "on")) + // In API version 2, this has changed completely. The total count is returned to client the HTTP header Fiware-Total-Count + // only when count option is enabled, but we enable internally the countP variable, as if CPrs are involved in the + // query execution we need it + if ((ciP->apiVersion == V2) || ((ciP->apiVersion == V1) && (ciP->uriParam["details"] == "on"))) { countP = &count; } - - // // 01. Call mongoBackend/mongoQueryContext // @@ -523,20 +562,6 @@ std::string postQueryContext } - // - // If API version 2, add count, if asked for, in HTTP header Fiware-Total-Count - // - if ((ciP->apiVersion == V2) && (countP != NULL)) - { - char cV[32]; - - snprintf(cV, sizeof(cV), "%llu", *countP); - ciP->httpHeader.push_back(HTTP_FIWARE_TOTAL_COUNT); - ciP->httpHeaderValue.push_back(cV); - } - - - // // 02. Normal case (no requests to be forwarded) // @@ -549,6 +574,14 @@ std::string postQueryContext // if (forwardsPending(qcrsP) == false) { + if ((ciP->apiVersion == V2) && (ciP->uriParamOptions["count"])) + { + char cV[32]; + + snprintf(cV, sizeof(cV), "%llu", *countP); + ciP->httpHeader.push_back(HTTP_FIWARE_TOTAL_COUNT); + ciP->httpHeaderValue.push_back(cV); + } TIMED_RENDER(answer = qcrsP->toJsonV1(asJsonObject)); qcrP->release(); @@ -671,6 +704,29 @@ std::string postQueryContext } } + // setting the pagination variables for forwarding the request to CP - + + int providerLimit = atoi(ciP->uriParam[URI_PARAM_PAGINATION_LIMIT].c_str()); + int totalOffset = atoi(ciP->uriParam[URI_PARAM_PAGINATION_OFFSET].c_str()); + int providerOffset = 0; + int brokerCount = 0; + + if (ciP->apiVersion == V2) + { + brokerCount = *countP; + // Setting providerOffset + if (totalOffset >= (*countP)) + { + providerOffset = totalOffset - (*countP); + } + + // Setting providerLimit + if (localQcrsP->contextElementResponseVector.size() >= 0) + { + providerLimit = providerLimit - localQcrsP->contextElementResponseVector.size(); + } + } + // // Any local results in localQcrsP? // @@ -723,8 +779,22 @@ std::string postQueryContext qP = new QueryContextResponse(); qP->errorCode.fill(SccOk); - if (queryForward(ciP, requestV[fIx], regIdsV[fIx], fIx + 1, qP) == true) + if (queryForward(ciP, requestV[fIx], regIdsV[fIx], providerLimit, providerOffset, countP, fIx + 1, qP) == true) { + if (ciP->apiVersion == V2) + { + providerLimit = providerLimit - qP->contextElementResponseVector.size(); + + if (providerOffset > (*countP - brokerCount)) + { + providerOffset -= (*countP - brokerCount); + brokerCount += (*countP - brokerCount); + } + else + { + providerOffset = 0; + } + } // // Each ContextElementResponse of qP should be tested to see whether there // is already an existing ContextElementResponse in responseV @@ -781,6 +851,19 @@ std::string postQueryContext } } + // Before implementing pagination for CPrs, this block of code was part of step 02. + // However, in that step we only have the count for CB entities. It is in the new location + // (after queryForward() invocation) when we have the total count CB+CPr + if ((ciP->apiVersion == V2) && (ciP->uriParamOptions["count"])) + { + char cV[32]; + + snprintf(cV, sizeof(cV), "%llu", *countP); + + ciP->httpHeader.push_back(HTTP_FIWARE_TOTAL_COUNT); + ciP->httpHeaderValue.push_back(cV); + } + std::string detailsString = ciP->uriParam[URI_PARAM_PAGINATION_DETAILS]; bool details = (strcasecmp("on", detailsString.c_str()) == 0)? true : false; diff --git a/src/lib/serviceRoutines/statisticsTreat.cpp b/src/lib/serviceRoutines/statisticsTreat.cpp index ce5607c79b..2fe34c6797 100644 --- a/src/lib/serviceRoutines/statisticsTreat.cpp +++ b/src/lib/serviceRoutines/statisticsTreat.cpp @@ -170,6 +170,13 @@ std::string renderCounterStats(bool fullCounters) (noOfRequestCounters[ix].patch != -1) || (noOfRequestCounters[ix].put != -1) || (noOfRequestCounters[ix]._delete != -1) || (noOfRequestCounters[ix].options != -1)) { + // FIXME: in 3.9.0 most of the NGSIv1/NGSI10 requests were removed. We have invented and speciall value "skip" + // for these cases. This "skip" hack should be removed when we definitively remove all that code + if (requestTypeForCounter(noOfRequestCounters[ix].request, std::string(noOfRequestCounters[ix].prefix)) == "skip") + { + continue; + } + // We add in the accumulator corresponing do the request kind if (((strncmp(noOfRequestCounters[ix].prefix, "v1", strlen("v1"))) == 0) || (strncmp(noOfRequestCounters[ix].prefix, "ngsi10", strlen("ngsi10")) == 0)) { diff --git a/src/lib/serviceRoutines/versionTreat.cpp b/src/lib/serviceRoutines/versionTreat.cpp index 90ff1e98c0..981c81f2b6 100644 --- a/src/lib/serviceRoutines/versionTreat.cpp +++ b/src/lib/serviceRoutines/versionTreat.cpp @@ -88,7 +88,12 @@ std::string libVersions(void) total += curl + "\"" + curlVersion + "\"" + ",\n"; total += mosq + "\"" + mosqVersion + "\"" + ",\n"; total += mhd + "\"" + MHD_get_version() + "\"" + ",\n"; +#ifdef OLD_SSL_VERSION_FORMAT + // Needed by openssl 1.1.1n in Debian 11 and before total += ssl + "\"" + SHLIB_VERSION_NUMBER "\"" + ",\n"; +#else + total += ssl + "\"" + OPENSSL_FULL_VERSION_STR "\"" + ",\n"; +#endif total += rjson + "\"" + RAPIDJSON_VERSION_STRING "\"" + ",\n"; total += mongo + "\"" + MONGOC_VERSION_S "\"" + ",\n"; total += bson + "\"" + BSON_VERSION_S "\"" + "\n"; diff --git a/src/lib/serviceRoutinesV2/logLevelTreat.cpp b/src/lib/serviceRoutinesV2/logLevelTreat.cpp index 08ced3c652..4f9f0522e2 100644 --- a/src/lib/serviceRoutinesV2/logLevelTreat.cpp +++ b/src/lib/serviceRoutinesV2/logLevelTreat.cpp @@ -78,8 +78,9 @@ std::string changeLogConfig int logSizeValue = atoi(logSize.c_str()); std::string payloadSize = ciP->uriParam[URI_PARAM_PAYLOAD_SIZE]; int payloadSizeValue = atoi(payloadSize.c_str()); + std::string deprecate = ciP->uriParam[URI_PARAM_DEPRECATE]; - if (level.empty() && logSize.empty() && payloadSize.empty()) + if (level.empty() && logSize.empty() && payloadSize.empty() && deprecate.empty()) { ciP->httpStatusCode = SccBadRequest; alarmMgr.badInput(clientIp, "no log configs in URI param"); @@ -114,6 +115,12 @@ std::string changeLogConfig } } + if (!deprecate.empty()) + { + std::transform(deprecate.begin(), deprecate.end(), deprecate.begin(), ::tolower); + logDeprecate = deprecate == "true" ? true : false; + } + // // Internally, the broker does not support "warn", nor "fatal". // However, to easy the task for our users, the broker accepts both of them: @@ -165,8 +172,10 @@ std::string getLogConfig std::string level = lmLevelMaskStringGet(); std::string payloadMaxSize = std::to_string(logInfoPayloadMaxSize); std::string lineMaxSize = std::to_string(logLineMaxSize); + std::string deprecate = logDeprecate ? "true" : "false"; return "{\"level\":\"" + level + "\", \ \"infoPayloadMaxSize\":" + payloadMaxSize + ", \ - \"lineMaxSize\":" + lineMaxSize + "}"; + \"lineMaxSize\":" + lineMaxSize + ", \ + \"deprecate\":" + deprecate + "}"; } diff --git a/test/acceptance/behave/requirements.txt b/test/acceptance/behave/requirements.txt index 3c450260ed..587ff63d25 100644 --- a/test/acceptance/behave/requirements.txt +++ b/test/acceptance/behave/requirements.txt @@ -2,7 +2,8 @@ importlib==1.0.3 argparse==1.3.0 behave==1.2.5 PyHamcrest==1.8.3 -requests==2.20.0 +# Blindly update from 2.20.0 (test/acceptance is no longer in use) +requests==2.31.0 xmltodict==0.9.2 fabric==1.10.2 pymongo==3.0.3 diff --git a/test/acceptance/lettuce/requirements.txt b/test/acceptance/lettuce/requirements.txt index f004ef85be..06178d0a7e 100644 --- a/test/acceptance/lettuce/requirements.txt +++ b/test/acceptance/lettuce/requirements.txt @@ -2,6 +2,6 @@ git+https://visitor:visitor@pdihub.hi.inet/fiware/fiware-iotqaUtils@v.3.1.2 pymongo==2.8 flask==2.3.2 # changed from 0.12.3 to 2.3.2 due to vulnerability check in github although we haven't checked if it works... lettuce==0.2.20 -requests==2.20.0 +requests==2.31.0 # changed from 2.20.0 (test/acceptance is no longer in use) psutil==5.6.6 # changed from 2.2.1 to 5.6.6 due to vulnerability check in github although we havent checked if it works... fabric==1.10.0 diff --git a/test/functionalTest/README.jp.md b/test/functionalTest/README.jp.md index fbb23bf38b..b744839cea 100644 --- a/test/functionalTest/README.jp.md +++ b/test/functionalTest/README.jp.md @@ -28,7 +28,7 @@ virtualenv --python=/usr/bin/python3 /path/to/ft_env ``` pip install Flask==2.0.2 pip install paho-mqtt==1.6.1 -pip install amqtt==0.10.1 # Not actually an accumulator-server.py dependency, but needed by some tests +pip install amqtt==0.11.0b1 # Not actually an accumulator-server.py dependency, but needed by some tests ``` 次に、accumulator-server.py のスクリプト自体をインストールします: diff --git a/test/functionalTest/README.md b/test/functionalTest/README.md index 97b91b5f21..541e1f02bc 100644 --- a/test/functionalTest/README.md +++ b/test/functionalTest/README.md @@ -26,7 +26,7 @@ Next install accumulator-server.py depencencies: ``` pip install Flask==2.0.2 pip install paho-mqtt==1.6.1 -pip install amqtt==0.10.1 # Not actually an accumulator-server.py dependency, but needed by some tests +pip install amqtt==0.11.0b1 # Not actually an accumulator-server.py dependency, but needed by some tests ``` Next, install the accumulator-server.py script itself: @@ -50,10 +50,15 @@ You can use the following Dockerfile to build the accumulator: ``` FROM debian:stable RUN apt-get update -y -RUN apt-get install -y python3 -RUN apt-get install -y python3-pip -RUN pip install Flask==2.0.2 -RUN pip install paho-mqtt==1.6.1 +RUN apt-get install -y python3 python3-venv python3-pip + +# Create a virtual environment +RUN python3 -m venv /venv +ENV PATH="/venv/bin:$PATH" + +# Install required packages within the virtual environment +RUN pip install Flask==2.0.2 paho-mqtt==1.6.1 + COPY . /app WORKDIR /app ENTRYPOINT [ "python3", "./accumulator-server.py"] diff --git a/test/functionalTest/cases/0000_bad_requests/erroneous_input.test b/test/functionalTest/cases/0000_bad_requests/erroneous_input.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_bad_requests/erroneous_input.test rename to test/functionalTest/cases/0000_bad_requests/erroneous_input.test.DISABLED diff --git a/test/functionalTest/cases/0000_bad_requests/service_not_recognized.test b/test/functionalTest/cases/0000_bad_requests/service_not_recognized.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_bad_requests/service_not_recognized.test rename to test/functionalTest/cases/0000_bad_requests/service_not_recognized.test.DISABLED diff --git a/test/functionalTest/cases/0000_cli/bool_option_with_value.test b/test/functionalTest/cases/0000_cli/bool_option_with_value.test index ec0a890625..157a33b97a 100644 --- a/test/functionalTest/cases/0000_cli/bool_option_with_value.test +++ b/test/functionalTest/cases/0000_cli/bool_option_with_value.test @@ -50,6 +50,7 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] [option '-port' ] [option '-pidpath' ] + [option '-dbURI' ] [option '-dbhost' ] [option '-rplSet' ] [option '-dbuser' ] @@ -98,8 +99,10 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-logLineMaxSize' ] [option '-logInfoPayloadMaxSize' ] [option '-disableMetrics' (turn off the 'metrics' feature)] + [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] [option '-insecureNotif' (allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates)] [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations)] [option '-mqttMaxAge' ] + [option '-logDeprecate' (log deprecation usages as warnings)] --TEARDOWN-- diff --git a/test/functionalTest/cases/0000_cli/command_line_options.test b/test/functionalTest/cases/0000_cli/command_line_options.test index d890888c07..20a639175b 100644 --- a/test/functionalTest/cases/0000_cli/command_line_options.test +++ b/test/functionalTest/cases/0000_cli/command_line_options.test @@ -39,6 +39,7 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] [option '-port' ] [option '-pidpath' ] + [option '-dbURI' ] [option '-dbhost' ] [option '-rplSet' ] [option '-dbuser' ] @@ -87,8 +88,10 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-logLineMaxSize' ] [option '-logInfoPayloadMaxSize' ] [option '-disableMetrics' (turn off the 'metrics' feature)] + [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] [option '-insecureNotif' (allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates)] [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations)] [option '-mqttMaxAge' ] + [option '-logDeprecate' (log deprecation usages as warnings)] --TEARDOWN-- diff --git a/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test b/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test index cc3a956f68..cf566803ce 100644 --- a/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test +++ b/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test @@ -40,6 +40,7 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] [option '-port' ] [option '-pidpath' ] + [option '-dbURI' ] [option '-dbhost' ] [option '-rplSet' ] [option '-dbuser' ] @@ -88,8 +89,10 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-logLineMaxSize' ] [option '-logInfoPayloadMaxSize' ] [option '-disableMetrics' (turn off the 'metrics' feature)] + [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] [option '-insecureNotif' (allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates)] [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations)] [option '-mqttMaxAge' ] + [option '-logDeprecate' (log deprecation usages as warnings)] --TEARDOWN-- diff --git a/test/functionalTest/cases/0000_content_related_headers/in_out_formats.test b/test/functionalTest/cases/0000_content_related_headers/in_out_formats.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_content_related_headers/in_out_formats.test rename to test/functionalTest/cases/0000_content_related_headers/in_out_formats.test.DISABLED diff --git a/test/functionalTest/cases/0000_content_related_headers/zero_content_length.test b/test/functionalTest/cases/0000_content_related_headers/zero_content_length.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_content_related_headers/zero_content_length.test rename to test/functionalTest/cases/0000_content_related_headers/zero_content_length.test.DISABLED diff --git a/test/functionalTest/cases/0000_deprecated_checkings/disable_ngsi_cli.test b/test/functionalTest/cases/0000_deprecated_checkings/disable_ngsi_cli.test new file mode 100644 index 0000000000..2f3121a671 --- /dev/null +++ b/test/functionalTest/cases/0000_deprecated_checkings/disable_ngsi_cli.test @@ -0,0 +1,71 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Disable NGSIv1 CLI + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0 IPV4 -disableNgsiv1 + +--SHELL-- + +# +# 01. Query E1-T1, get 400 service not found error +# + +echo "01. Query E1-T1, get 400 service not found error" +echo "================================================" +payload='{ + "entities": [ + { + "type": "T1", + "id": "E1" + } + ] +}' +orionCurl --url /v1/queryContext --payload "${payload}" +echo +echo + + +--REGEXPECT-- +01. Query E1-T1, get 400 service not found error +================================================ +HTTP/1.1 400 Bad Request +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 129 + +{ + "orionError": { + "code": "400", + "details": "Service not found. Check your URL as probably it is wrong.", + "reasonPhrase": "Bad Request" + } +} + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/0000_deprecated_checkings/legacy_geolocalization_area_json.test b/test/functionalTest/cases/0000_deprecated_checkings/legacy_geolocalization_area_json.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_deprecated_checkings/legacy_geolocalization_area_json.test rename to test/functionalTest/cases/0000_deprecated_checkings/legacy_geolocalization_area_json.test.DISABLED diff --git a/test/functionalTest/cases/0000_deprecated_checkings/log_deprecate_warning.test b/test/functionalTest/cases/0000_deprecated_checkings/log_deprecate_warning.test new file mode 100644 index 0000000000..baf5d43988 --- /dev/null +++ b/test/functionalTest/cases/0000_deprecated_checkings/log_deprecate_warning.test @@ -0,0 +1,268 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Disable NGSIv1 CLI + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0 IPV4 -logDeprecate + +--SHELL-- + +# +# 01. Query E1-T1 +# 02. GET /v1/contextEntities/E +# 03. Create entity using NGSIv1 metadata location +# 04. Create entity using NGSIv1 and geo:point +# 05. Create entity using NGSIv2 and geo:point +# 06. Get WARNING trace in logs +# + +echo "01. Query E1-T1" +echo "===============" +payload='{ + "entities": [ + { + "type": "T1", + "id": "E1" + } + ] +}' +orionCurl --url /v1/queryContext --payload "${payload}" +echo +echo + + +echo "02. GET /v1/contextEntities/E/attributes/A" +echo "==========================================" +orionCurl --url /v1/contextEntities/E/attributes/A +echo +echo + + +echo "03. Create entity using NGSIv1 metadata location" +echo "================================================" +payload='{ + "contextElements": [ + { + "type": "City", + "isPattern": "false", + "id": "Madrid", + "attributes": [ + { + "name": "location", + "type": "coords", + "value": "40.418889, -3.691944", + "metadatas": [ + { + "name": "location", + "type": "string", + "value": "WSG84" + } + ] + } + ] + } + ], + "updateAction": "APPEND" +}' +orionCurl --url /v1/updateContext --payload "$payload" +echo +echo + + +echo "04. Create entity using NGSIv1 and geo:point" +echo "============================================" +payload='{ + "contextElements": [ + { + "type": "City", + "isPattern": "false", + "id": "Barcelona", + "attributes": [ + { + "name": "location", + "type": "geo:point", + "value": "40.418889, -3.691944" + } + ] + } + ], + "updateAction": "APPEND" +}' +orionCurl --url /v1/updateContext --payload "$payload" +echo +echo + + +echo "05. Create entity using NGSIv2 and geo:point" +echo "============================================" +payload='{ + "id": "Sevilla", + "type": "City", + "location": { + "type": "geo:point", + "value": "40.418889, -3.691944" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "06. Get WARNING trace in logs" +echo "=============================" +cat /tmp/contextBroker.log | grep 'WARN' | awk -F 'msg=' '{print $2}' +echo +echo + + +--REGEXPECT-- +01. Query E1-T1 +=============== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 70 + +{ + "errorCode": { + "code": "404", + "reasonPhrase": "No context element found" + } +} + + +02. GET /v1/contextEntities/E/attributes/A +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 98 + +{ + "statusCode": { + "code": "404", + "details": "Entity id: /E/", + "reasonPhrase": "No context element found" + } +} + + +03. Create entity using NGSIv1 metadata location +================================================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 267 + +{ + "contextResponses": [ + { + "contextElement": { + "attributes": [ + { + "metadatas": [ + { + "name": "location", + "type": "string", + "value": "WSG84" + } + ], + "name": "location", + "type": "coords", + "value": "" + } + ], + "id": "Madrid", + "isPattern": "false", + "type": "City" + }, + "statusCode": { + "code": "200", + "reasonPhrase": "OK" + } + } + ] +} + + +04. Create entity using NGSIv1 and geo:point +============================================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 207 + +{ + "contextResponses": [ + { + "contextElement": { + "attributes": [ + { + "name": "location", + "type": "geo:point", + "value": "" + } + ], + "id": "Barcelona", + "isPattern": "false", + "type": "City" + }, + "statusCode": { + "code": "200", + "reasonPhrase": "OK" + } + } + ] +} + + +05. Create entity using NGSIv2 and geo:point +============================================ +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/Sevilla?type=City +Content-Length: 0 + + + +06. Get WARNING trace in logs +============================= +Deprecated NGSIv1 request received: POST /v1/queryContext, request payload (48 bytes): { "entities": [ { "type": "T1", "id": "E1" } ] }, response code: 200 +Deprecated NGSIv1 request received: GET /v1/contextEntities/E/attributes/A, response code: 200 +Deprecated usage of metadata location coords detected in attribute location at entity update, please use geo:json instead +Deprecated NGSIv1 request received: POST /v1/updateContext, request payload (279 bytes): { "contextElements": [ { "type": "City", "isPattern": "false", "id": "Madrid", "attributes": [ { "name": "location", "type": "coords", "value": "40.418889, -3.691944", "metadatas": [ { "name": "location", "type": "string", "value": "WSG84" } ] } ] } ], "updateAction": "APPEND" }, response code: 200 +Deprecated usage of geo:point detected in attribute location at entity update, please use geo:json instead +Deprecated NGSIv1 request received: POST /v1/updateContext, request payload (208 bytes): { "contextElements": [ { "type": "City", "isPattern": "false", "id": "Barcelona", "attributes": [ { "name": "location", "type": "geo:point", "value": "40.418889, -3.691944" } ] } ], "updateAction": "APPEND" }, response code: 200 +Deprecated usage of geo:point detected in attribute location at entity update, please use geo:json instead + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/0000_deprecated_checkings/log_deprecate_warning_dynamic.test b/test/functionalTest/cases/0000_deprecated_checkings/log_deprecate_warning_dynamic.test new file mode 100644 index 0000000000..b7f1dfa95d --- /dev/null +++ b/test/functionalTest/cases/0000_deprecated_checkings/log_deprecate_warning_dynamic.test @@ -0,0 +1,333 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Disable NGSIv1 CLI with dynamic changes done by management REST API + +--SHELL-INIT-- +dbInit CB +brokerStart CB 0 IPV4 -logDeprecate + +--SHELL-- + +# +# 00. Check deprecate is true +# 01. Query E1-T1 +# 02. GET /v1/contextEntities/E +# 03. Disable logDeprecated by API +# 04. Check deprecate is false +# 05. Query E1-T1 (not logged) +# 06. GET /v1/contextEntities/E (not logged) +# 07. Enable logDeprecated by API +# 08. Check deprecate is false +# 09. Query E1-T1 +# 10. GET /v1/contextEntities/E +# 11. Get WARNING trace in logs (see 4 traces) +# + + +echo "00. Check deprecate is true" +echo "============================" +orionCurl --url /admin/log +echo +echo + + +echo "01. Query E1-T1" +echo "===============" +payload='{ + "entities": [ + { + "type": "T1", + "id": "E1" + } + ] +}' +orionCurl --url /v1/queryContext --payload "${payload}" +echo +echo + + +echo "02. GET /v1/contextEntities/E/attributes/A" +echo "==========================================" +orionCurl --url /v1/contextEntities/E/attributes/A +echo +echo + + +echo "03. Disable logDeprecated by API" +echo "================================" +orionCurl --url /admin/log?deprecate=false -X PUT +echo +echo + + +echo "04. Check deprecate is false" +echo "============================" +orionCurl --url /admin/log +echo +echo + + +echo "05. Query E1-T1 (not logged)" +echo "============================" +payload='{ + "entities": [ + { + "type": "T1", + "id": "E1" + } + ] +}' +orionCurl --url /v1/queryContext --payload "${payload}" +echo +echo + + +echo "06. GET /v1/contextEntities/E/attributes/A (not logged)" +echo "=======================================================" +orionCurl --url /v1/contextEntities/E/attributes/A +echo +echo + + + +echo "07. Enable logDeprecated by API" +echo "================================" +orionCurl --url /admin/log?deprecate=TrUe -X PUT +echo +echo + + +echo "08. Check deprecate is true" +echo "============================" +orionCurl --url /admin/log +echo +echo + + +echo "09. Query E1-T1" +echo "===============" +payload='{ + "entities": [ + { + "type": "T1", + "id": "E1" + } + ] +}' +orionCurl --url /v1/queryContext --payload "${payload}" +echo +echo + + +echo "10. GET /v1/contextEntities/E/attributes/A" +echo "==========================================" +orionCurl --url /v1/contextEntities/E/attributes/A +echo +echo + + +echo "11. Get WARNING trace in logs (see 4 traces)" +echo "============================================" +cat /tmp/contextBroker.log | grep 'WARN' | awk -F 'msg=' '{print $2}' +echo +echo + + +--REGEXPECT-- +00. Check deprecate is true +============================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 116 + +{ + "deprecate": true, + "infoPayloadMaxSize": 5120, + "level": "DEBUG", + "lineMaxSize": 32768 +} + + +01. Query E1-T1 +=============== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 70 + +{ + "errorCode": { + "code": "404", + "reasonPhrase": "No context element found" + } +} + + +02. GET /v1/contextEntities/E/attributes/A +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 98 + +{ + "statusCode": { + "code": "404", + "details": "Entity id: /E/", + "reasonPhrase": "No context element found" + } +} + + +03. Disable logDeprecated by API +================================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Length: 0 + + + +04. Check deprecate is false +============================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 117 + +{ + "deprecate": false, + "infoPayloadMaxSize": 5120, + "level": "DEBUG", + "lineMaxSize": 32768 +} + + +05. Query E1-T1 (not logged) +============================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 70 + +{ + "errorCode": { + "code": "404", + "reasonPhrase": "No context element found" + } +} + + +06. GET /v1/contextEntities/E/attributes/A (not logged) +======================================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 98 + +{ + "statusCode": { + "code": "404", + "details": "Entity id: /E/", + "reasonPhrase": "No context element found" + } +} + + +07. Enable logDeprecated by API +================================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Length: 0 + + + +08. Check deprecate is true +============================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 116 + +{ + "deprecate": true, + "infoPayloadMaxSize": 5120, + "level": "DEBUG", + "lineMaxSize": 32768 +} + + +09. Query E1-T1 +=============== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 70 + +{ + "errorCode": { + "code": "404", + "reasonPhrase": "No context element found" + } +} + + +10. GET /v1/contextEntities/E/attributes/A +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 98 + +{ + "statusCode": { + "code": "404", + "details": "Entity id: /E/", + "reasonPhrase": "No context element found" + } +} + + +11. Get WARNING trace in logs (see 4 traces) +============================================ +Deprecated NGSIv1 request received: POST /v1/queryContext, request payload (48 bytes): { "entities": [ { "type": "T1", "id": "E1" } ] }, response code: 200 +Deprecated NGSIv1 request received: GET /v1/contextEntities/E/attributes/A, response code: 200 +Deprecated NGSIv1 request received: POST /v1/queryContext, request payload (48 bytes): { "entities": [ { "type": "T1", "id": "E1" } ] }, response code: 200 +Deprecated NGSIv1 request received: GET /v1/contextEntities/E/attributes/A, response code: 200 + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/0000_deprecated_checkings/metadata_id_service_not_found_old_urls.test b/test/functionalTest/cases/0000_deprecated_checkings/metadata_id_service_not_found_old_urls.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_deprecated_checkings/metadata_id_service_not_found_old_urls.test rename to test/functionalTest/cases/0000_deprecated_checkings/metadata_id_service_not_found_old_urls.test.DISABLED diff --git a/test/functionalTest/cases/0000_deprecated_checkings/ontimeinterval_subs.test b/test/functionalTest/cases/0000_deprecated_checkings/ontimeinterval_subs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_deprecated_checkings/ontimeinterval_subs.test rename to test/functionalTest/cases/0000_deprecated_checkings/ontimeinterval_subs.test.DISABLED diff --git a/test/functionalTest/cases/0000_https_support/https.test b/test/functionalTest/cases/0000_https_support/https.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_https_support/https.test rename to test/functionalTest/cases/0000_https_support/https.test.DISABLED diff --git a/test/functionalTest/cases/0000_ipv6_support/ipv4_ipv6_both.test b/test/functionalTest/cases/0000_ipv6_support/ipv4_ipv6_both.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ipv6_support/ipv4_ipv6_both.test rename to test/functionalTest/cases/0000_ipv6_support/ipv4_ipv6_both.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/empty_payloads.test b/test/functionalTest/cases/0000_json_parse/empty_payloads.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/empty_payloads.test rename to test/functionalTest/cases/0000_json_parse/empty_payloads.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParseBadVerbDiscoverContextAvailability.test b/test/functionalTest/cases/0000_json_parse/jsonParseBadVerbDiscoverContextAvailability.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParseBadVerbDiscoverContextAvailability.test rename to test/functionalTest/cases/0000_json_parse/jsonParseBadVerbDiscoverContextAvailability.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParseBadVerbRegisterContext.test b/test/functionalTest/cases/0000_json_parse/jsonParseBadVerbRegisterContext.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParseBadVerbRegisterContext.test rename to test/functionalTest/cases/0000_json_parse/jsonParseBadVerbRegisterContext.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParseContextEntitiesByEntityId.test b/test/functionalTest/cases/0000_json_parse/jsonParseContextEntitiesByEntityId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParseContextEntitiesByEntityId.test rename to test/functionalTest/cases/0000_json_parse/jsonParseContextEntitiesByEntityId.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParseContextEntityAttributes.test b/test/functionalTest/cases/0000_json_parse/jsonParseContextEntityAttributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParseContextEntityAttributes.test rename to test/functionalTest/cases/0000_json_parse/jsonParseContextEntityAttributes.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParseEntityByIdAttributeByName.test b/test/functionalTest/cases/0000_json_parse/jsonParseEntityByIdAttributeByName.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParseEntityByIdAttributeByName.test rename to test/functionalTest/cases/0000_json_parse/jsonParseEntityByIdAttributeByName.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParseIndividualContextEntity.test b/test/functionalTest/cases/0000_json_parse/jsonParseIndividualContextEntity.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParseIndividualContextEntity.test rename to test/functionalTest/cases/0000_json_parse/jsonParseIndividualContextEntity.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostDiscoverContextAvailability.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostDiscoverContextAvailability.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostDiscoverContextAvailability.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostDiscoverContextAvailability.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostNotifyContext.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostNotifyContext.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostNotifyContext.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostNotifyContext.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContext.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContext.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContext.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContext.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntities.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntities.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntities.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntities.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntityId.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntityId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntityId.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterContextNoEntityId.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterProvider.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterProvider.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterProvider.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostRegisterProvider.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostUnsubscribeContext.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostUnsubscribeContext.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostUnsubscribeContext.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostUnsubscribeContext.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContext.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContext.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContext.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContext.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContextSubscription.test b/test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContextSubscription.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContextSubscription.test rename to test/functionalTest/cases/0000_json_parse/jsonParsePostUpdateContextSubscription.test.DISABLED diff --git a/test/functionalTest/cases/0000_json_parse/json_throttling.test b/test/functionalTest/cases/0000_json_parse/json_throttling.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_json_parse/json_throttling.test rename to test/functionalTest/cases/0000_json_parse/json_throttling.test.DISABLED diff --git a/test/functionalTest/cases/0000_large_requests/large_discover_context_availability.test b/test/functionalTest/cases/0000_large_requests/large_discover_context_availability.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_large_requests/large_discover_context_availability.test rename to test/functionalTest/cases/0000_large_requests/large_discover_context_availability.test.DISABLED diff --git a/test/functionalTest/cases/0000_large_requests/large_register_context_request.test b/test/functionalTest/cases/0000_large_requests/large_register_context_request.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_large_requests/large_register_context_request.test rename to test/functionalTest/cases/0000_large_requests/large_register_context_request.test.DISABLED diff --git a/test/functionalTest/cases/0000_large_requests/large_subscribe_context.test b/test/functionalTest/cases/0000_large_requests/large_subscribe_context.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_large_requests/large_subscribe_context.test rename to test/functionalTest/cases/0000_large_requests/large_subscribe_context.test.DISABLED diff --git a/test/functionalTest/cases/0000_large_requests/large_unsubscribe_context.test b/test/functionalTest/cases/0000_large_requests/large_unsubscribe_context.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_large_requests/large_unsubscribe_context.test rename to test/functionalTest/cases/0000_large_requests/large_unsubscribe_context.test.DISABLED diff --git a/test/functionalTest/cases/0000_large_requests/large_update_context_subscription.test b/test/functionalTest/cases/0000_large_requests/large_update_context_subscription.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_large_requests/large_update_context_subscription.test rename to test/functionalTest/cases/0000_large_requests/large_update_context_subscription.test.DISABLED diff --git a/test/functionalTest/cases/0000_large_requests/split_request.test b/test/functionalTest/cases/0000_large_requests/split_request.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_large_requests/split_request.test rename to test/functionalTest/cases/0000_large_requests/split_request.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_compound_values/compound_convop_json.test b/test/functionalTest/cases/0000_ngsi10_compound_values/compound_convop_json.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_compound_values/compound_convop_json.test rename to test/functionalTest/cases/0000_ngsi10_compound_values/compound_convop_json.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_compound_values/compound_empty_keys_and_vector_values.test b/test/functionalTest/cases/0000_ngsi10_compound_values/compound_empty_keys_and_vector_values.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_compound_values/compound_empty_keys_and_vector_values.test rename to test/functionalTest/cases/0000_ngsi10_compound_values/compound_empty_keys_and_vector_values.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_compound_values/compound_standard_json.test b/test/functionalTest/cases/0000_ngsi10_compound_values/compound_standard_json.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_compound_values/compound_standard_json.test rename to test/functionalTest/cases/0000_ngsi10_compound_values/compound_standard_json.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_compound_values/compound_subscription_json.test b/test/functionalTest/cases/0000_ngsi10_compound_values/compound_subscription_json.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_compound_values/compound_subscription_json.test rename to test/functionalTest/cases/0000_ngsi10_compound_values/compound_subscription_json.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_compound_values/convop_attributes_as_json_objects_ngsi10.test b/test/functionalTest/cases/0000_ngsi10_compound_values/convop_attributes_as_json_objects_ngsi10.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_compound_values/convop_attributes_as_json_objects_ngsi10.test rename to test/functionalTest/cases/0000_ngsi10_compound_values/convop_attributes_as_json_objects_ngsi10.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_container_ngsi10.test b/test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_container_ngsi10.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_container_ngsi10.test rename to test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_container_ngsi10.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_ngsi10.test b/test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_ngsi10.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_ngsi10.test rename to test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_attribute_ngsi10.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_ngsi10.test b/test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_ngsi10.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_ngsi10.test rename to test/functionalTest/cases/0000_ngsi10_convenience/context_entity_types_ngsi10.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_fails.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_fails.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_fails.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_fails.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_delete_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_fails.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_fails.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_fails.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_fails.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_get_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_post_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_post_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_post_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_post_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_put_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_put_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_put_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attribute_put_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_fails.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_fails.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_fails.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_fails.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_delete_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_fails.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_fails.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_fails.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_fails.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_get_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_create.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_create.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_create.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_create.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_post_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_create.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_create.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_create.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_create.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_attributes_put_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_delete_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_delete_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_delete_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_delete_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_fails.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_fails.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_fails.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_fails.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_get_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_create.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_create.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_create.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_create.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_post_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_create.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_create.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_create.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_create.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_ok.test b/test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_ok.test rename to test/functionalTest/cases/0000_ngsi10_convenience/individual_context_entity_put_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/ngsi10_subscriptions.test b/test/functionalTest/cases/0000_ngsi10_convenience/ngsi10_subscriptions.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/ngsi10_subscriptions.test rename to test/functionalTest/cases/0000_ngsi10_convenience/ngsi10_subscriptions.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange.test b/test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange.test rename to test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange_nocache.test b/test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange_nocache.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange_nocache.test rename to test/functionalTest/cases/0000_ngsi10_convenience/subscriptions_onchange_nocache.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_geolocation_query/geolocalization_area_json.test b/test/functionalTest/cases/0000_ngsi10_geolocation_query/geolocalization_area_json.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_geolocation_query/geolocalization_area_json.test rename to test/functionalTest/cases/0000_ngsi10_geolocation_query/geolocalization_area_json.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_notify/notify_context.test b/test/functionalTest/cases/0000_ngsi10_notify/notify_context.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_notify/notify_context.test rename to test/functionalTest/cases/0000_ngsi10_notify/notify_context.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_bad_duration.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_bad_duration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_bad_duration.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_bad_duration.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_expiration.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_expiration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_expiration.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_expiration.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_nocache.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_nocache.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_nocache.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_onchange_nocache.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append-simpler.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append-simpler.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append-simpler.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append-simpler.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_append.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_update.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_update.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_update.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/subscription_sequence_wildcards_onchange_update.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi10_subscriptions/update_context_subscription.test b/test/functionalTest/cases/0000_ngsi10_subscriptions/update_context_subscription.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi10_subscriptions/update_context_subscription.test rename to test/functionalTest/cases/0000_ngsi10_subscriptions/update_context_subscription.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/context_entities_by_entity_id.test b/test/functionalTest/cases/0000_ngsi9_convenience/context_entities_by_entity_id.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/context_entities_by_entity_id.test rename to test/functionalTest/cases/0000_ngsi9_convenience/context_entities_by_entity_id.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_attributes.test b/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_attributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/context_entity_attributes.test rename to test/functionalTest/cases/0000_ngsi9_convenience/context_entity_attributes.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_container_ngsi9.test b/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_container_ngsi9.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_container_ngsi9.test rename to test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_container_ngsi9.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_ngsi9.test b/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_ngsi9.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_ngsi9.test rename to test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_attribute_ngsi9.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_ngsi9.test b/test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_ngsi9.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_ngsi9.test rename to test/functionalTest/cases/0000_ngsi9_convenience/context_entity_types_ngsi9.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/entity_by_id_attribute_by_name.test b/test/functionalTest/cases/0000_ngsi9_convenience/entity_by_id_attribute_by_name.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/entity_by_id_attribute_by_name.test rename to test/functionalTest/cases/0000_ngsi9_convenience/entity_by_id_attribute_by_name.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types.test b/test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types.test rename to test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute.test b/test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute.test rename to test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute_container.test b/test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute_container.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute_container.test rename to test/functionalTest/cases/0000_ngsi9_convenience/post_context_entity_types_attribute_container.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_registration_and_discover/check_default_duration.test b/test/functionalTest/cases/0000_ngsi9_registration_and_discover/check_default_duration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_registration_and_discover/check_default_duration.test rename to test/functionalTest/cases/0000_ngsi9_registration_and_discover/check_default_duration.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_expired.test b/test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_expired.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_expired.test rename to test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_expired.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_fail.test b/test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_fail.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_fail.test rename to test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_fail.test.DISABLED diff --git a/test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_ok.test b/test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_ok.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_ok.test rename to test/functionalTest/cases/0000_ngsi9_registration_and_discover/registration_ok.test.DISABLED diff --git a/test/functionalTest/cases/0000_statistics_operation/statistics_with_counters.test b/test/functionalTest/cases/0000_statistics_operation/statistics_with_counters.test index 97158899f8..b89e50670f 100644 --- a/test/functionalTest/cases/0000_statistics_operation/statistics_with_counters.test +++ b/test/functionalTest/cases/0000_statistics_operation/statistics_with_counters.test @@ -42,18 +42,15 @@ brokerStart CB 0 IPv4 -statCounters # - /leak[/*]": used only in DEBUG code # - /statistics DELETE: as using it will ruin all statistics :) # -# All counters has 1 hit except the following cases, which has 2, due to -# the URL covers two possible requests: +# All counters has 1 hit. # -# "/v1/subscribeContext|contextSubscriptions" -# "/ngsi10/subscribeContext|contextSubscriptions" -# -# As a king of checksum note there are 131 orion curl ocurrences in this file +# As a kind of checksum note there are 60 orionCurl ocurrences in this file # (it can be checked with grep) and that: # -# - jsonRequests: 55 -# - noPayloadRequests: 75 -# - textRequest: 1 +# - jsonRequests: 16 +# - noPayloadRequests: 42 +# - textRequest: 1 +# - (comented orionCurl) 1 # # which sum 131 @@ -213,49 +210,10 @@ orionCurl --url /version > /dev/null # Legacy payload='{}' -orionCurl --url /ngsi10/contextEntities/E > /dev/null -orionCurl --url /ngsi10/contextEntities/E -X DELETE > /dev/null -orionCurl --url /ngsi10/contextEntities/E -X POST --payload "$payload" > /dev/null -orionCurl --url /ngsi10/contextEntities/E -X PUT --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/E > /dev/null orionCurl --url /v1/contextEntities/E -X DELETE > /dev/null -orionCurl --url /v1/contextEntities/E -X POST --payload "$payload" > /dev/null orionCurl --url /v1/contextEntities/E -X PUT --payload "$payload" > /dev/null -payload='{}' -orionCurl --url /ngsi10/contextEntities/E/attributes > /dev/null -orionCurl --url /ngsi10/contextEntities/E/attributes -X DELETE > /dev/null -orionCurl --url /ngsi10/contextEntities/E/attributes -X POST --payload "$payload" > /dev/null -orionCurl --url /ngsi10/contextEntities/E/attributes -X PUT --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/E/attributes > /dev/null -orionCurl --url /v1/contextEntities/E/attributes -X DELETE > /dev/null -orionCurl --url /v1/contextEntities/E/attributes -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/E/attributes -X PUT --payload "$payload" > /dev/null - -payload='{}' -orionCurl --url /ngsi10/contextEntities/E/attributes/A > /dev/null -orionCurl --url /ngsi10/contextEntities/E/attributes/A -X DELETE > /dev/null -orionCurl --url /ngsi10/contextEntities/E/attributes/A -X POST --payload "$payload" > /dev/null -orionCurl --url /ngsi10/contextEntities/E/attributes/A -X PUT --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/E/attributes/A > /dev/null -orionCurl --url /v1/contextEntities/E/attributes/A -X DELETE > /dev/null -orionCurl --url /v1/contextEntities/E/attributes/A -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/E/attributes/A -X PUT --payload "$payload" > /dev/null - -orionCurl --url /ngsi10/contextEntityTypes/T > /dev/null -orionCurl --url /v1/contextEntityTypes/T > /dev/null - -orionCurl --url /ngsi10/contextEntityTypes/T/attributes > /dev/null -orionCurl --url /v1/contextEntityTypes/T/attributes > /dev/null - -orionCurl --url /ngsi10/contextEntityTypes/T/attributes/A > /dev/null -orionCurl --url /v1/contextEntityTypes/T/attributes/A > /dev/null - -payload='{}' -orionCurl --url /ngsi10/contextSubscriptions/123 -X DELETE > /dev/null -orionCurl --url /ngsi10/contextSubscriptions/123 -X PUT --payload "$payload" > /dev/null -orionCurl --url /v1/contextSubscriptions/123 -X DELETE > /dev/null -orionCurl --url /v1/contextSubscriptions/123 -X PUT --payload "$payload" > /dev/null +orionCurl --url /v1/contextEntities/E/attributes/A > /dev/null payload='{ "entities": [ @@ -269,51 +227,6 @@ payload='{ orionCurl --url /ngsi10/queryContext -X POST --payload "$payload" > /dev/null orionCurl --url /v1/queryContext -X POST --payload "$payload" > /dev/null -payload='{ - "entities": [ - { - "type": "T", - "isPattern": "false", - "id": "E" - } - ], - "attributes": [ - "A" - ], - "reference": "http://localhost:1234", - "duration": "PT1H", - "notifyConditions": [ - { - "type": "ONCHANGE", - "condValues": [ - "A" - ] - } - ] -}' -orionCurl --url /ngsi10/subscribeContext -X POST --payload "$payload" > /dev/null -orionCurl --url /ngsi10/contextSubscriptions -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/subscribeContext -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/contextSubscriptions -X POST --payload "$payload" > /dev/null - -payload='{}' -orionCurl --url /ngsi10/unsubscribeContext -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/unsubscribeContext -X POST --payload "$payload" > /dev/null - -payload='{ - "subscriptionId": "012345678901234567890123", - "throttling": "P5Y", - "duration": "P50Y", - "notifyConditions": [ - { - "type": "ONCHANGE", - "condValues": [ "A" ] - } - ] -}' -orionCurl --url /ngsi10/updateContextSubscription -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/updateContextSubscription -X POST --payload "$payload" > /dev/null - payload='{ "contextElements": [ { @@ -334,129 +247,6 @@ payload='{ orionCurl --url /ngsi10/updateContext -X POST --payload "$payload" > /dev/null orionCurl --url /v1/updateContext -X POST --payload "$payload" > /dev/null -payload='{ - "subscriptionId": "012345678901234567890123", - "originator": "http://localhost/test", - "contextResponses": [ - { - "contextElement": { - "type": "T", - "isPattern": "false", - "id": "E", - "attributes": [ - { - "name": "A", - "type": "Text", - "value": "foo" - } - ] - }, - "statusCode": { - "code": "200", - "reasonPhrase": "Ok", - "details": "a" - } - } - ] -}' -orionCurl --url /ngsi10/notifyContext -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/notifyContext -X POST --payload "$payload" > /dev/null - -payload='{}' -orionCurl --url /v1/contextEntities/type/T/id/E > /dev/null -orionCurl --url /v1/contextEntities/type/T/id/E -X DELETE > /dev/null -orionCurl --url /v1/contextEntities/type/T/id/E -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/type/T/id/E -X PUT --payload "$payload" > /dev/null - -payload='{}' -orionCurl --url /v1/contextEntities/type/T/id/E/attributes/A > /dev/null -orionCurl --url /v1/contextEntities/type/T/id/E/attributes/A -X DELETE > /dev/null -orionCurl --url /v1/contextEntities/type/T/id/E/attributes/A -X POST --payload "$payload" > /dev/null -orionCurl --url /v1/contextEntities/type/T/id/E/attributes/A -X PUT --payload "$payload" > /dev/null - -payload='{}' -orionCurl --url /v1/contextEntities > /dev/null -orionCurl --url /v1/contextEntities -X POST --payload "$payload" > /dev/null - -orionCurl --url /v1/contextTypes/T > /dev/null - -orionCurl --url /v1/contextTypes > /dev/null - -payload='{ - "contextRegistrations": [ - { - "entities": [ - { - "type": "T", - "isPattern": "false", - "id": "E" - } - ], - "attributes": [ - { - "name": "A", - "type": "Number" - } - ], - "providingApplication": "http://localhost:1234" - } - ], - "duration": "PT1M" -}' -orionCurl --url /v1/registry/registerContext -X POST --payload "$payload" > /dev/null - -payload='{ - "duration": "PT1M", - "providingApplication": "none" -}' -orionCurl --url /v1/registry/contextEntities/E > /dev/null -orionCurl --url /v1/registry/contextEntities/E -X POST --payload "$payload" > /dev/null - -orionCurl --url /v1/registry/contextEntities/type/T/id/E > /dev/null -orionCurl --url /v1/registry/contextEntities/type/T/id/E -X POST --payload "$payload" > /dev/null - -orionCurl --url /v1/registry/contextEntities/type/T/id/E/attributes/A > /dev/null -orionCurl --url /v1/registry/contextEntities/type/T/id/E/attributes/A -X POST --payload "$payload" > /dev/null - -orionCurl --url /v1/registry/contextEntities/E/attributes > /dev/null -orionCurl --url /v1/registry/contextEntities/E/attributes -X POST --payload "$payload" > /dev/null - -orionCurl --url /v1/registry/contextEntities/E/attributes/A > /dev/null -orionCurl --url /v1/registry/contextEntities/E/attributes/A -X POST --payload "$payload" > /dev/null - -payload='{ - "duration": "PT2M", - "providingApplication": "some", - "registrationId": "'$REG_ID'" -}' -orionCurl --url /v1/registry/contextEntityTypes/T > /dev/null -orionCurl --url /v1/registry/contextEntityTypes/T -X POST --payload "$payload" > /dev/null - -orionCurl --url /v1/registry/contextEntityTypes/T/attributes > /dev/null -orionCurl --url /v1/registry/contextEntityTypes/T/attributes -X POST --payload "$payload" > /dev/null - -payload='{ - "duration": "PT2M", - "providingApplication": "some", - "registrationId": "'$REG_ID'" -}' -orionCurl --url /v1/registry/contextEntityTypes/T/attributes/A > /dev/null -orionCurl --url /v1/registry/contextEntityTypes/T/attributes/A -X POST --payload "$payload" > /dev/null - -payload='{ - "entities": [ - { - "type": "T", - "isPattern": "false", - "id": "E" - } - ], - "attributes": [ - "A" - ] -}' -orionCurl --url /v1/registry/discoverContextAvailability -X POST --payload "$payload" > /dev/null - # Get statistics orionCurl --url /statistics?options @@ -470,8 +260,8 @@ Content-Length: REGEX(\d+) { "counters": { - "jsonRequests": 54, - "noPayloadRequests": 75, + "jsonRequests": 16, + "noPayloadRequests": 42, "requests": { "/admin/log": { "GET": 1, @@ -567,163 +357,24 @@ Content-Length: REGEX(\d+) } }, "requestsLegacy": { - "/ngsi10/contextEntities/{id}": { - "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, - "/ngsi10/contextEntities/{id}/attributes/": { - "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, - "/ngsi10/contextEntities/{id}/attributes/{name}": { - "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, - "/ngsi10/contextEntityTypes/{type}": { - "GET": 1 - }, - "/ngsi10/contextEntityTypes/{type}/attributes/": { - "GET": 1 - }, - "/ngsi10/contextEntityTypes/{type}/attributes/{name}": { - "GET": 1 - }, - "/ngsi10/contextSubscriptions/{id}": { - "DELETE": 1, - "PUT": 1 - }, - "/ngsi10/notifyContext": { - "POST": 1 - }, "/ngsi10/queryContext": { "POST": 1 }, - "/ngsi10/subscribeContext|contextSubscriptions": { - "POST": 2 - }, - "/ngsi10/unsubscribeContext": { - "POST": 1 - }, "/ngsi10/updateContext": { "POST": 1 }, - "/ngsi10/updateContextSubscription": { - "POST": 1 - }, - "/v1/contextEntities/type/{type}/id/{id}": { - "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, - "/v1/contextEntities/type/{type}/id/{id}/attributes/{name}": { - "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, "/v1/contextEntities/{id}": { "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, - "/v1/contextEntities/{id}/attributes/": { - "DELETE": 1, - "GET": 1, - "POST": 1, "PUT": 1 }, "/v1/contextEntities/{id}/attributes/{name}": { - "DELETE": 1, - "GET": 1, - "POST": 1, - "PUT": 1 - }, - "/v1/contextEntitites": { - "GET": 1, - "POST": 1 - }, - "/v1/contextEntityTypes/{type}": { "GET": 1 }, - "/v1/contextEntityTypes/{type}/attributes/": { - "GET": 1 - }, - "/v1/contextEntityTypes/{type}/attributes/{name}": { - "GET": 1 - }, - "/v1/contextSubscriptions/{id}": { - "DELETE": 1, - "PUT": 1 - }, - "/v1/contextType/{type}": { - "GET": 1 - }, - "/v1/contextTypes": { - "GET": 1 - }, - "/v1/notifyContext": { - "POST": 1 - }, "/v1/queryContext": { "POST": 1 }, - "/v1/registry/contextEntities/type/{type}/id/{id}": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntities/type/{type}/id/{id}/attributes/{name}": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntities/{id}": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntities/{id}/attributes": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntities/{id}/attributes/{name}": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntityTypes/{type}": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntityTypes/{type}/attributes": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/contextEntityTypes/{type}/attributes/{name}": { - "GET": 1, - "POST": 1 - }, - "/v1/registry/discoverContextAvailability": { - "POST": 1 - }, - "/v1/registry/registerContext": { - "POST": 1 - }, - "/v1/subscribeContext|contextSubscriptions": { - "POST": 2 - }, - "/v1/unsubscribeContext": { - "POST": 1 - }, "/v1/updateContext": { "POST": 1 - }, - "/v1/updateContextSubscription": { - "POST": 1 } }, "textRequests": 1 diff --git a/test/functionalTest/cases/0000_statistics_operation/statistics_with_full_counters.test b/test/functionalTest/cases/0000_statistics_operation/statistics_with_full_counters.test index d448b93e4d..4497c29ef5 100644 --- a/test/functionalTest/cases/0000_statistics_operation/statistics_with_full_counters.test +++ b/test/functionalTest/cases/0000_statistics_operation/statistics_with_full_counters.test @@ -46,7 +46,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 3605 +Content-Length: 1525 { "counters": { @@ -162,163 +162,24 @@ Content-Length: 3605 } }, "requestsLegacy": { - "/ngsi10/contextEntities/{id}": { - "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, - "/ngsi10/contextEntities/{id}/attributes/": { - "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, - "/ngsi10/contextEntities/{id}/attributes/{name}": { - "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, - "/ngsi10/contextEntityTypes/{type}": { - "GET": 0 - }, - "/ngsi10/contextEntityTypes/{type}/attributes/": { - "GET": 0 - }, - "/ngsi10/contextEntityTypes/{type}/attributes/{name}": { - "GET": 0 - }, - "/ngsi10/contextSubscriptions/{id}": { - "DELETE": 0, - "PUT": 0 - }, - "/ngsi10/notifyContext": { - "POST": 0 - }, "/ngsi10/queryContext": { "POST": 0 }, - "/ngsi10/subscribeContext|contextSubscriptions": { - "POST": 0 - }, - "/ngsi10/unsubscribeContext": { - "POST": 0 - }, "/ngsi10/updateContext": { "POST": 0 }, - "/ngsi10/updateContextSubscription": { - "POST": 0 - }, - "/v1/contextEntities/type/{type}/id/{id}": { - "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, - "/v1/contextEntities/type/{type}/id/{id}/attributes/{name}": { - "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, "/v1/contextEntities/{id}": { "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, - "/v1/contextEntities/{id}/attributes/": { - "DELETE": 0, - "GET": 0, - "POST": 0, "PUT": 0 }, "/v1/contextEntities/{id}/attributes/{name}": { - "DELETE": 0, - "GET": 0, - "POST": 0, - "PUT": 0 - }, - "/v1/contextEntitites": { - "GET": 0, - "POST": 0 - }, - "/v1/contextEntityTypes/{type}": { - "GET": 0 - }, - "/v1/contextEntityTypes/{type}/attributes/": { - "GET": 0 - }, - "/v1/contextEntityTypes/{type}/attributes/{name}": { - "GET": 0 - }, - "/v1/contextSubscriptions/{id}": { - "DELETE": 0, - "PUT": 0 - }, - "/v1/contextType/{type}": { - "GET": 0 - }, - "/v1/contextTypes": { "GET": 0 }, - "/v1/notifyContext": { - "POST": 0 - }, "/v1/queryContext": { "POST": 0 }, - "/v1/registry/contextEntities/type/{type}/id/{id}": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntities/type/{type}/id/{id}/attributes/{name}": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntities/{id}": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntities/{id}/attributes": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntities/{id}/attributes/{name}": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntityTypes/{type}": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntityTypes/{type}/attributes": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/contextEntityTypes/{type}/attributes/{name}": { - "GET": 0, - "POST": 0 - }, - "/v1/registry/discoverContextAvailability": { - "POST": 0 - }, - "/v1/registry/registerContext": { - "POST": 0 - }, - "/v1/subscribeContext|contextSubscriptions": { - "POST": 0 - }, - "/v1/unsubscribeContext": { - "POST": 0 - }, "/v1/updateContext": { "POST": 0 - }, - "/v1/updateContextSubscription": { - "POST": 0 } }, "textRequests": 0 diff --git a/test/functionalTest/cases/0001_federation/federation.test b/test/functionalTest/cases/0001_federation/federation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0001_federation/federation.test rename to test/functionalTest/cases/0001_federation/federation.test.DISABLED diff --git a/test/functionalTest/cases/0001_federation/federation_location_ngsiv1.test b/test/functionalTest/cases/0001_federation/federation_location_ngsiv1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0001_federation/federation_location_ngsiv1.test rename to test/functionalTest/cases/0001_federation/federation_location_ngsiv1.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/deleteAllEntitiesWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/deleteAllEntitiesWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/deleteAllEntitiesWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/deleteAllEntitiesWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttributeWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttributeWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttributeWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntityAttributeWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID.test b/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID_attributes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID_attributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID_attributes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/deleteIndividualContextEntity_v1_contextEntities_EID_attributes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/deleteSubscriptionConvOp.test b/test/functionalTest/cases/0117_convop_using_standard_ops/deleteSubscriptionConvOp.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/deleteSubscriptionConvOp.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/deleteSubscriptionConvOp.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/discovery_pagination.test b/test/functionalTest/cases/0117_convop_using_standard_ops/discovery_pagination.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/discovery_pagination.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/discovery_pagination.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getAllContextEntities.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getAllContextEntities.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getAllContextEntities.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getAllContextEntities.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getAllEntitiesWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getAllEntitiesWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getAllEntitiesWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getAllEntitiesWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getAttributesForEntityType.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getAttributesForEntityType.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getAttributesForEntityType.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getAttributesForEntityType.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityIdAndType.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityIdAndType.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityIdAndType.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntitiesByEntityIdAndType.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityAttributes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityAttributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityAttributes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityAttributes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypeAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypeAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypeAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypeAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getContextEntityTypes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByName.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByName.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByName.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByName.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByNameWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByNameWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByNameWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getEntityByIdAttributeByNameWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getEntityTypes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getEntityTypes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getEntityTypes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getEntityTypes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntity.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntity.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntity.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntity.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributeWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributeWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributeWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributeWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getIndividualContextEntityAttributes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypesAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypesAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypesAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/getNgsi10ContextEntityTypesAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postAllEntitiesWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postAllEntitiesWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postAllEntitiesWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postAllEntitiesWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityIdAndType.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityIdAndType.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityIdAndType.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntitiesByEntityIdAndType.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityAttributes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityAttributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityAttributes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityAttributes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypeAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypeAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypeAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypeAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postContextEntityTypes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByName.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByName.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByName.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByName.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByNameWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByNameWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByNameWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postEntityByIdAttributeByNameWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttributeWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttributeWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttributeWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntityAttributeWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID_attributes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID_attributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID_attributes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postIndividualContextEntity_v1_contextEntities_EID_attributes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/postSubscribeContextConvOp.test b/test/functionalTest/cases/0117_convop_using_standard_ops/postSubscribeContextConvOp.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/postSubscribeContextConvOp.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/postSubscribeContextConvOp.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/putAllEntitiesWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/putAllEntitiesWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/putAllEntitiesWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/putAllEntitiesWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntity.test b/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntity.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntity.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntity.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttribute.test b/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttribute.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttribute.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributeWithTypeAndId.test b/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributeWithTypeAndId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributeWithTypeAndId.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributeWithTypeAndId.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributes.test b/test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributes.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/putIndividualContextEntityAttributes.test.DISABLED diff --git a/test/functionalTest/cases/0117_convop_using_standard_ops/putSubscriptionConvOp.test b/test/functionalTest/cases/0117_convop_using_standard_ops/putSubscriptionConvOp.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0117_convop_using_standard_ops/putSubscriptionConvOp.test rename to test/functionalTest/cases/0117_convop_using_standard_ops/putSubscriptionConvOp.test.DISABLED diff --git a/test/functionalTest/cases/0208_expiration_overflow_fix/registration_64bit_duration.test b/test/functionalTest/cases/0208_expiration_overflow_fix/registration_64bit_duration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0208_expiration_overflow_fix/registration_64bit_duration.test rename to test/functionalTest/cases/0208_expiration_overflow_fix/registration_64bit_duration.test.DISABLED diff --git a/test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_onchange.test b/test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_onchange.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_onchange.test rename to test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_onchange.test.DISABLED diff --git a/test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_update_query.test b/test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_update_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_update_query.test rename to test/functionalTest/cases/0252_ngsi10_custom_metadata/custom_metadata_update_query.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/http_tenant_name_error.test b/test/functionalTest/cases/0322_multitenancy/http_tenant_name_error.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/http_tenant_name_error.test rename to test/functionalTest/cases/0322_multitenancy/http_tenant_name_error.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/http_tenant_register_discovery.test b/test/functionalTest/cases/0322_multitenancy/http_tenant_register_discovery.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/http_tenant_register_discovery.test rename to test/functionalTest/cases/0322_multitenancy/http_tenant_register_discovery.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/http_tenant_subscribe_and_update.test b/test/functionalTest/cases/0322_multitenancy/http_tenant_subscribe_and_update.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/http_tenant_subscribe_and_update.test rename to test/functionalTest/cases/0322_multitenancy/http_tenant_subscribe_and_update.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/tenant_in_notification.test b/test/functionalTest/cases/0322_multitenancy/tenant_in_notification.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/tenant_in_notification.test rename to test/functionalTest/cases/0322_multitenancy/tenant_in_notification.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/tenant_name_error.test b/test/functionalTest/cases/0322_multitenancy/tenant_name_error.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/tenant_name_error.test rename to test/functionalTest/cases/0322_multitenancy/tenant_name_error.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase.test b/test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase.test rename to test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase.test.DISABLED diff --git a/test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase_http_header.test b/test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase_http_header.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase_http_header.test rename to test/functionalTest/cases/0322_multitenancy/tenant_upperlowercase_http_header.test.DISABLED diff --git a/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values.test b/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values.test rename to test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values.test.DISABLED diff --git a/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values_nocache.test b/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values_nocache.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values_nocache.test rename to test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_empty_cond_values_nocache.test.DISABLED diff --git a/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values.test b/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values.test rename to test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values.test.DISABLED diff --git a/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values_nocache.test b/test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values_nocache.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values_nocache.test rename to test/functionalTest/cases/0350_onanychange_subscriptions/onanychange_omit_cond_values_nocache.test.DISABLED diff --git a/test/functionalTest/cases/0499_context_providers_basic/query_redirect_operation.test b/test/functionalTest/cases/0499_context_providers_basic/query_redirect_operation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0499_context_providers_basic/query_redirect_operation.test rename to test/functionalTest/cases/0499_context_providers_basic/query_redirect_operation.test.DISABLED diff --git a/test/functionalTest/cases/0499_context_providers_basic/query_redirect_three_providers.test b/test/functionalTest/cases/0499_context_providers_basic/query_redirect_three_providers.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0499_context_providers_basic/query_redirect_three_providers.test rename to test/functionalTest/cases/0499_context_providers_basic/query_redirect_three_providers.test.DISABLED diff --git a/test/functionalTest/cases/0499_context_providers_basic/update_redirect_delete_operation.test b/test/functionalTest/cases/0499_context_providers_basic/update_redirect_delete_operation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0499_context_providers_basic/update_redirect_delete_operation.test rename to test/functionalTest/cases/0499_context_providers_basic/update_redirect_delete_operation.test.DISABLED diff --git a/test/functionalTest/cases/0499_context_providers_basic/update_redirect_operation.test b/test/functionalTest/cases/0499_context_providers_basic/update_redirect_operation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0499_context_providers_basic/update_redirect_operation.test rename to test/functionalTest/cases/0499_context_providers_basic/update_redirect_operation.test.DISABLED diff --git a/test/functionalTest/cases/0501_cors/get_any_origin.test b/test/functionalTest/cases/0501_cors/get_any_origin.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0501_cors/get_any_origin.test rename to test/functionalTest/cases/0501_cors/get_any_origin.test.DISABLED diff --git a/test/functionalTest/cases/0501_cors/get_specific_origin.test b/test/functionalTest/cases/0501_cors/get_specific_origin.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0501_cors/get_specific_origin.test rename to test/functionalTest/cases/0501_cors/get_specific_origin.test.DISABLED diff --git a/test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypeAttributes.test b/test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypeAttributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypeAttributes.test rename to test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypeAttributes.test.DISABLED diff --git a/test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypes.test b/test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypes.test rename to test/functionalTest/cases/0519_ngsi10_entity_types_listing/contextEntityTypes.test.DISABLED diff --git a/test/functionalTest/cases/0559_new_url_paths/ngsi10_new_url_paths.test b/test/functionalTest/cases/0559_new_url_paths/ngsi10_new_url_paths.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0559_new_url_paths/ngsi10_new_url_paths.test rename to test/functionalTest/cases/0559_new_url_paths/ngsi10_new_url_paths.test.DISABLED diff --git a/test/functionalTest/cases/0559_new_url_paths/v1_paths.test b/test/functionalTest/cases/0559_new_url_paths/v1_paths.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0559_new_url_paths/v1_paths.test rename to test/functionalTest/cases/0559_new_url_paths/v1_paths.test.DISABLED diff --git a/test/functionalTest/cases/0559_new_url_paths/v1_registry.test b/test/functionalTest/cases/0559_new_url_paths/v1_registry.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0559_new_url_paths/v1_registry.test rename to test/functionalTest/cases/0559_new_url_paths/v1_registry.test.DISABLED diff --git a/test/functionalTest/cases/0563_ngsi10_get_list_of_all_entities/all_entities_no_filter.test b/test/functionalTest/cases/0563_ngsi10_get_list_of_all_entities/all_entities_no_filter.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0563_ngsi10_get_list_of_all_entities/all_entities_no_filter.test rename to test/functionalTest/cases/0563_ngsi10_get_list_of_all_entities/all_entities_no_filter.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_emptyType.test b/test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_emptyType.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_emptyType.test rename to test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_emptyType.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_filter.test b/test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_filter.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_filter.test rename to test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_filter.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_type_as_uri_param.test b/test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_type_as_uri_param.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_type_as_uri_param.test rename to test/functionalTest/cases/0570_filters_for_entity_type/all_entities_with_type_as_uri_param.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/emptyType_delete.test b/test/functionalTest/cases/0570_filters_for_entity_type/emptyType_delete.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/emptyType_delete.test rename to test/functionalTest/cases/0570_filters_for_entity_type/emptyType_delete.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/emptyType_post.test b/test/functionalTest/cases/0570_filters_for_entity_type/emptyType_post.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/emptyType_post.test rename to test/functionalTest/cases/0570_filters_for_entity_type/emptyType_post.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/emptyType_put.test b/test/functionalTest/cases/0570_filters_for_entity_type/emptyType_put.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/emptyType_put.test rename to test/functionalTest/cases/0570_filters_for_entity_type/emptyType_put.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_emptyType.test b/test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_emptyType.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_emptyType.test rename to test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_emptyType.test.DISABLED diff --git a/test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_type_as_uri_param.test b/test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_type_as_uri_param.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_type_as_uri_param.test rename to test/functionalTest/cases/0570_filters_for_entity_type/individual_entities_with_type_as_uri_param.test.DISABLED diff --git a/test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID.test b/test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID.test rename to test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID.test.DISABLED diff --git a/test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_JSON.test b/test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_JSON.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_JSON.test rename to test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_JSON.test.DISABLED diff --git a/test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_attribute.test b/test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_attribute.test rename to test/functionalTest/cases/0581_include_type_in_convops/v1_contextEntities_enType_ENTYPE_enId_ENID_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID.test b/test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID.test rename to test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID.test.DISABLED diff --git a/test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID_attribute_attrName.test b/test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID_attribute_attrName.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID_attribute_attrName.test rename to test/functionalTest/cases/0581_include_type_in_convops/v1_registry_contextEntities_enType_ENTYPE_enId_ENID_attribute_attrName.test.DISABLED diff --git a/test/functionalTest/cases/0585_empty_type_in_response/ngsi10.test b/test/functionalTest/cases/0585_empty_type_in_response/ngsi10.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0585_empty_type_in_response/ngsi10.test rename to test/functionalTest/cases/0585_empty_type_in_response/ngsi10.test.DISABLED diff --git a/test/functionalTest/cases/0585_empty_type_in_response/ngsi9.test b/test/functionalTest/cases/0585_empty_type_in_response/ngsi9.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0585_empty_type_in_response/ngsi9.test rename to test/functionalTest/cases/0585_empty_type_in_response/ngsi9.test.DISABLED diff --git a/test/functionalTest/cases/0613_POST_v1_contextEntities/v1_contextEntities_without_entity.test b/test/functionalTest/cases/0613_POST_v1_contextEntities/v1_contextEntities_without_entity.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0613_POST_v1_contextEntities/v1_contextEntities_without_entity.test rename to test/functionalTest/cases/0613_POST_v1_contextEntities/v1_contextEntities_without_entity.test.DISABLED diff --git a/test/functionalTest/cases/0619_forbidden_characters_in_payload/input.test b/test/functionalTest/cases/0619_forbidden_characters_in_payload/input.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0619_forbidden_characters_in_payload/input.test rename to test/functionalTest/cases/0619_forbidden_characters_in_payload/input.test.DISABLED diff --git a/test/functionalTest/cases/0633_new_name_for_json_object_rendering/convop_attributes_as_json_objects.test b/test/functionalTest/cases/0633_new_name_for_json_object_rendering/convop_attributes_as_json_objects.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0633_new_name_for_json_object_rendering/convop_attributes_as_json_objects.test rename to test/functionalTest/cases/0633_new_name_for_json_object_rendering/convop_attributes_as_json_objects.test.DISABLED diff --git a/test/functionalTest/cases/0640_attribute_name_unique_key_field/notify_type_change.test b/test/functionalTest/cases/0640_attribute_name_unique_key_field/notify_type_change.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0640_attribute_name_unique_key_field/notify_type_change.test rename to test/functionalTest/cases/0640_attribute_name_unique_key_field/notify_type_change.test.DISABLED diff --git a/test/functionalTest/cases/0640_attribute_name_unique_key_field/updating_types.test b/test/functionalTest/cases/0640_attribute_name_unique_key_field/updating_types.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0640_attribute_name_unique_key_field/updating_types.test rename to test/functionalTest/cases/0640_attribute_name_unique_key_field/updating_types.test.DISABLED diff --git a/test/functionalTest/cases/0642_service_path_entity_without_type/servicepath_entity_without_type.test b/test/functionalTest/cases/0642_service_path_entity_without_type/servicepath_entity_without_type.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0642_service_path_entity_without_type/servicepath_entity_without_type.test rename to test/functionalTest/cases/0642_service_path_entity_without_type/servicepath_entity_without_type.test.DISABLED diff --git a/test/functionalTest/cases/0646_servicepath_children/servicepath_all_children.test b/test/functionalTest/cases/0646_servicepath_children/servicepath_all_children.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0646_servicepath_children/servicepath_all_children.test rename to test/functionalTest/cases/0646_servicepath_children/servicepath_all_children.test.DISABLED diff --git a/test/functionalTest/cases/0646_servicepath_children/servicepath_default.test b/test/functionalTest/cases/0646_servicepath_children/servicepath_default.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0646_servicepath_children/servicepath_default.test rename to test/functionalTest/cases/0646_servicepath_children/servicepath_default.test.DISABLED diff --git a/test/functionalTest/cases/0647_crash_with_compounds/POST_notifyContextRequest.test b/test/functionalTest/cases/0647_crash_with_compounds/POST_notifyContextRequest.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0647_crash_with_compounds/POST_notifyContextRequest.test rename to test/functionalTest/cases/0647_crash_with_compounds/POST_notifyContextRequest.test.DISABLED diff --git a/test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_E1_attributes_A1.test b/test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_E1_attributes_A1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_E1_attributes_A1.test rename to test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_E1_attributes_A1.test.DISABLED diff --git a/test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_entityId.test b/test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_entityId.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_entityId.test rename to test/functionalTest/cases/0647_crash_with_compounds/PUT_v1_contextEntities_entityId.test.DISABLED diff --git a/test/functionalTest/cases/0673_xauth_token/auth_token_from_subscribe_request.test b/test/functionalTest/cases/0673_xauth_token/auth_token_from_subscribe_request.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0673_xauth_token/auth_token_from_subscribe_request.test rename to test/functionalTest/cases/0673_xauth_token/auth_token_from_subscribe_request.test.DISABLED diff --git a/test/functionalTest/cases/0673_xauth_token/auth_token_three_steps.test b/test/functionalTest/cases/0673_xauth_token/auth_token_three_steps.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0673_xauth_token/auth_token_three_steps.test rename to test/functionalTest/cases/0673_xauth_token/auth_token_three_steps.test.DISABLED diff --git a/test/functionalTest/cases/0673_xauth_token/subscription.test b/test/functionalTest/cases/0673_xauth_token/subscription.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0673_xauth_token/subscription.test rename to test/functionalTest/cases/0673_xauth_token/subscription.test.DISABLED diff --git a/test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_onchange_notification.test b/test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_onchange_notification.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_onchange_notification.test rename to test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_onchange_notification.test.DISABLED diff --git a/test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_single_onchange_notification.test b/test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_single_onchange_notification.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_single_onchange_notification.test rename to test/functionalTest/cases/0674_servicepath_in_notifications/service_path_in_single_onchange_notification.test.DISABLED diff --git a/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/erroneous_ngsi10_subscription_with_two_service_paths.test b/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/erroneous_ngsi10_subscription_with_two_service_paths.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/erroneous_ngsi10_subscription_with_two_service_paths.test rename to test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/erroneous_ngsi10_subscription_with_two_service_paths.test.DISABLED diff --git a/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_both_cities_with_isPattern_and_deeper_service_path.test b/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_both_cities_with_isPattern_and_deeper_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_both_cities_with_isPattern_and_deeper_service_path.test rename to test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_both_cities_with_isPattern_and_deeper_service_path.test.DISABLED diff --git a/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_exact_city_with_isPattern_and_deeper_service_path.test b/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_exact_city_with_isPattern_and_deeper_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_exact_city_with_isPattern_and_deeper_service_path.test rename to test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_exact_city_with_isPattern_and_deeper_service_path.test.DISABLED diff --git a/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_isPattern_and_deeper_service_path.test b/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_isPattern_and_deeper_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_isPattern_and_deeper_service_path.test rename to test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_isPattern_and_deeper_service_path.test.DISABLED diff --git a/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path.test b/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path.test rename to test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path.test.DISABLED diff --git a/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path_and_isPattern.test b/test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path_and_isPattern.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path_and_isPattern.test rename to test/functionalTest/cases/0675_servicePath_in_ngsi10_subscriptions/simple_ngsi10_subscription_with_recursive_service_path_and_isPattern.test.DISABLED diff --git a/test/functionalTest/cases/0676_servicepath_context_types/servicepath_context_types.test b/test/functionalTest/cases/0676_servicepath_context_types/servicepath_context_types.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0676_servicepath_context_types/servicepath_context_types.test rename to test/functionalTest/cases/0676_servicepath_context_types/servicepath_context_types.test.DISABLED diff --git a/test/functionalTest/cases/0676_servicepath_context_types/servicepath_default_context_types.test b/test/functionalTest/cases/0676_servicepath_context_types/servicepath_default_context_types.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0676_servicepath_context_types/servicepath_default_context_types.test rename to test/functionalTest/cases/0676_servicepath_context_types/servicepath_default_context_types.test.DISABLED diff --git a/test/functionalTest/cases/0676_servicepath_context_types/servicepath_sametype.test b/test/functionalTest/cases/0676_servicepath_context_types/servicepath_sametype.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0676_servicepath_context_types/servicepath_sametype.test rename to test/functionalTest/cases/0676_servicepath_context_types/servicepath_sametype.test.DISABLED diff --git a/test/functionalTest/cases/0676_servicepath_context_types/servicepath_specific_sametype.test b/test/functionalTest/cases/0676_servicepath_context_types/servicepath_specific_sametype.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0676_servicepath_context_types/servicepath_specific_sametype.test rename to test/functionalTest/cases/0676_servicepath_context_types/servicepath_specific_sametype.test.DISABLED diff --git a/test/functionalTest/cases/0684_entity_type_missing/entity_type_missing_in_v1_contextEntities.test b/test/functionalTest/cases/0684_entity_type_missing/entity_type_missing_in_v1_contextEntities.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0684_entity_type_missing/entity_type_missing_in_v1_contextEntities.test rename to test/functionalTest/cases/0684_entity_type_missing/entity_type_missing_in_v1_contextEntities.test.DISABLED diff --git a/test/functionalTest/cases/0686_contextTypes_with_no_attributes/contextTypes_with_no_attributes.test b/test/functionalTest/cases/0686_contextTypes_with_no_attributes/contextTypes_with_no_attributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0686_contextTypes_with_no_attributes/contextTypes_with_no_attributes.test rename to test/functionalTest/cases/0686_contextTypes_with_no_attributes/contextTypes_with_no_attributes.test.DISABLED diff --git a/test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_empty_type_and_service_path.test b/test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_empty_type_and_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_empty_type_and_service_path.test rename to test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_empty_type_and_service_path.test.DISABLED diff --git a/test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_no_type_and_service_path.test b/test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_no_type_and_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_no_type_and_service_path.test rename to test/functionalTest/cases/0691_empty_type_and_subscriptions/simple_ngsi10_subscriptions_with_no_type_and_service_path.test.DISABLED diff --git a/test/functionalTest/cases/0706_direct_https_notifications/direct_https_notifications_no_accept_selfsigned.test b/test/functionalTest/cases/0706_direct_https_notifications/direct_https_notifications_no_accept_selfsigned.test index d244c4b284..5450106eb1 100644 --- a/test/functionalTest/cases/0706_direct_https_notifications/direct_https_notifications_no_accept_selfsigned.test +++ b/test/functionalTest/cases/0706_direct_https_notifications/direct_https_notifications_no_accept_selfsigned.test @@ -92,7 +92,7 @@ echo "04. Look in the CB log for the warning about cert not accepted" echo "==============================================================" # Depdending the system the message in the logs may be diferent. For instance, it has been found than in -# CentOS8 and Debian 9 the message is "Peer certificate cannot be authenticated" but in Debian 11 +# CentOS8 and Debian 9 the message is "Peer certificate cannot be authenticated" but in Debian 11/12 # is "Peer certificate cannot be authenticated". At the end this error message comes from the SSH library grep "Peer certificate cannot be authenticated\|SSL peer certificate or SSH remote key was not OK" /tmp/contextBroker.log | grep "notification failure" | wc -l diff --git a/test/functionalTest/cases/0713_propagate_tenant/propagate_tenant_for_update_and_query_standard_ops.test b/test/functionalTest/cases/0713_propagate_tenant/propagate_tenant_for_update_and_query_standard_ops.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0713_propagate_tenant/propagate_tenant_for_update_and_query_standard_ops.test rename to test/functionalTest/cases/0713_propagate_tenant/propagate_tenant_for_update_and_query_standard_ops.test.DISABLED diff --git a/test/functionalTest/cases/0714_propagate_service_path/no_propagation_of_service_path_when_not_present.test b/test/functionalTest/cases/0714_propagate_service_path/no_propagation_of_service_path_when_not_present.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0714_propagate_service_path/no_propagation_of_service_path_when_not_present.test rename to test/functionalTest/cases/0714_propagate_service_path/no_propagation_of_service_path_when_not_present.test.DISABLED diff --git a/test/functionalTest/cases/0714_propagate_service_path/propagate_service_path_for_update_and_query_standard_ops.test b/test/functionalTest/cases/0714_propagate_service_path/propagate_service_path_for_update_and_query_standard_ops.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0714_propagate_service_path/propagate_service_path_for_update_and_query_standard_ops.test rename to test/functionalTest/cases/0714_propagate_service_path/propagate_service_path_for_update_and_query_standard_ops.test.DISABLED diff --git a/test/functionalTest/cases/0715_forward_xauth_token_to_cprs/propagate_xauth_token_for_update_and_query_standard_ops.test b/test/functionalTest/cases/0715_forward_xauth_token_to_cprs/propagate_xauth_token_for_update_and_query_standard_ops.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0715_forward_xauth_token_to_cprs/propagate_xauth_token_for_update_and_query_standard_ops.test rename to test/functionalTest/cases/0715_forward_xauth_token_to_cprs/propagate_xauth_token_for_update_and_query_standard_ops.test.DISABLED diff --git a/test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute.test b/test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute.test rename to test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute_query.test b/test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute_query.test rename to test/functionalTest/cases/0716_forward_registered_attributes/forward_attribute_query.test.DISABLED diff --git a/test/functionalTest/cases/0719_servicepath_for_registrations/forward_attribute_with_servicePath.test b/test/functionalTest/cases/0719_servicepath_for_registrations/forward_attribute_with_servicePath.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0719_servicepath_for_registrations/forward_attribute_with_servicePath.test rename to test/functionalTest/cases/0719_servicepath_for_registrations/forward_attribute_with_servicePath.test.DISABLED diff --git a/test/functionalTest/cases/0719_servicepath_for_registrations/forward_queries.test b/test/functionalTest/cases/0719_servicepath_for_registrations/forward_queries.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0719_servicepath_for_registrations/forward_queries.test rename to test/functionalTest/cases/0719_servicepath_for_registrations/forward_queries.test.DISABLED diff --git a/test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_invalid_service_paths.test b/test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_invalid_service_paths.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_invalid_service_paths.test rename to test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_invalid_service_paths.test.DISABLED diff --git a/test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_many_servicepaths.test b/test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_many_servicepaths.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_many_servicepaths.test rename to test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_many_servicepaths.test.DISABLED diff --git a/test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_servicepath.test b/test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_servicepath.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_servicepath.test rename to test/functionalTest/cases/0719_servicepath_for_registrations/register_and_discovery_with_servicepath.test.DISABLED diff --git a/test/functionalTest/cases/0740_crash_with_json_object_for_attributes/json_object_format.test b/test/functionalTest/cases/0740_crash_with_json_object_for_attributes/json_object_format.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0740_crash_with_json_object_for_attributes/json_object_format.test rename to test/functionalTest/cases/0740_crash_with_json_object_for_attributes/json_object_format.test.DISABLED diff --git a/test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update.test b/test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update.test rename to test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update.test.DISABLED diff --git a/test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_object.test b/test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_object.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_object.test rename to test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_object.test.DISABLED diff --git a/test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_vector.test b/test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_vector.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_vector.test rename to test/functionalTest/cases/0766_attribute_metadata_update/attribute_metadata_update_compound_vector.test.DISABLED diff --git a/test/functionalTest/cases/0772_bad_json_response_in_convop/post_v1_contextEntities_ID_attributes_ATTR.test b/test/functionalTest/cases/0772_bad_json_response_in_convop/post_v1_contextEntities_ID_attributes_ATTR.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0772_bad_json_response_in_convop/post_v1_contextEntities_ID_attributes_ATTR.test rename to test/functionalTest/cases/0772_bad_json_response_in_convop/post_v1_contextEntities_ID_attributes_ATTR.test.DISABLED diff --git a/test/functionalTest/cases/0773_not_found_in_context_provider/not_found_in_context_provider.test b/test/functionalTest/cases/0773_not_found_in_context_provider/not_found_in_context_provider.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0773_not_found_in_context_provider/not_found_in_context_provider.test rename to test/functionalTest/cases/0773_not_found_in_context_provider/not_found_in_context_provider.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/delete_attribute_that_does_exist_with_convop.test b/test/functionalTest/cases/0787_cprs_full_functional/delete_attribute_that_does_exist_with_convop.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/delete_attribute_that_does_exist_with_convop.test rename to test/functionalTest/cases/0787_cprs_full_functional/delete_attribute_that_does_exist_with_convop.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_double_forward.test b/test/functionalTest/cases/0787_cprs_full_functional/query_double_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_double_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_double_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_false_registration.test b/test/functionalTest/cases/0787_cprs_full_functional/query_false_registration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_false_registration.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_false_registration.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value.test b/test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value_in_provider.test b/test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value_in_provider.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value_in_provider.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_false_registration_and_one_more_value_in_provider.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_five_different_cprs_in_one_query.test b/test/functionalTest/cases/0787_cprs_full_functional/query_five_different_cprs_in_one_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_five_different_cprs_in_one_query.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_five_different_cprs_in_one_query.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_forward_depends_on_attr_field.test b/test/functionalTest/cases/0787_cprs_full_functional/query_forward_depends_on_attr_field.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_forward_depends_on_attr_field.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_forward_depends_on_attr_field.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_forward_query_not_found.test b/test/functionalTest/cases/0787_cprs_full_functional/query_forward_query_not_found.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_forward_query_not_found.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_forward_query_not_found.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_found_and_not_found_locally_and_remote.test b/test/functionalTest/cases/0787_cprs_full_functional/query_found_and_not_found_locally_and_remote.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_found_and_not_found_locally_and_remote.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_found_and_not_found_locally_and_remote.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CB_and_CP1.test b/test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CB_and_CP1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CB_and_CP1.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CB_and_CP1.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CP1_and_CP2.test b/test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CP1_and_CP2.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CP1_and_CP2.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_no_attributes_in_query_results_from_CP1_and_CP2.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_one_forward.test b/test/functionalTest/cases/0787_cprs_full_functional/query_one_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_one_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_one_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_shadowed_attribute.test b/test/functionalTest/cases/0787_cprs_full_functional/query_shadowed_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_shadowed_attribute.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_shadowed_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_cpr_one_local.test b/test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_cpr_one_local.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_cpr_one_local.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_cpr_one_local.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_one_cpr_three_in_another.test b/test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_one_cpr_three_in_another.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_one_cpr_three_in_another.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_two_attributes_in_one_cpr_three_in_another.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/query_with_contextElement_providingApplicationList.test b/test/functionalTest/cases/0787_cprs_full_functional/query_with_contextElement_providingApplicationList.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/query_with_contextElement_providingApplicationList.test rename to test/functionalTest/cases/0787_cprs_full_functional/query_with_contextElement_providingApplicationList.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_double_forward.test b/test/functionalTest/cases/0787_cprs_full_functional/update_double_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_double_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_double_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_false_registration.test b/test/functionalTest/cases/0787_cprs_full_functional/update_false_registration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_false_registration.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_false_registration.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value.test b/test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value_in_provider.test b/test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value_in_provider.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value_in_provider.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_false_registration_and_one_more_value_in_provider.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_five_different_cprs_in_one_query.test b/test/functionalTest/cases/0787_cprs_full_functional/update_five_different_cprs_in_one_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_five_different_cprs_in_one_query.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_five_different_cprs_in_one_query.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_forward_depends_on_attr_field.test b/test/functionalTest/cases/0787_cprs_full_functional/update_forward_depends_on_attr_field.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_forward_depends_on_attr_field.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_forward_depends_on_attr_field.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_found_and_not_found_in_local_and_three_cprs.test b/test/functionalTest/cases/0787_cprs_full_functional/update_found_and_not_found_in_local_and_three_cprs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_found_and_not_found_in_local_and_three_cprs.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_found_and_not_found_in_local_and_three_cprs.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_one_forward.test b/test/functionalTest/cases/0787_cprs_full_functional/update_one_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_one_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_one_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_shadowed_attribute.test b/test/functionalTest/cases/0787_cprs_full_functional/update_shadowed_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_shadowed_attribute.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_shadowed_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional/update_three_found_on_cps_two_local_four_not_found.test b/test/functionalTest/cases/0787_cprs_full_functional/update_three_found_on_cps_two_local_four_not_found.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional/update_three_found_on_cps_two_local_four_not_found.test rename to test/functionalTest/cases/0787_cprs_full_functional/update_three_found_on_cps_two_local_four_not_found.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_double_forward.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_double_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_double_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_double_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value_in_provider.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value_in_provider.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value_in_provider.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_false_registration_and_one_more_value_in_provider.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_five_different_cprs_in_one_query.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_five_different_cprs_in_one_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_five_different_cprs_in_one_query.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_five_different_cprs_in_one_query.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_depends_on_attr_field.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_depends_on_attr_field.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_depends_on_attr_field.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_depends_on_attr_field.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_query_not_found.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_query_not_found.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_query_not_found.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_forward_query_not_found.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_found_and_not_found_locally_and_remote.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_found_and_not_found_locally_and_remote.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_found_and_not_found_locally_and_remote.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_found_and_not_found_locally_and_remote.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CB_and_CP1.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CB_and_CP1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CB_and_CP1.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CB_and_CP1.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CP1_and_CP2.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CP1_and_CP2.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CP1_and_CP2.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_no_attributes_in_query_results_from_CP1_and_CP2.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_one_forward_query.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_one_forward_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_one_forward_query.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_one_forward_query.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_shadowed_attribute.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_shadowed_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_shadowed_attribute.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_shadowed_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_cpr_one_local.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_cpr_one_local.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_cpr_one_local.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_cpr_one_local.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_one_cpr_three_in_another.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_one_cpr_three_in_another.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_one_cpr_three_in_another.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_query_two_attributes_in_one_cpr_three_in_another.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_double_forward.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_double_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_double_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_double_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value_in_provider.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value_in_provider.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value_in_provider.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_false_registration_and_one_more_value_in_provider.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_five_different_cprs_in_one_query.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_five_different_cprs_in_one_query.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_five_different_cprs_in_one_query.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_five_different_cprs_in_one_query.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_forward_depends_on_attr_field.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_forward_depends_on_attr_field.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_forward_depends_on_attr_field.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_forward_depends_on_attr_field.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_found_and_not_found_in_local_and_three_cprs.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_found_and_not_found_in_local_and_three_cprs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_found_and_not_found_in_local_and_three_cprs.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_found_and_not_found_in_local_and_three_cprs.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_one_forward.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_one_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_one_forward.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_one_forward.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_shadowed_attribute.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_shadowed_attribute.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_shadowed_attribute.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_shadowed_attribute.test.DISABLED diff --git a/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_three_found_on_cps_two_local_four_not_found.test b/test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_three_found_on_cps_two_local_four_not_found.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_three_found_on_cps_two_local_four_not_found.test rename to test/functionalTest/cases/0787_cprs_full_functional_v2/ngsiv2_update_three_found_on_cps_two_local_four_not_found.test.DISABLED diff --git a/test/functionalTest/cases/0828_slash_at_end_of_uri_path/slash_or_no_slash_gives_same_result.test b/test/functionalTest/cases/0828_slash_at_end_of_uri_path/slash_or_no_slash_gives_same_result.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0828_slash_at_end_of_uri_path/slash_or_no_slash_gives_same_result.test rename to test/functionalTest/cases/0828_slash_at_end_of_uri_path/slash_or_no_slash_gives_same_result.test.DISABLED diff --git a/test/functionalTest/cases/0880_timeout_for_forward_and_notifications/forward_that_times_out.test b/test/functionalTest/cases/0880_timeout_for_forward_and_notifications/forward_that_times_out.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0880_timeout_for_forward_and_notifications/forward_that_times_out.test rename to test/functionalTest/cases/0880_timeout_for_forward_and_notifications/forward_that_times_out.test.DISABLED diff --git a/test/functionalTest/cases/0908_update_duplicated_attributes/dup_attrs_avoid_db_error.test b/test/functionalTest/cases/0908_update_duplicated_attributes/dup_attrs_avoid_db_error.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0908_update_duplicated_attributes/dup_attrs_avoid_db_error.test rename to test/functionalTest/cases/0908_update_duplicated_attributes/dup_attrs_avoid_db_error.test.DISABLED diff --git a/test/functionalTest/cases/0917_queryContext_behaves_differently/query_with_and_without_forwarding.test b/test/functionalTest/cases/0917_queryContext_behaves_differently/query_with_and_without_forwarding.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0917_queryContext_behaves_differently/query_with_and_without_forwarding.test rename to test/functionalTest/cases/0917_queryContext_behaves_differently/query_with_and_without_forwarding.test.DISABLED diff --git a/test/functionalTest/cases/0943_overnotification_bug/overnotification_bug.test b/test/functionalTest/cases/0943_overnotification_bug/overnotification_bug.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0943_overnotification_bug/overnotification_bug.test rename to test/functionalTest/cases/0943_overnotification_bug/overnotification_bug.test.DISABLED diff --git a/test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs.test b/test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs.test rename to test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs.test.DISABLED diff --git a/test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities.test b/test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities.test rename to test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities.test.DISABLED diff --git a/test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities2.test b/test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities2.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities2.test rename to test/functionalTest/cases/0945_pagination_with_cprs/pagination_with_cprs_mix_entities2.test.DISABLED diff --git a/test/functionalTest/cases/0968_ngsi10_asterisk_subs/0968_ngsi10_asterisk_subs.test b/test/functionalTest/cases/0968_ngsi10_asterisk_subs/0968_ngsi10_asterisk_subs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/0968_ngsi10_asterisk_subs/0968_ngsi10_asterisk_subs.test rename to test/functionalTest/cases/0968_ngsi10_asterisk_subs/0968_ngsi10_asterisk_subs.test.DISABLED diff --git a/test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_limited.test b/test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_limited.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_limited.test rename to test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_limited.test.DISABLED diff --git a/test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_unlimited.test b/test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_unlimited.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_unlimited.test rename to test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_unlimited.test.DISABLED diff --git a/test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_zero_limit.test b/test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_zero_limit.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_zero_limit.test rename to test/functionalTest/cases/1016_cpr_forward_limit/fwd_query_zero_limit.test.DISABLED diff --git a/test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_limited.test b/test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_limited.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_limited.test rename to test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_limited.test.DISABLED diff --git a/test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_unlimited.test b/test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_unlimited.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_unlimited.test rename to test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_unlimited.test.DISABLED diff --git a/test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_zero_limit.test b/test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_zero_limit.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_zero_limit.test rename to test/functionalTest/cases/1016_cpr_forward_limit/fwd_update_zero_limit.test.DISABLED diff --git a/test/functionalTest/cases/1038_ngsiv2_geo_location_entities/geoquery_circle_geopoint_count.test b/test/functionalTest/cases/1038_ngsiv2_geo_location_entities/geoquery_circle_geopoint_count.test new file mode 100644 index 0000000000..1bc9067a60 --- /dev/null +++ b/test/functionalTest/cases/1038_ngsiv2_geo_location_entities/geoquery_circle_geopoint_count.test @@ -0,0 +1,283 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Geo query (circle) with geo:point (NGSIv2) with count + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# Same as geoquery_circle_geopoint_count.test but with options=count in every query +# +# 01. Create entity corresponding to Madrid +# 02. Create entity corresponding to Alcobendas +# 03. Create entity corresponding to Leganes +# 04. Query inside 13.5 kms radius from Madrid center -> Madrid, Leganes +# 05. Query inside 15 kms radius from Madrid center -> Madrid, Alcobendas, Leganes +# 06. Query in 13.5 kms radius outside Madrid center -> Alcobendas +# 07. Query minDistance 0 kms to Madrid center -> Madrid, Alcobendas, Leganes + +echo "01. Create entity corresponding to Madrid" +echo "=========================================" +payload='{ + "id": "Madrid", + "type": "City", + "location": { + "value": "40.418889, -3.691944", + "type": "geo:point" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo +sleep 1.1 + + +echo "02. Create entity corresponding to Alcobendas" +echo "=============================================" +payload='{ + "id": "Alcobendas", + "type": "City", + "location": { + "value": "40.533333, -3.633333", + "type": "geo:point" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo +sleep 1.1 + + +echo "03. Create entity corresponding to Leganes" +echo "==========================================" +payload='{ + "id": "Leganes", + "type": "City", + "location": { + "value": "40.316667, -3.75", + "type": "geo:point" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "04. Query inside 13.5 kms radius from Madrid center -> Madrid, Leganes" +echo "======================================================================" +orionCurl --url '/v2/entities?georel=near;maxDistance:13500&geometry=point&coords=40.418889,-3.691944&options=count' +echo +echo + + +echo "05. Query inside 15 kms radius from Madrid center -> Madrid, Alcobendas, Leganes" +echo "================================================================================" +orionCurl --url '/v2/entities?georel=near;maxDistance:15000&geometry=point&coords=40.418889,-3.691944&options=count' +echo +echo + + +echo "06. Query in 13.5 kms radius outside Madrid center -> Alcobendas" +echo "================================================================" +orionCurl --url '/v2/entities?georel=near;minDistance:13500&geometry=point&coords=40.418889,-3.691944&options=count' +echo +echo + + +echo "07. Query minDistance 0 kms to Madrid center -> Madrid, Alcobendas, Leganes" +echo "===========================================================================" +orionCurl --url '/v2/entities?georel=near;minDistance:0&geometry=point&coords=40.418889,-3.691944&options=count' +echo +echo + + +--REGEXPECT-- +01. Create entity corresponding to Madrid +========================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/Madrid?type=City +Content-Length: 0 + + + +02. Create entity corresponding to Alcobendas +============================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/Alcobendas?type=City +Content-Length: 0 + + + +03. Create entity corresponding to Leganes +========================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/Leganes?type=City +Content-Length: 0 + + + +04. Query inside 13.5 kms radius from Madrid center -> Madrid, Leganes +====================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 2 +Content-Type: application/json +Content-Length: 212 + +[ + { + "id": "Madrid", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.418889, -3.691944" + }, + "type": "City" + }, + { + "id": "Leganes", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.316667, -3.75" + }, + "type": "City" + } +] + + +05. Query inside 15 kms radius from Madrid center -> Madrid, Alcobendas, Leganes +================================================================================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 3 +Content-Type: application/json +Content-Length: 323 + +[ + { + "id": "Madrid", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.418889, -3.691944" + }, + "type": "City" + }, + { + "id": "Alcobendas", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.533333, -3.633333" + }, + "type": "City" + }, + { + "id": "Leganes", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.316667, -3.75" + }, + "type": "City" + } +] + + +06. Query in 13.5 kms radius outside Madrid center -> Alcobendas +================================================================ +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 1 +Content-Type: application/json +Content-Length: 112 + +[ + { + "id": "Alcobendas", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.533333, -3.633333" + }, + "type": "City" + } +] + + +07. Query minDistance 0 kms to Madrid center -> Madrid, Alcobendas, Leganes +=========================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 3 +Content-Type: application/json +Content-Length: 323 + +[ + { + "id": "Madrid", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.418889, -3.691944" + }, + "type": "City" + }, + { + "id": "Alcobendas", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.533333, -3.633333" + }, + "type": "City" + }, + { + "id": "Leganes", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "40.316667, -3.75" + }, + "type": "City" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/1038_ngsiv2_geo_location_entities/geoquery_polygon_geopoint_count.test b/test/functionalTest/cases/1038_ngsiv2_geo_location_entities/geoquery_polygon_geopoint_count.test new file mode 100644 index 0000000000..0bd39049ba --- /dev/null +++ b/test/functionalTest/cases/1038_ngsiv2_geo_location_entities/geoquery_polygon_geopoint_count.test @@ -0,0 +1,297 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Geo query test (polygon) with geo:point (NGSIv2) with count + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# Same as geoquery_polygon_geopoint_count.test but with options=count in every query +# +# 01. Create Point A +# 02. Create Point B +# 03. Create Point C +# 04. Rectangle in: A, B +# 05. Rectangle in: B, C +# 06. Triangle in: A +# 07. Rectangle out: A +# 08. Triangle out: B, C +# + +echo "01. Create Point A" +echo "==================" +payload='{ + "id": "A", + "type": "Point", + "location": { + "value": "3, 2", + "type": "geo:point" + } +}' +orionCurl --url /v2/entities --payload "$payload" +sleep 1.1 +echo +echo + + +echo "02. Create Point B" +echo "==================" +payload='{ + "id": "B", + "type": "Point", + "location": { + "value": "5, 5", + "type": "geo:point" + } +}' +orionCurl --url /v2/entities --payload "$payload" +sleep 1.1 +echo +echo + + +echo "03. Create Point C" +echo "==================" +payload='{ + "id": "C", + "type": "Point", + "location": { + "value": "7, 4", + "type": "geo:point" + } +}' +orionCurl --url /v2/entities --payload "$payload" +sleep 1.1 +echo +echo + + +echo "04. Rectangle in: A, B" +echo "======================" +orionCurl --url '/v2/entities?georel=coveredBy&geometry=polygon&coords=0,0;0,6;6,6;6,0;0,0&options=count' +echo +echo + + +echo "05. Rectangle in: B, C" +echo "======================" +orionCurl --url '/v2/entities?georel=coveredBy&geometry=polygon&coords=3,3;3,8;11,8;11,3;3,3&options=count' +echo +echo + + +echo "06. Triangle in: A" +echo "==================" +orionCurl --url '/v2/entities?georel=coveredBy&geometry=polygon&coords=0,0;0,6;6,0;0,0&options=count' +echo +echo + + +echo "07. Rectangle out: A" +echo "====================" +orionCurl --url '/v2/entities?georel=disjoint&geometry=polygon&coords=3,3;3,8;11,8;11,3;3,3&options=count' +echo +echo + + +echo "08. Triangle out: B, C" +echo "======================" +orionCurl --url '/v2/entities?georel=disjoint&geometry=polygon&coords=0,0;0,6;6,0;0,0&options=count' +echo +echo + + +--REGEXPECT-- +01. Create Point A +================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/A?type=Point +Content-Length: 0 + + + +02. Create Point B +================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/B?type=Point +Content-Length: 0 + + + +03. Create Point C +================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/C?type=Point +Content-Length: 0 + + + +04. Rectangle in: A, B +====================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 2 +Content-Type: application/json +Content-Length: 175 + +[ + { + "id": "A", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "3, 2" + }, + "type": "Point" + }, + { + "id": "B", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "5, 5" + }, + "type": "Point" + } +] + + +05. Rectangle in: B, C +====================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 2 +Content-Type: application/json +Content-Length: 175 + +[ + { + "id": "B", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "5, 5" + }, + "type": "Point" + }, + { + "id": "C", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "7, 4" + }, + "type": "Point" + } +] + + +06. Triangle in: A +================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 1 +Content-Type: application/json +Content-Length: 88 + +[ + { + "id": "A", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "3, 2" + }, + "type": "Point" + } +] + + +07. Rectangle out: A +==================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 1 +Content-Type: application/json +Content-Length: 88 + +[ + { + "id": "A", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "3, 2" + }, + "type": "Point" + } +] + + +08. Triangle out: B, C +====================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 2 +Content-Type: application/json +Content-Length: 175 + +[ + { + "id": "B", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "5, 5" + }, + "type": "Point" + }, + { + "id": "C", + "location": { + "metadata": {}, + "type": "geo:point", + "value": "7, 4" + }, + "type": "Point" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/1041_GET_v2_entities_options_count/get_entities_option_count_multitenant.test b/test/functionalTest/cases/1041_GET_v2_entities_options_count/get_entities_option_count_multitenant.test new file mode 100644 index 0000000000..e7f7bf0b45 --- /dev/null +++ b/test/functionalTest/cases/1041_GET_v2_entities_options_count/get_entities_option_count_multitenant.test @@ -0,0 +1,158 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +GET Entities V2 options=count (multitenant variant) + +--SHELL-INIT-- +dbInit CB s1 +dbInit CB s2 +brokerStart CB 0 IPv4 -multiservice + +--SHELL-- + +# +# 01. POST /v2/entities (E1) in s1 /A +# 02. POST /v2/entities (E2) in s1 /B +# 03. POST /v2/entities (E3) in s2 /A +# 04. POST /v2/entities (E4) in s2 /B +# 05. GET /v2/entities?limit=0&options=count in s1 /A, get fiware-total-count 1 +# + + +echo "01. POST /v2/entities (E1) in s1 /A" +echo "===================================" +payload='{ + + "id": "E1", + "type": "Car", + "model" : { + "type": "myString", + "value" : "Klasse C" + } +}' +orionCurl --url /v2/entities --payload "$payload" --tenant s1 --servicePath /A +echo +echo + + +echo "02. POST /v2/entities (E2) in s1 /B" +echo "===================================" +payload='{ + + "id": "E2", + "type": "Car" +}' +orionCurl --url /v2/entities --payload "$payload" --tenant s1 --servicePath /B +echo +echo + + +echo "03. POST /v2/entities (E3) in s2 /A" +echo "===================================" +payload='{ + + "id": "E3", + "type": "Car" +}' +orionCurl --url /v2/entities --payload "$payload" --tenant s2 --servicePath /A +echo +echo + + +echo "04. POST /v2/entities (E4) in s2 /B" +echo "===================================" +payload='{ + + "id": "E4", + "type": "Car" +}' +orionCurl --url /v2/entities --payload "$payload" --tenant s2 --servicePath /B +echo +echo + + +echo "05. GET /v2/entities?limit=0&options=count in s1 /A, get fiware-total-count 1" +echo "=============================================================================" +orionCurl --url '/v2/entities?limit=0&options=count' --tenant s1 --servicePath /A +echo +echo + + +--REGEXPECT-- +01. POST /v2/entities (E1) in s1 /A +=================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=Car +Content-Length: 0 + + + +02. POST /v2/entities (E2) in s1 /B +=================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=Car +Content-Length: 0 + + + +03. POST /v2/entities (E3) in s2 /A +=================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E3?type=Car +Content-Length: 0 + + + +04. POST /v2/entities (E4) in s2 /B +=================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E4?type=Car +Content-Length: 0 + + + +05. GET /v2/entities?limit=0&options=count in s1 /A, get fiware-total-count 1 +============================================================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Fiware-Total-Count: 1 +Content-Type: application/json +Content-Length: 2 + +[] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB s1 +dbDrop CB s2 + diff --git a/test/functionalTest/cases/1048_subscription_cache/cache_population_at_init.test b/test/functionalTest/cases/1048_subscription_cache/cache_population_at_init.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1048_subscription_cache/cache_population_at_init.test rename to test/functionalTest/cases/1048_subscription_cache/cache_population_at_init.test.DISABLED diff --git a/test/functionalTest/cases/1048_subscription_cache/three_subscriptions.test b/test/functionalTest/cases/1048_subscription_cache/three_subscriptions.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1048_subscription_cache/three_subscriptions.test rename to test/functionalTest/cases/1048_subscription_cache/three_subscriptions.test.DISABLED diff --git a/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v1.test b/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v1.test.DISABLED similarity index 97% rename from test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v1.test rename to test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v1.test.DISABLED index e2fe55a3bb..d062fb7320 100644 --- a/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v1.test +++ b/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v1.test.DISABLED @@ -171,7 +171,7 @@ Content-Length: 269 03. Check the '=' in DB ======================= -{ "attrs" : { "A" : { "type" : "T", "creDate" : REGEX(.*), "value" : "foo", "md" : { "m=x" : { "type" : "string", "value" : "black" }, "m=y" : { "type" : "string", "value" : "sweet" } }, "mdNames" : [ "m.x", "m.y" ] } } } +{ "attrs" : { "A" : { "value" : "foo", "type" : "T", "creDate" : REGEX(.*), "md" : { "m=x" : { "type" : "string", "value" : "black" }, "m=y" : { "type" : "string", "value" : "sweet" } }, "mdNames" : [ "m.x", "m.y" ] } } } --TEARDOWN-- diff --git a/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v2.test b/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v2.test index 3822adf74b..a2c3e5a2d1 100644 --- a/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v2.test +++ b/test/functionalTest/cases/1112_metadata_as_keymap/metadata_with_dots_v2.test @@ -114,7 +114,7 @@ Content-Length: 139 03. Check the '=' in DB ======================= -{ "attrs" : { "A" : { "type" : "T", "creDate" : REGEX(.*), "value" : "foo", "md" : { "m=x" : { "type" : "string", "value" : "black" }, "m=y" : { "type" : "double", "value" : 5 } }, "mdNames" : [ "m.x", "m.y" ] } } } +{ "attrs" : { "A" : { "value" : "foo", "type" : "T", "creDate" : REGEX(.*), "md" : { "m=x" : { "type" : "string", "value" : "black" }, "m=y" : { "type" : "double", "value" : 5 } }, "mdNames" : [ "m.x", "m.y" ] } } } --TEARDOWN-- diff --git a/test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subs_pagination.test b/test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subs_pagination.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subs_pagination.test rename to test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subs_pagination.test.DISABLED diff --git a/test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subscriptions.test b/test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subscriptions.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subscriptions.test rename to test/functionalTest/cases/1126_GET_v2_subscriptions/GET_v2_all_subscriptions.test.DISABLED diff --git a/test/functionalTest/cases/1172_bug_json_invalid_render/invalid_json_render.test b/test/functionalTest/cases/1172_bug_json_invalid_render/invalid_json_render.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1172_bug_json_invalid_render/invalid_json_render.test rename to test/functionalTest/cases/1172_bug_json_invalid_render/invalid_json_render.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/cache_reset_from_db.test b/test/functionalTest/cases/1308_subscription_cache/cache_reset_from_db.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/cache_reset_from_db.test rename to test/functionalTest/cases/1308_subscription_cache/cache_reset_from_db.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/subCacheMixedSubscriptionsWithUpdatesAndDeletes.test b/test/functionalTest/cases/1308_subscription_cache/subCacheMixedSubscriptionsWithUpdatesAndDeletes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/subCacheMixedSubscriptionsWithUpdatesAndDeletes.test rename to test/functionalTest/cases/1308_subscription_cache/subCacheMixedSubscriptionsWithUpdatesAndDeletes.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpiration.test b/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpiration.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpiration.test rename to test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpiration.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterRefresh.test b/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterRefresh.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterRefresh.test rename to test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterRefresh.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdate.test b/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdate.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdate.test rename to test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdate.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdateWhenSubExpired.test b/test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdateWhenSubExpired.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdateWhenSubExpired.test rename to test/functionalTest/cases/1308_subscription_cache/subCacheThrottlingAndExpirationAfterSubUpdateWhenSubExpired.test.DISABLED diff --git a/test/functionalTest/cases/1308_subscription_cache/sub_expired_and_updated_then_cache_refresh.test b/test/functionalTest/cases/1308_subscription_cache/sub_expired_and_updated_then_cache_refresh.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1308_subscription_cache/sub_expired_and_updated_then_cache_refresh.test rename to test/functionalTest/cases/1308_subscription_cache/sub_expired_and_updated_then_cache_refresh.test.DISABLED diff --git a/test/functionalTest/cases/1310_suspect_200OK/suspect_200OK.test b/test/functionalTest/cases/1310_suspect_200OK/suspect_200OK.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1310_suspect_200OK/suspect_200OK.test rename to test/functionalTest/cases/1310_suspect_200OK/suspect_200OK.test.DISABLED diff --git a/test/functionalTest/cases/1317_GET_v2_subscription/get_subscription.test b/test/functionalTest/cases/1317_GET_v2_subscription/get_subscription.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1317_GET_v2_subscription/get_subscription.test rename to test/functionalTest/cases/1317_GET_v2_subscription/get_subscription.test.DISABLED diff --git a/test/functionalTest/cases/1322_using_patt_conv_op/get_ce_type_id.test b/test/functionalTest/cases/1322_using_patt_conv_op/get_ce_type_id.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1322_using_patt_conv_op/get_ce_type_id.test rename to test/functionalTest/cases/1322_using_patt_conv_op/get_ce_type_id.test.DISABLED diff --git a/test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values.test b/test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values.test rename to test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values.test.DISABLED diff --git a/test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values_notification.test b/test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values_notification.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values_notification.test rename to test/functionalTest/cases/1358_v1_empty_attribute_values/empty_attribute_values_notification.test.DISABLED diff --git a/test/functionalTest/cases/1358_v1_empty_attribute_values/empty_values_conv_ops.test b/test/functionalTest/cases/1358_v1_empty_attribute_values/empty_values_conv_ops.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1358_v1_empty_attribute_values/empty_values_conv_ops.test rename to test/functionalTest/cases/1358_v1_empty_attribute_values/empty_values_conv_ops.test.DISABLED diff --git a/test/functionalTest/cases/1367_time_measures/time_measure_stats.test b/test/functionalTest/cases/1367_time_measures/time_measure_stats.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1367_time_measures/time_measure_stats.test rename to test/functionalTest/cases/1367_time_measures/time_measure_stats.test.DISABLED diff --git a/test/functionalTest/cases/1392_empty_attr_conv_op/empty_attr_conv_op.test b/test/functionalTest/cases/1392_empty_attr_conv_op/empty_attr_conv_op.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1392_empty_attr_conv_op/empty_attr_conv_op.test rename to test/functionalTest/cases/1392_empty_attr_conv_op/empty_attr_conv_op.test.DISABLED diff --git a/test/functionalTest/cases/1426_empty_components_in_uri_path/empty_components_in_uri_path.test b/test/functionalTest/cases/1426_empty_components_in_uri_path/empty_components_in_uri_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1426_empty_components_in_uri_path/empty_components_in_uri_path.test rename to test/functionalTest/cases/1426_empty_components_in_uri_path/empty_components_in_uri_path.test.DISABLED diff --git a/test/functionalTest/cases/1440_cpr_update_compounds/cpr_update_compounds.test b/test/functionalTest/cases/1440_cpr_update_compounds/cpr_update_compounds.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1440_cpr_update_compounds/cpr_update_compounds.test rename to test/functionalTest/cases/1440_cpr_update_compounds/cpr_update_compounds.test.DISABLED diff --git a/test/functionalTest/cases/1449_notification_mode_cases/onchange_persisent.test b/test/functionalTest/cases/1449_notification_mode_cases/onchange_persisent.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1449_notification_mode_cases/onchange_persisent.test rename to test/functionalTest/cases/1449_notification_mode_cases/onchange_persisent.test.DISABLED diff --git a/test/functionalTest/cases/1449_notification_mode_cases/onchange_simulated.test b/test/functionalTest/cases/1449_notification_mode_cases/onchange_simulated.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1449_notification_mode_cases/onchange_simulated.test rename to test/functionalTest/cases/1449_notification_mode_cases/onchange_simulated.test.DISABLED diff --git a/test/functionalTest/cases/1449_notification_mode_cases/onchange_threadpool.test b/test/functionalTest/cases/1449_notification_mode_cases/onchange_threadpool.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1449_notification_mode_cases/onchange_threadpool.test rename to test/functionalTest/cases/1449_notification_mode_cases/onchange_threadpool.test.DISABLED diff --git a/test/functionalTest/cases/1471_ngsiv1_render_not_string_in_compounds/ngsiv1_render_not_string_in_compounds.test b/test/functionalTest/cases/1471_ngsiv1_render_not_string_in_compounds/ngsiv1_render_not_string_in_compounds.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1471_ngsiv1_render_not_string_in_compounds/ngsiv1_render_not_string_in_compounds.test rename to test/functionalTest/cases/1471_ngsiv1_render_not_string_in_compounds/ngsiv1_render_not_string_in_compounds.test.DISABLED diff --git a/test/functionalTest/cases/1488_unsubscribe_sem_bug/unsubscribe_sem_bug.test b/test/functionalTest/cases/1488_unsubscribe_sem_bug/unsubscribe_sem_bug.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1488_unsubscribe_sem_bug/unsubscribe_sem_bug.test rename to test/functionalTest/cases/1488_unsubscribe_sem_bug/unsubscribe_sem_bug.test.DISABLED diff --git a/test/functionalTest/cases/1577_servicepath_get_subs/get_subs_with_servicepath.test b/test/functionalTest/cases/1577_servicepath_get_subs/get_subs_with_servicepath.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1577_servicepath_get_subs/get_subs_with_servicepath.test rename to test/functionalTest/cases/1577_servicepath_get_subs/get_subs_with_servicepath.test.DISABLED diff --git a/test/functionalTest/cases/1582_alarmManager/alarm_manager_bad_input_v1.test b/test/functionalTest/cases/1582_alarmManager/alarm_manager_bad_input_v1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1582_alarmManager/alarm_manager_bad_input_v1.test rename to test/functionalTest/cases/1582_alarmManager/alarm_manager_bad_input_v1.test.DISABLED diff --git a/test/functionalTest/cases/1642_empty_string_in_nested_object/empty_string_in_nested_object.test b/test/functionalTest/cases/1642_empty_string_in_nested_object/empty_string_in_nested_object.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1642_empty_string_in_nested_object/empty_string_in_nested_object.test rename to test/functionalTest/cases/1642_empty_string_in_nested_object/empty_string_in_nested_object.test.DISABLED diff --git a/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_api_v1.test b/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_api_v1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_api_v1.test rename to test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_api_v1.test.DISABLED diff --git a/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms_api_v1.test b/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms_api_v1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms_api_v1.test rename to test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms_api_v1.test.DISABLED diff --git a/test/functionalTest/cases/1675_entity_with_plus_symbol/entity_with_plus_symbol.test b/test/functionalTest/cases/1675_entity_with_plus_symbol/entity_with_plus_symbol.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1675_entity_with_plus_symbol/entity_with_plus_symbol.test rename to test/functionalTest/cases/1675_entity_with_plus_symbol/entity_with_plus_symbol.test.DISABLED diff --git a/test/functionalTest/cases/1693_preserve_sp_updating_subscription/preserve_sp_updating_subscription_ngsiv1.test b/test/functionalTest/cases/1693_preserve_sp_updating_subscription/preserve_sp_updating_subscription_ngsiv1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1693_preserve_sp_updating_subscription/preserve_sp_updating_subscription_ngsiv1.test rename to test/functionalTest/cases/1693_preserve_sp_updating_subscription/preserve_sp_updating_subscription_ngsiv1.test.DISABLED diff --git a/test/functionalTest/cases/1697_more_than_one_bad_input/more_than_one_bad_input.test b/test/functionalTest/cases/1697_more_than_one_bad_input/more_than_one_bad_input.test index dc105394f8..2f95550b78 100644 --- a/test/functionalTest/cases/1697_more_than_one_bad_input/more_than_one_bad_input.test +++ b/test/functionalTest/cases/1697_more_than_one_bad_input/more_than_one_bad_input.test @@ -71,6 +71,14 @@ echo echo "04. grep BadInput in log-file (4 lines found)" echo "=============================================" +# FIXME: in Debian 11 IP is 0.0.0.0 while in Debian 12 is 127.0.0.1. This could be due to changes in how +# curl (used internally by orionCurl) works, from 7.74 (Debian 11) to 7.88 (Debian 12) (it wouldn't be +# the only change, see https://stackoverflow.com/q/77045755/1485926 ;). I have tried to fix +# using explictely 'curl --interface 0.0.0.0' in orionCurl function, but it doesn't work. Thus, the +# alternative is to use a REGEX() so both IP options get covered. This can be seen as a temporal fix, so +# when we decide to remove compatibility with Debian 11 we can remove the REGEX() and leave only one way +# (it seems we have already used this trick is other .test files, look for '0.0.0.0|127.0.0.1' text pattern, +# maybe all them could be removed at the same time) grep BadInput /tmp/contextBroker.log | awk -F'|' '{ print $10 }' | awk -F= '{ print $2 }' echo echo @@ -138,10 +146,10 @@ Bad input active alarms: 1, raised: _total: 1, new: 1_, released: _total: 0, new 04. grep BadInput in log-file (4 lines found) ============================================= -Raising alarm BadInput 0.0.0.0: service '/v2/noService' not found -Repeated BadInput 0.0.0.0: JSON Parse Error (Invalid value) -Repeated BadInput 0.0.0.0: bad verb for url '/v2/entities', method 'GETT' -Repeated BadInput 0.0.0.0: {"error":"ContentLengthRequired","description":"Zero/No Content-Length in PUT/POST/PATCH request"} +Raising alarm BadInput REGEX((0.0.0.0|127.0.0.1)): service '/v2/noService' not found +Repeated BadInput REGEX((0.0.0.0|127.0.0.1): JSON Parse Error \(Invalid value\)) +Repeated BadInput REGEX((0.0.0.0|127.0.0.1)): bad verb for url '/v2/entities', method 'GETT' +Repeated BadInput REGEX((0.0.0.0|127.0.0.1)): {"error":"ContentLengthRequired","description":"Zero/No Content-Length in PUT/POST/PATCH request"} --TEARDOWN-- diff --git a/test/functionalTest/cases/1705_csub_cache_objects/csub_cache_objects_errors.test b/test/functionalTest/cases/1705_csub_cache_objects/csub_cache_objects_errors.test index 3db0e3161f..08804a2c3c 100644 --- a/test/functionalTest/cases/1705_csub_cache_objects/csub_cache_objects_errors.test +++ b/test/functionalTest/cases/1705_csub_cache_objects/csub_cache_objects_errors.test @@ -119,20 +119,23 @@ echo echo -echo "09. GET /v2/entities with only whitespace in q-item (q= )" -echo "===========================================================" -q='q= ' -orionCurl --url "/v2/entities?$q" -echo -echo - - -echo "10. GET /v2/entities with trailing whitespace in q (q=a==12; )" -echo "================================================================" -q='q=a==12; ' -orionCurl --url "/v2/entities?$q" -echo -echo +# FIXME: curl has changed its behaviour from Debian 11 to Debian 12 (see https://stackoverflow.com/q/77045755/1485926) +# and now it is not a valid tool to test malformed URLs. Thus, we are commenting this fields while we look for +# another tool or avoid curl to work in the old way +#echo "09. GET /v2/entities with only whitespace in q-item (q= )" +#echo "===========================================================" +#q='q= ' +#orionCurl --url "/v2/entities?$q" +#echo +#echo +# +# +#echo "10. GET /v2/entities with trailing whitespace in q (q=a==12; )" +#echo "================================================================" +#q='q=a==12; ' +#orionCurl --url "/v2/entities?$q" +#echo +#echo echo "11. GET /v2/entities with > RANGE" @@ -333,34 +336,34 @@ Content-Length: 79 } -09. GET /v2/entities with only whitespace in q-item (q= ) -=========================================================== -HTTP/1.1 400 Bad Request -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 77 - -{ - "description": "empty q-item (only whitespace)", - "error": "BadRequest" -} - - -10. GET /v2/entities with trailing whitespace in q (q=a==12; ) -================================================================ -HTTP/1.1 400 Bad Request -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 51 - -{ - "description": "empty q-item", - "error": "BadRequest" -} - - +##09. GET /v2/entities with only whitespace in q-item (q= ) +##=========================================================== +##HTTP/1.1 400 Bad Request +##Date: REGEX(.*) +##Fiware-Correlator: REGEX([0-9a-f\-]{36}) +##Content-Type: application/json +##Content-Length: 77 +## +##{ +## "description": "empty q-item (only whitespace)", +## "error": "BadRequest" +##} +## +## +##10. GET /v2/entities with trailing whitespace in q (q=a==12; ) +##================================================================ +##HTTP/1.1 400 Bad Request +##Date: REGEX(.*) +##Fiware-Correlator: REGEX([0-9a-f\-]{36}) +##Content-Type: application/json +##Content-Length: 51 +## +##{ +## "description": "empty q-item", +## "error": "BadRequest" +##} +## +## 11. GET /v2/entities with > RANGE ================================= HTTP/1.1 400 Bad Request diff --git a/test/functionalTest/cases/1830_default_type_none/ngsiv1_no_type_render_as_none.test b/test/functionalTest/cases/1830_default_type_none/ngsiv1_no_type_render_as_none.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1830_default_type_none/ngsiv1_no_type_render_as_none.test rename to test/functionalTest/cases/1830_default_type_none/ngsiv1_no_type_render_as_none.test.DISABLED diff --git a/test/functionalTest/cases/1852_escaped_slashes_in_json_v1_payload/escaped_slashes_in_json_v1_payload.test b/test/functionalTest/cases/1852_escaped_slashes_in_json_v1_payload/escaped_slashes_in_json_v1_payload.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1852_escaped_slashes_in_json_v1_payload/escaped_slashes_in_json_v1_payload.test rename to test/functionalTest/cases/1852_escaped_slashes_in_json_v1_payload/escaped_slashes_in_json_v1_payload.test.DISABLED diff --git a/test/functionalTest/cases/1875_NGSIv2_notification_formats/NGSIv2_notification_formats.test b/test/functionalTest/cases/1875_NGSIv2_notification_formats/NGSIv2_notification_formats.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1875_NGSIv2_notification_formats/NGSIv2_notification_formats.test rename to test/functionalTest/cases/1875_NGSIv2_notification_formats/NGSIv2_notification_formats.test.DISABLED diff --git a/test/functionalTest/cases/1916_fiware_correlator/fiware_correlator_forward_and_notifications.test b/test/functionalTest/cases/1916_fiware_correlator/fiware_correlator_forward_and_notifications.test.DISABLED similarity index 100% rename from test/functionalTest/cases/1916_fiware_correlator/fiware_correlator_forward_and_notifications.test rename to test/functionalTest/cases/1916_fiware_correlator/fiware_correlator_forward_and_notifications.test.DISABLED diff --git a/test/functionalTest/cases/2057_uri_path_case_sensitive_for_v2/uri_path_case_sensitive_for_v2.test b/test/functionalTest/cases/2057_uri_path_case_sensitive_for_v2/uri_path_case_sensitive_for_v2.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2057_uri_path_case_sensitive_for_v2/uri_path_case_sensitive_for_v2.test rename to test/functionalTest/cases/2057_uri_path_case_sensitive_for_v2/uri_path_case_sensitive_for_v2.test.DISABLED diff --git a/test/functionalTest/cases/2058_wrong_number_rendering/ilegal_json_attributeformat_object_with_number.test b/test/functionalTest/cases/2058_wrong_number_rendering/ilegal_json_attributeformat_object_with_number.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2058_wrong_number_rendering/ilegal_json_attributeformat_object_with_number.test rename to test/functionalTest/cases/2058_wrong_number_rendering/ilegal_json_attributeformat_object_with_number.test.DISABLED diff --git a/test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_all_attrs.test b/test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_all_attrs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_all_attrs.test rename to test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_all_attrs.test.DISABLED diff --git a/test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_specific_attr.test b/test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_specific_attr.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_specific_attr.test rename to test/functionalTest/cases/2193_entity_not_found_when_forwarding/entity_not_found_when_forwarding_specific_attr.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME_value.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME_value.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME_value.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_GET_v2_entities_EID_attrs_ATTRNAME_value.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PATCH_v2_entities_EID_attrs.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PATCH_v2_entities_EID_attrs.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PATCH_v2_entities_EID_attrs.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PATCH_v2_entities_EID_attrs.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_POST_v2_op_update.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_POST_v2_op_update.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_POST_v2_op_update.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_POST_v2_op_update.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PUT_v2_entities_EID_attrs_ATTRNAME.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PUT_v2_entities_EID_attrs_ATTRNAME.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PUT_v2_entities_EID_attrs_ATTRNAME.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/forward_using_PUT_v2_entities_EID_attrs_ATTRNAME.test.DISABLED diff --git a/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/v1_reply_to_v2_response_on_error_with_cpr.test b/test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/v1_reply_to_v2_response_on_error_with_cpr.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/v1_reply_to_v2_response_on_error_with_cpr.test rename to test/functionalTest/cases/2193_v1_reply_to_v2_response_on_error_with_cpr/v1_reply_to_v2_response_on_error_with_cpr.test.DISABLED diff --git a/test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages.test b/test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages.test rename to test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages.test.DISABLED diff --git a/test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages_exactly_as_issue.test b/test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages_exactly_as_issue.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages_exactly_as_issue.test rename to test/functionalTest/cases/2237_compound_values_in_forwarded_messages/compound_values_in_forwarded_messages_exactly_as_issue.test.DISABLED diff --git a/test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/attribute_type_converted_to_string_on_forward.test b/test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/attribute_type_converted_to_string_on_forward.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/attribute_type_converted_to_string_on_forward.test rename to test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/attribute_type_converted_to_string_on_forward.test.DISABLED diff --git a/test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/forwarding_updates_overwrite_the_types_of_attributes.test b/test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/forwarding_updates_overwrite_the_types_of_attributes.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/forwarding_updates_overwrite_the_types_of_attributes.test rename to test/functionalTest/cases/2248_forwarding_updates_overwrite_the_types_of_attributes/forwarding_updates_overwrite_the_types_of_attributes.test.DISABLED diff --git a/test/functionalTest/cases/2332_patterns_in_registrations/patterns_in_registrations.test b/test/functionalTest/cases/2332_patterns_in_registrations/patterns_in_registrations.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2332_patterns_in_registrations/patterns_in_registrations.test rename to test/functionalTest/cases/2332_patterns_in_registrations/patterns_in_registrations.test.DISABLED diff --git a/test/functionalTest/cases/2339_json_native_types_in_v1/json_native_types_in_v1.test b/test/functionalTest/cases/2339_json_native_types_in_v1/json_native_types_in_v1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2339_json_native_types_in_v1/json_native_types_in_v1.test rename to test/functionalTest/cases/2339_json_native_types_in_v1/json_native_types_in_v1.test.DISABLED diff --git a/test/functionalTest/cases/2352_get_log_level/get_log_level.test b/test/functionalTest/cases/2352_get_log_level/get_log_level.test index 963f4e8611..feb8ad0439 100644 --- a/test/functionalTest/cases/2352_get_log_level/get_log_level.test +++ b/test/functionalTest/cases/2352_get_log_level/get_log_level.test @@ -79,9 +79,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 87 +Content-Length: 117 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "DEBUG", "lineMaxSize": 32768 @@ -103,9 +104,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 86 +Content-Length: 116 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "INFO", "lineMaxSize": 32768 @@ -127,9 +129,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 87 +Content-Length: 117 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "ERROR", "lineMaxSize": 32768 diff --git a/test/functionalTest/cases/2360_cpr_invalid_response/cpr_invalid_response.test b/test/functionalTest/cases/2360_cpr_invalid_response/cpr_invalid_response.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2360_cpr_invalid_response/cpr_invalid_response.test rename to test/functionalTest/cases/2360_cpr_invalid_response/cpr_invalid_response.test.DISABLED diff --git a/test/functionalTest/cases/2419_log_level/log_level.test b/test/functionalTest/cases/2419_log_level/log_level.test index 93c367c1da..314011dd45 100644 --- a/test/functionalTest/cases/2419_log_level/log_level.test +++ b/test/functionalTest/cases/2419_log_level/log_level.test @@ -162,9 +162,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 86 +Content-Length: 116 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "NONE", "lineMaxSize": 32768 @@ -186,9 +187,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 87 +Content-Length: 117 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "FATAL", "lineMaxSize": 32768 @@ -210,9 +212,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 87 +Content-Length: 117 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "ERROR", "lineMaxSize": 32768 @@ -234,9 +237,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 86 +Content-Length: 116 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "WARN", "lineMaxSize": 32768 @@ -258,9 +262,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 86 +Content-Length: 116 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "INFO", "lineMaxSize": 32768 @@ -282,9 +287,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 87 +Content-Length: 117 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "DEBUG", "lineMaxSize": 32768 @@ -310,9 +316,10 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 87 +Content-Length: 117 { + "deprecate": false, "infoPayloadMaxSize": 5120, "level": "DEBUG", "lineMaxSize": 32768 diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test index 2e4c940398..0c24073d89 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_basic_crud.test @@ -261,7 +261,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 343 +Content-Length: 358 { "id": "REGEX([0-9a-f]{24})", @@ -275,6 +275,7 @@ Content-Length: 343 "x2": 2 }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -310,7 +311,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -321,6 +322,7 @@ Content-Length: 336 "mqttCustom": { "payload": "foo", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -356,7 +358,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 339 +Content-Length: 354 { "id": "REGEX([0-9a-f]{24})", @@ -370,6 +372,7 @@ Content-Length: 339 "zz" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -405,7 +408,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 335 +Content-Length: 350 { "id": "REGEX([0-9a-f]{24})", @@ -420,6 +423,7 @@ Content-Length: 335 3 ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -455,7 +459,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -466,6 +470,7 @@ Content-Length: 336 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -503,7 +508,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 336 +Content-Length: 351 { "id": "REGEX([0-9a-f]{24})", @@ -514,6 +519,7 @@ Content-Length: 336 "mqttCustom": { "payload": "zzz", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -549,7 +555,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 352 +Content-Length: 367 { "id": "REGEX([0-9a-f]{24})", @@ -566,6 +572,7 @@ Content-Length: 352 ] }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -593,7 +600,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 691 +Content-Length: 721 [ { @@ -605,6 +612,7 @@ Content-Length: 691 "mqttCustom": { "payload": "bar", "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -639,6 +647,7 @@ Content-Length: 691 ] }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test index 7681c75fe2..d8fe2d436c 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_constants.test @@ -186,7 +186,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 916 +Content-Length: 946 [ { @@ -227,6 +227,7 @@ Content-Length: 916 "text": "foo" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -284,6 +285,7 @@ Content-Length: 916 } ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test index 9a56668ca2..954ed3bdba 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 838 +Content-Length: 868 [ { @@ -212,6 +212,7 @@ Content-Length: 838 "text": "${text}" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -247,6 +248,7 @@ Content-Length: 838 "${object}" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test index fb76352125..3a6f4a15c5 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside.test @@ -192,7 +192,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 851 +Content-Length: 881 [ { @@ -211,6 +211,7 @@ Content-Length: 851 "F": "ns:${object}" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -246,6 +247,7 @@ Content-Length: 851 "ns:${object}" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test index b6efd0d7cd..940492dc04 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_inside_multi.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 957 +Content-Length: 987 [ { @@ -212,6 +212,7 @@ Content-Length: 957 "F": "ns:${object}:${text}" }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -247,6 +248,7 @@ Content-Length: 957 "ns:${object}:${text}" ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test index ec23694b71..020245e27b 100644 --- a/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test +++ b/test/functionalTest/cases/2560_custom_notification_json/custom_notification_mqtt_json_replacements_intermediate.test @@ -163,7 +163,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 751 +Content-Length: 781 [ { @@ -184,6 +184,7 @@ Content-Length: 751 ] }, "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, @@ -225,6 +226,7 @@ Content-Length: 751 ] ], "qos": 0, + "retain": false, "topic": "topic1", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/2750_common_metrics/2750_forwards.test b/test/functionalTest/cases/2750_common_metrics/2750_forwards.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2750_common_metrics/2750_forwards.test rename to test/functionalTest/cases/2750_common_metrics/2750_forwards.test.DISABLED diff --git a/test/functionalTest/cases/2772_empty_component_in_service_path/empty_component_in_service_path.test b/test/functionalTest/cases/2772_empty_component_in_service_path/empty_component_in_service_path.test.DISABLED similarity index 100% rename from test/functionalTest/cases/2772_empty_component_in_service_path/empty_component_in_service_path.test rename to test/functionalTest/cases/2772_empty_component_in_service_path/empty_component_in_service_path.test.DISABLED diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test new file mode 100644 index 0000000000..ca01185745 --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/get_entities_with_servicepath_as_a_wildcard_and_multiple_elements.test @@ -0,0 +1,369 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +get entities with servicepath as a wildcard and multiple elements + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# +# 01. Create entity E1 in servicePath /Madrid/A +# 02. Create entity E2 in servicePath /Madrid/B +# 03. Create entity E3 in servicePath /Barcelona/C +# 04. Create entity E4 in servicePath /Barcelona/D +# 05. GET entities with servicePath /# +# 06. GET entities with servicePath /Madrid/# +# 07. GET entities with servicePath /Madrid/A,/Barcelona/C +# 08. GET entities with servicePath /Madrid/A,/Barcelona/# +# 09. GET entities with servicePath /Madrid/#,/Barcelona/# +# + + +echo "01. Create entity E1" +echo "====================" +payload='{ + "id": "E1", + "type": "T", + "A": { + "value":11.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "02. Create entity E2" +echo "====================" +payload='{ + "id": "E2", + "type": "T", + "B": { + "value": 12.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/B +echo +echo + + +echo "03. Create entity E3" +echo "====================" +payload='{ + "id": "E3", + "type": "T", + "C": { + "value": 13.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelona/C +echo +echo + + +echo "04. Create entity E4" +echo "====================" +payload='{ + "id": "E4", + "type": "T", + "D": { + "value": 14.5, + "type": "Float" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelona/D +echo +echo + + +echo "05. GET entities with servicePath /#" +echo "====================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /# +echo +echo + + +echo "06. GET entities with servicePath /Madrid/A" +echo "===========================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/A +echo +echo + + +echo "07. GET entities with servicePath /Madrid/A,/Barcelona/C" +echo "========================================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/A,/Barcelona/C +echo +echo + + +echo "08. GET entities with servicePath /Madrid/A,/Barcelona/#" +echo "========================================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/A,/Barcelona/# +echo +echo + + +echo "09. GET entities with servicePath /Madrid/#,/Barcelona/#" +echo "========================================================" +orionCurl --url /v2/entities?attrs=servicePath --servicePath /Madrid/#,/Barcelona/# +echo +echo + + +--REGEXPECT-- +01. Create entity E1 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=T +Content-Length: 0 + + + +02. Create entity E2 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=T +Content-Length: 0 + + + +03. Create entity E3 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E3?type=T +Content-Length: 0 + + + +04. Create entity E4 +==================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E4?type=T +Content-Length: 0 + + + +05. GET entities with servicePath /# +==================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 355 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E2", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/B" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + }, + { + "id": "E4", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/D" + }, + "type": "T" + } +] + + +06. GET entities with servicePath /Madrid/A +=========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 88 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + } +] + + +07. GET entities with servicePath /Madrid/A,/Barcelona/C +======================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 178 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + } +] + + +08. GET entities with servicePath /Madrid/A,/Barcelona/# +======================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 268 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + }, + { + "id": "E4", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/D" + }, + "type": "T" + } +] + + +09. GET entities with servicePath /Madrid/#,/Barcelona/# +======================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 355 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "T" + }, + { + "id": "E2", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/B" + }, + "type": "T" + }, + { + "id": "E3", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/C" + }, + "type": "T" + }, + { + "id": "E4", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Barcelona/D" + }, + "type": "T" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test new file mode 100644 index 0000000000..6996c26a54 --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_as_a_builtin_attribute_return_in_notifications.test @@ -0,0 +1,184 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +return servicePath as a builtin attribute in notifications + +--SHELL-INIT-- +dbInit CB +brokerStart CB +accumulatorStart --pretty-print + +--SHELL-- + +# +# 01. POST /v2/entities, to create entity E1 +# 02. POST /v2/subscriptions, to create a subscription for E1 with notification.attrs as [ "*", "servicePath"] +# 03. Update entity E1 +# 04. Dump accumulator and see two notifications +# + + +echo "01. POST /v2/entities, to create entity E1" +echo "==========================================" +payload='{ + "id": "E1", + "type": "Thing", + "A1": { + "value": 26.5, + "type": "Float" + }, + "B1": { + "value": 720, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "02. POST /v2/subscriptions, to create a subscription for E1 with notification.attrs as [ "*", "servicePath"]" +echo "============================================================================================================" +payload='{ + "description": "A subscription to get info about E1", + "subject": { + "entities": [ + { + "id": "E1", + "type": "Thing" + } + ], + "condition": { + "attrs": [ + "A1" + ] + } + }, + "notification": { + "http": { + "url": "http://localhost:'$LISTENER_PORT'/notify" + }, + "attrs": [ + "*", + "servicePath" + ] + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +subId=$(echo "$_responseHeaders" | grep Location | awk -F/ '{ print $4 }' | tr -d "\r\n") +echo +echo + + +echo "03. Update entity E1" +echo "====================" +payload='{ + "A1": { + "value": 31.7, + "type": "Float" + } +}' +orionCurl --url /v2/entities/E1/attrs --payload "$payload" -X PATCH --servicePath /Madrid/A +echo +echo + + +echo "04. Dump accumulator and see two notifications" +echo "==============================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. POST /v2/entities, to create entity E1 +========================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=Thing +Content-Length: 0 + + + +02. POST /v2/subscriptions, to create a subscription for E1 with notification.attrs as [ *, servicePath] +============================================================================================================ +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +03. Update entity E1 +==================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +04. Dump accumulator and see two notifications +============================================== +POST http://localhost:REGEX(\d+)/notify +Fiware-Servicepath: /Madrid/A +Content-Length: 244 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: localhost:9997 +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A1": { + "metadata": {}, + "type": "Float", + "value": 31.7 + }, + "B1": { + "metadata": {}, + "type": "Integer", + "value": 720 + }, + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/Madrid/A" + }, + "type": "Thing" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test new file mode 100644 index 0000000000..dd55accdfa --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_behave_with_q_and_orderBy.test @@ -0,0 +1,293 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +servicepath behave with q and orderBy + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# +# 01. Create entity E1 with temperature = 35 in servicePath /Madrid/A +# 02. Create entity E2 with temperature = 25 in servicePath /Barcelona/B +# 03. Create entity E3 with temperature = 30 in servicePath /Madrid/A +# 04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B +# 05. GET entities with q parameter and servicePath /Madrid/A +# 06. GET entities with orderBy servicePath +# 07. GET entities with orderBy !servicePath +# + + +echo "01. Create entity E1 with temperature = 35 in servicePath /Madrid/A" +echo "===================================================================" +payload='{ + "id": "E1", + "type": "T", + "temperature": { + "value":35, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "02. Create entity E2 with temperature = 25 in servicePath /Barcelona/B" +echo "======================================================================" +payload='{ + "id": "E2", + "type": "T", + "temperature": { + "value": 25, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelon/B +echo +echo + + +echo "03. Create entity E3 with temperature = 30 in servicePath /Madrid/A" +echo "===================================================================" +payload='{ + "id": "E3", + "type": "T", + "temperature": { + "value": 30, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Madrid/A +echo +echo + + +echo "04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B" +echo "======================================================================" +payload='{ + "id": "E4", + "type": "T", + "temperature": { + "value": 40, + "type": "Integer" + } +}' +orionCurl --url /v2/entities --payload "$payload" --servicePath /Barcelona/B +echo +echo + + +echo "05. GET entities with q parameter and servicePath /Madrid/A" +echo "===========================================================" +orionCurl --url /v2/entities?q=servicePath:/Madrid/A +echo +echo + + +echo "06. GET entities with orderBy servicePath" +echo "=========================================" +orionCurl --url /v2/entities?orderBy=servicePath +echo +echo + + +echo "07. GET entities with orderBy !servicePath" +echo "==========================================" +orionCurl --url /v2/entities?orderBy=!servicePath +echo +echo + + +--REGEXPECT-- +01. Create entity E1 with temperature = 35 in servicePath /Madrid/A +=================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=T +Content-Length: 0 + + + +02. Create entity E2 with temperature = 25 in servicePath /Barcelona/B +====================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=T +Content-Length: 0 + + + +03. Create entity E3 with temperature = 30 in servicePath /Madrid/A +=================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E3?type=T +Content-Length: 0 + + + +04. Create entity E4 with temperature = 40 in servicePath /Barcelona/B +====================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E4?type=T +Content-Length: 0 + + + +05. GET entities with q parameter and servicePath /Madrid/A +=========================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 163 + +[ + { + "id": "E1", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 35 + }, + "type": "T" + }, + { + "id": "E3", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 30 + }, + "type": "T" + } +] + + +06. GET entities with orderBy servicePath +========================================= +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 325 + +[ + { + "id": "E2", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 25 + }, + "type": "T" + }, + { + "id": "E4", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 40 + }, + "type": "T" + }, + { + "id": "E1", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 35 + }, + "type": "T" + }, + { + "id": "E3", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 30 + }, + "type": "T" + } +] + + +07. GET entities with orderBy !servicePath +========================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 325 + +[ + { + "id": "E1", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 35 + }, + "type": "T" + }, + { + "id": "E3", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 30 + }, + "type": "T" + }, + { + "id": "E4", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 40 + }, + "type": "T" + }, + { + "id": "E2", + "temperature": { + "metadata": {}, + "type": "Integer", + "value": 25 + }, + "type": "T" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test new file mode 100644 index 0000000000..1ac4a3247c --- /dev/null +++ b/test/functionalTest/cases/2877_return_ServicePath_in_entity_response/servicePath_in_entity_response.test @@ -0,0 +1,141 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +return ServicePath in entity response + +--SHELL-INIT-- +dbInit CB +brokerStart CB + +--SHELL-- + +# +# 01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1 +# 02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2 +# 03. GET all entities, with service path +# + + +echo "01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1" +echo "=======================================================================" +payload='{ + "id": "E1", + "type": "Thing", + "A1": { + "value": 26.5, + "type": "Float", + "metadata": { + "M1": { + "value": 0.77, + "type": "Float" + } + } + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2" +echo "=======================================================================" +payload='{ + "id": "E2", + "type": "Thing", + "A2": { + "value": 21.5, + "type": "Float", + "metadata": { + "M2": { + "value": 11.5, + "type": "Float" + } + } + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. GET all entities, with service path" +echo "====================================================" +orionCurl --url /v2/entities?attrs=servicePath +echo +echo + + +--REGEXPECT-- +01. POST /v2/entities, to create entity E1 with attr A1 and metadata M1 +======================================================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E1?type=Thing +Content-Length: 0 + + + +02. POST /v2/entities, to create entity E2 with attr A2 and metadata M2 +======================================================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E2?type=Thing +Content-Length: 0 + + + +03. GET all entities, with service path +==================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 167 + +[ + { + "id": "E1", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/" + }, + "type": "Thing" + }, + { + "id": "E2", + "servicePath": { + "metadata": {}, + "type": "Text", + "value": "/" + }, + "type": "Thing" + } +] + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test index 0055a407b8..d482101617 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_basic_crud.test @@ -282,7 +282,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 2338 +Content-Length: 2428 [ { @@ -297,6 +297,7 @@ Content-Length: 2338 "mqttCustom": { "payload": "temperature:${temperature}", "qos": 0, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -328,6 +329,7 @@ Content-Length: 2338 "mqttCustom": { "payload": "temperature:${temperature}", "qos": 2, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -358,6 +360,7 @@ Content-Length: 2338 "covered": false, "mqttCustom": { "qos": 0, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -388,6 +391,7 @@ Content-Length: 2338 "covered": false, "mqttCustom": { "qos": 2, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -419,6 +423,7 @@ Content-Length: 2338 "mqttCustom": { "payload": null, "qos": 0, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, @@ -450,6 +455,7 @@ Content-Length: 2338 "mqttCustom": { "payload": null, "qos": 2, + "retain": false, "topic": "/orion/${dest}", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test index cbabe14000..531e251861 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_custom_subscription_update.test @@ -204,7 +204,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 374 +Content-Length: 389 { "description": "Original sub", @@ -216,6 +216,7 @@ Content-Length: 374 "mqttCustom": { "payload": "t:${t}", "qos": 2, + "retain": false, "topic": "/orion/${d}", "url": "mqtt://localhost:1883" }, @@ -251,7 +252,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 374 +Content-Length: 389 { "description": "Modified sub", @@ -263,6 +264,7 @@ Content-Length: 374 "mqttCustom": { "payload": "t:${t}", "qos": 2, + "retain": false, "topic": "/orion/${d}", "url": "mqtt://localhost:1883" }, @@ -298,7 +300,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 367 +Content-Length: 382 { "description": "Modified sub", @@ -310,6 +312,7 @@ Content-Length: 367 "mqttCustom": { "payload": null, "qos": 0, + "retain": false, "topic": "/cb/${d}", "url": "mqtt://localhost:1884" }, @@ -389,7 +392,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 357 +Content-Length: 372 { "description": "Modified sub", @@ -400,6 +403,7 @@ Content-Length: 357 "covered": false, "mqttCustom": { "qos": 1, + "retain": false, "topic": "/orionbk/${d}", "url": "mqtt://localhost:1885" }, @@ -435,7 +439,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 344 +Content-Length: 359 { "description": "Modified sub", @@ -446,6 +450,7 @@ Content-Length: 344 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1887" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_notification.test b/test/functionalTest/cases/3001_mqtt/mqtt_notification.test index 5a938eb3c5..8e60fee1e6 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_notification.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_notification.test @@ -301,7 +301,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 1349 +Content-Length: 1379 [ { @@ -315,6 +315,7 @@ Content-Length: 1349 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://localhost:1883" }, @@ -346,6 +347,7 @@ Content-Length: 1349 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "sub2", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test b/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test index fdc5e520dc..ecc29badba 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_notification_custom.test @@ -245,7 +245,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 494 +Content-Length: 509 [ { @@ -260,6 +260,7 @@ Content-Length: 494 "mqttCustom": { "payload": "{ %22A%22: %22${A}%22 }", "qos": 0, + "retain": false, "topic": "sub/${id}", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test b/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test index ae4e6b0330..a0adbcf1f6 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_notification_qos.test @@ -270,7 +270,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 1357 +Content-Length: 1402 [ { @@ -284,6 +284,7 @@ Content-Length: 1357 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "sub0", "url": "mqtt://localhost:1883" }, @@ -315,6 +316,7 @@ Content-Length: 1357 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 1, + "retain": false, "topic": "sub1", "url": "mqtt://localhost:1883" }, @@ -346,6 +348,7 @@ Content-Length: 1357 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 2, + "retain": false, "topic": "sub2", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test index a697234c43..b1f8282f9f 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_basic_crud.test @@ -124,7 +124,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 728 +Content-Length: 758 [ { @@ -138,6 +138,7 @@ Content-Length: 728 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "/orion/notif", "url": "mqtt://localhost:1883" }, @@ -168,6 +169,7 @@ Content-Length: 728 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion/notif", "url": "mqtt://localhost:1883" }, diff --git a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test index dfe1dd1fd5..7ee82a77f2 100644 --- a/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test +++ b/test/functionalTest/cases/3001_mqtt/mqtt_subscription_update.test @@ -177,7 +177,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 344 +Content-Length: 359 { "description": "Original sub", @@ -188,6 +188,7 @@ Content-Length: 344 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883" }, @@ -223,7 +224,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 344 +Content-Length: 359 { "description": "Modified sub", @@ -234,6 +235,7 @@ Content-Length: 344 "covered": false, "mqtt": { "qos": 2, + "retain": false, "topic": "/orion", "url": "mqtt://localhost:1883" }, @@ -269,7 +271,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 341 +Content-Length: 356 { "description": "Modified sub", @@ -280,6 +282,7 @@ Content-Length: 341 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "/cb", "url": "mqtt://localhost:1884" }, @@ -359,7 +362,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 346 +Content-Length: 361 { "description": "Modified sub", @@ -370,6 +373,7 @@ Content-Length: 346 "covered": false, "mqtt": { "qos": 1, + "retain": false, "topic": "/orionbk", "url": "mqtt://localhost:1885" }, diff --git a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test index 48bf71ec62..0877eb5d53 100644 --- a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test +++ b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_and_release.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -208,6 +208,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -247,7 +248,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -262,6 +263,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -309,7 +311,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 551 +Content-Length: 566 [ { @@ -324,6 +326,7 @@ Content-Length: 551 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "SeY7oD5XPa1UENBiOLPHqWXmj4r4OZHu4tsgWn1AmTkQuMW6lCDCmqMvi1oURVfJ" diff --git a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test index 7dd4c95c83..caf1d9af57 100644 --- a/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test +++ b/test/functionalTest/cases/3001_mqtt_alarms/mqtt_alarms_raise_repeat_and_release.test @@ -193,7 +193,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -208,6 +208,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -247,7 +248,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 467 +Content-Length: 482 [ { @@ -262,6 +263,7 @@ Content-Length: 467 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "user" @@ -309,7 +311,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 551 +Content-Length: 566 [ { @@ -324,6 +326,7 @@ Content-Length: 551 "mqtt": { "passwd": "*****", "qos": 0, + "retain": false, "topic": "sub1", "url": "mqtt://mqtt.flespi.io:1883", "user": "SeY7oD5XPa1UENBiOLPHqWXmj4r4OZHu4tsgWn1AmTkQuMW6lCDCmqMvi1oURVfJ" diff --git a/test/functionalTest/cases/3045_wrong_inclusion_location_metadata_notification/wrong_inclusion_location_metadata_V1.test b/test/functionalTest/cases/3045_wrong_inclusion_location_metadata_notification/wrong_inclusion_location_metadata_V1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3045_wrong_inclusion_location_metadata_notification/wrong_inclusion_location_metadata_V1.test rename to test/functionalTest/cases/3045_wrong_inclusion_location_metadata_notification/wrong_inclusion_location_metadata_V1.test.DISABLED diff --git a/test/functionalTest/cases/3068_cprs_full_functional/fwd_v2_query_with_contextElement_providingApplicationList.test b/test/functionalTest/cases/3068_cprs_full_functional/fwd_v2_query_with_contextElement_providingApplicationList.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3068_cprs_full_functional/fwd_v2_query_with_contextElement_providingApplicationList.test rename to test/functionalTest/cases/3068_cprs_full_functional/fwd_v2_query_with_contextElement_providingApplicationList.test.DISABLED diff --git a/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/check_no_overquerying.test b/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/check_no_overquerying.test index 1925284021..a7bacd20f8 100644 --- a/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/check_no_overquerying.test +++ b/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/check_no_overquerying.test @@ -107,7 +107,7 @@ Content-Length: 2 03. Dump accumulator and check that E/A was forwarded (not including B or C) ============================================================================ -POST http://localhost:REGEX(\d+)/v2/op/query +POST http://localhost:REGEX(\d+)/v2/op/query?limit=20&offset=0&options=count Fiware-Servicepath: / Content-Length: 50 User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) diff --git a/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/forwards_with_accumulator.test b/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/forwards_with_accumulator.test index 909c7754e1..296bf178b9 100644 --- a/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/forwards_with_accumulator.test +++ b/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/forwards_with_accumulator.test @@ -223,7 +223,7 @@ Content-Length: 2 03. Dump the accumulator, see the forwarded query ================================================= -POST http://localhost:REGEX(\d+)/v2/op/query +POST http://localhost:REGEX(\d+)/v2/op/query?limit=20&offset=0&options=count Fiware-Servicepath: / Content-Length: 60 User-Agent: REGEX(.*) @@ -269,7 +269,7 @@ Content-Length: 2 06. Dump the accumulator, see the forwarded query ================================================= -POST http://localhost:REGEX(\d+)/v2/op/query +POST http://localhost:REGEX(\d+)/v2/op/query?limit=20&offset=0&options=count Fiware-Servicepath: / Content-Length: 56 User-Agent: REGEX(.*) @@ -313,7 +313,7 @@ Content-Length: 2 09. Dump the accumulator, see the forwarded query ================================================= -POST http://localhost:REGEX(\d+)/v2/op/query +POST http://localhost:REGEX(\d+)/v2/op/query?limit=20&offset=0&options=count Fiware-Servicepath: / Content-Length: 53 User-Agent: REGEX(.*) @@ -359,7 +359,7 @@ Content-Length: 2 12. Dump the accumulator, see the forwarded query ================================================= -POST http://localhost:9997/v2/op/query +POST http://localhost:9997/v2/op/query?limit=20&offset=0&options=count Fiware-Servicepath: / Content-Length: 49 User-Agent: REGEX(.*) diff --git a/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/legacy_forwarding_true_false_default_with_accumulator.test b/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/legacy_forwarding_true_false_default_with_accumulator.test index 92efafbc08..20e9c8368d 100644 --- a/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/legacy_forwarding_true_false_default_with_accumulator.test +++ b/test/functionalTest/cases/3068_ngsi_v2_based_forwarding/legacy_forwarding_true_false_default_with_accumulator.test @@ -96,7 +96,7 @@ Content-Length: 2 03. Dump and reset the accumulator, see the forwarded query in NGSIv2 format ============================================================================ -POST http://localhost:REGEX(\d+)/v2/op/query +POST http://localhost:REGEX(\d+)/v2/op/query?limit=20&offset=0&options=count Fiware-Servicepath: / Content-Length: 37 User-Agent: REGEX(.*) diff --git a/test/functionalTest/cases/3122_location_metadata_issues/create_and_get_location_metadata_V1_V2_and_geoquery.test b/test/functionalTest/cases/3122_location_metadata_issues/create_and_get_location_metadata_V1_V2_and_geoquery.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3122_location_metadata_issues/create_and_get_location_metadata_V1_V2_and_geoquery.test rename to test/functionalTest/cases/3122_location_metadata_issues/create_and_get_location_metadata_V1_V2_and_geoquery.test.DISABLED diff --git a/test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V1.test b/test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V1.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V1.test rename to test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V1.test.DISABLED diff --git a/test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V1_creation.test b/test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V1_creation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V1_creation.test rename to test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V1_creation.test.DISABLED diff --git a/test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V2_creation.test b/test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V2_creation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V2_creation.test rename to test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_V2_creation.test.DISABLED diff --git a/test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_db_creation.test b/test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_db_creation.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_db_creation.test rename to test/functionalTest/cases/3122_location_metadata_issues/get_location_attr_with_db_creation.test.DISABLED diff --git a/test/functionalTest/cases/3177_updateContext_APPEND_CPr_Registration/updateContext_APPEND_CPr_Reg.test b/test/functionalTest/cases/3177_updateContext_APPEND_CPr_Registration/updateContext_APPEND_CPr_Reg.test.DISABLED similarity index 100% rename from test/functionalTest/cases/3177_updateContext_APPEND_CPr_Registration/updateContext_APPEND_CPr_Reg.test rename to test/functionalTest/cases/3177_updateContext_APPEND_CPr_Registration/updateContext_APPEND_CPr_Reg.test.DISABLED diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/http_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/http_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test new file mode 100644 index 0000000000..0a6f3d38da --- /dev/null +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/http_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test @@ -0,0 +1,386 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +maxFailsLimit still works when update subscription is done just after cache refresh (HTTP case) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 212 IPv4 -subCacheIval 5 + +--SHELL-- + +# +# 01. POST /v2/subscriptions, to create subscription with maxFailsLimit=3 to failing endpoint +# 02. Trigger 4 notifications +# 03. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=4, failsCounter=4, maxFailsLimit=3 +# 04. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +# 05. Trigger 1 notification +# 06. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 +# 07. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 (after cache pass) +# 08. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +# 09. Trigger 2 notifications +# 10. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=6, failsCounter=6, maxFailsLimit=3 +# + + +echo '01. POST /v2/subscriptions, to create subscription with maxFailsLimit=3 to failing endpoint' +echo '===========================================================================================' +payload='{ + "subject": { + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + }, + "notification": { + "http": { + "url": "http://localhost:'$LISTENER_PORT'/notify" + }, + "maxFailsLimit": 3 + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +subId=$(echo "$_responseHeaders" | grep Location | awk -F/ '{ print $4 }' | tr -d "\r\n") +echo +echo + + +echo '02. Trigger 4 notifications' +echo '===========================' +payload='{ + "id": "Room1", + "type": "Room", + "temperature": { + "value": 23, + "type": "Float" + } +}' +# We leave some time between updates to leave some time to connection to fail so CB can process the fail correctly +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +echo +echo + + +echo '03. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=4, failsCounter=4, maxFailsLimit=3' +echo '=====================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +echo '04. PATCH /v2/subscriptions/subscription_id, to re-enable subscription' +echo '======================================================================' +payload='{ + "status": "active" +}' +orionCurl --url /v2/subscriptions/${subId} --payload "$payload" -X PATCH +echo +echo + + +echo '05. Trigger 1 notifications' +echo '===========================' +payload='{ + "id": "Room1", + "type": "Room", + "temperature": { + "value": 23, + "type": "Float" + } +}' +# We leave some time between updates to leave some time to connection to fail so CB can process the fail correctly +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +echo +echo + + +echo '06. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3' +echo '=====================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +# Ensure that one cache sync has passed +sleep 5.5s + + +echo '07. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 (after cache pass)' +echo '========================================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +echo '08. PATCH /v2/subscriptions/subscription_id, to re-enable subscription' +echo '======================================================================' +payload='{ + "status": "active" +}' +orionCurl --url /v2/subscriptions/${subId} --payload "$payload" -X PATCH +echo +echo + + +echo '09. Trigger 2 notifications' +echo '===========================' +payload='{ + "id": "Room1", + "type": "Room", + "temperature": { + "value": 23, + "type": "Float" + } +}' +# We leave some time between updates to leave some time to connection to fail so CB can process the fail correctly +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +echo +echo + + +echo '10. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=6, failsCounter=6, maxFailsLimit=3' +echo '=====================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +--REGEXPECT-- +01. POST /v2/subscriptions, to create subscription with maxFailsLimit=3 to failing endpoint +=========================================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Trigger 4 notifications +=========================== + + +03. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=4, failsCounter=4, maxFailsLimit=3 +===================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 493 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 4, + "http": { + "url": "http://localhost:REGEX(\d+)/notify" + }, + "lastFailure": "REGEX(.*)", + "lastFailureReason": "Couldn't connect to server", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "onlyChangedAttrs": false, + "timesSent": 4 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +04. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +====================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Trigger 1 notifications +=========================== + + +06. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 +===================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 493 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 5, + "http": { + "url": "http://localhost:REGEX(\d+)/notify" + }, + "lastFailure": "REGEX(.*)", + "lastFailureReason": "Couldn't connect to server", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "onlyChangedAttrs": false, + "timesSent": 5 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +07. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 (after cache pass) +======================================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 493 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 5, + "http": { + "url": "http://localhost:REGEX(\d+)/notify" + }, + "lastFailure": "REGEX(.*)", + "lastFailureReason": "Couldn't connect to server", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "onlyChangedAttrs": false, + "timesSent": 5 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +08. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +====================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +09. Trigger 2 notifications +=========================== + + +10. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=6, failsCounter=6, maxFailsLimit=3 +===================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 493 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 6, + "http": { + "url": "http://localhost:REGEX(\d+)/notify" + }, + "lastFailure": "REGEX(.*)", + "lastFailureReason": "Couldn't connect to server", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "onlyChangedAttrs": false, + "timesSent": 6 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test index 7a0aa8de76..28e5775da4 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_keeps_after_cache_refresh_cycles.test @@ -136,7 +136,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -149,6 +149,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -177,7 +178,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -190,6 +191,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -218,7 +220,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -231,6 +233,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test index daf48d9ca5..ee6791cdc8 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_after_cache_refresh_cycles.test @@ -160,7 +160,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -173,6 +173,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -215,7 +216,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -228,6 +229,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -256,7 +258,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -269,6 +271,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test index 4600ff39a3..a2a06ea556 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_failscounter_recovers_and_fails_within_cache_refresh_cycles.test @@ -209,7 +209,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 430 +Content-Length: 445 { "id": "REGEX([0-9a-f]{24})", @@ -222,6 +222,7 @@ Content-Length: 430 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -273,7 +274,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 471 +Content-Length: 486 { "id": "REGEX([0-9a-f]{24})", @@ -287,6 +288,7 @@ Content-Length: 471 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -327,7 +329,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -340,6 +342,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -368,7 +371,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 454 +Content-Length: 469 { "id": "REGEX([0-9a-f]{24})", @@ -381,6 +384,7 @@ Content-Length: 454 "lastSuccess": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test index 919209336e..4beb19c195 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_autodisable_after_cache_refresh_cycles.test @@ -147,7 +147,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 448 +Content-Length: 463 { "id": "REGEX([0-9a-f]{24})", @@ -161,6 +161,7 @@ Content-Length: 448 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -205,7 +206,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -219,6 +220,7 @@ Content-Length: 450 "maxFailsLimit": 3, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test index d3025113ae..5c4d464fed 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_failing_from_the_beginning.test @@ -213,7 +213,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 448 +Content-Length: 463 { "id": "REGEX([0-9a-f]{24})", @@ -227,6 +227,7 @@ Content-Length: 448 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -264,7 +265,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 448 +Content-Length: 463 { "id": "REGEX([0-9a-f]{24})", @@ -278,6 +279,7 @@ Content-Length: 448 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -315,7 +317,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -329,6 +331,7 @@ Content-Length: 450 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -379,7 +382,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 472 +Content-Length: 487 { "id": "REGEX([0-9a-f]{24})", @@ -393,6 +396,7 @@ Content-Length: 472 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test index c6c880b177..bf996cffea 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_full_lifecycle.test @@ -423,7 +423,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 431 +Content-Length: 446 { "id": "REGEX([0-9a-f]{24})", @@ -436,6 +436,7 @@ Content-Length: 431 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -486,7 +487,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 489 +Content-Length: 504 { "id": "REGEX([0-9a-f]{24})", @@ -501,6 +502,7 @@ Content-Length: 489 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -538,7 +540,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -553,6 +555,7 @@ Content-Length: 491 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -599,7 +602,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -614,6 +617,7 @@ Content-Length: 491 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -659,7 +663,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -674,6 +678,7 @@ Content-Length: 491 "maxFailsLimit": 2, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -719,7 +724,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 489 +Content-Length: 504 { "id": "REGEX([0-9a-f]{24})", @@ -734,6 +739,7 @@ Content-Length: 489 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -771,7 +777,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -786,6 +792,7 @@ Content-Length: 491 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -832,7 +839,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 491 +Content-Length: 506 { "id": "REGEX([0-9a-f]{24})", @@ -847,6 +854,7 @@ Content-Length: 491 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -897,7 +905,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 472 +Content-Length: 487 { "id": "REGEX([0-9a-f]{24})", @@ -911,6 +919,7 @@ Content-Length: 472 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test new file mode 100644 index 0000000000..8dde8abcaa --- /dev/null +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_maxfailslimit_still_works_when_update_sub_after_cache_refresh.test @@ -0,0 +1,395 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +maxFailsLimit still works when update subscription is done just after cache refresh (MQTT case) + +--SHELL-INIT-- +dbInit CB +brokerStart CB 212 IPv4 -subCacheIval 5 + +--SHELL-- + +# +# 01. POST /v2/subscriptions, to create subscription with maxFailsLimit=3 to failing endpoint +# 02. Trigger 4 notifications +# 03. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=4, failsCounter=4, maxFailsLimit=3 +# 04. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +# 05. Trigger 1 notification +# 06. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 +# 07. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 (after cache pass) +# 08. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +# 09. Trigger 2 notifications +# 10. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=6, failsCounter=6, maxFailsLimit=3 +# + + +echo '01. POST /v2/subscriptions, to create subscription with maxFailsLimit=3 to failing endpoint' +echo '===========================================================================================' +payload='{ + "subject": { + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + }, + "notification": { + "mqtt": { + "url": "mqtt://localhost:'${MQTT_DEBUG_PORT}'", + "topic": "test" + }, + "maxFailsLimit": 3 + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +subId=$(echo "$_responseHeaders" | grep Location | awk -F/ '{ print $4 }' | tr -d "\r\n") +echo +echo + + +echo '02. Trigger 4 notifications' +echo '===========================' +payload='{ + "id": "Room1", + "type": "Room", + "temperature": { + "value": 23, + "type": "Float" + } +}' +# We leave some time between updates to leave some time to connection to fail so CB can process the fail correctly +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +echo +echo + + +echo '03. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=4, failsCounter=4, maxFailsLimit=3' +echo '=====================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +echo '04. PATCH /v2/subscriptions/subscription_id, to re-enable subscription' +echo '======================================================================' +payload='{ + "status": "active" +}' +orionCurl --url /v2/subscriptions/${subId} --payload "$payload" -X PATCH +echo +echo + + +echo '05. Trigger 1 notifications' +echo '===========================' +payload='{ + "id": "Room1", + "type": "Room", + "temperature": { + "value": 23, + "type": "Float" + } +}' +# We leave some time between updates to leave some time to connection to fail so CB can process the fail correctly +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +echo +echo + + +echo '06. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3' +echo '=====================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +# Ensure that one cache sync has passed +sleep 5.5s + + +echo '07. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 (after cache pass)' +echo '========================================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +echo '08. PATCH /v2/subscriptions/subscription_id, to re-enable subscription' +echo '======================================================================' +payload='{ + "status": "active" +}' +orionCurl --url /v2/subscriptions/${subId} --payload "$payload" -X PATCH +echo +echo + + +echo '09. Trigger 2 notifications' +echo '===========================' +payload='{ + "id": "Room1", + "type": "Room", + "temperature": { + "value": 23, + "type": "Float" + } +}' +# We leave some time between updates to leave some time to connection to fail so CB can process the fail correctly +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +orionCurl --url /v2/entities?options=upsert,forcedUpdate --payload "$payload" > /dev/null +sleep 0.25s +echo +echo + + +echo '10. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=6, failsCounter=6, maxFailsLimit=3' +echo '=====================================================================================================================' +orionCurl --url /v2/subscriptions/${subId} +echo +echo + + +--REGEXPECT-- +01. POST /v2/subscriptions, to create subscription with maxFailsLimit=3 to failing endpoint +=========================================================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Trigger 4 notifications +=========================== + + +03. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=4, failsCounter=4, maxFailsLimit=3 +===================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 476 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 4, + "lastFailure": "REGEX(.*)", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "test", + "url": "mqtt://localhost:18883" + }, + "onlyChangedAttrs": false, + "timesSent": 4 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +04. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +====================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Trigger 1 notifications +=========================== + + +06. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 +===================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 476 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 5, + "lastFailure": "REGEX(.*)", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "test", + "url": "mqtt://localhost:18883" + }, + "onlyChangedAttrs": false, + "timesSent": 5 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +07. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=5, failsCounter=5, maxFailsLimit=3 (after cache pass) +======================================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 476 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 5, + "lastFailure": "REGEX(.*)", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "test", + "url": "mqtt://localhost:18883" + }, + "onlyChangedAttrs": false, + "timesSent": 5 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +08. PATCH /v2/subscriptions/subscription_id, to re-enable subscription +====================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +09. Trigger 2 notifications +=========================== + + +10. GET /v2/subscriptions/subscription_id, to check the status=inactive, timesSent=6, failsCounter=6, maxFailsLimit=3 +===================================================================================================================== +HTTP/1.1 200 OK +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Content-Type: application/json +Content-Length: 476 + +{ + "id": "REGEX([0-9a-f]{24})", + "notification": { + "attrs": [], + "attrsFormat": "normalized", + "covered": false, + "failsCounter": 6, + "lastFailure": "REGEX(.*)", + "lastNotification": "REGEX(.*)", + "maxFailsLimit": 3, + "mqtt": { + "qos": 0, + "retain": false, + "topic": "test", + "url": "mqtt://localhost:18883" + }, + "onlyChangedAttrs": false, + "timesSent": 6 + }, + "status": "inactive", + "subject": { + "condition": { + "attrs": [], + "notifyOnMetadataChange": true + }, + "entities": [ + { + "idPattern": ".*", + "type": "Room" + } + ] + } +} + + +--TEARDOWN-- +brokerStop CB +dbDrop CB diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test index af5f483d41..63b9cf3457 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_inactive_status_keeps_after_cache_refresh.test @@ -150,7 +150,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -164,6 +164,7 @@ Content-Length: 450 "maxFailsLimit": 1, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -196,7 +197,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 450 +Content-Length: 465 { "id": "REGEX([0-9a-f]{24})", @@ -210,6 +211,7 @@ Content-Length: 450 "maxFailsLimit": 1, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test index 36de9e0cae..81a098ad92 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_passes_to_inactive_state_after_limit_of_failed_connection_attemps.test @@ -278,7 +278,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 415 +Content-Length: 430 { "description": "A subscription to get info about Room1", @@ -292,6 +292,7 @@ Content-Length: 415 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -329,7 +330,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -346,6 +347,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -384,7 +386,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -401,6 +403,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -439,7 +442,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -456,6 +459,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -494,7 +498,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -511,6 +515,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -549,7 +554,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -566,6 +571,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -604,7 +610,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 535 +Content-Length: 550 { "description": "A subscription to get info about Room1", @@ -621,6 +627,7 @@ Content-Length: 535 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test index 3384f44620..eee0a0d2ec 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_status_set_to_active_state_after_a_failsCounter_reset.test @@ -212,7 +212,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 415 +Content-Length: 430 { "description": "A subscription to get info about Room1", @@ -226,6 +226,7 @@ Content-Length: 415 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -263,7 +264,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -280,6 +281,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -318,7 +320,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 533 +Content-Length: 548 { "description": "A subscription to get info about Room1", @@ -335,6 +337,7 @@ Content-Length: 533 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -378,7 +381,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 557 +Content-Length: 572 { "description": "A subscription to get info about Room1", @@ -395,6 +398,7 @@ Content-Length: 557 "maxFailsLimit": 5, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test index 509f30e420..135d8d9e85 100644 --- a/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test +++ b/test/functionalTest/cases/3541_subscription_max_fails_limit/mqtt_subscription_without_maxfailslimit_and_failscounter.test @@ -147,7 +147,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 397 +Content-Length: 412 { "description": "A subscription to get info about Room1", @@ -160,6 +160,7 @@ Content-Length: 397 "covered": false, "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, @@ -197,7 +198,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 515 +Content-Length: 530 { "description": "A subscription to get info about Room1", @@ -213,6 +214,7 @@ Content-Length: 515 "lastNotification": "REGEX(.*)", "mqtt": { "qos": 0, + "retain": false, "topic": "test", "url": "mqtt://localhost:REGEX(\d+)" }, diff --git a/test/functionalTest/cases/3658_env_vars/env_vars.test b/test/functionalTest/cases/3658_env_vars/env_vars.test index 6e924bc50f..495c359dec 100644 --- a/test/functionalTest/cases/3658_env_vars/env_vars.test +++ b/test/functionalTest/cases/3658_env_vars/env_vars.test @@ -85,6 +85,7 @@ Extended Usage: contextBroker [option '-U' (extended usage)] [option '-localIp' ] ORION_LOCALIP '0.0.0.0' /'0.0.0.0'/ [option '-port' ] ORION_PORT 1 <= 1026 /1026/ <= 65535 [option '-pidpath' ] ORION_PID_PATH '/tmp/contextBroker.pid' /'/tmp/contextBroker/ + [option '-dbURI' ] ORION_MONGO_URI '' /''/ [option '-dbhost' ] ORION_MONGO_HOST 'localhost' /'localhost'/ [option '-rplSet' ] ORION_MONGO_REPLICA_SET '' /''/ [option '-dbuser' ] ORION_MONGO_USER '' /''/ @@ -133,9 +134,11 @@ Extended Usage: contextBroker [option '-U' (extended usage)] [option '-logLineMaxSize' ] ORION_LOG_LINE_MAX_SIZE 32768 /32768/ >= 100 [option '-logInfoPayloadMaxSize' = 0 [option '-disableMetrics' (turn off the 'metrics' feature)] ORION_DISABLE_METRICS FALSE /FALSE/ + [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] ORION_DISABLE_NGSIV1 FALSE /FALSE/ [option '-insecureNotif' (allow HTTPS notifications to peers which certificate c] ORION_INSECURE_NOTIF FALSE /FALSE/ [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSI] ORION_NGSIV1_AUTOCAST FALSE /FALSE/ [option '-mqttMaxAge' $TEST_REGEXPECT + sed -n '/--REGEXPECT--/,/^--/p' $path | grep -v "^--" | sed '/^##/d' > $TEST_REGEXPECT else exitFunction 5 "--REGEXPECT-- part is missing" $path "($path)" "" DIE fi @@ -914,7 +914,8 @@ function testDisabled dIx=0 while [ $dIx -lt ${#DISABLED[@]} ] do - if [ test/functionalTest/cases/$testcase == ${DISABLED[$dIx]} ] + # Comparison is done based in filename, skipping the path (see https://stackdiary.com/tutorials/bash-get-filename-from-path/) + if [ "${testcase##*/}" == "${DISABLED[$dIx]##*/}" ] then echo "Disabled" diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 9b429548a4..af8fbaf709 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -245,11 +245,9 @@ MESSAGE("unitTest distro: '${DISTRO}'") IF(${DISTRO} MATCHES "CentOS_6.*") TARGET_LINK_LIBRARIES(unitTest ${STATIC_LIBS} ${BOOST_MT} ${DYNAMIC_LIBS}) -ELSEIF((${DISTRO} MATCHES "Debian_8.*") OR (${DISTRO} MATCHES "Debian_9.*") OR (${DISTRO} MATCHES "Debian_10.*") OR (${DISTRO} MATCHES "Debian_11.*")) - # It seems that Debian 8.x/9.x doesn't like -mt libraries for unit tests... not sure about other Debian versions - TARGET_LINK_LIBRARIES(unitTest ${STATIC_LIBS} ${BOOST} ${DYNAMIC_LIBS}) +# From Debian 8.x to 12.x: they don't like -mt libraries for unit tests ELSEIF(${DISTRO} MATCHES "Debian_.*") - TARGET_LINK_LIBRARIES(unitTest ${STATIC_LIBS} ${BOOST_MT} ${DYNAMIC_LIBS}) + TARGET_LINK_LIBRARIES(unitTest ${STATIC_LIBS} ${BOOST} ${DYNAMIC_LIBS}) # The following ones are distros that haven't been checked since the refactoring in # PR #2062. They should be "promoted" as soon as we have positive feedback about diff --git a/test/unittests/main_UnitTest.cpp b/test/unittests/main_UnitTest.cpp index 5932dff585..7d7b9bc991 100644 --- a/test/unittests/main_UnitTest.cpp +++ b/test/unittests/main_UnitTest.cpp @@ -78,6 +78,9 @@ bool disableCusNotif = false; unsigned long logInfoPayloadMaxSize = 5 * 1024; unsigned long logLineMaxSize = 32 * 1024; +bool logDeprecate = false; + +char dbURI[1024]; char dbHost[256]; char rplSet[64]; char dbName[64]; @@ -105,6 +108,7 @@ unsigned long fcMaxInterval = 0; */ PaArgument paArgs[] = { + { "-dbURI", dbURI, "DB_URI", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, { "-dbhost", dbHost, "DB_HOST", PaString, PaOpt, (int64_t) "localhost", PaNL, PaNL, "" }, { "-rplSet", rplSet, "RPL_SET", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, { "-dbuser", user, "DB_USER", PaString, PaOpt, (int64_t) "", PaNL, PaNL, "" }, @@ -156,7 +160,7 @@ int main(int argC, char** argV) LM_M(("Init tests")); orionInit(exitFunction, orionUnitTestVersion, SemReadWriteOp, false, false, false, false, false); // Note that disableRetryTries, multitenancy and mutex time stats are disabled for unit test mongo init - mongoInit(dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, false, false, dbTimeout, writeConcern, dbPoolSize, false); + mongoInit(dbURI, dbHost, rplSet, dbName, user, pwd, authMech, authDb, dbSSL, false, false, dbTimeout, writeConcern, dbPoolSize, false); alarmMgr.init(false); logSummaryInit(&lsPeriod); // setupDatabase(); FIXME #3775: pending on mongo unit test re-enabling diff --git a/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp b/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp index c913603920..35b987f713 100644 --- a/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp +++ b/test/unittests/ngsi9/DiscoverContextAvailabilityResponse_test.cpp @@ -117,7 +117,7 @@ TEST(DiscoverContextAvailabilityResponse, jsonRender) rendered = dcarP->toJsonV1(); EXPECT_STREQ(expectedBuf, rendered.c_str()); dcarP->release(); // ... otherwise the 500 remains and "pollutes" next tests - free(dcarP); + delete dcarP; // 2. One contextRegistrationResponse - errorCode inside ContextRegistrationResponse - only providingApplication in ContextRegistration @@ -343,7 +343,7 @@ TEST(DiscoverContextAvailabilityResponse, jsonRender) rendered = dcarP->toJsonV1(); EXPECT_STREQ(expectedBuf, rendered.c_str()); - free(dcarP); + delete dcarP; utExit(); }