fix(047): the initial csource notification (TS 104-175 clause 12.4.7)

The initial notification of a context source registration subscription.

Spec: TS 104-175 clause 12.4.7: "the csource notification shall be sent on initial subscription and whenever there is a change in a matching csource registration" - also when no registration matches yet, with an empty data array.

Change:

  • 047_03, 047_04, 047_07 consume the initial notification, so their later waits see the notification they are about.
  • 047_05 checks the bookkeeping of that initial notification (timesSent, no failure), and that a registration that does not match sends nothing more (1-timesSent-failed.json updated).
  • 047_02 and 047_04 register Building and Bus (context-source-registration-building-and-bus-entities.jsonld), so the notified registration ids are the ones the Test Case created.
  • Check Notification Data Entities (NotificationUtils) accepts an entityInfo type as a string or an array of strings - indexing [0] into a string gave its first character.

Effect (against coraine): 047_02_01, 047_03_01, 047_04_01, 047_06_01, 047_07_01, 047_07_02 fail on develop and pass with this MR. 047_01_01 and 047_05_01 pass on both. None breaks. 047_08 to 047_16 need the same change - the next MR, stacked on this one.

Checks run: robocop format --check (0 files), scripts/find_unused_test_data.py (nothing new), statisticsDocumentationData.py (0 of 625 failed), doc unit tests OK.

Fix MR 10 of the plan: https://famzang.com/ttf/ngsi-ld-suite-plan.html

Edited by Ken Zangelin

Merge request reports

Loading
+1 −1
Changes for TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_02.robot: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Test Teardown Delete Created Context Source Registration And Context Sourc


*** Variables ***
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration.jsonld
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration-building-and-bus-entities.jsonld
${subscription_payload_file_path}=                      csourceSubscriptions/subscription.jsonld
${update_fragment_file_path}=                           csourceRegistrations/fragments/context-source-registration-update.json

+1 −0
Changes for TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_03.robot: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ Setup Initial Context Source Registration Subscription
    ${create_response}=    Create Context Source Registration Subscription    ${subscription_payload}
    Check Response Status Code    201    ${create_response.status_code}
    Set Suite Variable    ${subscription_id}
    Wait for notification

Delete Created Context Source Registration And Subscription
    Stop Local Server
+2 −1
Changes for TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_04.robot: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Test Teardown Delete Created Context Source Registration And Subscription


*** Variables ***
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration.jsonld
${context_source_registration_payload_file_path}=       csourceRegistrations/context-source-registration-building-and-bus-entities.jsonld
${subscription_payload_file_path}=                      csourceSubscriptions/subscription.jsonld


@@ -44,6 +44,7 @@ Setup Initial Context Source Registration Subscription
    ${create_response}=    Create Context Source Registration Subscription    ${subscription_payload}
    Check Response Status Code    201    ${create_response.status_code}
    Set Suite Variable    ${subscription_id}
    Wait for notification

Delete Created Context Source Registration And Subscription
    Stop Local Server
+2 −1
Changes for TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_05.robot: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -27,8 +27,9 @@ ${notification_expectation_file_path}= notifications/expectatio
    ...    ${context_source_registration_payload_file_path}
    ...    ${context_source_registration_id}
    Set Suite Variable    ${context_source_registration_id}
    ${create_response}=    Create Context Source Registration    ${context_source_registration_payload}
    Wait for notification
    ${create_response}=    Create Context Source Registration    ${context_source_registration_payload}
    Wait for no notification
    ${response}=    Retrieve Context Source Registration Subscription
    ...    subscription_id=${subscription_id}
    @{expected_notification_additional_members}=    Create List    lastNotification    lastSuccess
+1 −0
Changes for TP/NGSI-LD/ContextSource/RegistrationSubscription/ContextSourceRegistrationSubscriptionNotificationBehaviour/047_07.robot: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ Setup Initial Context Source Registration Subscription
    ...    ${subscription_id}
    ${create_response}=    Create Context Source Registration Subscription    ${subscription_payload}
    Check Response Status Code    201    ${create_response.status_code}
    Wait for notification
    Set Suite Variable    ${subscription_id}

Delete Created Context Source Registration And Subscription
Loading
Loading