Update VID and SDNC preload for amsterdam 91/24791/1
authorJerry Flood <jf9860@att.com>
Tue, 21 Nov 2017 21:21:21 +0000 (16:21 -0500)
committerJerry Flood <jf9860@att.com>
Tue, 21 Nov 2017 21:21:52 +0000 (16:21 -0500)
Issue: TEST-54
Change-Id: Iaa0d952d78f11cf1d271dce7de21bca2ff7cd419
Signed-off-by: Jerry Flood <jf9860@att.com>
robot/resources/appc_interface.robot
robot/resources/sdngc_interface.robot
robot/resources/stack_validation/validate_common.robot
robot/resources/stack_validation/validate_vfw.robot
robot/resources/test_templates/vnf_orchestration_test_template.robot
robot/resources/vid/create_service_instance.robot
robot/resources/vid/create_vid_vnf.robot

index 289d1d7..5cebd9a 100644 (file)
@@ -1,7 +1,7 @@
 *** Settings ***
 Documentation     The main interface for interacting with APP-C. It handles low level stuff like managing the http request library and APP-C required fields
 Library              RequestsLibrary
-Library                  UUID      
+Library                  UUID
 Library           OperatingSystem
 Library           StringTemplater
 Resource          global_properties.robot
@@ -19,7 +19,7 @@ Run APPC Health Check
     [Documentation]    Runs an APPC healthcheck
        ${resp}=    Run APPC Post Request     ${APPC_INDEX PATH}${APPC_HEALTHCHECK_OPERATION_PATH}     ${None}
     Should Be Equal As Strings         ${resp.status_code}     200
-    Should Be Equal As Strings         ${resp.json()['output']['response-code']}       200   
+    Should Be Equal As Strings         ${resp.json()['output']['response-code']}       200
 
 Run APPC Post Request
     [Documentation]    Runs an APPC post request
@@ -44,13 +44,13 @@ Run APPC Put Request
     ${resp}=   Put Request     appc    ${data_path}     data=${data}    headers=${headers}
     Log    Received response from appc ${resp.text}
     [Return]    ${resp}
-    
+
 Create Mount Point In APPC
     [Documentation]     Go tell APPC about the PGN we just spun up...
     [Arguments]    ${nodeid}    ${host}    ${port}=${GLOBAL_PGN_PORT}    ${username}=admin    ${password}=admin
     ${dict}=    Create Dictionary    nodeid=${nodeid}    host=${host}    port=${port}    username=${username}    password=${password}
     ${template}=    OperatingSystem.Get File    ${APPC_MOUNT_XML}
-    ${data}=    Template String    ${template}    ${dict}   
+    ${data}=    Template String    ${template}    ${dict}
     ${resp}=    Run APPC Put Request     ${APPC_INDEX PATH}${APPC_CREATE_MOUNTPOINT_PATH}${nodeid}     ${data}
-    Should Be Equal As Strings         ${resp.status_code}     200
-    [Return]     ${resp}    
\ No newline at end of file
+    Should Be Equal As Strings         ${resp.status_code}     201
+    [Return]     ${resp}
\ No newline at end of file
index 754904f..2339ab5 100644 (file)
@@ -118,7 +118,7 @@ Preload One Vnf Topology
     Return From Keyword If    '${filename}' == ''
     ${data_template}=    OperatingSystem.Get File    ${PRELOAD_VNF_TOPOLOGY_OPERATION_BODY}/preload.template
     ${parameters}=    Get Template Parameters    ${filename}   ${uuid}
-    Set To Dictionary   ${parameters}   generic_vnf_name=${generic_vnf_name}     generic_vnf_type=${generic_vnf_type}  service_type=${service_type_uuid}    vf_module_name=${vf_module_name}    vf_module_type=${vf_module_type}    uuid=${uuid}
+    Set To Dictionary   ${parameters}   generic_vnf_name=${generic_vnf_name}     generic_vnf_type=${generic_vnf_type}  service_type=${service_type_uuid}    vf_module_name=${vf_module_name}    vf_module_type=${vf_module_type}
     ${data}=   Fill JSON Template    ${data_template}    ${parameters}
        ${put_resp}=    Run SDNGC Post Request     ${SDNGC_INDEX_PATH}${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH}     ${data}
     Should Be Equal As Strings         ${put_resp.json()['output']['response-code']}   200
@@ -130,26 +130,44 @@ Get Template Parameters
     ${rest}   ${suite}=    Split String From Right    ${SUITE NAME}   .   1
     ${uuid}=    Catenate    ${uuid}
     ${hostid}=    Get Substring    ${uuid}    -4
