First Pass Automated vFW control setup 93/57193/1
authorBrian Freeman <bf1936@att.com>
Mon, 23 Jul 2018 17:47:21 +0000 (12:47 -0500)
committerBrian Freeman <bf1936@att.com>
Mon, 23 Jul 2018 17:47:39 +0000 (12:47 -0500)
Issue-ID: TEST-110
Change-Id: Ib3ea0120a72dc0b6932bb9e12c4ba385e89511c3
Signed-off-by: Brian Freeman <bf1936@att.com>
robot/assets/templates/policy/FirewallPolicy_delete.template [new file with mode: 0644]
robot/assets/templates/policy/FirewallPolicy_push.template [new file with mode: 0644]
robot/resources/demo_preload.robot
robot/resources/global_properties.robot
robot/resources/mso_interface.robot
robot/resources/policy_interface.robot
robot/resources/test_templates/vnf_orchestration_test_template.robot
robot/testsuites/demo.robot

diff --git a/robot/assets/templates/policy/FirewallPolicy_delete.template b/robot/assets/templates/policy/FirewallPolicy_delete.template
new file mode 100644 (file)
index 0000000..c88d718
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "pdpGroup": "default",
+  "policyComponent" : "PDP",
+  "policyName": "com.BRMSParamvFirewall",
+  "policyType": "BRMS_Param"
+}
diff --git a/robot/assets/templates/policy/FirewallPolicy_push.template b/robot/assets/templates/policy/FirewallPolicy_push.template
new file mode 100644 (file)
index 0000000..46033f8
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "pdpGroup": "default",
+  "policyName": "com.BRMSParamvFirewall",
+  "policyType": "BRMS_Param"
+}
index 664525b..102305a 100644 (file)
@@ -4,7 +4,9 @@ Documentation     This test template encapsulates the VNF Orchestration use case.
 Resource        test_templates/model_test_template.robot
 Resource        test_templates/vnf_orchestration_test_template.robot
 Resource        asdc_interface.robot
+Resource        mso_interface.robot
 Resource        vid/vid_interface.robot
+Resource       policy_interface.robot
 
 Library                UUID
 Library                Collections
@@ -152,6 +154,14 @@ Instantiate VNF
     Save For Delete
     Log to Console   Customer Name=${CUSTOMER_NAME}
     Log to Console   VNF Module Name=${vf_module_name}
+    ${model_invariant_id}=   Run MSO Get ModelInvariantId   ${SUITE_SERVICE_MODEL_NAME} 
+    Log to Console   ModelInvariantID=${model_invariant_id}
+    Update vVFWCL Policy   ${model_invariant_id}
+    APPC Mount Point    ${vf_module_name}
+    
+    
+    
+
 
 Save For Delete
     [Documentation]   Create a variable file to be loaded for save for delete
@@ -182,5 +192,6 @@ Save For Delete
     \    ${comma}=   Catenate   ,
     ${vars}=    Catenate  ${vars}]\n
     OperatingSystem.Create File   ${FILE_CACHE}/${STACK_NAME}.py   ${vars}
+    OperatingSystem.Create File   ${FILE_CACHE}/lastVNF4HEATBRIGE.py   ${vars}
 
 
index 70909e2..e32b01e 100644 (file)
@@ -28,6 +28,7 @@ ${GLOBAL_VID_UI_TIMEOUT_SHORT}    20s
 ${GLOBAL_VID_UI_TIMEOUT_MEDIUM}    60s
 ${GLOBAL_VID_UI_TIMEOUT_LONG}    120s
 ${GLOBAL_VM_PRIVATE_KEY}   ${EXECDIR}/robot/assets/keys/robot_ssh_private_key.pvt
+${GLOBAL_ONAP_PRIVATE_KEY}   ${EXECDIR}/robot/assets/keys/onap_dev.pvt
 ${GLOBAL_AAI_ZONE_ID}    nova1
 ${GLOBAL_AAI_ZONE_NAME}    nova
 ${GLOBAL_AAI_DESIGN_TYPE}    integration
index 49965c8..200b270 100644 (file)
@@ -20,6 +20,16 @@ Run MSO Health Check
     ${resp}=   Get Request     mso     ${MSO_HEALTH_CHECK_PATH}     headers=${headers}
     Should Be Equal As Strings         ${resp.status_code}     200
 
+Run MSO Get ModelInvariantId
+    [Documentation]    Runs an MSO Get ModelInvariantID for ClosedLoop Polieis 
+    [Arguments]    ${service_model_name}    
+    ${param_dict}=    Create Dictionary    serviceModelName    ${service_model_name}
+    ${param}=   Evaluate   urllib.urlencode(${param_dict})    urllib
+    ${data_path}=   Catenate   SEPARATOR=     /ecomp/mso/catalog/v2/serviceVnfs?  ${param}
+    ${resp}=    Run MSO Get Request    ${data_path}
+    Log    ${resp.json()}
+    [Return]   ${resp.json()['serviceVnfs'][0]['modelInfo']['modelInvariantUuid']}
+    
 Run MSO Get Request
     [Documentation]    Runs an MSO get request
     [Arguments]    ${data_path}    ${accept}=application/json
index f05f265..8bc9c3b 100644 (file)
@@ -11,6 +11,7 @@ Resource          global_properties.robot
 ${POLICY_HEALTH_CHECK_PATH}        /healthcheck
 ${POLICY_ENDPOINT}     ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_SERVER_PORT}
 ${POLICY_HEALTHCHECK_ENDPOINT}     ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
+${POLICY_TEMPLATES}        robot/assets/templates/policy
 
 *** Keywords ***
 
@@ -63,7 +64,7 @@ Run Policy Get Configs Request
 
 Update vVFWCL Policy
     [Arguments]   ${resource_id}
-    Delete vFWCL Policy
+    Run Keyword and Ignore Error    Delete vFWCL Policy
     Sleep    20s
     Create vFWCL Policy     ${resource_id}
     Sleep    5s
index 6e2cd9a..ae0ba02 100644 (file)
@@ -58,6 +58,7 @@ Orchestrate VNF
     ${service_name}=    Catenate    Service_Ete_Name${uuid}
     ${service_type}=    Set Variable    ${service}
     ${service_model_type}     ${vnf_type}    ${vf_modules}   ${catalog_resources}=    Model Distribution For Directory    ${service}
+    Set Suite Variable    ${SUITE_SERVICE_MODEL_NAME}   ${service_model_type}
     Run Keyword If   '${service}' == 'vVG'    Create VVG Server    ${uuid}
     Create Customer For VNF    ${CUSTOMER_NAME}    ${CUSTOMER_NAME}    INFRA    ${service_type}    ${GLOBAL_AAI_CLOUD_OWNER}
     Setup Browser
index 005b410..e7c47f4 100644 (file)
@@ -43,6 +43,7 @@ Instantiate VFWCL
     [Tags]   instantiateVFWCL
     Instantiate VNF   vFWCL
 
+
 Delete Instantiated VNF
     [Documentation]   This test assumes all necessary variables are loaded via the variable file create in  Save For Delete
     ...    The Teardown VNF needs to be in the teardown step of the test case...