Skip to content

Commit

Permalink
Added a CLI option to set the broker's trace levels + Added a few ste…
Browse files Browse the repository at this point in the history
…ps in a functest to test pre-expanded entity types in GET /entities
  • Loading branch information
kzangeli committed May 11, 2023
1 parent 75a096c commit 128c4f5
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
90 changes: 90 additions & 0 deletions test/functionalTest/cases/0000_ngsild/ngsild_entities_get.test
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ orionldStart CB
# 10. GET all entities with id E.* with count and limit==0 - see empty array and count==4
# 11. GET all entities of type T with options=sysAttrs set, see E1 and E3, with createdAt/modifiedAt present
# 12. GET ALL LOCAL entities
# 13. GET all entities using an pre-expanded type for T
# 14. GET all entities using an pre-expanded type for T that is url-encoded manually
#

echo "01. POST /ngsi-ld/v1/entities::http://a.b.c/entity/E1, with test context, and type T"
Expand Down Expand Up @@ -180,6 +182,20 @@ echo
echo


echo "13. GET all entities using an pre-expanded type for T"
echo "====================================================="
orionCurl --url '/ngsi-ld/v1/entities?type=http://example.org/T&prettyPrint=yes' --noPayloadCheck -H 'Link: <https://fiware.github.io/NGSI-LD_TestSuite/ldContext/testContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
echo
echo


echo "14. GET all entities using an pre-expanded type for T that is url-encoded manually"
echo "=================================================================================="
orionCurl --url '/ngsi-ld/v1/entities?type=http%3A%2F%2Fexample.org/T&prettyPrint=yes' --noPayloadCheck -H 'Link: <https://fiware.github.io/NGSI-LD_TestSuite/ldContext/testContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"'
echo
echo


--REGEXPECT--
01. POST /ngsi-ld/v1/entities::http://a.b.c/entity/E1, with test context, and type T
====================================================================================
Expand Down Expand Up @@ -520,6 +536,80 @@ Date: REGEX(.*)



13. GET all entities using an pre-expanded type for T
=====================================================
HTTP/1.1 200 OK
Content-Length: 435
Content-Type: application/json
Date: REGEX(.*)
Link: <https://fiware.github.io/NGSI-LD_TestSuite/ldContext/testContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"

[
{
"id": "http://a.b.c/entity/E1",
"type": "T",
"P1": {
"type": "Property",
"value": "E1"
},
"R1": {
"type": "Relationship",
"object": "http://a.b.c/entity/E1"
}
},
{
"id": "http://a.b.c/entity/E3",
"type": "T",
"P1": {
"type": "Property",
"value": "E3"
},
"R1": {
"type": "Relationship",
"object": "http://a.b.c/entity/E3"
}
}
]



14. GET all entities using an pre-expanded type for T that is url-encoded manually
==================================================================================
HTTP/1.1 200 OK
Content-Length: 435
Content-Type: application/json
Date: REGEX(.*)
Link: <https://fiware.github.io/NGSI-LD_TestSuite/ldContext/testContext.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"

[
{
"id": "http://a.b.c/entity/E1",
"type": "T",
"P1": {
"type": "Property",
"value": "E1"
},
"R1": {
"type": "Relationship",
"object": "http://a.b.c/entity/E1"
}
},
{
"id": "http://a.b.c/entity/E3",
"type": "T",
"P1": {
"type": "Property",
"value": "E3"
},
"R1": {
"type": "Relationship",
"object": "http://a.b.c/entity/E3"
}
}
]



--TEARDOWN--
brokerStop CB
dbDrop CB
2 changes: 2 additions & 0 deletions test/functionalTest/testHarness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ function usage()
empty=$(echo $sfile | tr 'a-zA-z/0-9.:' ' ')
echo "$sfile [-u (usage)]"
echo "$empty [-v (verbose)]"
echo "$empty [-t (trace level for broker)]"
echo "$empty [--loud (loud - see travis extra info)]"
echo "$empty [-ld (only ngsild tests)]"
echo "$empty [-troe (only ngsild TRoE (Temporal Representation of Entities) tests)]"
Expand Down Expand Up @@ -434,6 +435,7 @@ while [ "$#" != 0 ]
do
if [ "$1" == "-u" ]; then usage 0;
elif [ "$1" == "-v" ]; then verbose=on;
elif [ "$1" == "-t" ]; then export CB_TRACELEVELS="$2"; shift;
elif [ "$1" == "-ld" ]; then ngsild=on;
elif [ "$1" == "-troe" ]; then troe=on;
elif [ "$1" == "-eb" ]; then externalBroker=ON;
Expand Down

0 comments on commit 128c4f5

Please sign in to comment.