-    ${ecompnet}=    Evaluate    ${GLOBAL_BUILD_NUMBER}%255
+    ${ecompnet}=    Evaluate    (${GLOBAL_BUILD_NUMBER}%128)+128
+
+
     # Initialize the value map with the properties generated from the Robot VM /opt/config folder
-    ${valuemap}=   Create Dictionary
+    ${valuemap}=   Copy Dictionary    ${GLOBAL_INJECTED_PROPERTIES}
+
+    # These should be deprecated by the above....
     Set To Dictionary   ${valuemap}   artifacts_version=${GLOBAL_INJECTED_ARTIFACTS_VERSION}
     Set To Dictionary   ${valuemap}   network=${GLOBAL_INJECTED_NETWORK}
     Set To Dictionary   ${valuemap}   public_net_id=${GLOBAL_INJECTED_PUBLIC_NET_ID}
     Set To Dictionary   ${valuemap}   cloud_env=${GLOBAL_INJECTED_CLOUD_ENV}
-    Set To Dictionary   ${valuemap}   install_script_version=${GLOBAL_INJECTED_INSTALL_SCRIPT_VERSION}
+    Set To Dictionary   ${valuemap}   install_script_version=${GLOBAL_INJECTED_SCRIPT_VERSION}
     Set To Dictionary   ${valuemap}   vm_image_name=${GLOBAL_INJECTED_VM_IMAGE_NAME}
-    Set To Dictionary   ${valuemap}   vm_flavor_name=${GLOBAL_INJECTED_VM_FLAVOR_NAME}
+    Set To Dictionary   ${valuemap}   vm_flavor_name=${GLOBAL_INJECTED_VM_FLAVOR}
+
+
     # update the value map with unique values.
     Set To Dictionary   ${valuemap}   uuid=${uuid}   hostid=${hostid}    ecompnet=${ecompnet}
-    ${parameters}=    Create Dictionary
-    ${defaults}=    Get From Dictionary    ${GLOBAL_PRELOAD_PARAMETERS}    defaults
-    Resolve Values Into Dictionary   ${valuemap}   ${defaults}    ${parameters}
+
+    #
+    # Mash together the defaults dict with the test case dict to create the set of
+    # preload parameters
+    #
     ${suite_templates}=    Get From Dictionary    ${GLOBAL_PRELOAD_PARAMETERS}    ${suite}
     ${template}=    Get From Dictionary    ${suite_templates}    ${template}
-    ${vnf_parameters}=   Resolve VNF Parameters Into Array   ${valuemap}   ${template}    ${parameters}
+    ${defaults}=    Get From Dictionary    ${GLOBAL_PRELOAD_PARAMETERS}    defaults
+    # add all of the defaults to template...
+    @{keys}=    Get Dictionary Keys    ${defaults}
+    :for   ${key}   in   @{keys}
+    \    ${value}=   Get From Dictionary    ${defaults}    ${key}
+    \    Set To Dictionary    ${template}  ${key}    ${value}
+
+    #
+    # Get the vnf_parameters to preload
+    #
+    ${vnf_parameters}=   Resolve VNF Parameters Into Array   ${valuemap}   ${template}
     ${vnf_parameters_json}=   Evaluate    json.dumps(${vnf_parameters})    json
-    Set To Dictionary   ${parameters}   vnf_parameters=${vnf_parameters_json}
+    ${parameters}=   Create Dictionary   vnf_parameters=${vnf_parameters_json}
     [Return]    ${parameters}
 
 Resolve Values Into Dictionary
@@ -161,7 +179,7 @@ Resolve Values Into Dictionary
     \    Set To Dictionary    ${to}    ${key}    ${value}
 
 Resolve VNF Parameters Into Array
-    [Arguments]   ${valuemap}    ${from}    ${to}
+    [Arguments]   ${valuemap}    ${from}
     ${vnf_parameters}=   Create List
     ${keys}=    Get Dictionary Keys    ${from}
     :for   ${key}   in  @{keys}
@@ -201,7 +219,7 @@ Login To SDNGC Admin GUI
     ## Setup Browser is now being managed by the test case
     ## Setup Browser
     Go To    ${SDNGC_ADMIN_SIGNUP_URL}
-    Maximize Browser Window
+    ##Maximize Browser Window
     Set Selenium Speed    ${GLOBAL_SELENIUM_DELAY}
     Set Browser Implicit Wait    ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
     Log    Logging in to ${SDNGC_ADMIN_LOGIN_URL}
