From 009b913754dd0cbf795ae699bac50ab1bb7ced54 Mon Sep 17 00:00:00 2001 From: Ken Zangelin Date: Sun, 24 Sep 2023 10:54:00 +0200 Subject: [PATCH] Added mongodb info in a functest to debug what's happening in github actions --- .../ngsild_GET_with_keyValues.test | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/test/functionalTest/cases/0000_ngsild/ngsild_GET_with_keyValues.test b/test/functionalTest/cases/0000_ngsild/ngsild_GET_with_keyValues.test index 0557927cb5..828f6f9e78 100644 --- a/test/functionalTest/cases/0000_ngsild/ngsild_GET_with_keyValues.test +++ b/test/functionalTest/cases/0000_ngsild/ngsild_GET_with_keyValues.test @@ -31,6 +31,7 @@ orionldStart CB # # 01. Create an entity with attributes P1-P5 +# 02. See the entity in mongo # 02. GET the entity with options=keyValues # 03. GET attributes P1 and P4 with options=keyValues # 04. GET all entities with options=keyValues @@ -68,6 +69,12 @@ echo echo +echo "02. See the entity in mongo" +echo "===========================" +mongoCmd2 ftest "db.entities.findOne()" +echo +echo + echo "02. GET the entity with options=keyValues" echo "=========================================" @@ -76,6 +83,13 @@ echo echo +echo "02. GET all entities" +echo "====================" +orionCurl --url /ngsi-ld/v1/entities?local=true +echo +echo + + echo "03. GET attributes P1 and P4 with options=keyValues" echo "===================================================" orionCurl --url '/ngsi-ld/v1/entities/urn:ngsi-ld:T:2018-11-22T10:00:00?prettyPrint=yes&spaces=2&options=keyValues&attrs=P1,P4' --noPayloadCheck @@ -100,6 +114,75 @@ Location: /ngsi-ld/v1/entities/urn:ngsi-ld:T:2018-11-22T10:00:00 +02. See the entity in mongo +=========================== +MongoDB shell version REGEX(.*) +connecting to: REGEX(.*) +MongoDB server version: REGEX(.*) +{ + "_id" : { + "id" : "urn:ngsi-ld:T:2018-11-22T10:00:00", + "type" : "https://uri.etsi.org/ngsi-ld/default-context/T", + "servicePath" : "/" + }, + "attrNames" : [ + "https://uri.etsi.org/ngsi-ld/default-context/P1", + "https://uri.etsi.org/ngsi-ld/default-context/P2", + "https://uri.etsi.org/ngsi-ld/default-context/P3", + "https://uri.etsi.org/ngsi-ld/default-context/P4", + "https://uri.etsi.org/ngsi-ld/default-context/P5" + ], + "attrs" : { + "https://uri=etsi=org/ngsi-ld/default-context/P1" : { + "type" : "Property", + "creDate" : REGEX(.*), + "modDate" : REGEX(.*), + "value" : 1, + "mdNames" : [ ] + }, + "https://uri=etsi=org/ngsi-ld/default-context/P2" : { + "type" : "Property", + "creDate" : REGEX(.*), + "modDate" : REGEX(.*), + "value" : "Stringeling", + "mdNames" : [ ] + }, + "https://uri=etsi=org/ngsi-ld/default-context/P3" : { + "type" : "Property", + "creDate" : REGEX(.*), + "modDate" : REGEX(.*), + "value" : true, + "mdNames" : [ ] + }, + "https://uri=etsi=org/ngsi-ld/default-context/P4" : { + "type" : "Property", + "creDate" : REGEX(.*), + "modDate" : REGEX(.*), + "value" : { + "a" : 1, + "b" : "2" + }, + "mdNames" : [ ] + }, + "https://uri=etsi=org/ngsi-ld/default-context/P5" : { + "type" : "Property", + "creDate" : REGEX(.*), + "modDate" : REGEX(.*), + "value" : [ + 1, + 2, + 3 + ], + "mdNames" : [ ] + } + }, + "creDate" : REGEX(.*), + "modDate" : REGEX(.*), + "lastCorrelator" : "" +} +bye + + 02. GET the entity with options=keyValues ========================================= HTTP/1.1 200 OK @@ -127,6 +210,49 @@ Link: ; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" + +[ + { + "P1": { + "type": "Property", + "value": 1 + }, + "P2": { + "type": "Property", + "value": "Stringeling" + }, + "P3": { + "type": "Property", + "value": true + }, + "P4": { + "type": "Property", + "value": { + "a": 1, + "b": "2" + } + }, + "P5": { + "type": "Property", + "value": [ + 1, + 2, + 3 + ] + }, + "id": "urn:ngsi-ld:T:2018-11-22T10:00:00", + "type": "T" + } +] + + 03. GET attributes P1 and P4 with options=keyValues =================================================== HTTP/1.1 200 OK