-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1780 from telefonicaid/bug/1764_long_servicepath_…
…component Fix error with long servicepath component
- Loading branch information
Showing
3 changed files
with
164 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
...functionalTest/cases/1764_long_servicepath_component/1764_long_servicepath_component.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
# Copyright 2016 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-- | ||
Bug long servicepath component created, but not accesible | ||
|
||
--SHELL-INIT-- | ||
dbInit CB | ||
brokerStart CB | ||
|
||
--SHELL-- | ||
|
||
# | ||
# 01. POST /v2/entities to create entity | ||
# 02. GET /v2/entities | ||
# 03. PUT /v2/entities | ||
# 04. DELETE /v2/entities | ||
# | ||
|
||
SP_LONG=/F_n_F4elhADVuCbEK4DDXlmi8lcV1b81OIhOpiubSD2jO6BZGM/9WNRpTC7Citc4c3qPbrHBUB7YhMxr1jenFM3JMhBHshBT5PcKl/2UAwWWAKBHI_0zU7sLfjozmcyhEcVle2c6mHQFZFkvswiyH2nb/6QaTP24vcPf4GozreIJnqZUN7WHYoOoCLz2dcgdVUOJ3sdiIh3/uf8uPlJanFCgkSiYnPwzTbIMc637zTK2ND_MsBK9BwMcEbQ9Xr/au_RXEqbjEMNRIelgPjosLpV_ZZ_JZqBg0UC1L8wlbsgYPLQEc/knywh8I1Ke41Cs1rcT4AZfoI0F6EsGyuVcgJTP3VJRqpRfTv7j/HTbaBPgyw4Z94_kzb40tCMzAWzYnerChJQmMeGND_kX6zXnBAO/QjyQLjX3OPyApIg0s4nwAqFGIoGmytUVOt2k4o0qpWNqvwxufg/RtEgL9yEQBp1wSX4bYwze7kf_BMh0sISAJBPNFnH5c9r6ydxsX | ||
|
||
echo "01. POST /v2/entities to create entity" | ||
echo "======================================" | ||
payload='{ | ||
"id": "8787GHY", | ||
"type": "Car", | ||
"brand":{ | ||
"type": "string", | ||
"value": "Mercedes Benz" | ||
}, | ||
"speed":{ | ||
"type": "number", | ||
"value" : "150" | ||
}, | ||
"plateCountry": { | ||
"value" : "ES" | ||
}, | ||
"madeInCountry": { | ||
"value" : "DE", | ||
"type" : "" | ||
}, | ||
"model" : { | ||
"type": "myString", | ||
"value" : "Klasse C" | ||
} | ||
}' | ||
orionCurl --url /v2/entities --payload "$payload" --servicePath "$SP_LONG" --json | ||
echo | ||
echo | ||
|
||
|
||
echo "02. GET /v2/entities/8787GHY" | ||
echo "============================" | ||
orionCurl --url "/v2/entities/8787GHY" --servicePath "$SP_LONG" --json | ||
echo | ||
echo | ||
|
||
|
||
echo "03. PUT /v2/entities/8787GHY/attrs/speed" | ||
echo "========================================" | ||
payload='{ | ||
"value" : "999" | ||
}' | ||
orionCurl --url "/v2/entities/8787GHY/attrs/speed" --payload "$payload" --servicePath "$SP_LONG" --json -X PUT | ||
echo | ||
echo | ||
|
||
|
||
echo "04. DELETE /v2/entities/8787GHY" | ||
echo "===============================" | ||
orionCurl --url "/v2/entities/8787GHY" --servicePath "$SP_LONG" --json -X DELETE | ||
echo | ||
echo | ||
|
||
|
||
--REGEXPECT-- | ||
01. POST /v2/entities to create entity | ||
====================================== | ||
HTTP/1.1 201 Created | ||
Content-Length: 0 | ||
Location: /v2/entities/8787GHY | ||
Date: REGEX(.*) | ||
|
||
|
||
|
||
02. GET /v2/entities/8787GHY | ||
============================ | ||
HTTP/1.1 200 OK | ||
Content-Length: 321 | ||
Content-Type: application/json | ||
Date: REGEX(.*) | ||
|
||
{ | ||
"brand": { | ||
"metadata": {}, | ||
"type": "string", | ||
"value": "Mercedes Benz" | ||
}, | ||
"id": "8787GHY", | ||
"madeInCountry": { | ||
"metadata": {}, | ||
"type": null, | ||
"value": "DE" | ||
}, | ||
"model": { | ||
"metadata": {}, | ||
"type": "myString", | ||
"value": "Klasse C" | ||
}, | ||
"plateCountry": { | ||
"metadata": {}, | ||
"type": null, | ||
"value": "ES" | ||
}, | ||
"speed": { | ||
"metadata": {}, | ||
"type": "number", | ||
"value": "150" | ||
}, | ||
"type": "Car" | ||
} | ||
|
||
|
||
03. PUT /v2/entities/8787GHY/attrs/speed | ||
======================================== | ||
HTTP/1.1 204 No Content | ||
Content-Length: 0 | ||
Date: REGEX(.*) | ||
|
||
|
||
|
||
04. DELETE /v2/entities/8787GHY | ||
=============================== | ||
HTTP/1.1 204 No Content | ||
Content-Length: 0 | ||
Date: REGEX(.*) | ||
|
||
|
||
|
||
--TEARDOWN-- | ||
brokerStop CB | ||
dbDrop CB |