index 24f9fe3..6c97fac 100644 (file)
@@ -32,7 +32,7 @@ Get Server Ip
     ${server_name}=   Get From Dictionary     ${stack_info}   ${key_name}
     ${server}=    Get From Dictionary    ${server_list}    ${server_name}
     Log    Entering Get Openstack Server Ip
-    ${ip}=    Get Openstack Server Ip    ${server}    network_name=${network_name}
+    ${ip}=    Search Addresses    ${server}    ${network_name}
     Log    Returned Get Openstack Server Ip
     [Return]    ${ip}
 
@@ -45,3 +45,58 @@ Find And Reboot The Server
     Reboot Server    auth   ${vfw_server_id}
 
 
+Search Addresses
+    [Arguments]   ${server}   ${network_name}
+    ${addresses}   Get From Dictionary   ${server}   addresses
+    ${status}   ${server_ip}=   Run Keyword And Ignore Error   Find Rackspace   ${addresses}   ${network_name}
+    Return From Keyword If   '${status}'=='PASS'   ${server_ip}
+    ${status}   ${server_ip}=   Run Keyword And Ignore Error   Find Openstack   ${addresses}   ${network_name}
+    Return From Keyword If   '${status}'=='PASS'   ${server_ip}
+    ${status}   ${server_ip}=   Run Keyword And Ignore Error   Find Openstack 2   ${addresses}   ${network_name}
+    Return From Keyword If   '${status}'=='PASS'   ${server_ip}
+    Fail  ${server}/${network_name} Not Found
+
+Find Rackspace
+    [Arguments]   ${addresses}   ${network_name}
+    ${ips}   Get From Dictionary   ${addresses}   ${network_name}
+    ${ip}=   Get V4 IP   ${ips}
+    [Return]   ${ip}
+
+Find Openstack
+    [Arguments]   ${addresses}   ${network_name}
+    ${network_name}=   Set Variable If    '${network_name}' == 'public'    external   ${network_name}
+    ${ip}=   Get V4 IP Openstack   ${addresses}   ${network_name}
+    [Return]   ${ip}
+
+Find Openstack 2
+    [Arguments]   ${addresses}   ${network_name}
+    ${network_name}=   Set Variable If    '${network_name}' == 'public'    floating   ${network_name}
+    ${ipmaps}=   Get From Dictionary   ${addresses}   ${GLOBAL_INJECTED_NETWORK}
+    ${ip}=   Get V4 IP Openstack 2  ${ipmaps}   ${network_name}
+    [Return]   ${ip}
+
+Get V4 IP
+    [Arguments]   ${ipmaps}
+    :for   ${ipmap}   in   @{ipmaps}
+    \    ${ip}   Get From Dictionary   ${ipmap}   addr
+    \    ${version}   Get From Dictionary   ${ipmap}   version
+    \    Return from Keyword if   '${version}' == '4'   ${ip}
+    Fail  No Version 4 IP
+
+Get V4 IP Openstack
+    [Arguments]   ${addresses}   ${testtype}
+    ${ipmaps}=   Get From Dictionary   ${addresses}   ${testtype}
+    :for   ${ipmap}   in   @{ipmaps}
+    \    ${ip}   Get From Dictionary   ${ipmap}   addr
+    \    ${version}   Get From Dictionary   ${ipmap}   version
+    \    Return from Keyword if   '${version}'=='4'   ${ip}
+    Fail  No Version 4 IP
+
+Get V4 IP Openstack 2
+    [Arguments]   ${ipmaps}   ${testtype}
+    :for   ${ipmap}   in   @{ipmaps}
+    \    ${type}   Get From Dictionary   ${ipmap}   OS-EXT-IPS:type
+    \    ${ip}   Get From Dictionary   ${ipmap}   addr
+    \    ${version}   Get From Dictionary   ${ipmap}   version
+    \    Return from Keyword if   '${version}'=='4' and '${type}'=='${testtype}'   ${ip}
+    Fail  No Version 4 IP
index b0d591f..e162720 100644 (file)
@@ -60,18 +60,18 @@ Wait For Packets
 Wait For Firewall
     [Documentation]     Wait for the defined firewall processes to come up
     [Arguments]    ${ip}
