${AAI_DEPLOY}   Set Variable   FALSE
     ${SDNC_DEPLOY}   Set Variable  FALSE
     ${SO_DEPLOY}   Set Variable   FALSE
+    ${SO_COMPLETE}   Set Variable   FALSE
     :FOR    ${ELEMENT}    IN    @{ITEMS}
     \    Log    ${ELEMENT['omfComponentID']}
     \    Log    ${ELEMENT['status']}
     \    ${SDNC_DEPLOY}  Set Variable If   (('sdnc-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${SDNC_DEPLOY}' == 'TRUE')    TRUE 
     \     ${SO_DEPLOY}  Set Variable If   (('mso-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${SO_DEPLOY}' == 'TRUE')   TRUE  
     \    ${AAI_DEPLOY}   Set Variable If   (('aai-ml' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DEPLOY_OK')) or ('${AAI_DEPLOY}'=='TRUE')  TRUE 
+    \    ${SO_COMPLETE}   Set Variable If   (('mso-docker' in '${ELEMENT['omfComponentID']}') and ('${ELEMENT['status']}' == 'DISTRIBUTION_COMPLETE_OK')) or ('${SO_COMPLETE}'=='TRUE')  TRUE
     Should Be True   ( '${SDNC_DEPLOY}'=='TRUE')  SDNC Test
-    Should Be True   ( '${SO_DEPLOY}'=='TRUE')   SO Test 
+    Should Be True   ( '${SO_DEPLOY}'=='TRUE')   SO Test
     Should Be True   ( '${AAI_DEPLOY}'=='TRUE')   AAI Test
+    Should Be True   ( '${SO_COMPLETE}'=='TRUE')   SO Test
 Get Catalog Service Distribution Details
     [Documentation]    gets an asdc catalog Service distrbution details
     [Arguments]    ${catalog_service_distribution_id}
    ${fileDir}  ${fileName}=  Split Path  ${filePath}
    ${partData}=  Create List  ${fileName}  ${fileData}  ${contentType}
    Set To Dictionary  ${addTo}  ${partName}=${partData}
-
 
     \   VLB Closed Loop Hack   ${service}   ${generic_vnf}   ${closedloop_vf_module}
     \   Set Test Variable    ${STACK_NAME}   ${vf_module_name}
     \   Append To List   ${STACK_NAMES}   ${STACK_NAME}
-    \   Execute Heatbridge    ${vf_module_name}    ${service_instance_id}    ${vnf}
-    \   Validate VF Module      ${vf_module_name}    ${vnf}
+    \   Run Keyword and Ignore Error   Execute Heatbridge    ${vf_module_name}    ${service_instance_id}    ${vnf}
+    \   Run Keyword and Ignore Error   Validate VF Module      ${vf_module_name}    ${vnf}
     [Return]     ${vf_module_name}    ${service}
 
 
 Delete VNF
     [Documentation]    Called at the end of a test case to tear down the VNF created by Orchestrate VNF
     ${lcp_region}=   Get Openstack Region
+    ${list}=    Create List
+    Set Test Variable    ${KEYPAIRS}   ${list}
+    # remove duplicates, sort vFW-> vPKG , revers to get vPKG > vFWSNK
+    ${sorted_stack_names}=    Create List
+    ${sorted_stack_names}=  Remove Duplicates   ${STACK_NAMES}
+    Sort List   ${sorted_stack_names}
+    Reverse List   ${sorted_stack_names}
+    :for   ${stack}   in   @{sorted_stack_names}
+    \     Get Stack Keypairs   ${stack}
     Teardown VVG Server
     Teardown VLB Closed Loop Hack
     Run Keyword and Ignore Error   Teardown VID   ${SERVICE_INSTANCE_ID}   ${lcp_region}   ${TENANT_NAME}   ${CUSTOMER_NAME}
+    #
+    :for   ${stack}   in   @{sorted_stack_names}
+    \    Run Keyword and Ignore Error    Teardown Stack    ${stack}
+    \    Log    Stack Deleted ${stack}
+    # only needed if stack deleted but not keypair
+    :for   ${key_pair}   in   @{KEYPAIRS}
+    \    Run Keyword and Ignore Error    Delete Stack Keypair  ${key_pair}
+    \    Log    Key pair Deleted ${key_pair}
     Log    VNF Deleted
 
 Teardown VNF
     Remove from Dictionary   ${vvg_params}   nova_instance
     Log    Teardown VVG Server Completed
 
+Get Stack Keypairs
+    [Documentation]  Get keypairs from openstack
+    [Arguments]   ${stack}
+    Run Openstack Auth Request    auth
+    ${stack_info}=    Get Stack Details    auth    ${stack}
+    Log    ${stack_info}
+    ${stack_id}=    Get From Dictionary    ${stack_info}    id
+    ${key_pair_status}   ${keypair_name}=   Run Keyword And Ignore Error   Get From Dictionary    ${stack_info}    key_name
+    Append To List   ${KEYPAIRS}   ${keypair_name}
+
+Delete Stack Keypair
+    [Documentation]  Delete keypairs from openstack
+    [Arguments]   ${keypair_name}
+    Run Openstack Auth Request    auth
+    Run Keyword   Delete Openstack Keypair    auth    ${keypair_name}
+
 Teardown Stack
     [Documentation]    OBSOLETE - Called at the end of a test case to tear down the Stack created by Orchestrate VNF
     [Arguments]   ${stack}
     Delete Openstack Stack      auth    ${stack}    ${stack_id}
     Log    Deleted ${stack} ${stack_id}
     Run Keyword If   '${key_pair_status}' == 'PASS'   Delete Openstack Keypair    auth    ${keypair_name}
-    Teardown VLB Closed Loop Hack
+    #Teardown VLB Closed Loop Hack
 
 Clean A&AI Inventory
     [Documentation]    Clean up Tenant in A&AI, Create Customer, Create Service and related relationships