Skip to content

Commit

Permalink
add **test_sp02_test_service_reconfiguration_(OS)** sonata-nfv#209
Browse files Browse the repository at this point in the history
  • Loading branch information
efotopoulou committed Jul 15, 2019
1 parent 5008a04 commit 26bef39
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 179 deletions.
26 changes: 0 additions & 26 deletions tests/SP/test_runtime_policy_lifecycle/README.md

This file was deleted.

67 changes: 0 additions & 67 deletions tests/SP/test_runtime_policy_lifecycle/generic_template.robot

This file was deleted.

73 changes: 0 additions & 73 deletions tests/SP/test_runtime_policy_lifecycle/testcomplete.robot

This file was deleted.

29 changes: 28 additions & 1 deletion tests/SP/test_service_reconfiguration_k8s/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
readme
|||||
| :--- | :--- | :--- | :--- |
| __Test Case Name__ | | __Test Service Lifecycle in k8s with elasticity policies__ | |
| __Test Purpose__ | | Check the lifecycle of a Network Service with an elasticity policy activated. Check collaboration between MANO, monitoring engine and policy engine| |
| __Configuration__ | | ns-mediapilot-service pilot NS is deployed on the Service Platform upon k8s| |
| __Test Tool__ | | Robot Framework, using Tnglib | |
| __Metric__ | | Boolean (success or not), execution time | |
| __References__ | | | |
| __Applicability__ | | Variations of this test case can be performed to test multiple policy actions | |
| __Pre-test conditions__ | | The packages that contain the NS will be created before the test execution. The policy descriptor is also defined before the test execution.| |
| __Test sequence__ | Step | Description | Result |
| | 1 | Service Package On-Boarding | Service Package is on-boarded in the SP|
| | 2 | Runtime Policy Creation | Runtime Policy is created in the SP |
| | 3 | Define Runtime Policy as default | Attach the Runtime Policy with the deployed Service Package |
| | 4 | Deploy Network Service | Network Service is deployed in the SP |
| | 5 | Check Network Service instantiation | Confirm that the NS was deployed without errors |
| | 6 | Check Monitoring Rules | Confirm that the NS monitoring rules are enabled without errors from the monitoring engine |
| | 7 | Satisfy Monitoring Rule | generate a custom metric value that satisfies the monitoring rule |
| | 8 | Demand Elasticity policy action | policy manager requests VNF scaling out from MANO |
| | 9 | Evaluate the outcome of MANO scaling action enforcement | Confirm that the requested action is succesfully completed |
| | 10 | Deactivate Runtime Policy | Deactivate runtime policy while the NS is still deployed |
| | 9 | Terminate Network Service | Delete the NS deployed |
| | 10 | Delete Runtime Policy | Delete Runtime Policy |
| | 11 | Remove NS package | Remove NS package |
| __Test Verdict__ | | Network services is succesfully deployed and undeployed at an OS VIM environment.Runtime Policies are enforced and deactivated succesfully | |
| __Additional resources__ | | | |


32 changes: 28 additions & 4 deletions tests/SP/test_service_reconfiguration_k8s/test.robot
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
*** Settings ***
Documentation Test suite template for deploy and undeploy
Documentation Test suite template for deploy and undeploy with elasticity policy enforcement
Library tnglib
Library Collections

*** Variables ***
${SP_HOST} http://qual-sp-bcn.5gtango.eu
${FILE_SOURCE_DIR} /home/paco/test/robot/packages
${NS_PACKAGE_NAME} service.tgo
${SP_HOST} http://int-sp-ath.5gtango.eu # the name of SP we want to use
${READY} READY
${FILE_SOURCE_DIR} ./packages # to be modified and added accordingly if package is not on the same folder as test
${NS_PACKAGE_NAME} service.tgo # The package to be uploaded and tested
${NS_PACKAGE_SHORT_NAME} ns-mediapilot-service
${POLICIES_SOURCE_DIR} ./policies # to be modified and added accordingly if policy is not on the same folder as test
${POLICY_NAME} ns-mediapilot-Elasticity-Policy-Premium.json # The policy to be uploaded and tested
${READY} READY
${PASSED} PASSED