-    Wait for Process on Host    ./vpp_measurement_reporter    ${ip}
+    ##Wait for Process on Host    ./vpp_measurement_reporter    ${ip}
     Wait for Process on Host    vpp -c /etc/vpp/startup.conf    ${ip}
 
 Wait For Packet Generator
     [Documentation]     Wait for the defined packet generator processes to come up
     [Arguments]    ${ip}
     Wait for Process on Host    vpp -c /etc/vpp/startup.conf    ${ip}
-    Wait Until Keyword Succeeds    180s    5s    Tail File on Host Until    ${ip}    Honeycomb    /var/log/honeycomb/honeycomb.log    - Honeycomb initialized   options=-c +0    timeout=120s
+    ##Wait Until Keyword Succeeds    180s    5s    Tail File on Host Until    ${ip}    Honeycomb    /var/log/honeycomb/honeycomb.log    - Honeycomb initialized   options=-c +0    timeout=120s
     Run Keyword And Ignore Error    Wait for Process on Host    run_traffic_fw_demo.sh    ${ip}    timeout=60s
     Pkill Process On Host    "/bin/bash ./run_traffic_fw_demo.sh"    ${ip}
 
 Wait For Packet Sink
     [Documentation]     Wait for the defined packet sink processes to come up
     [Arguments]    ${ip}
-    Log    noting to check on ${ip}
+    Wait for Process on Host    /usr/sbin/darkstat    ${ip}
index ceba3a7..1d53da1 100644 (file)
@@ -60,12 +60,12 @@ Orchestrate VNF
     Create Customer For VNF    ${CUSTOMER_NAME}    ${CUSTOMER_NAME}    INFRA    ${service_type}    ${GLOBAL_AAI_CLOUD_OWNER}
     Setup Browser
     Login To VID GUI
-    ${service_instance_id}=    Create VID Service Instance    ${customer_name}    ${service_model_type}    ${service}     ${service_name}
+    ${service_instance_id}=   Wait Until Keyword Succeeds    300s   5s    Create VID Service Instance    ${customer_name}    ${service_model_type}    ${service}     ${service_name}
     Set Test Variable   ${SERVICE_INSTANCE_ID}   ${service_instance_id}
     Validate Service Instance    ${service_instance_id}    ${service}      ${customer_name}
-    Create VID VNF    ${service_instance_id}    ${vnf_name}    ${product_family}    ${lcp_region}    ${tenant}    ${vnf_type}
+    Wait Until Keyword Succeeds    300s   5s    Create VID VNF    ${service_instance_id}    ${vnf_name}    ${product_family}    ${lcp_region}    ${tenant}    ${vnf_type}   ${CUSTOMER_NAME}
     ${vf_module_type}   ${closedloop_vf_module}=   Preload Vnf    ${service_instance_id}   ${vnf_name}   ${vnf_type}   ${vf_module_name}    ${vf_modules}    ${service}    ${uuid}
-    ${vf_module_id}=   Create VID VNF module    ${service_instance_id}    ${vf_module_name}    ${lcp_region}    ${tenant}     ${vf_module_type}
+    ${vf_module_id}=   Create VID VNF module    ${service_instance_id}    ${vf_module_name}    ${lcp_region}    ${tenant}     ${vf_module_type}   ${CUSTOMER_NAME}
     ${generic_vnf}=   Validate Generic VNF    ${vnf_name}    ${vnf_type}    ${service_instance_id}
     VLB Closed Loop Hack   ${service}   ${generic_vnf}   ${closedloop_vf_module}
     Set Test Variable    ${STACK_NAME}   ${vf_module_name}
index 6c7f8a0..00fafea 100644 (file)
@@ -22,11 +22,12 @@ Create VID Service Instance
     Wait Until Page Contains Element    xpath=//input[@parameter-name='Instance Name']    ${GLOBAL_VID_UI_TIMEOUT_LONG}
     Wait Until Element Is Visible    xpath=//input[@parameter-name='Instance Name']    ${GLOBAL_VID_UI_TIMEOUT_LONG}
     Xpath Should Match X Times    //input[@parameter-name='Instance Name']    1
-    Input Text When Enabled    //input[@parameter-name='Instance Name']    ${service_name}
-    Select From List When Enabled    //select[@prompt='Select Subscriber Name']    ${customer_name}
+    Wait Until Keyword Succeeds   120s  5s    Input Text When Enabled    //input[@parameter-name='Instance Name']    ${service_name}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
+    Select From List When Enabled    //select[@prompt='Select Subscriber Name']    ${customer_name}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
     Select From List WHen Enabled    //select[@prompt='Select Service Type']     ${service_type}   timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
     Click On Button When Enabled    //div[@class = 'buttonRow']/button[text() = 'Confirm']
