Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PATCH of regs modifying/adding reg properties to an existing functest #1657

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading