diff --git a/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot b/TP/NGSI-LD/CommonBehaviours/CommonResponses/VerifyLdContextNotAvailable/043_01.robot index 39c65643694d72a0b76f407e7e63e4e73a7ccf52..95e4fa31b51fba0010ea565c94345f952ddda1c8 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/ContextInformation/Subscription/CreateSubscription/028_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_01.robot index f0807b7677a26c33f71ffa3bcaec530d081bc503..c70fc28513290f6a2c2d9cf20f83bfa921dde76d 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/CreateSubscription/028_07.robot b/TP/NGSI-LD/ContextInformation/Subscription/CreateSubscription/028_07.robot index 4e6f8c9cdc3172872bce096c1d334025c01720fa..678cc3baa91f5f7c6f3c0931e5854d2a7579a85f 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 *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/RetrieveSubscription/030_03.robot index 9f62aac5b9ed0c205a6d80c9ee24e180d2212b44..5091c9ef51c1e7b346fd96234d4f7d558a5372da 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 6d68133f5149f8aad3dfa52583765f986d91cf8a..eb0a3d5e18038bfe3fb740efeb1783676cac70fb 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 51fa609a023d4646eeeb2b07af81263df4134a2f..5e21f86db4060cd40e3e55668b2835a108df8f07 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/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot index f01cb49fdab9a23dd72e5ba83867691d152bd36b..dd458ca0ec06421a7c48989f243c38680e876d7c 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 61a7e17e52eb3a5fdcabe62ac49a6a13824b72b4..2af8f1c433744fd489ecc8290b27de40dd6f06ce 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 6b75603dcf211e87b65f48e286c4a06b1f23b5b5..8fe8055568c8e5faa5d913fa44775a146428b163 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,24 @@ 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.) + # `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" - ... "timesFailed" - ... "timesSent" - ... "notificationTrigger" + ... jsonldContext + ... ${notification_result_regex_expr} ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${subscription_payload} ... ${response_body}