-       Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    requestId    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
+       Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    requestState    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
+       Page Should Contain    "requestState": "COMPLETE"
     ${response text}=    Get Text    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
     Click On Button When Enabled    //div[@class = 'buttonRow']/button[text() = 'Close']
     ${request_id}=    Parse Request Id    ${response text}
index 2db2421..67e308c 100644 (file)
@@ -14,22 +14,24 @@ Resource          vid_interface.robot
 
 Create VID VNF
     [Documentation]    Creates a VNF instance using VID for passed instance id with the passed service instance name
-    [Arguments]    ${service_instance_id}    ${service_instance_name}    ${product_family}    ${lcp_region}    ${tenant}   ${vnf_type}
+    [Arguments]    ${service_instance_id}    ${service_instance_name}    ${product_family}    ${lcp_region}    ${tenant}   ${vnf_type}   ${customer}
     Go To VID HOME
     Click Link       xpath=//div[@heading = 'Search for Existing Service Instances']/a
     Wait Until Page Contains    Please search by    timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
 
     # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
-    Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
-    Select From List By Label    //select[@ng-model='selectedserviceinstancetype']    Service Instance Id
+    #Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
+    #Select From List By Label    //select[@ng-model='selectedserviceinstancetype']    Service Instance Id
+    Select From List By Label    //select[@ng-model='selectedCustomer']    ${customer}
     Click Button    button=Submit
     Wait Until Page Contains Element    link=View/Edit    timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
     Click Element     xpath=//a[contains(text(), 'View/Edit')]
     Wait Until Page Contains    View/Edit Service Instance     timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
     Click Element    button=Add VNF
-
+    #01681d02-2304-4c91-ab2d 0
     # This is where firefox breaks. Th elink never becomes visible when run with the script.
-    Click Element    link=${vnf_type}
+    ${dataTestsId}=    Catenate   AddVNFOption-${vnf_type}
+    Click Element    xpath=//a[contains(text(), '${vnf_type}')]
     Wait Until Page Contains Element    xpath=//input[@parameter-id='instanceName']    ${GLOBAL_VID_UI_TIMEOUT_SHORT}
     Wait Until Element Is Enabled    xpath=//input[@parameter-id='instanceName']    ${GLOBAL_VID_UI_TIMEOUT_SHORT}
 
@@ -41,7 +43,7 @@ Create VID VNF
     Select From List By Label    xpath=//select[@parameter-id='lcpRegion']    ${lcp_region}
     Select From List By Label    xpath=//select[@parameter-id='tenant']    ${tenant}
     Click Element    button=Confirm
-       Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    Status: OK (200)    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
+       Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    requestState    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
     ${response text}=    Get Text    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
        Should Not Contain    ${response text}    FAILED
     Click Element    button=Close
@@ -79,14 +81,15 @@ Delete VID VNF
     Poll MSO Get Request    ${GLOBAL_MSO_STATUS_PATH}${request_id}   COMPLETE
 
 Create VID VNF module
-    [Arguments]    ${service_instance_id}    ${vf_module_name}    ${lcp_region}    ${TENANT}    ${VNF_TYPE}
+    [Arguments]    ${service_instance_id}    ${vf_module_name}    ${lcp_region}    ${TENANT}    ${VNF_TYPE}   ${customer}
     Go To VID HOME
     Click Link       xpath=//div[@heading = 'Search for Existing Service Instances']/a
     Wait Until Page Contains    Please search by    timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
     Wait Until Page Contains Element    xpath=//div[@class='statusLine aaiHidden']    timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
 
      # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException)
-    Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
+    Select From List By Label    //select[@ng-model='selectedCustomer']    ${customer}
+    ###Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
     Click Button    button=Submit
     Wait Until Page Contains Element    link=View/Edit    timeout=${GLOBAL_VID_UI_TIMEOUT_MEDIUM}
     Click Element     link=View/Edit
@@ -108,6 +111,7 @@ Create VID VNF module
     Input Text           xpath=//input[@parameter-id='instanceName']    ${vf_module_name}
     Select From List By Label    xpath=//select[@parameter-id='lcpRegion']    ${lcp_region}
     Select From List By Label    xpath=//select[@parameter-id='tenant']    ${tenant}
+    Select Checkbox    xpath=//input[@parameter-id='sdncPreload']
     Click Element    button=Confirm
        Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    requestId    timeout=${GLOBAL_VID_UI_TIMEOUT_LONG}
     ${response text}=    Get Text    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']