*** Test Cases ***
*** Test Cases ***
Setting the SP Path
Set SP Path ${SP_HOST}
Expand All @@ -32,6 +36,14 @@ Upload the NS Package
Should Be True ${service[0]}
Set Suite Variable ${SERVICE_UUID} ${service[1]}
Log ${SERVICE_UUID}
Create Runtime Policy
${result} = Create Policy ${POLICIES_SOURCE_DIR}/${POLICY_NAME}
Should Be True ${result[0]}
Set Suite Variable ${POLICY_UUID} ${result[1]}
Sleep 30
Define Runtime Policy as Default
${result} = Define Policy As Default ${POLICY_UUID} service_uuid=${SERVICE_UUID}
Should Be True ${result[0]}
Deploying Service
${init} = Service Instantiate ${SERVICE_UUID}
Log ${init}
Expand All @@ -40,6 +52,10 @@ Deploying Service
Wait For Ready
Wait until Keyword Succeeds 2 min 5 sec Check Status
Set SIU
Check monitoring rules
###Check monitoring rules code will go here once ready
Deactivate Runtime Policy
###Deactivate Runtime Policy code will go here once ready
Terminate Service
Log ${TERMINATE}
${ter} = Service Terminate ${TERMINATE}
Expand All @@ -52,6 +68,14 @@ Clean the Package after terminating
FOR ${PACKAGE} IN @{PACKAGES[1]}
Run Keyword If '${PACKAGE['name']}'== '${NS_PACKAGE_SHORT_NAME}' Remove Package ${PACKAGE['package_uuid']}
END
Delete Runtime Policy
${result} = Delete Policy ${POLICY_UUID}
Should Be True ${result[0]}
Clean the Package after terminating
@{PACKAGES} = Get Packages
FOR ${PACKAGE} IN @{PACKAGES[1]}
Run Keyword If '${PACKAGE['name']}'== '${NS_PACKAGE_SHORT_NAME}' Remove Package ${PACKAGE['package_uuid']}
END



Expand Down
29 changes: 28 additions & 1 deletion tests/SP/test_service_reconfiguration_os/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
readme
|||||
| :--- | :--- | :--- | :--- |
| __Test Case Name__ | | __Test Service Lifecycle in OS with elasticity policies__ | |
| __Test Purpose__ | | Check the lifecycle of a Network Service with an elasticity policy activated. Check collaboration between MANO, monitoring engine and policy engine| |
| __Configuration__ | | A NS composed by one haproxy and one squid VNF are deployed on the Service Platform| |
| __Test Tool__ | | Robot Framework, using Tnglib | |
| __Metric__ | | Boolean (success or not), execution time | |
| __References__ | | | |
| __Applicability__ | | Variations of this test case can be performed to test multiple policy actions | |
| __Pre-test conditions__ | | The packages that contain the NS will be created before the test execution. The policy descriptor is also defined before the test execution.| |
| __Test sequence__ | Step | Description | Result |
| | 1 | Service Package On-Boarding | Service Package is on-boarded in the SP|
| | 2 | Runtime Policy Creation | Runtime Policy is created in the SP |
| | 3 | Define Runtime Policy as default | Attach the Runtime Policy with the deployed Service Package |
| | 4 | Deploy Network Service | Network Service is deployed in the SP |
| | 5 | Check Network Service instantiation | Confirm that the NS was deployed without errors |
| | 6 | Check Monitoring Rules | Confirm that the NS monitoring rules are enabled without errors from the monitoring engine |
| | 7 | Satisfy Monitoring Rule | generate a custom metric value that satisfies the monitoring rule |
| | 8 | Demand Elasticity policy action | policy manager requests VNF scaling out from MANO |
| | 9 | Evaluate the outcome of MANO scaling action enforcement | Confirm that the requested action is succesfully completed |
| | 10 | Deactivate Runtime Policy | Deactivate runtime policy while the NS is still deployed |
| | 9 | Terminate Network Service | Delete the NS deployed |
| | 10 | Delete Runtime Policy | Delete Runtime Policy |
| | 11 | Remove NS package | Remove NS package |
| __Test Verdict__ | | Network services is succesfully deployed and undeployed at an OS VIM environment.Runtime Policies are enforced and deactivated succesfully | |
| __Additional resources__ | | | |


Binary file not shown.
33 changes: 26 additions & 7 deletions tests/SP/test_service_reconfiguration_os/test.robot
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
*** Settings ***
Documentation Test suite template for deploy and undeploy
Documentation Test suite template for deploy and undeploy with elasticity policy enforcement
Library tnglib
Library Collections

*** Variables ***
${SP_HOST} http://qual-sp-bcn.5gtango.eu
${FILE_SOURCE_DIR} /home/paco/test/robot/packages
${NS_PACKAGE_NAME} service.tgo
${NS_PACKAGE_SHORT_NAME} ns-mediapilot-service
${SP_HOST} http://int-sp-ath.5gtango.eu # the name of SP we want to use
${READY} READY
${FILE_SOURCE_DIR} ./packages # to be modified and added accordingly if package is not on the same folder as test
${NS_PACKAGE_NAME} eu.5gtango.ns-squid-haproxy.0.1.tgo # The package to be uploaded and tested
${NS_PACKAGE_SHORT_NAME} ns-squid-haproxy
${POLICIES_SOURCE_DIR} ./policies # to be modified and added accordingly if policy is not on the same folder as test
${POLICY_NAME} NS-squid-haproxy-Elasticity-Policy-Premium.json # The policy to be uploaded and tested
${READY} READY
${PASSED} PASSED


*** Test Cases ***
Setting the SP Path
Set SP Path ${SP_HOST}
Expand All @@ -32,6 +34,14 @@ Upload the NS Package
Should Be True ${service[0]}
Set Suite Variable ${SERVICE_UUID} ${service[1]}
Log ${SERVICE_UUID}
Create Runtime Policy
${result} = Create Policy ${POLICIES_SOURCE_DIR}/${POLICY_NAME}
Should Be True ${result[0]}
Set Suite Variable ${POLICY_UUID} ${result[1]}
Sleep 30
Define Runtime Policy as Default
${result} = Define Policy As Default ${POLICY_UUID} service_uuid=${SERVICE_UUID}
Should Be True ${result[0]}
Deploying Service
${init} = Service Instantiate ${SERVICE_UUID}
Log ${init}
Expand All @@ -40,6 +50,10 @@ Deploying Service
Wait For Ready
Wait until Keyword Succeeds 2 min 5 sec Check Status
Set SIU
Check monitoring rules
###Check monitoring rules code will go here once ready
Deactivate Runtime Policy
###Deactivate Runtime Policy code will go here once ready
Terminate Service
Log ${TERMINATE}
${ter} = Service Terminate ${TERMINATE}
Expand All @@ -52,7 +66,12 @@ Clean the Package after terminating
FOR ${PACKAGE} IN @{PACKAGES[1]}
Run Keyword If '${PACKAGE['name']}'== '${NS_PACKAGE_SHORT_NAME}' Remove Package ${PACKAGE['package_uuid']}
END

Delete Runtime Policy
${result} = Delete Policy ${POLICY_UUID}
Should Be True ${result[0]}
Remove the Package
${result} = Remove Package ${PACKAGE_UUID}
Should Be True ${result[0]}


*** Keywords ***
Expand Down

0 comments on commit 26bef39

Please sign in to comment.