Commit 6e939c4a authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch...

Merge branch 'OCF61-add-retries-to-tests-on-events-and-notification_destination-variable' into 'staging'

Resolve "Add retries to tests on events and NOTIFICATION_DESTINATION variable"

Closes #61

See merge request !46
parents 05d60773 302f7a8b
Loading
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -10,24 +10,20 @@ RESULT_FOLDER=$REPOSITORY_BASE_FOLDER/results/$timestamp
ROBOT_DOCKER_FILE_FOLDER=$REPOSITORY_BASE_FOLDER/tools/robot

# nginx Hostname and http port (80 by default) to reach for tests
# CAPIF_REGISTER=registercapif.mobilesandbox.cloud
CAPIF_REGISTER=capifcore
# CAPIF_REGISTER_PORT=37211
CAPIF_REGISTER_PORT=8084
# CAPIF_HOSTNAME=capif.mobilesandbox.cloud
CAPIF_HOSTNAME=capifcore
CAPIF_HTTP_PORT=8080
CAPIF_HTTPS_PORT=443

# VAULT access configuration
# CAPIF_VAULT=vault.5gnacar.int
CAPIF_VAULT=vault
CAPIF_VAULT_PORT=8200
# CAPIF_VAULT_TOKEN=dev-only-token
CAPIF_VAULT_TOKEN=read-ca-token


MOCK_SERVER_URL=http://mock-server:9090
NOTIFICATION_DESTINATION_URL=http://mock-server:9090


echo "CAPIF_HOSTNAME = $CAPIF_HOSTNAME"
@@ -78,4 +74,5 @@ docker run -ti --rm --network="host" \
    --variable CAPIF_VAULT:$CAPIF_VAULT \
    --variable CAPIF_VAULT_PORT:$CAPIF_VAULT_PORT \
    --variable CAPIF_VAULT_TOKEN:$CAPIF_VAULT_TOKEN \
    --variable NOTIFICATION_DESTINATION_URL:$NOTIFICATION_DESTINATION_URL \
    --variable MOCK_SERVER_URL:$MOCK_SERVER_URL $@
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ Test Teardown Reset Testing Environment
${APF_ID_NOT_VALID}             apf-example
${SERVICE_API_ID_NOT_VALID}     not-valid
${API_INVOKER_NOT_VALID}        not-valid
${NOTIFICATION_DESTINATION}     http://robot.testing:1080
${AEF_ID_NOT_VALID}             not-valid


+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ Test Teardown Reset Testing Environment
${AEF_ID_NOT_VALID}             aef-example
${SERVICE_API_ID_NOT_VALID}     not-valid
${API_INVOKER_NOT_VALID}        not-valid
${NOTIFICATION_DESTINATION}     http://robot.testing:1080
${API_VERSION_VALID}            v1
${API_VERSION_NOT_VALID}        v58

+14 −14
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ Invoker receives Service API Invocation events

    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ...    eventFilters=${event_filters}
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions
@@ -209,7 +209,7 @@ Invoker receives Service API Invocation events
    ...    ${subscription_id}
    ...    ${request_body}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}

Invoker subscribe to Service API Available and Unavailable events
    [Tags]    capif_api_events-7    mockserver
@@ -243,7 +243,7 @@ Invoker subscribe to Service API Available and Unavailable events

    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ...    eventFilters=${event_filters}
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions
@@ -279,7 +279,7 @@ Invoker subscribe to Service API Available and Unavailable events
    ...    service_api_available_resources=${service_api_available_resources}
    ...    service_api_unavailable_resources=${service_api_unavailable_resources}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}

Invoker subscribe to Service API Update
    [Tags]    capif_api_events-8    mockserver
@@ -313,7 +313,7 @@ Invoker subscribe to Service API Update

    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ...    eventFilters=${event_filters}
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_invoker['api_invoker_id']}/subscriptions
@@ -342,7 +342,7 @@ Invoker subscribe to Service API Update
    ## Create check Events to ensure all notifications were received
    ${events_expected}=   Create Expected Service Update Event   ${subscription_id}   ${resource_url}  ${service_api_description_modified}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}

Provider subscribe to API Invoker events
    [Tags]    capif_api_events-9    mockserver
@@ -357,7 +357,7 @@ Provider subscribe to API Invoker events
    ${events_list}=    Create List    API_INVOKER_ONBOARDED    API_INVOKER_UPDATED    API_INVOKER_OFFBOARDED
    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions
    ...    json=${request_body}
@@ -407,7 +407,7 @@ Provider subscribe to API Invoker events
    ...    ${subscription_id}
    ...    ${register_user_info_invoker['api_invoker_id']}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}

Invoker subscribed to ACL update event
    [Tags]    capif_api_events-10    mockserver
@@ -432,7 +432,7 @@ Invoker subscribed to ACL update event
    ${events_list}=    Create List    ACCESS_CONTROL_POLICY_UPDATE
    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions
    ...    json=${request_body}
@@ -491,7 +491,7 @@ Invoker subscribed to ACL update event
    ...    ${service_api_id}
    ...    ${api_invoker_policies}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}

Provider receives an ACL unavailable event when invoker remove Security Context.
    [Tags]    capif_api_events-11    mockserver
@@ -516,7 +516,7 @@ Provider receives an ACL unavailable event when invoker remove Security Context.
    ${events_list}=    Create List    ACCESS_CONTROL_POLICY_UNAVAILABLE
    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions
    ...    json=${request_body}
@@ -565,7 +565,7 @@ Provider receives an ACL unavailable event when invoker remove Security Context.
    ## Create check Events to ensure all notifications were received
    ${events_expected}=    Create Expected Access Control Policy Unavailable    ${subscription_id}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}

Invoker receives an Invoker Authorization Revoked and ACL unavailable event when Provider revoke Invoker Authorization.
    [Tags]    capif_api_events-12    mockserver
@@ -590,7 +590,7 @@ Invoker receives an Invoker Authorization Revoked and ACL unavailable event when
    ${events_list}=    Create List    ACCESS_CONTROL_POLICY_UNAVAILABLE    API_INVOKER_AUTHORIZATION_REVOKED
    ${request_body}=    Create Events Subscription
    ...    events=@{events_list}
    ...    notificationDestination=${MOCK_SERVER_URL}/testing
    ...    notificationDestination=${NOTIFICATION_DESTINATION_URL}/testing
    ${resp}=    Post Request Capif
    ...    /capif-events/v1/${register_user_info_provider['amf_id']}/subscriptions
    ...    json=${request_body}
@@ -649,7 +649,7 @@ Invoker receives an Invoker Authorization Revoked and ACL unavailable event when
    ...    ${subscription_id}
    ...    events_expected=${events_expected}
    ## Check Events Expected towards received notifications at mock server
    Check Mock Server Notification Events    ${events_expected}
    Wait Until Keyword Succeeds  5x  5s  Check Mock Server Notification Events    ${events_expected}


*** Keywords ***
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ Test Teardown Reset Testing Environment
${AEF_ID_NOT_VALID}             aef-example
${SERVICE_API_ID_NOT_VALID}     not-valid
${API_INVOKER_NOT_VALID}        not-valid
${NOTIFICATION_DESTINATION}     http://robot.testing:1080


*** Test Cases ***
Loading