Skip to content

Commit

Permalink
Merge pull request #1657 from FIWARE/csf/patchAddingRegProperties
Browse files Browse the repository at this point in the history
Adding PATCH of regs modifying/adding reg properties to an existing functest
  • Loading branch information
kzangeli authored Aug 22, 2024
2 parents 5d3c511 + 0f2adf4 commit f5762db
Showing 1 changed file with 114 additions and 1 deletion.
115 changes: 114 additions & 1 deletion test/functionalTest/cases/0000_ngsild/ngsild_issue_1652-csf.test
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ orionldStart CB -experimental
# 06. Query registrations with csf=Type2~=urn:aeros:federation:.* - see R1 and R2
# 07. Query registrations with csf=Type2~=urn:aeros:o.* - see R3
# 08. Query registrations with csf=Type2~=urn:hairos:.* - see []
# 09. PATCH R1 setting Type2 to urn:hairos:09
# 10. Query registrations with csf=Type2~=urn:hairos:.* - see R1
# 11. PATCH R2, adding a reg property Type3=urn:aeros:federation2:R2
# 12. Query registrations with csf=Type3~=urn:aeros:federation2.* - see R2
#

echo "01. Create a registration R1 with a property Type2 = urn:aeros:federation:r1"
Expand Down Expand Up @@ -144,6 +148,40 @@ echo
echo


echo "09. PATCH R1 setting Type2 to urn:hairos:09"
echo "==========================================="
payload='{
"Type2": "urn:hairos:09"
}'
orionCurl --url /ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:R1 --payload "$payload" -H 'Link: <http://localhost:7080/jsonldContexts/schema_lab_fiware_org_ld_context.jsonld>' -X PATCH
echo
echo


echo "10. Query registrations with csf=Type2~=urn:hairos:.* - see R1"
echo "=============================================================="
orionCurl --url /ngsi-ld/v1/csourceRegistrations?csf=Type2~=urn:hairos.* -H 'Link: <http://localhost:7080/jsonldContexts/schema_lab_fiware_org_ld_context.jsonld>'
echo
echo


echo "11. PATCH R2, adding a reg property Type3=urn:aeros:federation2:R2"
echo "=================================================================="
payload='{
"Type3": "urn:aeros:federation2:R2"
}'
orionCurl --url /ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:R2 --payload "$payload" -H 'Link: <http://localhost:7080/jsonldContexts/schema_lab_fiware_org_ld_context.jsonld>' -X PATCH
echo
echo


echo "12. Query registrations with csf=Type3~=urn:aeros:federation2.* - see R2"
echo "========================================================================"
orionCurl --url /ngsi-ld/v1/csourceRegistrations?csf=Type3~=urn:aeros:federation2.* -H 'Link: <http://localhost:7080/jsonldContexts/schema_lab_fiware_org_ld_context.jsonld>'
echo
echo


--REGEXPECT--
01. Create a registration R1 with a property Type2 = urn:aeros:federation:r1
============================================================================
Expand Down Expand Up @@ -316,6 +354,81 @@ Date: REGEX(.*)
[]


09. PATCH R1 setting Type2 to urn:hairos:09
===========================================
HTTP/1.1 204 No Content
Date: REGEX(.*)



10. Query registrations with csf=Type2~=urn:hairos:.* - see R1
==============================================================
HTTP/1.1 200 OK
Content-Length: 233
Content-Type: application/json
Date: REGEX(.*)
Link: REGEX(.*)

[
{
"Type2": "urn:hairos:09",
"endpoint": "http://my.csource.org:1026",
"id": "urn:ngsi-ld:R1",
"information": [
{
"entities": [
{
"id": "urn:ngsi-ld:Car1",
"type": "Vehicle"
}
]
}
],
"origin": "cache",
"status": "active",
"type": "ContextSourceRegistration"
}
]


11. PATCH R2, adding a reg property Type3=urn:aeros:federation2:R2
==================================================================
HTTP/1.1 204 No Content
Date: REGEX(.*)



12. Query registrations with csf=Type3~=urn:aeros:federation2.* - see R2
========================================================================
HTTP/1.1 200 OK
Content-Length: 278
Content-Type: application/json
Date: REGEX(.*)
Link: REGEX(.*)

[
{
"Type2": "urn:aeros:federation:r2",
"Type3": "urn:aeros:federation2:R2",
"endpoint": "http://my.csource.org:1026",
"id": "urn:ngsi-ld:R2",
"information": [
{
"entities": [
{
"id": "urn:ngsi-ld:Car1",
"type": "Vehicle"
}
]
}
],
"origin": "cache",
"status": "active",
"type": "ContextSourceRegistration"
}
]


--TEARDOWN--
brokerStop CB
#dbDrop CB
dbDrop CB

0 comments on commit f5762db

Please sign in to comment.