diff --git a/doc/manuals.jp/admin/cli.md b/doc/manuals.jp/admin/cli.md index bdc50ba14a..ceecf9ae7d 100644 --- a/doc/manuals.jp/admin/cli.md +++ b/doc/manuals.jp/admin/cli.md @@ -169,5 +169,4 @@ Orion は、環境変数を使用した引数の受け渡しをサポートし | ORION_DISABLE_METRICS | disableMetrics | | ORION_DISABLE_NGSIV1 | disableNgsiv1 | | ORION_INSECURE_NOTIF | insecureNotif | -| ORION_NGSIV1_AUTOCAST | ngsiv1Autocast | | ORION_MQTT_MAX_AGE | mqttMaxAge | diff --git a/doc/manuals/admin/cli.md b/doc/manuals/admin/cli.md index 0159a4e1a8..d66c9650c7 100644 --- a/doc/manuals/admin/cli.md +++ b/doc/manuals/admin/cli.md @@ -233,6 +233,5 @@ Two facts have to be taken into account: | ORION_DISABLE_METRICS | disableMetrics | | ORION_DISABLE_NGSIV1 | disableNgsiv1 | | ORION_INSECURE_NOTIF | insecureNotif | -| ORION_NGSIV1_AUTOCAST | ngsiv1Autocast | | ORION_MQTT_MAX_AGE | mqttMaxAge | | ORION_LOG_DEPRECATE | logDeprecate | diff --git a/docker/Dockerfile b/docker/Dockerfile index aac4d0b52f..5c4eb8c651 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -157,7 +157,7 @@ RUN --mount=type=secret,id=repo_token,dst=/run/secrets/repo_token \ WORKDIR / # Note we disable log file as docker container will output by stdout -ENTRYPOINT ["/usr/bin/contextBroker","-fg", "-multiservice", "-ngsiv1Autocast", "-disableFileLog" ] +ENTRYPOINT ["/usr/bin/contextBroker","-fg", "-multiservice", "-disableFileLog" ] EXPOSE 1026 LABEL "maintainer"="Orion Team. Telefónica I+D" diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index 884c9cf1ef..07d63a291e 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -170,7 +170,7 @@ RUN --mount=type=secret,id=repo_token,dst=/run/secrets/repo_token \ WORKDIR / # Note we disable log file as docker container will output by stdout -ENTRYPOINT ["/usr/bin/contextBroker","-fg", "-multiservice", "-ngsiv1Autocast", "-disableFileLog" ] +ENTRYPOINT ["/usr/bin/contextBroker","-fg", "-multiservice", "-disableFileLog" ] EXPOSE 1026 LABEL "maintainer"="Orion Team. Telefónica I+D" diff --git a/src/app/contextBroker/contextBroker.cpp b/src/app/contextBroker/contextBroker.cpp index 4edaa8a84f..481c04bf82 100644 --- a/src/app/contextBroker/contextBroker.cpp +++ b/src/app/contextBroker/contextBroker.cpp @@ -190,7 +190,6 @@ bool disableNgsiv1; bool disableFileLog; int reqTimeout; bool insecureNotif; -bool ngsiv1Autocast; bool fcEnabled; double fcGauge; @@ -348,8 +347,6 @@ PaArgument paArgs[] = { "-insecureNotif", &insecureNotif, "INSECURE_NOTIF", PaBool, PaOpt, false, false, true, INSECURE_NOTIF_DESC }, - { "-ngsiv1Autocast", &ngsiv1Autocast, "NGSIV1_AUTOCAST", PaBool, PaOpt, false, false, true, NGSIV1_AUTOCAST_DESC }, - { "-mqttMaxAge", &mqttMaxAge, "MQTT_MAX_AGE", PaInt, PaOpt, 60, PaNL, PaNL, MQTT_MAX_AGE_DESC }, { "-logDeprecate", &logDeprecate, "LOG_DEPRECATE", PaBool, PaOpt, false, false, true, LOG_DEPRECATE_DESC }, diff --git a/src/lib/common/globals.h b/src/lib/common/globals.h index 895c9692f1..75b81a01b4 100644 --- a/src/lib/common/globals.h +++ b/src/lib/common/globals.h @@ -207,7 +207,6 @@ extern bool checkIdv1; extern bool disableCusNotif; extern bool insecureNotif; -extern bool ngsiv1Autocast; extern unsigned long long inReqPayloadMaxSize; extern unsigned long long outReqMsgMaxSize; diff --git a/test/functionalTest/cases/0000_cli/bool_option_with_value.test b/test/functionalTest/cases/0000_cli/bool_option_with_value.test index 111fb8dde8..fcf79b16f3 100644 --- a/test/functionalTest/cases/0000_cli/bool_option_with_value.test +++ b/test/functionalTest/cases/0000_cli/bool_option_with_value.test @@ -93,7 +93,6 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-disableMetrics' (turn off the 'metrics' feature)] [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] [option '-insecureNotif' (allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates)] - [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations)] [option '-mqttMaxAge' ] [option '-logDeprecate' (log deprecation usages as warnings)] diff --git a/test/functionalTest/cases/0000_cli/command_line_options.test b/test/functionalTest/cases/0000_cli/command_line_options.test index f97b786889..8d2831c2fb 100644 --- a/test/functionalTest/cases/0000_cli/command_line_options.test +++ b/test/functionalTest/cases/0000_cli/command_line_options.test @@ -82,7 +82,6 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-disableMetrics' (turn off the 'metrics' feature)] [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] [option '-insecureNotif' (allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates)] - [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations)] [option '-mqttMaxAge' ] [option '-logDeprecate' (log deprecation usages as warnings)] diff --git a/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test b/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test index 8c92e4fffc..bd4a1e120b 100644 --- a/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test +++ b/test/functionalTest/cases/0000_cli/tracelevel_without_logLevel_as_DEBUG.test @@ -83,7 +83,6 @@ Usage: contextBroker [option '-U' (extended usage)] [option '-disableMetrics' (turn off the 'metrics' feature)] [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] [option '-insecureNotif' (allow HTTPS notifications to peers which certificate cannot be authenticated with known CA certificates)] - [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSIv1 update/create attribute operations)] [option '-mqttMaxAge' ] [option '-logDeprecate' (log deprecation usages as warnings)] diff --git a/test/functionalTest/cases/3112_ngsiv1_autocast/create_attributes_with_autocast.test.DISABLED b/test/functionalTest/cases/3112_ngsiv1_autocast/create_attributes_with_autocast.test.DISABLED deleted file mode 100644 index ad8aa4d3cc..0000000000 --- a/test/functionalTest/cases/3112_ngsiv1_autocast/create_attributes_with_autocast.test.DISABLED +++ /dev/null @@ -1,353 +0,0 @@ -# Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U -# -# This file is part of Orion Context Broker. -# -# Orion Context Broker is free software: you can redistribute it and/or -# modify it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Orion Context Broker is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -# General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -# -# For those usages not covered by this license please contact with -# iot_support at tid dot es - -# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh - ---NAME-- -Create attributes using NGSIv1 autocast functionality - ---SHELL-INIT-- -dbInit CB -brokerStart CB 0 IPV4 -ngsiv1Autocast - ---SHELL-- - -# -# 01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types -# 02. Get entity using NGSIv2 and check values are right -# 03. Append five new attributes with Quantity, Number, Boolean, DateTime and ISO8601 types -# 04. Get entity using NGSIv2 and check values are right -# -# Test is focused in updateContext operation. Note that we have several convenience operations -# in NGSIv1 to do attribute creation/update, but all them are the end are mapped internally -# to updateContext so focusing on it we get proper testing coverage - - -echo "01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types" -echo "============================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "-23" - }, - { - "name": "Q", - "type": "Quantity", - "value": "11.31" - }, - { - "name": "B", - "type": "Boolean", - "value": "true" - }, - { - "name": "D", - "type": "DateTime", - "value": "2016-01-12T15:25:00.000Z" - }, - { - "name": "I", - "type": "ISO8601", - "value": "2016-02-24T10:00:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "02. Get entity using NGSIv2 and check values are right " -echo "======================================================" -orionCurl --url /v2/entities/E -echo -echo - - -echo "03. Append five new attributes with Quantity, Number, Boolean, DateTime and ISO8601 types" -echo "=========================================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "N1", - "type": "Number", - "value": "11" - }, - { - "name": "Q1", - "type": "Quantity", - "value": "-41.31" - }, - { - "name": "B1", - "type": "Boolean", - "value": "false" - }, - { - "name": "D1", - "type": "DateTime", - "value": "2018-01-12T15:25:00.000Z" - }, - { - "name": "I1", - "type": "ISO8601", - "value": "2019-02-24T10:00:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "04. Get entity using NGSIv2 and check values are right " -echo "======================================================" -orionCurl --url /v2/entities/E -echo -echo - - ---REGEXPECT-- -01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types -============================================================================ -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 352 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "" - }, - { - "name": "Q", - "type": "Quantity", - "value": "" - }, - { - "name": "B", - "type": "Boolean", - "value": "" - }, - { - "name": "D", - "type": "DateTime", - "value": "" - }, - { - "name": "I", - "type": "ISO8601", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -02. Get entity using NGSIv2 and check values are right -====================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 316 - -{ - "B": { - "metadata": {}, - "type": "Boolean", - "value": true - }, - "D": { - "metadata": {}, - "type": "DateTime", - "value": "2016-01-12T15:25:00.000Z" - }, - "I": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-02-24T10:00:00.000Z" - }, - "N": { - "metadata": {}, - "type": "Number", - "value": -23 - }, - "Q": { - "metadata": {}, - "type": "Quantity", - "value": 11.31 - }, - "id": "E", - "type": "T" -} - - -03. Append five new attributes with Quantity, Number, Boolean, DateTime and ISO8601 types -========================================================================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 357 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "N1", - "type": "Number", - "value": "" - }, - { - "name": "Q1", - "type": "Quantity", - "value": "" - }, - { - "name": "B1", - "type": "Boolean", - "value": "" - }, - { - "name": "D1", - "type": "DateTime", - "value": "" - }, - { - "name": "I1", - "type": "ISO8601", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -04. Get entity using NGSIv2 and check values are right -====================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 617 - -{ - "B": { - "metadata": {}, - "type": "Boolean", - "value": true - }, - "B1": { - "metadata": {}, - "type": "Boolean", - "value": false - }, - "D": { - "metadata": {}, - "type": "DateTime", - "value": "2016-01-12T15:25:00.000Z" - }, - "D1": { - "metadata": {}, - "type": "DateTime", - "value": "2018-01-12T15:25:00.000Z" - }, - "I": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-02-24T10:00:00.000Z" - }, - "I1": { - "metadata": {}, - "type": "ISO8601", - "value": "2019-02-24T10:00:00.000Z" - }, - "N": { - "metadata": {}, - "type": "Number", - "value": -23 - }, - "N1": { - "metadata": {}, - "type": "Number", - "value": 11 - }, - "Q": { - "metadata": {}, - "type": "Quantity", - "value": 11.31 - }, - "Q1": { - "metadata": {}, - "type": "Quantity", - "value": -41.31 - }, - "id": "E", - "type": "T" -} - - ---TEARDOWN-- -brokerStop CB -dbDrop CB diff --git a/test/functionalTest/cases/3112_ngsiv1_autocast/filters_in_autocasted_attributes.test.DISABLED b/test/functionalTest/cases/3112_ngsiv1_autocast/filters_in_autocasted_attributes.test.DISABLED deleted file mode 100644 index c8fdb6a63c..0000000000 --- a/test/functionalTest/cases/3112_ngsiv1_autocast/filters_in_autocasted_attributes.test.DISABLED +++ /dev/null @@ -1,336 +0,0 @@ -# Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U -# -# This file is part of Orion Context Broker. -# -# Orion Context Broker is free software: you can redistribute it and/or -# modify it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Orion Context Broker is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -# General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -# -# For those usages not covered by this license please contact with -# iot_support at tid dot es - -# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh - ---NAME-- -Filtering on attribute values created with NGSIv1 autocast - ---SHELL-INIT-- -dbInit CB -brokerStart CB 0 IPV4 -ngsiv1Autocast - ---SHELL-- - -# -# 01. Create E1 entity, with attribute level = 70, date = 2016-01-12T15:25:00.000Z -# 02. Create E2 entity, with attribute level = 80, date = 2016-01-12T14:25:00.000Z -# 03. Create E3 entity, with attribute level = 90, date = 2016-01-12T13:25:00.000Z -# 04. Query level<85, get E1 and E2 -# 05. Query date<2016-01-12T15:00:00.000Z, get E2 and E3 -# -# Test is focused in updateContext operation. Note that we have several convenience operations -# in NGSIv1 to do attribute creation/update, but all them are the end are mapped internally -# to updateContext so focusing on it we get proper testing coverage - - -echo "01. Create E1 entity, with attribute level = 70, date = 20160112T15:25:00.000Z" -echo "==============================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E1", - "attributes": [ - { - "name": "level", - "type": "Number", - "value": "70" - }, - { - "name": "date", - "type": "ISO8601", - "value": "2016-01-12T15:25:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "02. Create E2 entity, with attribute level = 80, date = 2016-01-12T14:25:00.000Z" -echo "================================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E2", - "attributes": [ - { - "name": "level", - "type": "Number", - "value": "80" - }, - { - "name": "date", - "type": "ISO8601", - "value": "2016-01-12T14:25:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "03. Create E3 entity, with attribute level = 90, date = 2016-01-12T13:25:00.000Z" -echo "================================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E3", - "attributes": [ - { - "name": "level", - "type": "Number", - "value": "90" - }, - { - "name": "date", - "type": "ISO8601", - "value": "2016-01-12T13:25:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "04. Query level<85, get E1 and E2" -echo "=================================" -orionCurl --url '/v2/entities?q=level<85' -echo -echo - - -echo "05. Query date<2016-01-12T15:00:00.000Z, get E2 and E3" -echo "======================================================" -orionCurl --url '/v2/entities?q=date<2016-01-12T15:00:00.000Z' -echo -echo - - ---REGEXPECT-- -01. Create E1 entity, with attribute level = 70, date = 20160112T15:25:00.000Z -============================================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 235 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "level", - "type": "Number", - "value": "" - }, - { - "name": "date", - "type": "ISO8601", - "value": "" - } - ], - "id": "E1", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -02. Create E2 entity, with attribute level = 80, date = 2016-01-12T14:25:00.000Z -================================================================================ -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 235 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "level", - "type": "Number", - "value": "" - }, - { - "name": "date", - "type": "ISO8601", - "value": "" - } - ], - "id": "E2", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -03. Create E3 entity, with attribute level = 90, date = 2016-01-12T13:25:00.000Z -================================================================================ -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 235 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "level", - "type": "Number", - "value": "" - }, - { - "name": "date", - "type": "ISO8601", - "value": "" - } - ], - "id": "E3", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -04. Query level<85, get E1 and E2 -================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 299 - -[ - { - "date": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-01-12T15:25:00.000Z" - }, - "id": "E1", - "level": { - "metadata": {}, - "type": "Number", - "value": 70 - }, - "type": "T" - }, - { - "date": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-01-12T14:25:00.000Z" - }, - "id": "E2", - "level": { - "metadata": {}, - "type": "Number", - "value": 80 - }, - "type": "T" - } -] - - -05. Query date<2016-01-12T15:00:00.000Z, get E2 and E3 -====================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 299 - -[ - { - "date": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-01-12T14:25:00.000Z" - }, - "id": "E2", - "level": { - "metadata": {}, - "type": "Number", - "value": 80 - }, - "type": "T" - }, - { - "date": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-01-12T13:25:00.000Z" - }, - "id": "E3", - "level": { - "metadata": {}, - "type": "Number", - "value": 90 - }, - "type": "T" - } -] - - ---TEARDOWN-- -brokerStop CB -dbDrop CB diff --git a/test/functionalTest/cases/3112_ngsiv1_autocast/update_attributes_with_autocast.test.DISABLED b/test/functionalTest/cases/3112_ngsiv1_autocast/update_attributes_with_autocast.test.DISABLED deleted file mode 100644 index fd1f23ed88..0000000000 --- a/test/functionalTest/cases/3112_ngsiv1_autocast/update_attributes_with_autocast.test.DISABLED +++ /dev/null @@ -1,328 +0,0 @@ -# Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U -# -# This file is part of Orion Context Broker. -# -# Orion Context Broker is free software: you can redistribute it and/or -# modify it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Orion Context Broker is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -# General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -# -# For those usages not covered by this license please contact with -# iot_support at tid dot es - -# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh - ---NAME-- -Update attributes using NGSIv1 autocast functionality - ---SHELL-INIT-- -dbInit CB -brokerStart CB 0 IPV4 -ngsiv1Autocast - ---SHELL-- - -# -# 01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types but with 'wrong' values -# 02. Get entity using NGSIv2 and check values (all strings) -# 03. Update attributes with 'right' Quantity, Number, Boolean, DateTime and ISO8601 values -# 04. Get entity using NGSIv2 and check values (right types) -# -# Test is focused in updateContext operation. Note that we have several convenience operations -# in NGSIv1 to do attribute creation/update, but all them are the end are mapped internally -# to updateContext so focusing on it we get proper testing coverage - - -echo "01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types but with 'wrong' values" -echo "====================================================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "-2x3" - }, - { - "name": "Q", - "type": "Quantity", - "value": "11,,31" - }, - { - "name": "B", - "type": "Boolean", - "value": "truex" - }, - { - "name": "D", - "type": "DateTime", - "value": "20160112T15:25:00.000Z" - }, - { - "name": "I", - "type": "ISO8601", - "value": "year-02-24T10:00:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "02. Get entity using NGSIv2 and check values (all strings)" -echo "==========================================================" -orionCurl --url /v2/entities/E -echo -echo - - -echo "03. Update attributes with 'right' Quantity, Number, Boolean, DateTime and ISO8601 values" -echo "=========================================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "11" - }, - { - "name": "Q", - "type": "Quantity", - "value": "-41.31" - }, - { - "name": "B", - "type": "Boolean", - "value": "false" - }, - { - "name": "D", - "type": "DateTime", - "value": "2018-01-12T15:25:00.000Z" - }, - { - "name": "I", - "type": "ISO8601", - "value": "2019-02-24T10:00:00.000Z" - } - ] - } - ], - "updateAction": "UPDATE" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "04. Get entity using NGSIv2 and check values (right types)" -echo "==========================================================" -orionCurl --url /v2/entities/E -echo -echo - - ---REGEXPECT-- -01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types but with 'wrong' values -==================================================================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 352 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "" - }, - { - "name": "Q", - "type": "Quantity", - "value": "" - }, - { - "name": "B", - "type": "Boolean", - "value": "" - }, - { - "name": "D", - "type": "DateTime", - "value": "" - }, - { - "name": "I", - "type": "ISO8601", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -02. Get entity using NGSIv2 and check values (all strings) -========================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 323 - -{ - "B": { - "metadata": {}, - "type": "Boolean", - "value": "truex" - }, - "D": { - "metadata": {}, - "type": "DateTime", - "value": "20160112T15:25:00.000Z" - }, - "I": { - "metadata": {}, - "type": "ISO8601", - "value": "year-02-24T10:00:00.000Z" - }, - "N": { - "metadata": {}, - "type": "Number", - "value": "-2x3" - }, - "Q": { - "metadata": {}, - "type": "Quantity", - "value": "11,,31" - }, - "id": "E", - "type": "T" -} - - -03. Update attributes with 'right' Quantity, Number, Boolean, DateTime and ISO8601 values -========================================================================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 352 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "" - }, - { - "name": "Q", - "type": "Quantity", - "value": "" - }, - { - "name": "B", - "type": "Boolean", - "value": "" - }, - { - "name": "D", - "type": "DateTime", - "value": "" - }, - { - "name": "I", - "type": "ISO8601", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -04. Get entity using NGSIv2 and check values (right types) -========================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 317 - -{ - "B": { - "metadata": {}, - "type": "Boolean", - "value": false - }, - "D": { - "metadata": {}, - "type": "DateTime", - "value": "2018-01-12T15:25:00.000Z" - }, - "I": { - "metadata": {}, - "type": "ISO8601", - "value": "2019-02-24T10:00:00.000Z" - }, - "N": { - "metadata": {}, - "type": "Number", - "value": 11 - }, - "Q": { - "metadata": {}, - "type": "Quantity", - "value": -41.31 - }, - "id": "E", - "type": "T" -} - - ---TEARDOWN-- -brokerStop CB -dbDrop CB diff --git a/test/functionalTest/cases/3112_ngsiv1_autocast/update_only_value_with_autocast.test.DISABLED b/test/functionalTest/cases/3112_ngsiv1_autocast/update_only_value_with_autocast.test.DISABLED deleted file mode 100644 index 6a8357c484..0000000000 --- a/test/functionalTest/cases/3112_ngsiv1_autocast/update_only_value_with_autocast.test.DISABLED +++ /dev/null @@ -1,507 +0,0 @@ -# Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U -# -# This file is part of Orion Context Broker. -# -# Orion Context Broker is free software: you can redistribute it and/or -# modify it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Orion Context Broker is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -# General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -# -# For those usages not covered by this license please contact with -# iot_support at tid dot es - -# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh - ---NAME-- -Update only value in attributes using NGSIv1 autocast functionality - ---SHELL-INIT-- -dbInit CB -brokerStart CB 0 IPV4 -ngsiv1Autocast - ---SHELL-- - -# -# 01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types -# 02. Get entity using NGSIv2 and check values are right -# 03. Update only the value of the Quantity -# 04. Update only the value of the Number -# 05. Update only the value of the Boolean -# 06. Update only the value of the DateTime -# 07. Update only the value of the ISO8601 -# 08. Get entity using NGSIv2 and check values are right -# -# Test is focused in updateContext operation. Note that we have several convenience operations -# in NGSIv1 to do attribute creation/update, but all them are the end are mapped internally -# to updateContext so focusing on it we get proper testing coverage - - -echo "01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types" -echo "============================================================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "-23" - }, - { - "name": "Q", - "type": "Quantity", - "value": "11.31" - }, - { - "name": "B", - "type": "Boolean", - "value": "true" - }, - { - "name": "D", - "type": "DateTime", - "value": "2016-01-12T15:25:00.000Z" - }, - { - "name": "I", - "type": "ISO8601", - "value": "2016-02-24T10:00:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "02. Get entity using NGSIv2 and check types are right " -echo "=====================================================" -orionCurl --url /v2/entities/E -echo -echo - - -echo "03. Update only the value of the Quantity" -echo "=========================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "Q", - "value": "-42" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "04. Update only the value of the Number" -echo "=======================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "N", - "value": "2.22" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "05. Update only the value of the Boolean" -echo "========================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "B", - "value": "false" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "06. Update only the value of the DateTime" -echo "=========================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "D", - "value": "2010-01-12T15:25:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "07 Update only the value of the ISO8601" -echo "=======================================" -payload='{ - "contextElements": [ - { - "type": "T", - "id": "E", - "attributes": [ - { - "name": "I", - "value": "2008-01-12T15:25:00.000Z" - } - ] - } - ], - "updateAction": "APPEND" -}' -orionCurl --url /v1/updateContext --payload "$payload" -echo -echo - - -echo "08. Get entity using NGSIv2 and check types are right " -echo "=====================================================" -orionCurl --url /v2/entities/E -echo -echo - - ---REGEXPECT-- -01. Create entity with Quantity, Number, Boolean, DateTime and ISO8601 types -============================================================================ -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 352 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "N", - "type": "Number", - "value": "" - }, - { - "name": "Q", - "type": "Quantity", - "value": "" - }, - { - "name": "B", - "type": "Boolean", - "value": "" - }, - { - "name": "D", - "type": "DateTime", - "value": "" - }, - { - "name": "I", - "type": "ISO8601", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -02. Get entity using NGSIv2 and check types are right -===================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 316 - -{ - "B": { - "metadata": {}, - "type": "Boolean", - "value": true - }, - "D": { - "metadata": {}, - "type": "DateTime", - "value": "2016-01-12T15:25:00.000Z" - }, - "I": { - "metadata": {}, - "type": "ISO8601", - "value": "2016-02-24T10:00:00.000Z" - }, - "N": { - "metadata": {}, - "type": "Number", - "value": -23 - }, - "Q": { - "metadata": {}, - "type": "Quantity", - "value": 11.31 - }, - "id": "E", - "type": "T" -} - - -03. Update only the value of the Quantity -========================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 180 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "Q", - "type": "", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -04. Update only the value of the Number -======================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 180 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "N", - "type": "", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -05. Update only the value of the Boolean -======================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 180 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "B", - "type": "", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -06. Update only the value of the DateTime -========================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 180 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "D", - "type": "", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -07 Update only the value of the ISO8601 -======================================= -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 180 - -{ - "contextResponses": [ - { - "contextElement": { - "attributes": [ - { - "name": "I", - "type": "", - "value": "" - } - ], - "id": "E", - "isPattern": "false", - "type": "T" - }, - "statusCode": { - "code": "200", - "reasonPhrase": "OK" - } - } - ] -} - - -08. Get entity using NGSIv2 and check types are right -===================================================== -HTTP/1.1 200 OK -Date: REGEX(.*) -Fiware-Correlator: REGEX([0-9a-f\-]{36}) -Content-Type: application/json -Content-Length: 316 - -{ - "B": { - "metadata": {}, - "type": "Boolean", - "value": false - }, - "D": { - "metadata": {}, - "type": "DateTime", - "value": "2010-01-12T15:25:00.000Z" - }, - "I": { - "metadata": {}, - "type": "ISO8601", - "value": "2008-01-12T15:25:00.000Z" - }, - "N": { - "metadata": {}, - "type": "Number", - "value": 2.22 - }, - "Q": { - "metadata": {}, - "type": "Quantity", - "value": -42 - }, - "id": "E", - "type": "T" -} - - ---TEARDOWN-- -brokerStop CB -dbDrop CB diff --git a/test/functionalTest/cases/3658_env_vars/env_vars.test b/test/functionalTest/cases/3658_env_vars/env_vars.test index 60222b9c14..bf1f8d3c1e 100644 --- a/test/functionalTest/cases/3658_env_vars/env_vars.test +++ b/test/functionalTest/cases/3658_env_vars/env_vars.test @@ -128,7 +128,6 @@ Extended Usage: contextBroker [option '-U' (extended usage)] [option '-disableMetrics' (turn off the 'metrics' feature)] ORION_DISABLE_METRICS FALSE /FALSE/ [option '-disableNgsiv1' (turn off NGSIv1 request endpoints)] ORION_DISABLE_NGSIV1 FALSE /FALSE/ [option '-insecureNotif' (allow HTTPS notifications to peers which certificate c] ORION_INSECURE_NOTIF FALSE /FALSE/ - [option '-ngsiv1Autocast' (automatic cast for number, booleans and dates in NGSI] ORION_NGSIV1_AUTOCAST FALSE /FALSE/ [option '-mqttMaxAge'