Skip to content

Commit

Permalink
Merge pull request #3294 from telefonicaid/hardening/2525_2506_missin…
Browse files Browse the repository at this point in the history
…g_tests

Add missing ftest for #2425 and #2506
  • Loading branch information
AlvaroVega committed Sep 14, 2018
2 parents e95d052 + 4cff1ea commit 71eb582
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGES_NEXT_RELEASE
Expand Up @@ -2,7 +2,7 @@
- Hardening: Mongo driver now compiled using --use-sasl-client --ssl to enable proper DB authentication mechanisms
- Fix: correct error payload using errorCode (previously orionError was used) in POST /v1/queryContext and POST /v1/updateContext in some cases
- Fix: bug in metadata compound value rendering in NGSIv2 (sometimes "toplevel" key was wrongly inserted in the resulting JSON object)
- Fix: righ processing of JSON special characteres (such as \n) in NGSIv2 rendering (#3280)
- Fix: correct processing of JSON special characters (such as \n) in NGSIv2 rendering (#3280)
- Hardening: modification of the URL parsing mechanism, making it more efficient, and the source code easier to follow (#3109, step 1)
- Hardening: refactor NGSIv2 rendering code (throughput increase up to 33%/365% in entities/subscriptions rendering intensive scenarios) (#1298)
- Fix: Missing or empty metadata values were not allowed in NGSIv2 create/update operations (#3121)
Expand Down
2 changes: 1 addition & 1 deletion rpm/SPECS/contextBroker.spec
Expand Up @@ -178,7 +178,7 @@ fi
- Add: transient entities functionality (new NGSIv2 builtin attribute: dateExpires) (#3000)
- Add: "attrs" field in POST /v2/op/query (making "attributes" obsolete) (#2604)
- Add: "expression" field in POST /v2/op/query (#2706)
- Fix: large integer wrong rendering in responses (#2603)
- Fix: large integer wrong rendering in responses (#2603, #2425, #2506)
- Remove: "scopes" field in POST /v2/op/query (#2706)

* Fri Jun 15 2018 Fermin Galan <fermin.galanmarquez@telefonica.com> 1.14.0-1
Expand Down
Expand Up @@ -37,8 +37,6 @@ accumulatorStart
# 04. Update E1 temperature: 34.1234567 (7 decimals)
# 05. Dump accumulator, see 3 notifications, all of them with the correct number of decimals
#
# FIXME #2425: step 4 is not working fine and will be fixed when this issue is solved
#

echo "01. Create subscription with custom notification"
echo "================================================"
Expand Down Expand Up @@ -170,15 +168,15 @@ Fiware-Correlator: REGEX([0-9a-f\-]{36})
The temperature is 34.4 degrees=======================================
POST http://127.0.0.1:REGEX(\d+)/notify
Fiware-Servicepath: /
Content-Length: 39
Content-Length: 37
User-Agent: orion/REGEX(\d+\.\d+\.\d+.*)
Ngsiv2-Attrsformat: custom
Host: 127.0.0.1:REGEX(\d+)
Accept: application/json
Content-Type: text/plain
Fiware-Correlator: REGEX([0-9a-f\-]{36})

The temperature is 34.123456700 degrees=======================================
The temperature is 34.1234567 degrees=======================================


--TEARDOWN--
Expand Down
@@ -0,0 +1,83 @@
# 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--
Test to check the fix for precission lost in large integers

--SHELL-INIT--
dbInit CB
brokerStart CB

--SHELL--

#
# 01. Create entity with large integer 2523232323232323
# 02. Get entity a see integer 2523232323232323
#

echo "01. Create entity with large integer 2523232323232323"
echo "====================================================="
payload='{
"id": "E",
"type": "T",
"A": {
"value": 2523232323232323,
"type": "Number"
}
}'
orionCurl --url /v2/entities --payload "$payload"
echo
echo


echo "02. Get entity a see integer 2523232323232323"
echo "============================================="
orionCurl --url /v2/entities/E --noPayloadCheck
echo
echo


--REGEXPECT--
01. Create entity with large integer 2523232323232323
=====================================================
HTTP/1.1 201 Created
Content-Length: 0
Location: /v2/entities/E?type=T
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)



02. Get entity a see integer 2523232323232323
=============================================
HTTP/1.1 200 OK
Content-Length: 82
Content-Type: application/json
Fiware-Correlator: REGEX([0-9a-f\-]{36})
Date: REGEX(.*)

{"id":"E","type":"T","A":{"type":"Number","value":2523232323232323,"metadata":{}}}


--TEARDOWN--
brokerStop CB
dbDrop CB
Expand Up @@ -21,7 +21,7 @@
# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh

--NAME--
Right processing of JSON special characteres
Correct processing of JSON special characters

--SHELL-INIT--
dbInit CB
Expand Down
1 change: 0 additions & 1 deletion test/functionalTest/testHarness.sh
Expand Up @@ -35,7 +35,6 @@ echo $testStartTime > /tmp/brokerStartCounter
#
DISABLED=('test/functionalTest/cases/1156_qfilters_and_compounds/qfilters_and_compounds_equals_null.test' \
'test/functionalTest/cases/0000_bad_requests/exit.test' \
'test/functionalTest/cases/2207_not_spurious_decimals_in_custom_notifications/not_spurious_decimals_in_custom_notifications.test' \
'test/functionalTest/cases/0917_queryContext_behaves_differently/query_with_and_without_forwarding.test' \
'test/functionalTest/cases/0000_ipv6_support/ipv4_only.test' \
'test/functionalTest/cases/0000_ipv6_support/ipv6_only.test' \
Expand Down

0 comments on commit 71eb582

Please sign in to comment.