DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | 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 |
| 3 | Library RequestsLibrary |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 4 | Library UUID |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 5 | Library OperatingSystem |
| 6 | Library StringTemplater |
| 7 | Resource global_properties.robot |
| 8 | |
| 9 | *** Variables *** |
| 10 | ${APPC_INDEX_PATH} /restconf |
| 11 | ${APPC_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck |
| 12 | ${APPC_CREATE_MOUNTPOINT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/ |
| 13 | ${APPC_MOUNT_XML} robot/assets/templates/appc/vnf_mount.template |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 14 | ${APPC_ENDPOINT} ${GLOBAL_APPC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPC_IP_ADDR}:${GLOBAL_APPC_SERVER_PORT} |
Aaron Hay | c3f081d | 2018-08-05 13:01:17 -0400 | [diff] [blame] | 15 | ${APPC_CDT_Config_Scaleout} ${EXECDIR}/robot/assets/templates/appc/template_ConfigScaleOut_vLoadBalancer_vLoadBalancer-test0_0.0.1V_vLB.xml |
| 16 | ${APPC_CDT_Config_Scaleout_PD} ${EXECDIR}/robot/assets/templates/appc/pd_ConfigScaleOut_vLoadBalancer_vLoadBalancer-test0_0.0.1V_vLB.yaml |
| 17 | ${APPC_CDT_Config_Scaleout_REF} ${EXECDIR}/robot/assets/templates/appc/reference_AllAction_vLoadBalancer_vLoadBalancer-test0_0.0.1V.json |
| 18 | ${APPC_CDT_Config_Scaleout_REF_name} reference_AllAction_vLoadBalancer_vLoadBalancer-test0_0.0.1V.json |
| 19 | ${APPC_CDT_ENDPOINT} ${GLOBAL_APPC_CDT_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPC_CDT_IP_ADDR}:${GLOBAL_APPC_CDT_SERVER_PORT} |
| 20 | ${APPC_CDT_LOGIN_URL} ${APPC_CDT_ENDPOINT}/index.html |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 21 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 22 | |
| 23 | *** Keywords *** |
| 24 | Run APPC Health Check |
| 25 | [Documentation] Runs an APPC healthcheck |
| 26 | ${resp}= Run APPC Post Request ${APPC_INDEX PATH}${APPC_HEALTHCHECK_OPERATION_PATH} ${None} |
| 27 | Should Be Equal As Strings ${resp.status_code} 200 |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 28 | Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 29 | |
| 30 | Run APPC Post Request |
| 31 | [Documentation] Runs an APPC post request |
| 32 | [Arguments] ${data_path} ${data} ${content}=json |
| 33 | ${auth}= Create List ${GLOBAL_APPC_USERNAME} ${GLOBAL_APPC_PASSWORD} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 34 | Log Creating session ${APPC_ENDPOINT} |
| 35 | ${session}= Create Session appc ${APPC_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | ${uuid}= Generate UUID |
| 37 | ${headers}= Create Dictionary Accept=application/${content} Content-Type=application/${content} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 38 | ${resp}= Post Request appc ${data_path} data=${data} headers=${headers} |
| 39 | Log Received response from appc ${resp.text} |
| 40 | [Return] ${resp} |
| 41 | |
| 42 | Run APPC Put Request |
| 43 | [Documentation] Runs an APPC post request |
| 44 | [Arguments] ${data_path} ${data} ${content}=xml |
| 45 | ${auth}= Create List ${GLOBAL_APPC_USERNAME} ${GLOBAL_APPC_PASSWORD} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 46 | Log Creating session ${APPC_ENDPOINT} |
| 47 | ${session}= Create Session appc ${APPC_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 48 | ${uuid}= Generate UUID |
| 49 | ${headers}= Create Dictionary Accept=application/${content} Content-Type=application/${content} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 50 | ${resp}= Put Request appc ${data_path} data=${data} headers=${headers} |
| 51 | Log Received response from appc ${resp.text} |
| 52 | [Return] ${resp} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 53 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 54 | Create Mount Point In APPC |
| 55 | [Documentation] Go tell APPC about the PGN we just spun up... |
| 56 | [Arguments] ${nodeid} ${host} ${port}=${GLOBAL_PGN_PORT} ${username}=admin ${password}=admin |
| 57 | ${dict}= Create Dictionary nodeid=${nodeid} host=${host} port=${port} username=${username} password=${password} |
| 58 | ${template}= OperatingSystem.Get File ${APPC_MOUNT_XML} |
Jerry Flood | 81d33fb | 2017-11-21 16:21:21 -0500 | [diff] [blame] | 59 | ${data}= Template String ${template} ${dict} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 60 | ${resp}= Run APPC Put Request ${APPC_INDEX PATH}${APPC_CREATE_MOUNTPOINT_PATH}${nodeid} ${data} |
DR695H | b034c28 | 2018-02-23 18:33:19 -0500 | [diff] [blame] | 61 | Should Be True 200 <= ${resp.status_code} < 300 |
Tal Karbachinsky | b97d930 | 2018-02-08 10:58:26 +0200 | [diff] [blame] | 62 | [Return] ${resp} |
Aaron Hay | c3f081d | 2018-08-05 13:01:17 -0400 | [diff] [blame] | 63 | |
| 64 | Preload APPC CDT GUI |
| 65 | [Documentation] APPC CDT GUI Preload |
| 66 | [Arguments] ${username}=${GLOBAL_APPC_CDT_USERNAME} ${reference_file_name}=${APPC_CDT_Config_Scaleout_REF_name} ${reference_file}=${APPC_CDT_Config_Scaleout_REF} ${template_file}=${APPC_CDT_Config_Scaleout} ${parameterdefinition_file}=${APPC_CDT_Config_Scaleout_PD} |
| 67 | # Setup Browser Now being managed by test case |
| 68 | ##Setup Browser |
| 69 | Go To ${APPC_CDT_LOGIN_URL}#/home |
| 70 | Set Selenium Speed ${GLOBAL_SELENIUM_DELAY} |
| 71 | Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
| 72 | Log Logging in to ${APPC_CDT_ENDPOINT} |
| 73 | Handle Proxy Warning |
| 74 | Wait Until Page Contains WELCOME ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} |
| 75 | Go To ${APPC_CDT_LOGIN_URL}#/vnfs |
| 76 | Wait Until Element Is Visible id=userId ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} |
| 77 | Input Text id=userId ${username} |
| 78 | Click Button Submit |
| 79 | Page Should Contain ${username} |
| 80 | Wait Until Page Contains Element xpath=(//*[@class='mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary']) ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} |
| 81 | Click Button Create New VNF Type or VNFC Type |
| 82 | Page Should Contain Enter VNF type and VNFC to proceed |
| 83 | Click Button Proceed anyway |
| 84 | Click Button Upload Reference File |
| 85 | Choose File id=inputFile ${reference_file} |
| 86 | Select From List By Value name=templateIdentifier vLB |
| 87 | Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
| 88 | Click Link Template |
| 89 | Click Button Upload Template File |
| 90 | Choose File id=inputFile ${template_file} |
| 91 | Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
| 92 | Click Link Parameter Definition |
| 93 | Click Button UPLOAD PD FILE |
| 94 | Choose File id=inputFile1 ${parameterdefinition_file} |
| 95 | Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} |
| 96 | Click Link Reference Data |
| 97 | Select From List By Value name=templateIdentifier vLB |
| 98 | Click Button saveToAppc |
| 99 | Go To ${APPC_CDT_LOGIN_URL}#/vnfs |
| 100 | Wait Until Page Contains ${reference_file_name} ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} |
| 101 | Log Logged in to ${APPC_CDT_ENDPOINT} |