From 46e7de31bfacfdb9e2aaafe16e08467a554a8b12 Mon Sep 17 00:00:00 2001 From: kzangeli Date: Tue, 26 May 2026 22:28:42 +0200 Subject: [PATCH 1/3] fix: 028_07_02 expects 504 for LdContextNotAvailable, not 503 TS 104-176 \302\2476.3.2 maps LdContextNotAvailable to HTTP 504. --- .../Subscription/CreateSubscription/028_07.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot index 4e6f8c9c..678cc3ba 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot @@ -19,7 +19,7 @@ ${unavailable_jsonldContext_subscription_file_path}= subscriptions/subscripti ${invalid_jsonldContext_subscription_file_path} ${ERROR_TYPE_BAD_REQUEST_DATA} 400 028_07_02 Subscription With Unavailable jsonldContext [Tags] sub-create 5_8_1 since_v1.7.1 - ${unavailable_jsonldContext_subscription_file_path} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} 503 + ${unavailable_jsonldContext_subscription_file_path} ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} 504 *** Keywords *** -- GitLab From d56b0681f6474208e5c04e2ca2d9754692f934da Mon Sep 17 00:00:00 2001 From: kzangeli Date: Tue, 26 May 2026 23:10:13 +0200 Subject: [PATCH 2/3] fix: ignore NotificationParams Additional Members in subscription config TCs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A subscription's notification object carries Additional Members (5.2.14.2) — lastNotification/lastSuccess/lastFailure/timesSent/timesFailed and the last-result status — populated only after a notification has been delivered, so they are non-deterministic in create/update/retrieve/query TCs. Exclude them via a new notification-scoped regex var (notification_result_regex_expr), matching the existing Additional-Members convention used in 038/040. The regex is scoped to the notification object, so subscription-level status and notificationTrigger stay verified. Also fixes the double-quoted ignore-key regexes in the subscription-list keyword that never matched DeepDiff's paths. --- .../Subscription/CreateSubscription/028_01.robot | 5 ++++- .../RetrieveSubscription/030_03.robot | 5 ++++- .../Subscription/UpdateSubscription/029_05.robot | 10 ++++++++-- .../Subscription/UpdateSubscription/029_06.robot | 6 ++++-- resources/AssertionUtils.resource | 15 +++++++++++---- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index f0807b76..c70fc285 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot @@ -29,7 +29,10 @@ ${subscription_expectation_file_path}= subscriptions/expectations/subscript ... id=${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} - ${ignore_keys}= Create List jsonldContext timesFailed timesSent notificationTrigger + # Ignore the broker-computed Additional Members of NotificationParams (lastNotification/ + # lastSuccess/lastFailure/timesSent/timesFailed/status) — non-deterministic, present + # only after a notification has been delivered. + ${ignore_keys}= Create List jsonldContext notificationTrigger ${notification_result_regex_expr} Check Created Resource Set To ${expected_subscription} ${response1.json()} ${ignore_keys} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 9f62aac5..5091c9ef 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot @@ -23,7 +23,10 @@ ${expectation_file_path}= subscriptions/expectations/subscriptions ... id=${subscription_id} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - ${ignore_keys}= Create List jsonldContext timesFailed timesSent notificationTrigger + # Ignore the broker-computed Additional Members of NotificationParams (lastNotification/ + # lastSuccess/lastFailure/timesSent/timesFailed/status) — non-deterministic, present + # only after a notification has been delivered. + ${ignore_keys}= Create List jsonldContext notificationTrigger ${notification_result_regex_expr} Check Response Body Containing Subscription element ... ${expectation_file_path} ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot index 6d68133f..eb0a3d5e 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_05.robot @@ -31,7 +31,10 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio ${response1}= Retrieve Subscription ... id=${subscription_id} ... context=${ngsild_test_suite_context} - ${ignore_keys}= Create List jsonldContext timesFailed timesSent notificationTrigger + # Ignore the broker-computed Additional Members of NotificationParams (lastNotification/ + # lastSuccess/lastFailure/timesSent/timesFailed/status) — non-deterministic, present + # only after a notification has been delivered. + ${ignore_keys}= Create List jsonldContext notificationTrigger ${notification_result_regex_expr} Check Response Body Containing Subscription element ... ${expected_subscription_payload_file_path} ... ${subscription_id} @@ -50,7 +53,10 @@ ${expected_expanded_subscription_payload_file_path}= subscriptions/expectatio Check Response Body Is Empty ${response} ${response1}= Retrieve Subscription ... id=${subscription_id} - ${ignore_keys}= Create List jsonldContext timesFailed timesSent notificationTrigger + # Ignore the broker-computed Additional Members of NotificationParams (lastNotification/ + # lastSuccess/lastFailure/timesSent/timesFailed/status) — non-deterministic, present + # only after a notification has been delivered. + ${ignore_keys}= Create List jsonldContext notificationTrigger ${notification_result_regex_expr} Check Response Body Containing Subscription element ... ${expected_expanded_subscription_payload_file_path} ... ${subscription_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot index 51fa609a..5e21f86d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_06.robot @@ -32,12 +32,14 @@ ${subscription_update_fragment_file_path}= subscriptions/fragments/subscrip ... id=${subscription_id} ... accept=${CONTENT_TYPE_LD_JSON} ... context=${ngsild_test_suite_context} + # Ignore the broker-computed Additional Members of NotificationParams (lastNotification/ + # lastSuccess/lastFailure/timesSent/timesFailed/status) — non-deterministic, present + # only after a notification has been delivered. ${ignored_attributes}= Create List ... ${status_regex_expr} ... jsonldContext - ... timesFailed - ... timesSent ... notificationTrigger + ... ${notification_result_regex_expr} Check Updated Resource Set To ... updated_resource=${subscription} ... response_body=${response1.json()} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6b75603d..d3b22d96 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -21,6 +21,10 @@ ${timesFailed_regex_expr}= root\\['timesFailed'\\] ${timesSent_regex_expr}= root\\['timesSent'\\] ${is_active_expr}= root\\['isActive'\\] ${context_source_ignored_regex_expr}= root\\['@context'\\] +# Broker-computed Additional Members of NotificationParams (5.2.14.2), nested under +# the Subscription's 'notification' object — non-deterministic (present only after a +# notification has been delivered), so excluded from equality checks at any index. +${notification_result_regex_expr}= \\['notification'\\]\\['(lastNotification|lastSuccess|lastFailure|timesSent|timesFailed|status)'\\] *** Keywords *** @@ -268,12 +272,15 @@ Check Response Body Containing List Containing Subscription elements ... ${subscription_id} ${index}= Evaluate ${index} + 1 END + # Ignore the broker-computed Additional Members of NotificationParams (lastNotification/ + # lastSuccess/lastFailure/timesSent/timesFailed/status) — non-deterministic, present only + # after a notification has been delivered; the regex is scoped to the notification object + # so the subscription-level status and notificationTrigger stay verified. (The previous + # entries were double-quoted and never matched DeepDiff's single-quoted paths.) ${ignored_keys}= Create List ... ${context_regex_expr} - ... "jsonldContext" - ... "timesFailed" - ... "timesSent" - ... "notificationTrigger" + ... jsonldContext + ... ${notification_result_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription_payload} ... ${response_body} -- GitLab From d73544dfcc7d93bd00c40e1de6e6d3ac8e26b809 Mon Sep 17 00:00:00 2001 From: kzangeli Date: Thu, 28 May 2026 10:27:30 +0200 Subject: [PATCH 3/3] =?UTF-8?q?fix(LdContextNotAvailable):=20extend=20503?= =?UTF-8?q?=E2=86=92504=20to=20043=5F01/051=5F05/053=5F05=20+=20comment=20?= =?UTF-8?q?ignored=20jsonldContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses review comments on this MR. 1. Sweep for tests asserting 503 against LdContextNotAvailable. Beyond 028_07_02 (already fixed in this branch), the only three remaining are: - 043_01.robot — bumps ${expected_status_code} (covers all 5 tests). - 051_05.robot — status + paired "Service Unavailable" reason phrase → "Gateway Timeout". - 053_05.robot — status only. Verified: 043_01_01..05 and 053_05_01 PASS; no other 503 + LdContextNotAvailable pairings remain in the suite. 2. Document why `jsonldContext` stays in the ignore list as a temporary cross-broker workaround. TS 104-175 § 10.5.2.4 actually mandates auto-initialisation ("If not present, the jsonldContext field shall be initialized with the @context applicable for the Subscription"), but implementations don't all comply yet. See spec-doubts.md #16 (the related subscription-vs-CSR fallback asymmetry). The ignore — and matching fixture omission of jsonldContext — should be removed once implementations converge on the spec's mandate. notificationTrigger does NOT need ignoring: every subscription-shaped expectation specifies it explicitly and the broker echoes user values, so deep-diff matches. !269's removal of notificationTrigger from the (previously dead-quoted) ignore list is correct as-is. Co-Authored-By: Claude Opus 4.7 --- .../VerifyLdContextNotAvailable/043_01.robot | 2 +- .../jsonldContext/Consumption/ServeContext/053_05.robot | 2 +- .../jsonldContext/Provision/DeleteContext/051_05.robot | 4 ++-- resources/AssertionUtils.resource | 9 +++++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot index 39c65643..95e4fa31 100644 --- a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot @@ -11,7 +11,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variables *** -${expected_status_code}= 503 +${expected_status_code}= 504 ${building_filename}= building-unretrievable-context.jsonld ${subscription_filename}= subscriptions/subscription-unretrievable-context.jsonld ${tea_filename}= bus-temporal-representation-unretrievable-context.jsonld diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot index f01cb49f..dd458ca0 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot @@ -71,7 +71,7 @@ Create Initial @context condition from an external server Stop @context Local Server ${response}= Delete a @context ${uri} true - Check Response Status Code 503 ${response.status_code} + Check Response Status Code 504 ${response.status_code} Delete Initial @context condition from an external server Log Delete initial contidions diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot index 61a7e17e..2af8f1c4 100644 --- a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot @@ -31,8 +31,8 @@ ${uri} /api/v1/context.jsonld ${response}= Delete a @context ${uri} true - Check Response Status Code 503 ${response.status_code} - Check Response Reason set to ${response.reason} Service Unavailable + Check Response Status Code 504 ${response.status_code} + Check Response Reason set to ${response.reason} Gateway Timeout Check Response Body Containing ProblemDetails Element ... ${response.json()} ... ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index d3b22d96..8fe80555 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -277,6 +277,15 @@ Check Response Body Containing List Containing Subscription elements # after a notification has been delivered; the regex is scoped to the notification object # so the subscription-level status and notificationTrigger stay verified. (The previous # entries were double-quoted and never matched DeepDiff's single-quoted paths.) + # `jsonldContext` is ignored as a temporary cross-broker workaround. + # TS 104-175 § 10.5.2.4 actually MANDATES auto-initialisation: + # "If not present, the jsonldContext field shall be initialized + # with the @context applicable for the Subscription." + # But implementations don't all comply yet — some emit nothing, others + # emit a defaulted URL. See spec-doubts.md #16 (the related fallback + # asymmetry between subscription and CSR). Drop this ignore — and + # update fixtures to specify the expected initialized value — once + # implementations converge on the spec's mandate. ${ignored_keys}= Create List ... ${context_regex_expr} ... jsonldContext -- GitLab