diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 2ec1f9e42c..7b6b61eeea 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -23,7 +23,7 @@ jobs: services: mongodb: - image: mongo:4.4 + image: mongo:6.0 ports: - 27017:27017 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 5354359713..722a7bb8db 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -22,7 +22,7 @@ jobs: services: mongodb: - image: mongo:4.4 + image: mongo:6.0 ports: - 27017:27017 diff --git a/.github/workflows/valgrind-nocache.yml b/.github/workflows/valgrind-nocache.yml index 43a1f2effc..ea86291e59 100644 --- a/.github/workflows/valgrind-nocache.yml +++ b/.github/workflows/valgrind-nocache.yml @@ -26,7 +26,7 @@ jobs: services: mongodb: - image: mongo:4.4 + image: mongo:6.0 ports: - 27017:27017 diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 0ea9538f00..67940e7d17 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -23,7 +23,7 @@ jobs: services: mongodb: - image: mongo:4.4 + image: mongo:6.0 ports: - 27017:27017 diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e241145fe2..0c8dcd255b 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -8,4 +8,5 @@ - 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 MongoDB version changed from 4.4 to 6.0 - Reference distribution changed from Debian 11 to Debian 12 diff --git a/ci/deb/build-dep.sh b/ci/deb/build-dep.sh index 6b7f76fac4..ea8531172a 100755 --- a/ci/deb/build-dep.sh +++ b/ci/deb/build-dep.sh @@ -49,15 +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 \ +&& curl -L https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add - \ +&& echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/6.0 main" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \ && apt-get -y update \ -&& apt-get -y install mongodb-org-shell +&& apt-get -y install mongodb-mongosh echo "INSTALL: python special dependencies" \ && cd /opt \ diff --git a/doc/manuals/admin/build_source.md b/doc/manuals/admin/build_source.md index d839243cb8..b534e0b2db 100644 --- a/doc/manuals/admin/build_source.md +++ b/doc/manuals/admin/build_source.md @@ -107,13 +107,7 @@ The Orion Context Broker comes with a suite of unit, valgrind and end-to-end tes 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](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 +* 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 6.0 (it may work with previous versions, but we don't recommend it). * Run unit test diff --git a/doc/manuals/admin/install.md b/doc/manuals/admin/install.md index 80fdf6b09f..13da6cc513 100644 --- a/doc/manuals/admin/install.md +++ b/doc/manuals/admin/install.md @@ -26,7 +26,7 @@ In the case you are installing Orion building from sources you need: * 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!). + is 6.0 (Orion may work with older versions but we don't recommend it at all!). For system resources (CPUs, RAM, etc.) see [these recommendations](diagnosis.md#resource-availability). diff --git a/doc/manuals/admin/perf_tuning.md b/doc/manuals/admin/perf_tuning.md index e3f6ab0c94..a06795f0c2 100644 --- a/doc/manuals/admin/perf_tuning.md +++ b/doc/manuals/admin/perf_tuning.md @@ -20,7 +20,7 @@ ## MongoDB configuration -From a performance point of view, it is recommended to use MongoDB 4.4 with WireTiger, especially +From a performance point of view, it is recommended to use MongoDB 6.0 with WireTiger, especially in update-intensive scenarios. In addition, take into account the following information from the official MongoDB documentation, as it may have diff --git a/docker/README.md b/docker/README.md index 07d9452258..e8cc578dce 100644 --- a/docker/README.md +++ b/docker/README.md @@ -38,7 +38,7 @@ Follow these steps: command: -dbhost mongo mongo: - image: mongo:4.4 + image: mongo:6.0 command: --nojournal 3. Using the command-line and within the directory you created type: `sudo docker-compose up`. @@ -77,7 +77,7 @@ Check that everything works with ### 2B. MongoDB runs on another docker container In case you want to run MongoDB on another container you can launch it like this - sudo docker run --name mongodb -d mongo:4.4 + sudo docker run --name mongodb -d mongo:6.0 And then run Orion with this command @@ -111,7 +111,7 @@ Steps: 4. Run Orion... * Using an automated scenario with docker-compose and building your new image: `sudo docker-compose up`. You may also modify the provided `docker-compose.yml` file if you need so. * Manually, running MongoDB on another container: - 1. `sudo docker run --name mongodb -d mongo:4.4` + 1. `sudo docker run --name mongodb -d mongo:6.0` 2. `sudo docker build -t orion .` 3. `sudo docker run -d --name orion1 --link mongodb:mongodb -p 1026:1026 orion -dbhost mongodb`. * Manually, specifying where to find your MongoDB host: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index cec2de0556..4587af3990 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,6 +10,6 @@ services: command: -dbhost mongo mongo: - image: mongo:4.4 + image: mongo:6.0 command: --nojournal diff --git a/docker/docker_swarm.md b/docker/docker_swarm.md index 867a7ee6da..ef30a5b5a4 100644 --- a/docker/docker_swarm.md +++ b/docker/docker_swarm.md @@ -86,7 +86,7 @@ Details on how to deploy a MongoDB ReplicaSet in Docker Swarm are available services: mongo: - image: mongo:4.4 + image: mongo:6.0 entrypoint: [ "/usr/bin/mongod", "--replSet", "rs", "--journal", "--smallfiles", "--bind_ip", "0.0.0.0"] volumes: - mongodata:/data/db diff --git a/docker/raspberry_pi.md b/docker/raspberry_pi.md index 500e5f9894..bbc3615ac6 100644 --- a/docker/raspberry_pi.md +++ b/docker/raspberry_pi.md @@ -49,7 +49,7 @@ services: command: -dbhost mongo mongo: - image: mongo:4.4 + image: mongo:6.0 command: --nojournal ``` diff --git a/scripts/dbList.sh b/scripts/dbList.sh index 7156d90279..de3931276c 100755 --- a/scripts/dbList.sh +++ b/scripts/dbList.sh @@ -24,6 +24,4 @@ then exit 1 fi -mongo --quiet << EOF - show dbs -EOF +mongosh --eval 'show dbs' --quiet diff --git a/scripts/dbReset.sh b/scripts/dbReset.sh index 05ca42318e..1e3f15cf4f 100755 --- a/scripts/dbReset.sh +++ b/scripts/dbReset.sh @@ -32,11 +32,11 @@ then db=testharness fi - echo 'db.dropDatabase()' | mongo $db --quiet + mongosh $db --eval 'db.dropDatabase()' --quiet else while [ "$#" != 0 ] do - echo 'db.dropDatabase()' | mongo $1 --quiet + mongosh $1 --eval 'db.dropDatabase()' --quiet shift done fi diff --git a/scripts/managedb/do_in_all_orion_dbs.sh b/scripts/managedb/do_in_all_orion_dbs.sh index 0d084b47b9..79f4bbd274 100755 --- a/scripts/managedb/do_in_all_orion_dbs.sh +++ b/scripts/managedb/do_in_all_orion_dbs.sh @@ -22,7 +22,7 @@ MONGO_URI="mongodb://127.0.0.1:27017" #MONGO_URI="mongodb://mongodb1:27017,mongodb2:27017,mongodb3:27017/?replicaSet=cb_rs0" -for db in $(echo 'show dbs' | mongo $MONGO_URI | grep '^orion' | awk -F ' ' '{print $1}') +for db in $(mongosh $MONGO_URI --eval 'show dbs' --quiet | grep '^orion' | awk -F ' ' '{print $1}') do echo "Processing $db db" # Edit next line to set the script you want diff --git a/test/functionalTest/cases/0725_multiservice_ignore/service_ignore_without_multiservice.test b/test/functionalTest/cases/0725_multiservice_ignore/service_ignore_without_multiservice.test index 20b21596de..100bea14eb 100644 --- a/test/functionalTest/cases/0725_multiservice_ignore/service_ignore_without_multiservice.test +++ b/test/functionalTest/cases/0725_multiservice_ignore/service_ignore_without_multiservice.test @@ -27,7 +27,7 @@ Ignoring service header when not running in multiservice mode dbInit CB dbInit ${CB_DB_NAME}-foo dbResetAll -echo "show dbs" | mongo | grep ${CB_DB_NAME} | awk '{ print $1 }' +mongosh --eval 'show dbs' | grep ${CB_DB_NAME} | awk '{ print $1 }' brokerStart CB 0-255 IPV4 @@ -59,14 +59,14 @@ echo echo "2. Check that the number of orion databases is just 1" echo "=====================================================" # In this case mongoCmd helper is not used, due to we don't have -# a particular database for mongo command and the output could be +# a particular database for mongosh command and the output could be # multiline in a general case -echo "show dbs" | mongo | grep ${CB_DB_NAME} | wc -l -echo "show dbs" | mongo | grep ${CB_DB_NAME}-foo | wc -l +mongosh --eval 'show dbs' | grep ${CB_DB_NAME} | wc -l +mongosh --eval 'show dbs' | grep ${CB_DB_NAME}-foo | wc -l # Next line was added in PR https://github.com/telefonicaid/fiware-orion/pull/1184/files#r37738638 # in order to help us to detect where the ftest-ftest-ftest-... problem is. It could happen that # after fixing #1186 this is no longer needed, but let's keep it for a while as a "quarentine" measure... -echo "show dbs" | mongo | grep ${CB_DB_NAME} | awk '{ print $1 }' +mongosh --eval 'show dbs' | grep ${CB_DB_NAME} | awk '{ print $1 }' --REGEXPECT-- 1. Create an entity using foo as tenant diff --git a/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh.test b/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh.test index 0f616583fe..4ed5c6ef33 100644 --- a/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh.test +++ b/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh.test @@ -26,7 +26,7 @@ Get subscription before and after cache refresh --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:1028/accumulate", @@ -134,15 +134,15 @@ echo echo "02. Set dynamic fields in DB to set B" echo "=====================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.update({_id: ObjectId("61960a51596aa2623032357d")}, { +mongoCmd ${CB_DB_NAME} 'db.csubs.updateOne({_id: ObjectId("61960a51596aa2623032357d")}, { $set: { - lastNotification: NumberLong(1577876400), - lastSuccess: NumberLong(1577876400), - lastFailure: NumberLong(1577872800), - lastSuccessCode: NumberLong(204), + lastNotification: NumberLong("1577876400"), + lastSuccess: NumberLong("1577876400"), + lastFailure: NumberLong("1577872800"), + lastSuccessCode: NumberLong("204"), lastFailureReason: "Timeout", - count: NumberLong(25), - failsCounter: NumberLong(8), + count: NumberLong("25"), + failsCounter: NumberLong("8"), status: "inactive", statusLastChange: 1578733200 } @@ -217,7 +217,7 @@ Content-Length: 551 02. Set dynamic fields in DB to set B ===================================== -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) +{"acknowledged":true,"insertedId":null,"matchedCount":1,"modifiedCount":1,"upsertedCount":0} 03. GET /v2/subscriptions and see dynamic fields set B although cache has not been synched yet diff --git a/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh_status_in_db_older.test b/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh_status_in_db_older.test index f377701aee..157a789900 100644 --- a/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh_status_in_db_older.test +++ b/test/functionalTest/cases/1048_subscription_cache/get_subscription_before_and_after_cache_refresh_status_in_db_older.test @@ -26,7 +26,7 @@ Get subscription before and after cache refresh with status older in DB during r --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:1028/accumulate", @@ -99,15 +99,15 @@ echo echo "02. Set dynamic fields in DB to set B" echo "=====================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.update({_id: ObjectId("61960a51596aa2623032357d")}, { +mongoCmd ${CB_DB_NAME} 'db.csubs.updateOne({_id: ObjectId("61960a51596aa2623032357d")}, { $set: { - lastNotification: NumberLong(1577876400), - lastSuccess: NumberLong(1577876400), - lastFailure: NumberLong(1577872800), - lastSuccessCode: NumberLong(204), + lastNotification: NumberLong("1577876400"), + lastSuccess: NumberLong("1577876400"), + lastFailure: NumberLong("1577872800"), + lastSuccessCode: NumberLong("204"), lastFailureReason: "Timeout", - count: NumberLong(25), - failsCounter: NumberLong(8), + count: NumberLong("25"), + failsCounter: NumberLong("8"), status: "inactive", statusLastChange: 1577869200 } @@ -182,7 +182,7 @@ Content-Length: 551 02. Set dynamic fields in DB to set B ===================================== -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) +{"acknowledged":true,"insertedId":null,"matchedCount":1,"modifiedCount":1,"upsertedCount":0} 03. GET /v2/subscriptions and see dynamic fields set B although cache has not been synched yet diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled.test b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled.test index b9f43ee4f1..1202288ba8 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled.test @@ -26,7 +26,7 @@ Cache refresh keeps newer information from cache in disabled notification scenar --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -131,7 +131,7 @@ echo echo "05. Get doc in DB before cache refresh and see status active changed in the past and without count and without failsCounter" echo "===========================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -146,7 +146,7 @@ echo echo "07. Get doc in DB after cache refresh and see status inactive changed in the present and count 2, failsCounter 2" echo "================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled_with_update_in_the_middle.test b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled_with_update_in_the_middle.test index 7b037d9373..384ede8153 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled_with_update_in_the_middle.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_disabled_with_update_in_the_middle.test @@ -26,7 +26,7 @@ Cache refresh keeps newer information from cache in disabled notification scenar --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -133,7 +133,7 @@ echo echo "05. Get doc in DB before cache refresh and see status active changed in the past and without count and without failsCounter" echo "===========================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -150,7 +150,7 @@ echo echo "07. Get doc in DB before cache refresh and see status active changed in the past and without count and without failsCounter + description" echo "=========================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -165,7 +165,7 @@ echo echo "09. Get doc in DB after cache refresh and see status inactive changed in the present and count 2, failsCounter 2 + description" echo "==============================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail.test b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail.test index f0a00408b0..7272205b19 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail.test @@ -26,7 +26,7 @@ Cache refresh keeps newer information from cache in failed notification scenario --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -124,7 +124,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Failure in a the past and reason 'some reason' but no count and no failsCounter" echo "===============================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -139,7 +139,7 @@ echo echo "06. Get doc in DB after cache refresh and see lastNotification/Failure in the present and reason 'could not connect' and count 1 and failsCounter 1" echo "===================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail_with_update_in_the_middle.test b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail_with_update_in_the_middle.test index d13bc3f79d..f602ba30b6 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail_with_update_in_the_middle.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_fail_with_update_in_the_middle.test @@ -26,7 +26,7 @@ Cache refresh keeps newer information from cache in failed notification scenario --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -126,7 +126,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Failure in a the past and reason 'some reason' but no count and no failsCounter" echo "===============================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -143,7 +143,7 @@ echo echo "06. Get doc in DB before cache refresh and see lastNotification/Failure in a the past and reason 'some reason' but no count and no failsCounter + description" echo "=============================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -158,7 +158,7 @@ echo echo "08. Get doc in DB after cache refresh and see lastNotification/Failure in the present and reason 'could not connect' and count 1 and failsCounter 1 + description" echo "=================================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success.test b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success.test index e552f2aa5d..b39bae8cba 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success.test @@ -26,7 +26,7 @@ Cache refresh keeps newer information from cache in successfull notification sce --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -126,7 +126,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Success in the past and status code 211 but no count" echo "====================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -141,7 +141,7 @@ echo echo "06. Get doc in DB after cache refresh and see lastNotification/Success in the present and status code 200 and count 1" echo "=====================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success_with_update_in_the_middle.test b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success_with_update_in_the_middle.test index c4353bc50a..850b9d6765 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success_with_update_in_the_middle.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_cache_wins_notif_success_with_update_in_the_middle.test @@ -26,7 +26,7 @@ Cache refresh keeps newer information from cache in successfull notification sce --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -128,7 +128,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Success in the past and status code 211 but no count" echo "====================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -145,7 +145,7 @@ echo echo "06. Get doc in DB before cache refresh and see lastNotification/Success in the past and status code 211 but no count + description" echo "==================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -160,7 +160,7 @@ echo echo "08. Get doc in DB after cache refresh and see lastNotification/Success in the present and status code 200 and count 1 + description" echo "===================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled.test b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled.test index b4986ff145..d3ceaa5982 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled.test @@ -26,7 +26,7 @@ Cache refresh takes newer information from DB in disabled notification scenario --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -128,7 +128,7 @@ echo echo "05. Get doc in DB before cache refresh and see status active changed in a far future and without count and without failsCounter" echo "===============================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -143,7 +143,7 @@ echo echo "07. Get doc in DB after cache refresh and see status active changed in a far future and count 2, failsCounter 2" echo "===============================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled_with_update_in_the_middle.test b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled_with_update_in_the_middle.test index 86c2f0cdc9..d93748cb57 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled_with_update_in_the_middle.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_disabled_with_update_in_the_middle.test @@ -26,7 +26,7 @@ Cache refresh takes newer information from DB in disabled notification scenario --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -130,7 +130,7 @@ echo echo "05. Get doc in DB before cache refresh and see status active changed in a far future and without count and without failsCounter" echo "===============================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -147,7 +147,7 @@ echo echo "07. Get doc in DB before cache refresh and see status active changed in a far future and without count and without failsCounter + description" echo "=============================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -162,7 +162,7 @@ echo echo "09. Get doc in DB after cache refresh and see status active changed in a far future and count 2, failsCounter 2 + description" echo "=============================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail.test b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail.test index 4dfe82b91c..032e2ed5d4 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail.test @@ -26,7 +26,7 @@ Cache refresh takes newer information from DB in failed notification scenario --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -121,7 +121,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Failure in a far future and reason 'some reason' but no count and no failsCounter" echo "=================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -136,7 +136,7 @@ echo echo "06. Get doc in DB after cache refresh and see lastNotification/Failure in a far future and reason 'some reason' and count 1 and failsCounter 1" echo "==============================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail_with_update_in_the_middle.test b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail_with_update_in_the_middle.test index 9792d862f6..1a7e1a5093 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail_with_update_in_the_middle.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_fail_with_update_in_the_middle.test @@ -26,7 +26,7 @@ Cache refresh takes newer information from DB in failed notification scenario wi --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -123,7 +123,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Failure in a far future and reason 'some reason' but no count and no failsCounter" echo "=================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -140,7 +140,7 @@ echo echo "06. Get doc in DB before cache refresh and see lastNotification/Failure in a far future and reason 'some reason' but no count and no failsCounter + description" echo "===============================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -155,7 +155,7 @@ echo echo "08. Get doc in DB after cache refresh and see lastNotification/Failure in a far future and reason 'some reason' and count 1 and failsCounter 1 + description" echo "============================================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success.test b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success.test index 64d3648b08..51dff14bbc 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success.test @@ -26,7 +26,7 @@ Cache refresh takes newer information from DB in successfull notification scenar --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -123,7 +123,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Success in a far future and status code 211 but no count" echo "========================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -138,7 +138,7 @@ echo echo "06. Get doc in DB after cache refresh and see lastNotification/Success in a far future and status code 211 and count 1" echo "======================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success_with_update_in_the_middle.test b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success_with_update_in_the_middle.test index eb2d3961d5..c20ce9479a 100644 --- a/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success_with_update_in_the_middle.test +++ b/test/functionalTest/cases/1048_subscription_cache/refresh_db_wins_notif_success_with_update_in_the_middle.test @@ -26,7 +26,7 @@ Cache refresh takes newer information from DB in successfull notification scenar --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("61960a51596aa2623032357d"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:9997/notify", @@ -125,7 +125,7 @@ echo echo "04. Get doc in DB before cache refresh and see lastNotification/Success in a far future and status code 211 but no count" echo "========================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -142,7 +142,7 @@ echo echo "06. Get doc in DB before cache refresh and see lastNotification/Success in a far future and status code 211 but no count + description" echo "======================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -157,7 +157,7 @@ echo echo "08. Get doc in DB after cache refresh and see lastNotification/Success in a far future and status code 211 and count 1 + description" echo "====================================================================================================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.find({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | sed 's/NumberLong(\([[:digit:]]\+\))/\1/g' | sed 's/NumberLong("\([[:digit:]]\+\)")/\1/g' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.csubs.findOne({ _id: ObjectId("61960a51596aa2623032357d")}, {_id:0, expiration: 0})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo 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 a2c3e5a2d1..ddb7f001a0 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 @@ -68,7 +68,7 @@ echo echo "03. Check the '=' in DB" echo "=======================" -mongoCmd ${CB_DB_NAME} 'db.entities.find({ "_id" : { "id" : "E", "type": "T", "servicePath" : "/" } }, {_id:0, attrs: 1})' +mongoCmd ${CB_DB_NAME} 'db.entities.findOne({ "_id" : { "id" : "E", "type": "T", "servicePath" : "/" } }, {_id:0, attrs: 1})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -114,7 +114,30 @@ Content-Length: 139 03. Check the '=' in DB ======================= -{ "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" ] } } } +{ + "attrs": { + "A": { + "creDate": REGEX(.*), + "md": { + "m=x": { + "type": "string", + "value": "black" + }, + "m=y": { + "type": "double", + "value": 5 + } + }, + "mdNames": [ + "m.x", + "m.y" + ], + "modDate": REGEX(.*), + "type": "T", + "value": "foo" + } + } +} --TEARDOWN-- diff --git a/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_empty_type_entities.test b/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_empty_type_entities.test index 4cd0acf465..dfd643fc66 100644 --- a/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_empty_type_entities.test +++ b/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_empty_type_entities.test @@ -72,7 +72,7 @@ echo "=====================================" # It seems that the ability to generate _id.type = "" was lost in some old Orion version # (although some DB generated with old versions could persist nowadays). Thus, we need to # createthis entity with a hack at MongoDB level -mongoCmd ${CB_DB_NAME} 'db.entities.insert({ +mongoCmd ${CB_DB_NAME} 'db.entities.insertOne({ "_id": { "id": "E2", "type": "", @@ -171,7 +171,7 @@ Content-Length: 6 04. Create E2/""/A1+A3 (using NGSIv1) ===================================== -WriteResult({ "nInserted" : 1 }) +{"acknowledged":true,"insertedId":{"id":"E2","type":"","servicePath":"/"}} 05. Create E3/T3/A2+A4 diff --git a/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_null_and_empty_types.test b/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_null_and_empty_types.test index fcee2f5939..8f9dd731a4 100644 --- a/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_null_and_empty_types.test +++ b/test/functionalTest/cases/1170_get_types_values_option/get_types_values_option_with_null_and_empty_types.test @@ -52,7 +52,7 @@ echo "======================" # It seems that the ability to generate _id.type = "" was lost in some old Orion version # (although some DB generated with old versions could persist nowadays). Thus, we need to # createthis entity with a hack at MongoDB level -mongoCmd ${CB_DB_NAME} 'db.entities.insert({ +mongoCmd ${CB_DB_NAME} 'db.entities.insertOne({ "_id": { "id": "E1", "type": "", @@ -163,7 +163,7 @@ Content-Length: 2 02. Create E1/""/A1+A2 ====================== -WriteResult({ "nInserted" : 1 }) +{"acknowledged":true,"insertedId":{"id":"E1","type":"","servicePath":"/"}} 03. GET /v2/types?options=values and get a non-empty list diff --git a/test/functionalTest/cases/1323_put_replacing_dot_in_attrnames/put_replacing_dot_in_attrnames.test b/test/functionalTest/cases/1323_put_replacing_dot_in_attrnames/put_replacing_dot_in_attrnames.test index 298850f82d..d34a341357 100644 --- a/test/functionalTest/cases/1323_put_replacing_dot_in_attrnames/put_replacing_dot_in_attrnames.test +++ b/test/functionalTest/cases/1323_put_replacing_dot_in_attrnames/put_replacing_dot_in_attrnames.test @@ -117,7 +117,7 @@ echo echo "07. Check attributes in DB" echo "==========================" -mongoCmd ${CB_DB_NAME} 'db.entities.find({ "_id" : { "id" : "E1", "type": "Thing", "servicePath" : "/" } }, {_id:0, attrNames: 1})' +mongoCmd ${CB_DB_NAME} 'db.entities.findOne({ "_id" : { "id" : "E1", "type": "Thing", "servicePath" : "/" } }, {_id:0, attrNames: 1})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -279,7 +279,12 @@ Content-Length: 10 07. Check attributes in DB ========================== -{ "attrNames" : [ "A2..y", "A3.Z" ] } +{ + "attrNames": [ + "A2..y", + "A3.Z" + ] +} --TEARDOWN-- diff --git a/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error.test b/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error.test index 91c152b1fe..c726bb7a88 100644 --- a/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error.test +++ b/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error.test @@ -168,7 +168,7 @@ echo echo "07. Corrupt reference in subscription (using mongo)" echo "===================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.update({_id: ObjectId("'$SUB_ID'")}, { $set: { "reference": "badReferenceForSubscription" }})' +mongoCmd ${CB_DB_NAME} 'db.csubs.updateOne({_id: ObjectId("'$SUB_ID'")}, { $set: { "reference": "badReferenceForSubscription" }})' echo echo @@ -265,7 +265,7 @@ Releasing alarm BadInput REGEX((0.0.0.0|127.0.0.1)) 07. Corrupt reference in subscription (using mongo) =================================================== -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) +{"acknowledged":true,"insertedId":null,"matchedCount":1,"modifiedCount":1,"upsertedCount":0} 08. Wait six seconds to assure the subscription cache has been modified diff --git a/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms.test b/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms.test index 773ddecae9..c99478e16b 100644 --- a/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms.test +++ b/test/functionalTest/cases/1661_bad_input_on_notification_error/bad_input_on_notification_error_with_relogged_alarms.test @@ -168,7 +168,7 @@ echo echo "07. Corrupt reference in subscription (using mongo)" echo "===================================================" -mongoCmd ${CB_DB_NAME} 'db.csubs.update({_id: ObjectId("'$SUB_ID'")}, { $set: { "reference": "badReferenceForSubscription" }})' +mongoCmd ${CB_DB_NAME} 'db.csubs.updateOne({_id: ObjectId("'$SUB_ID'")}, { $set: { "reference": "badReferenceForSubscription" }})' echo echo @@ -269,7 +269,7 @@ Releasing alarm BadInput REGEX((0.0.0.0|127.0.0.1)) 07. Corrupt reference in subscription (using mongo) =================================================== -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) +{"acknowledged":true,"insertedId":null,"matchedCount":1,"modifiedCount":1,"upsertedCount":0} 08. Wait six seconds to assure the subscription cache has been modified diff --git a/test/functionalTest/cases/2394_inconsistent_mdnames_after_update/inconsistent_mdnames_after_update.test b/test/functionalTest/cases/2394_inconsistent_mdnames_after_update/inconsistent_mdnames_after_update.test index e88e74907b..ba822b78d1 100644 --- a/test/functionalTest/cases/2394_inconsistent_mdnames_after_update/inconsistent_mdnames_after_update.test +++ b/test/functionalTest/cases/2394_inconsistent_mdnames_after_update/inconsistent_mdnames_after_update.test @@ -61,7 +61,7 @@ echo echo "02. Get from Database, only 2 metadata" echo "======================================" -mongoCmd ${CB_DB_NAME} "db.entities.find({}, {_id:0, \"attrs.temperature.mdNames\":1})" +mongoCmd ${CB_DB_NAME} "db.entities.find({}, {_id:0, \"attrs.temperature.mdNames\":1}).toArray()" echo echo @@ -88,7 +88,7 @@ echo echo "04. Get from Database, only 2 metadata" echo "======================================" -mongoCmd ${CB_DB_NAME} "db.entities.find({}, {_id:0, \"attrs.temperature.mdNames\":1})" +mongoCmd ${CB_DB_NAME} "db.entities.find({}, {_id:0, \"attrs.temperature.mdNames\":1}).toArray()" echo echo @@ -106,7 +106,7 @@ Content-Length: 0 02. Get from Database, only 2 metadata ====================================== -{ "attrs" : { "temperature" : { "mdNames" : [ "34.4E-34_1", "34.4E-34_0" ] } } } +[{"attrs":{"temperature":{"mdNames":["34.4E-34_1","34.4E-34_0"]}}}] 03. Update E-temperature, including metatata @@ -119,7 +119,7 @@ Fiware-Correlator: REGEX([0-9a-f\-]{36}) 04. Get from Database, only 2 metadata ====================================== -{ "attrs" : { "temperature" : { "mdNames" : [ "34.4E-34_1", "34.4E-34_0" ] } } } +[{"attrs":{"temperature":{"mdNames":["34.4E-34_1","34.4E-34_0"]}}}] --TEARDOWN-- diff --git a/test/functionalTest/cases/2770_v1_append_not_updates_geo_point/v1_append_not_updates_geo_point.test b/test/functionalTest/cases/2770_v1_append_not_updates_geo_point/v1_append_not_updates_geo_point.test index 6b6aee38df..cf183f4d39 100644 --- a/test/functionalTest/cases/2770_v1_append_not_updates_geo_point/v1_append_not_updates_geo_point.test +++ b/test/functionalTest/cases/2770_v1_append_not_updates_geo_point/v1_append_not_updates_geo_point.test @@ -54,7 +54,7 @@ echo echo "02. Check location field at DB is -4.33, 36.12" echo "==============================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find({"_id.id": "line1"}, {_id: 0, location: 1})' +mongoCmd ${CB_DB_NAME} 'db.entities.find({"_id.id": "line1"}, {_id: 0, location: 1}).toArray()' echo echo @@ -84,7 +84,7 @@ echo echo "04. Check location field at DB is -11.22, 22.33" echo "===============================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find({"_id.id": "line1"}, {_id: 0, location: 1})' +mongoCmd ${CB_DB_NAME} 'db.entities.find({"_id.id": "line1"}, {_id: 0, location: 1}).toArray()' echo echo @@ -102,7 +102,7 @@ Content-Length: 0 02. Check location field at DB is -4.33, 36.12 ============================================== -{ "location" : { "attrName" : "loc", "coords" : { "type" : "Point", "coordinates" : [ -4.33, 36.12 ] } } } +[{"location":{"attrName":"loc","coords":{"type":"Point","coordinates":[-4.33,36.12]}}}] 03. Update entity using v1 updateContext APPEND @@ -139,7 +139,7 @@ Content-Length: 197 04. Check location field at DB is -11.22, 22.33 =============================================== -{ "location" : { "attrName" : "loc", "coords" : { "type" : "Point", "coordinates" : [ -11.22, 22.33 ] } } } +[{"location":{"attrName":"loc","coords":{"type":"Point","coordinates":[-11.22,22.33]}}}] --TEARDOWN-- diff --git a/test/functionalTest/cases/2871_fwd_update_ok_but_not_found_response/fwd_update_ok_but_not_found_response.test b/test/functionalTest/cases/2871_fwd_update_ok_but_not_found_response/fwd_update_ok_but_not_found_response.test index 7a7b1c567e..a5595702d1 100644 --- a/test/functionalTest/cases/2871_fwd_update_ok_but_not_found_response/fwd_update_ok_but_not_found_response.test +++ b/test/functionalTest/cases/2871_fwd_update_ok_but_not_found_response/fwd_update_ok_but_not_found_response.test @@ -49,7 +49,7 @@ echo "01. Create registration directly in DB" echo "======================================" doc='{ "_id":ObjectId("5b1ff2ee49597334c9b5efc7"), - "expiration":NumberLong(1845053934), + "expiration":NumberLong("1845053934"), "servicePath":"/ss1", "format":"JSON", "contextRegistration":[ @@ -70,7 +70,7 @@ doc='{ } ] }' -mongoCmd ${CB_DB_NAME} "db.registrations.insert($doc)" +mongoCmd ${CB_DB_NAME} "db.registrations.insertOne($doc)" echo echo @@ -131,7 +131,7 @@ doc='{ "modDate": 1528820541, "lastCorrelator": "c8bcef8a-6e5c-11e8-a06c-0242ac11000b" }' -mongoCmd ${CB_DB_NAME} "db.entities.insert($doc)" +mongoCmd ${CB_DB_NAME} "db.entities.insertOne($doc)" echo echo @@ -222,12 +222,12 @@ echo --REGEXPECT-- 01. Create registration directly in DB ====================================== -WriteResult({ "nInserted" : 1 }) +{"acknowledged":true,"insertedId":{"$oid":"5b1ff2ee49597334c9b5efc7"}} 02. Create entity directly in DB ================================ -WriteResult({ "nInserted" : 1 }) +{"acknowledged":true,"insertedId":{"id":"entity1","type":"device","servicePath":"/ss1"}} 03. Update turn attribute using PATCH on entity diff --git a/test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V2.test b/test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V2.test index 496b530cec..be79908420 100644 --- a/test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V2.test +++ b/test/functionalTest/cases/3122_location_metadata_issues/create_location_attr_V2.test @@ -80,14 +80,14 @@ echo echo "03. Check E1 entity in DB has location metadata but no location GeoJSON field" echo "=============================================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find({ "_id" : { "id" : "E1", "type": "T", "servicePath" : "/" } }, {_id:0, attrs: 1, location: 1})' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.findOne({ "_id" : { "id" : "E1", "type": "T", "servicePath" : "/" } }, {_id:0, attrs: 1, location: 1})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo echo "04. Check E2 entity in DB has no location metadata but location GeoJSON field" echo "=============================================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find({ "_id" : { "id" : "E2", "type": "T", "servicePath" : "/" } }, {_id:0, attrs: 1, location: 1})' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.findOne({ "_id" : { "id" : "E2", "type": "T", "servicePath" : "/" } }, {_id:0, attrs: 1, location: 1})' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/blanked_out_attr.test b/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/blanked_out_attr.test index 377cf618be..40c7feed77 100644 --- a/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/blanked_out_attr.test +++ b/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/blanked_out_attr.test @@ -86,7 +86,7 @@ echo echo "03. Get entity from mongodb" echo "===========================" -m=$(mongoCmd ${CB_DB_NAME} 'db.entities.find({ "_id" : { "id" : "urn:ngsi-ld:Store:004", "type": "Store", "servicePath" : "/" }})') +m=$(mongoCmd ${CB_DB_NAME} 'db.entities.findOne({ "_id" : { "id" : "urn:ngsi-ld:Store:004", "type": "Store", "servicePath" : "/" }})') echo $m | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -128,7 +128,7 @@ echo echo "06. Get entity from mongodb" echo "===========================" -m=$(mongoCmd ${CB_DB_NAME} 'db.entities.find({ "_id" : { "id" : "urn:ngsi-ld:Store:004", "type": "Store", "servicePath" : "/" }})') +m=$(mongoCmd ${CB_DB_NAME} 'db.entities.findOne({ "_id" : { "id" : "urn:ngsi-ld:Store:004", "type": "Store", "servicePath" : "/" }})') echo $m | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo diff --git a/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/query_for_arrays.test b/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/query_for_arrays.test index 67bffeca00..f6db6dcf1a 100644 --- a/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/query_for_arrays.test +++ b/test/functionalTest/cases/3162_context_providers_legacy_non_primitive/query_for_arrays.test @@ -51,7 +51,7 @@ payload='{ "entities": [ { "id": "E1", - "type": "E" + "type": "T" } ], "attrs": [ @@ -75,7 +75,7 @@ echo "==================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -99,7 +99,7 @@ echo "======================" payload='{ "entities": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1" } @@ -125,7 +125,7 @@ echo "==========================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -190,7 +190,7 @@ Content-Length: 187 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -225,7 +225,7 @@ Content-Length: 203 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -271,7 +271,7 @@ Content-Length: 187 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -319,7 +319,7 @@ Content-Length: 148 ] }, "id": "E1", - "type": "E" + "type": "T" } diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_create_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_create_does_not_break_location.test index cf68b94d8c..dcd6943251 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_create_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_create_does_not_break_location.test @@ -40,7 +40,7 @@ echo "===================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -61,7 +61,7 @@ echo echo "02. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -89,7 +89,7 @@ Content-Length: 195 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -102,61 +102,63 @@ Content-Length: 195 02. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:box", - "value": [ - "7.7, 8.8", - "9.9, -10.10" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - [ - -10.1, - 7.7 - ], - [ - -10.1, - 9.9 - ], - [ - 8.8, - 9.9 - ], - [ - 8.8, - 7.7 - ], +[ + { + "_id": { + "id": "E1", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "position" + ], + "attrs": { + "position": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:box", + "value": [ + "7.7, 8.8", + "9.9, -10.10" + ] + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "position", + "coords": { + "coordinates": [ [ - -10.1, - 7.7 + [ + -10.1, + 7.7 + ], + [ + -10.1, + 9.9 + ], + [ + 8.8, + 9.9 + ], + [ + 8.8, + 7.7 + ], + [ + -10.1, + 7.7 + ] ] - ] - ], - "type": "Polygon" - } - }, - "modDate": REGEX(\d+\.\d+) -} + ], + "type": "Polygon" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_update_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_update_does_not_break_location.test index 8ffdc90cac..2d0ba1d089 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_update_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geobox_update_does_not_break_location.test @@ -57,12 +57,12 @@ echo "===================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:box", "value": ["-3.3, 4.4", "5.5, -6.6"] } @@ -78,7 +78,7 @@ echo echo "03. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -88,12 +88,12 @@ echo "===================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:box", "value": ["7.7, 8.8", "9.9, -10.10"] } @@ -109,7 +109,7 @@ echo echo "05. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -132,7 +132,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 195 +Content-Length: 194 { "contextResponses": [ @@ -140,14 +140,14 @@ Content-Length: 195 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:box", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -160,61 +160,63 @@ Content-Length: 195 03. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:box", - "value": [ - "-3.3, 4.4", - "5.5, -6.6" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - [ - -6.6, - -3.3 - ], - [ - -6.6, - 5.5 - ], - [ - 4.4, - 5.5 - ], - [ - 4.4, - -3.3 - ], +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:box", + "value": [ + "-3.3, 4.4", + "5.5, -6.6" + ] + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ [ - -6.6, - -3.3 + [ + -6.6, + -3.3 + ], + [ + -6.6, + 5.5 + ], + [ + 4.4, + 5.5 + ], + [ + 4.4, + -3.3 + ], + [ + -6.6, + -3.3 + ] ] - ] - ], - "type": "Polygon" - } - }, - "modDate": REGEX(\d+\.\d+) -} + ], + "type": "Polygon" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] 04. Update entity with geo:box with NGSIv1 (UPDATE) @@ -223,7 +225,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 195 +Content-Length: 194 { "contextResponses": [ @@ -231,14 +233,14 @@ Content-Length: 195 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:box", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -251,61 +253,63 @@ Content-Length: 195 05. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:box", - "value": [ - "7.7, 8.8", - "9.9, -10.10" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - [ - -10.1, - 7.7 - ], - [ - -10.1, - 9.9 - ], - [ - 8.8, - 9.9 - ], - [ - 8.8, - 7.7 - ], +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:box", + "value": [ + "7.7, 8.8", + "9.9, -10.10" + ] + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ [ - -10.1, - 7.7 + [ + -10.1, + 7.7 + ], + [ + -10.1, + 9.9 + ], + [ + 8.8, + 9.9 + ], + [ + 8.8, + 7.7 + ], + [ + -10.1, + 7.7 + ] ] - ] - ], - "type": "Polygon" - } - }, - "modDate": REGEX(\d+\.\d+) -} + ], + "type": "Polygon" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_create_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_create_does_not_break_location.test index 17ea8ae9f8..143371555b 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_create_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_create_does_not_break_location.test @@ -40,7 +40,7 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -64,7 +64,7 @@ echo echo "02. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -92,7 +92,7 @@ Content-Length: 196 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -105,44 +105,46 @@ Content-Length: 196 02. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:json", - "value": { +[ + { + "_id": { + "id": "E1", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "position" + ], + "attrs": { + "position": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:json", + "value": { + "coordinates": [ + "5.5", + "-6.6" + ], + "type": "Point" + } + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "position", + "coords": { "coordinates": [ - "5.5", - "-6.6" + 5.5, + -6.6 ], "type": "Point" } - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - 5.5, - -6.6 - ], - "type": "Point" - } - }, - "modDate": REGEX(\d+\.\d+) -} + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_update_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_update_does_not_break_location.test index 064a19243c..a441e56954 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_update_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geojson_update_does_not_break_location.test @@ -57,12 +57,12 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:json", "value": { "type": "Point", @@ -81,7 +81,7 @@ echo echo "03. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -91,12 +91,12 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:json", "value": { "type": "Point", @@ -115,7 +115,7 @@ echo echo "05. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -138,7 +138,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 196 +Content-Length: 195 { "contextResponses": [ @@ -146,14 +146,14 @@ Content-Length: 196 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:json", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -166,44 +166,46 @@ Content-Length: 196 03. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:json", - "value": { +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:json", + "value": { + "coordinates": [ + "-3.3", + "4.4" + ], + "type": "Point" + } + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { "coordinates": [ - "-3.3", - "4.4" + -3.3, + 4.4 ], "type": "Point" } - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - -3.3, - 4.4 - ], - "type": "Point" - } - }, - "modDate": REGEX(\d+\.\d+) -} + }, + "modDate": REGEX(\d+\.\d+) + } +] 04. Update entity with geo:json with NGSIv1 (UPDATE) @@ -212,7 +214,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 196 +Content-Length: 195 { "contextResponses": [ @@ -220,14 +222,14 @@ Content-Length: 196 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:json", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -240,44 +242,46 @@ Content-Length: 196 05. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:json", - "value": { +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:json", + "value": { + "coordinates": [ + "5.5", + "-6.6" + ], + "type": "Point" + } + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { "coordinates": [ - "5.5", - "-6.6" + 5.5, + -6.6 ], "type": "Point" } - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - 5.5, - -6.6 - ], - "type": "Point" - } - }, - "modDate": REGEX(\d+\.\d+) -} + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_create_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_create_does_not_break_location.test index 3871ac0398..c210466a92 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_create_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_create_does_not_break_location.test @@ -40,7 +40,7 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -61,7 +61,7 @@ echo echo "02. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -89,7 +89,7 @@ Content-Length: 196 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -102,47 +102,49 @@ Content-Length: 196 02. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:line", - "value": [ - "7.7, 8.8", - "9.9, -10.10" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - 8.8, - 7.7 - ], - [ - -10.1, - 9.9 +[ + { + "_id": { + "id": "E1", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "position" + ], + "attrs": { + "position": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:line", + "value": [ + "7.7, 8.8", + "9.9, -10.10" ] - ], - "type": "LineString" - } - }, - "modDate": REGEX(\d+\.\d+) -} + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "position", + "coords": { + "coordinates": [ + [ + 8.8, + 7.7 + ], + [ + -10.1, + 9.9 + ] + ], + "type": "LineString" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_update_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_update_does_not_break_location.test index 60f3a45428..c3c8e42075 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_update_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geoline_update_does_not_break_location.test @@ -57,12 +57,12 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:line", "value": ["-3.3, 4.4", "5.5, -6.6"] } @@ -78,7 +78,7 @@ echo echo "03. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -88,12 +88,12 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:line", "value": ["7.7, 8.8", "9.9, -10.10"] } @@ -109,7 +109,7 @@ echo echo "05. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -132,7 +132,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 196 +Content-Length: 195 { "contextResponses": [ @@ -140,14 +140,14 @@ Content-Length: 196 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:line", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -160,47 +160,49 @@ Content-Length: 196 03. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:line", - "value": [ - "-3.3, 4.4", - "5.5, -6.6" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - 4.4, - -3.3 - ], - [ - -6.6, - 5.5 +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:line", + "value": [ + "-3.3, 4.4", + "5.5, -6.6" ] - ], - "type": "LineString" - } - }, - "modDate": REGEX(\d+\.\d+) -} + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ + [ + 4.4, + -3.3 + ], + [ + -6.6, + 5.5 + ] + ], + "type": "LineString" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] 04. Update entity with geo:line with NGSIv1 (UPDATE) @@ -209,7 +211,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 196 +Content-Length: 195 { "contextResponses": [ @@ -217,14 +219,14 @@ Content-Length: 196 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:line", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -237,47 +239,49 @@ Content-Length: 196 05. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:line", - "value": [ - "7.7, 8.8", - "9.9, -10.10" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - 8.8, - 7.7 - ], - [ - -10.1, - 9.9 +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:line", + "value": [ + "7.7, 8.8", + "9.9, -10.10" ] - ], - "type": "LineString" - } - }, - "modDate": REGEX(\d+\.\d+) -} + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ + [ + 8.8, + 7.7 + ], + [ + -10.1, + 9.9 + ] + ], + "type": "LineString" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_create_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_create_does_not_break_location.test index 3d6563b108..de3fa48d9e 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_create_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_create_does_not_break_location.test @@ -40,7 +40,7 @@ echo "=====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -61,7 +61,7 @@ echo echo "02. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -89,7 +89,7 @@ Content-Length: 197 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -102,38 +102,40 @@ Content-Length: 197 02. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:point", - "value": "5.5, -6.6" - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - -6.6, - 5.5 - ], - "type": "Point" - } - }, - "modDate": REGEX(\d+\.\d+) -} +[ + { + "_id": { + "id": "E1", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "position" + ], + "attrs": { + "position": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:point", + "value": "5.5, -6.6" + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "position", + "coords": { + "coordinates": [ + -6.6, + 5.5 + ], + "type": "Point" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_update_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_update_does_not_break_location.test index 141019e70f..6fabd5604c 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_update_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopoint_update_does_not_break_location.test @@ -57,12 +57,12 @@ echo "=====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:point", "value": "-3.3, 4.4" } @@ -78,7 +78,7 @@ echo echo "03. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -88,12 +88,12 @@ echo "=====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:point", "value": "5.5, -6.6" } @@ -109,7 +109,7 @@ echo echo "05. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -132,7 +132,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 197 +Content-Length: 196 { "contextResponses": [ @@ -140,14 +140,14 @@ Content-Length: 197 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:point", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -160,38 +160,40 @@ Content-Length: 197 03. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:point", - "value": "-3.3, 4.4" - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - 4.4, - -3.3 - ], - "type": "Point" - } - }, - "modDate": REGEX(\d+\.\d+) -} +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:point", + "value": "-3.3, 4.4" + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ + 4.4, + -3.3 + ], + "type": "Point" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] 04. Update entity with geo:point with NGSIv1 (UPDATE) @@ -200,7 +202,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 197 +Content-Length: 196 { "contextResponses": [ @@ -208,14 +210,14 @@ Content-Length: 197 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:point", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -228,38 +230,40 @@ Content-Length: 197 05. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:point", - "value": "5.5, -6.6" - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - -6.6, - 5.5 - ], - "type": "Point" - } - }, - "modDate": REGEX(\d+\.\d+) -} +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:point", + "value": "5.5, -6.6" + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ + -6.6, + 5.5 + ], + "type": "Point" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_create_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_create_does_not_break_location.test index 9de8bd322b..56e69a6734 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_create_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_create_does_not_break_location.test @@ -40,7 +40,7 @@ echo "=======================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", "id": "E1", "attributes": [ @@ -61,7 +61,7 @@ echo echo "02. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -89,7 +89,7 @@ Content-Length: 199 ], "id": "E1", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -102,59 +102,61 @@ Content-Length: 199 02. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:polygon", - "value": [ - "7.7, 8.8", - "9.9, -10.10", - "3.3, 2.2", - "7.7, 8.8" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - [ - 8.8, - 7.7 - ], - [ - -10.1, - 9.9 - ], - [ - 2.2, - 3.3 - ], +[ + { + "_id": { + "id": "E1", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "position" + ], + "attrs": { + "position": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:polygon", + "value": [ + "7.7, 8.8", + "9.9, -10.10", + "3.3, 2.2", + "7.7, 8.8" + ] + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "position", + "coords": { + "coordinates": [ [ - 8.8, - 7.7 + [ + 8.8, + 7.7 + ], + [ + -10.1, + 9.9 + ], + [ + 2.2, + 3.3 + ], + [ + 8.8, + 7.7 + ] ] - ] - ], - "type": "Polygon" - } - }, - "modDate": REGEX(\d+\.\d+) -} + ], + "type": "Polygon" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_update_does_not_break_location.test b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_update_does_not_break_location.test index 5e25fef048..0810506047 100644 --- a/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_update_does_not_break_location.test +++ b/test/functionalTest/cases/3442_ngsiv1_interop_location_fix/ngsiv1_geopolygon_update_does_not_break_location.test @@ -57,12 +57,12 @@ echo "=======================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:polygon", "value": ["-3.3, 4.4", "5.5, -6.6", "1.1, 2.2", "-3.3, 4.4"] } @@ -78,7 +78,7 @@ echo echo "03. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -88,12 +88,12 @@ echo "====================================================" payload='{ "contextElements": [ { - "type": "E", + "type": "T", "isPattern": "false", - "id": "E1", + "id": "E", "attributes": [ { - "name": "position", + "name": "location", "type": "geo:polygon", "value": ["7.7, 8.8", "9.9, -10.10", "3.3, 2.2", "7.7, 8.8"] } @@ -109,7 +109,7 @@ echo echo "05. Check location field is not broken in database" echo "==================================================" -mongoCmd ${CB_DB_NAME} 'db.entities.find()' | python ${SCRIPT_HOME}/jsonBeautifier.py +mongoCmd ${CB_DB_NAME} 'db.entities.find().toArray()' | python ${SCRIPT_HOME}/jsonBeautifier.py echo echo @@ -132,7 +132,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 199 +Content-Length: 198 { "contextResponses": [ @@ -140,14 +140,14 @@ Content-Length: 199 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:polygon", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -160,59 +160,61 @@ Content-Length: 199 03. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:polygon", - "value": [ - "-3.3, 4.4", - "5.5, -6.6", - "1.1, 2.2", - "-3.3, 4.4" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - [ - 4.4, - -3.3 - ], - [ - -6.6, - 5.5 - ], - [ - 2.2, - 1.1 - ], +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:polygon", + "value": [ + "-3.3, 4.4", + "5.5, -6.6", + "1.1, 2.2", + "-3.3, 4.4" + ] + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ [ - 4.4, - -3.3 + [ + 4.4, + -3.3 + ], + [ + -6.6, + 5.5 + ], + [ + 2.2, + 1.1 + ], + [ + 4.4, + -3.3 + ] ] - ] - ], - "type": "Polygon" - } - }, - "modDate": REGEX(\d+\.\d+) -} + ], + "type": "Polygon" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] 04. Update entity with geo:polygon with NGSIv1 (UPDATE) @@ -221,7 +223,7 @@ HTTP/1.1 200 OK Date: REGEX(.*) Fiware-Correlator: REGEX([0-9a-f\-]{36}) Content-Type: application/json -Content-Length: 199 +Content-Length: 198 { "contextResponses": [ @@ -229,14 +231,14 @@ Content-Length: 199 "contextElement": { "attributes": [ { - "name": "position", + "name": "location", "type": "geo:polygon", "value": "" } ], - "id": "E1", + "id": "E", "isPattern": "false", - "type": "E" + "type": "T" }, "statusCode": { "code": "200", @@ -249,59 +251,61 @@ Content-Length: 199 05. Check location field is not broken in database ================================================== -{ - "_id": { - "id": "E1", - "servicePath": "/", - "type": "E" - }, - "attrNames": [ - "position" - ], - "attrs": { - "position": { - "creDate": REGEX(\d+\.\d+), - "mdNames": [], - "modDate": REGEX(\d+\.\d+), - "type": "geo:polygon", - "value": [ - "7.7, 8.8", - "9.9, -10.10", - "3.3, 2.2", - "7.7, 8.8" - ] - } - }, - "creDate": REGEX(\d+\.\d+), - "lastCorrelator": "REGEX(.*)", - "location": { - "attrName": "position", - "coords": { - "coordinates": [ - [ - [ - 8.8, - 7.7 - ], - [ - -10.1, - 9.9 - ], - [ - 2.2, - 3.3 - ], +[ + { + "_id": { + "id": "E", + "servicePath": "/", + "type": "T" + }, + "attrNames": [ + "location" + ], + "attrs": { + "location": { + "creDate": REGEX(\d+\.\d+), + "mdNames": [], + "modDate": REGEX(\d+\.\d+), + "type": "geo:polygon", + "value": [ + "7.7, 8.8", + "9.9, -10.10", + "3.3, 2.2", + "7.7, 8.8" + ] + } + }, + "creDate": REGEX(\d+\.\d+), + "lastCorrelator": "REGEX(.*)", + "location": { + "attrName": "location", + "coords": { + "coordinates": [ [ - 8.8, - 7.7 + [ + 8.8, + 7.7 + ], + [ + -10.1, + 9.9 + ], + [ + 2.2, + 3.3 + ], + [ + 8.8, + 7.7 + ] ] - ] - ], - "type": "Polygon" - } - }, - "modDate": REGEX(\d+\.\d+) -} + ], + "type": "Polygon" + } + }, + "modDate": REGEX(\d+\.\d+) + } +] --TEARDOWN-- diff --git a/test/functionalTest/cases/3706_incorrect_location_processing/incorrect_location_processing.test b/test/functionalTest/cases/3706_incorrect_location_processing/incorrect_location_processing.test index 64e62982bd..ec5a7c49d2 100644 --- a/test/functionalTest/cases/3706_incorrect_location_processing/incorrect_location_processing.test +++ b/test/functionalTest/cases/3706_incorrect_location_processing/incorrect_location_processing.test @@ -239,9 +239,7 @@ doc='{ "modDate": 1603273111.6493506, "lastCorrelator": "2e7b6c36-1381-11eb-a1f0-0242ac110013" }' -# FIXME P3: not sure why mongCmd() doesn't work this time... maybe $doc is too long? -#mongoCmd ${CB_DB_NAME} "db.entities.insert($doc)" -echo "db.entities.insert($doc)" | mongo mongodb://localhost:27017/${CB_DB_NAME} | tail -n 2 | head -n 1 +mongoCmd ${CB_DB_NAME} "db.entities.insertOne($doc)" echo echo @@ -264,7 +262,7 @@ echo --REGEXPECT-- 01. Create entity directly in DB ================================ -WriteResult({ "nInserted" : 1 }) +{"acknowledged":true,"insertedId":{"id":"ES0021000001111111AA","type":"SupplyPoint","servicePath":"/energia"}} 02. Update the entity as described in #3706 and check we don't get 413 error diff --git a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test index 95d03e9ebd..59a65b45f0 100644 --- a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test +++ b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test @@ -353,8 +353,8 @@ Content-Length: 366 06. Get sub password pass1 from DB ================================== -user1 -pass1 +"user1" +"pass1" 07. PATCH sub changing password to user10 and pass10 @@ -407,8 +407,8 @@ Content-Length: 367 09. Get sub password pass10 from DB =================================== -user10 -pass10 +"user10" +"pass10" 10. PATCH sub removing auth parameters @@ -513,8 +513,8 @@ Content-Length: 366 15. Get sub password pass1 from DB ================================== -user1 -pass1 +"user1" +"pass1" --TEARDOWN-- diff --git a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test index 2b149a5221..f165102fb6 100644 --- a/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test +++ b/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test @@ -353,8 +353,8 @@ Content-Length: 360 06. Get sub password pass1 from DB ================================== -user1 -pass1 +"user1" +"pass1" 07. PATCH sub changing password to user10 and pass10 @@ -407,8 +407,8 @@ Content-Length: 361 09. Get sub password pass10 from DB =================================== -user10 -pass10 +"user10" +"pass10" 10. PATCH sub removing auth parameters @@ -513,8 +513,8 @@ Content-Length: 360 15. Get sub password pass1 from DB ================================== -user1 -pass1 +"user1" +"pass1" --TEARDOWN-- diff --git a/test/functionalTest/cases/4069_status_inactive_not_working_with_cache_in_ha/status_inactive_not_working_with_cache_in_ha.test b/test/functionalTest/cases/4069_status_inactive_not_working_with_cache_in_ha/status_inactive_not_working_with_cache_in_ha.test index 7940e619b1..971e0151e9 100644 --- a/test/functionalTest/cases/4069_status_inactive_not_working_with_cache_in_ha/status_inactive_not_working_with_cache_in_ha.test +++ b/test/functionalTest/cases/4069_status_inactive_not_working_with_cache_in_ha/status_inactive_not_working_with_cache_in_ha.test @@ -26,7 +26,7 @@ Status inactive was not working in HA scenario when cache is used --SHELL-INIT-- dbInit CB -mongoCmd ${CB_DB_NAME} 'db.csubs.insert({ +mongoCmd ${CB_DB_NAME} 'db.csubs.insertOne({ "_id" : ObjectId("620e0d04219c8378695c822b"), "expiration" : NumberLong("9223372036854775807"), "reference" : "http://localhost:1234", diff --git a/test/functionalTest/harnessFunctions.sh b/test/functionalTest/harnessFunctions.sh index 08df1697f3..d1de8a684d 100644 --- a/test/functionalTest/harnessFunctions.sh +++ b/test/functionalTest/harnessFunctions.sh @@ -145,7 +145,7 @@ function dbInit() fi dMsg "database to drop: <$db>" - echo 'db.dropDatabase()' | mongo mongodb://$host:$port/$db --quiet + mongosh mongodb://$host:$port/$db --eval 'db.dropDatabase()' --quiet } @@ -186,9 +186,9 @@ function dbList if [ "$name" != "" ] then - echo show dbs | mongo mongodb://$host:$port --quiet | grep "$name" | awk '{ print $1 }' + mongosh mongodb://$host:$port --eval 'show dbs' --quiet | grep "$name" | awk '{ print $1 }' else - echo show dbs | mongo mongodb://$host:$port --quiet | awk '{ print $1 }' + mongosh mongodb://$host:$port --eval 'show dbs' --quiet | awk '{ print $1 }' fi } @@ -212,7 +212,7 @@ function dbResetAll() port="27017" fi - all=$(echo show dbs | mongo mongodb://$host:$port --quiet | grep ftest | awk '{ print $1 }') + all=$(mongosh mongodb://$host:$port --eval 'show dbs' --quiet | grep ftest | awk '{ print $1 }') for db in $all do dbDrop $db @@ -1040,17 +1040,7 @@ function valgrindSleep() # ------------------------------------------------------------------------------ # -# mongoCmd - -# -# This functions is needed due to some problems with jenkins that seems to avoid -# the usage of 'mongo --quiet ...' directly. Thus, we need to use mongo without -# --quiet, but we need to get rid of some preamble lines about mongo version and -# connection information and a final 'bye' line -# -# NOTE: this will no longer work with new mongosh shell. Note that legacy shell -# (the 'mongo' command) has been deprecated in MongoDB 5.0 and removed in MongoDB 6.0. -# This function (and many .test using mongoCmd) would need fixing after stepping to -# MongoDB 6.0 +# mongoCmd - # function mongoCmd() { @@ -1066,35 +1056,12 @@ function mongoCmd() port="27017" fi - db=$1 - cmd=$2 - echo $cmd | mongo mongodb://$host:$port/$db | tail -n 2 | head -n 1 -} - - - -# ------------------------------------------------------------------------------ -# -# mongoCmdLong - like mongoCmd but showing all the output, not just the last line. -# Meant to be used in conjunction with 'grep' -# -function mongoCmdLong() -{ - host="${CB_DATABASE_HOST}" - if [ "$host" == "" ] - then - host="localhost" - fi - - port="${CB_DATABASE_PORT}" - if [ "$port" == "" ] - then - port="27017" - fi + # Why to use EJSON.stringfiy() instead of JSON.stringfly()? + # See https://stackoverflow.com/q/77678898/1485926 db=$1 - cmd=$2 - echo $cmd | mongo mongodb://$host:$port/$db + cmd="EJSON.stringify($2)" + mongosh mongodb://$host:$port/$db --eval "$cmd" --quiet } @@ -1158,7 +1125,7 @@ function dbInsertEntity() port="27017" fi - echo "$jsCode ; $ent ; $doc ; $cmd" | mongo mongodb://$host:$port/$db + mongosh mongodb://$host:$port/$db --eval "$jsCode ; $ent ; $doc ; $cmd" --quiet } @@ -1426,7 +1393,6 @@ export -f accumulator3Reset export -f orionCurl export -f dbInsertEntity export -f mongoCmd -export -f mongoCmdLong export -f vMsg export -f dMsg export -f valgrindSleep diff --git a/test/loadTest/cache_refresh/drop_database_mongo.sh b/test/loadTest/cache_refresh/drop_database_mongo.sh index 1857640035..1a4d50fad2 100644 --- a/test/loadTest/cache_refresh/drop_database_mongo.sh +++ b/test/loadTest/cache_refresh/drop_database_mongo.sh @@ -19,7 +19,7 @@ # # For those usages not covered by this license please contact with # iot_support at tid dot es -# author: 'Iván Arias León (ivan dot ariasleon at telefonica dot com)' +# author: 'Iván Arias León (ivan dot ariasleon at telefonica dot com)' if [ "$1" == "" ] then @@ -41,7 +41,7 @@ fi - +# FIXME: use mongosh instead of mongo dbs=(`(echo 'show databases' | mongo --host $host) | grep $prefix`) for db in ${dbs[@]}; do diff --git a/test/loadTest/perf/csub_clean.sh b/test/loadTest/perf/csub_clean.sh index 7d46460fe1..5701af6a86 100755 --- a/test/loadTest/perf/csub_clean.sh +++ b/test/loadTest/perf/csub_clean.sh @@ -19,4 +19,5 @@ # For those usages not covered by this license please contact with # iot_support at tid dot es +# FIXME: use mongosh instead of mongo echo 'db.csubs.drop()' | mongo --quiet orion diff --git a/test/valgrind/valgrindTestSuite.sh b/test/valgrind/valgrindTestSuite.sh index ee817af3cc..ce1501235c 100755 --- a/test/valgrind/valgrindTestSuite.sh +++ b/test/valgrind/valgrindTestSuite.sh @@ -103,7 +103,7 @@ function vMsg() # ----------------------------------------------------------------------------- # -# If any mongo database ftest-ftest exists, strange memory leaks appear ... +# If any MongoDB database ftest-ftest exists, strange memory leaks appear ... # So, before starting, it's important to remove all ftest DBs # function dbReset()