blob: 2415539cd6dd0ec1f21d1eb5ed228559ef7b4442 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with APP-C. It handles low level stuff like managing the http request library and APP-C required fields
3Library RequestsLibrary
Jerry Flood81d33fb2017-11-21 16:21:21 -05004Library UUID
DR695Hccff30b2017-02-17 18:44:24 -05005Library OperatingSystem
DR695H910097e2019-05-08 13:55:32 -04006Library SeleniumLibrary
DR695Hccff30b2017-02-17 18:44:24 -05007Library StringTemplater
8Resource global_properties.robot
DR695H910097e2019-05-08 13:55:32 -04009Resource browser_setup.robot
DR695Hccff30b2017-02-17 18:44:24 -050010
11*** Variables ***
12${APPC_INDEX_PATH} /restconf
13${APPC_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck
14${APPC_CREATE_MOUNTPOINT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/
15${APPC_MOUNT_XML} robot/assets/templates/appc/vnf_mount.template
DR695Hbf5a3a32017-06-30 13:09:57 -040016${APPC_ENDPOINT} ${GLOBAL_APPC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPC_IP_ADDR}:${GLOBAL_APPC_SERVER_PORT}
Aaron Hayc3f081d2018-08-05 13:01:17 -040017${APPC_CDT_Config_Scaleout} ${EXECDIR}/robot/assets/templates/appc/template_ConfigScaleOut_vLoadBalancer_vLoadBalancer-test0_0.0.1V_vLB.xml
18${APPC_CDT_Config_Scaleout_PD} ${EXECDIR}/robot/assets/templates/appc/pd_ConfigScaleOut_vLoadBalancer_vLoadBalancer-test0_0.0.1V_vLB.yaml
19${APPC_CDT_Config_Scaleout_REF} ${EXECDIR}/robot/assets/templates/appc/reference_AllAction_vLoadBalancer_vLoadBalancer-test0_0.0.1V.json
20${APPC_CDT_Config_Scaleout_REF_name} reference_AllAction_vLoadBalancer_vLoadBalancer-test0_0.0.1V.json
21${APPC_CDT_ENDPOINT} ${GLOBAL_APPC_CDT_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPC_CDT_IP_ADDR}:${GLOBAL_APPC_CDT_SERVER_PORT}
22${APPC_CDT_LOGIN_URL} ${APPC_CDT_ENDPOINT}/index.html
DR695Hbf5a3a32017-06-30 13:09:57 -040023
DR695Hccff30b2017-02-17 18:44:24 -050024
25*** Keywords ***
26Run APPC Health Check
27 [Documentation] Runs an APPC healthcheck
28 ${resp}= Run APPC Post Request ${APPC_INDEX PATH}${APPC_HEALTHCHECK_OPERATION_PATH} ${None}
29 Should Be Equal As Strings ${resp.status_code} 200
Jerry Flood81d33fb2017-11-21 16:21:21 -050030 Should Be Equal As Strings ${resp.json()['output']['response-code']} 200
DR695Hccff30b2017-02-17 18:44:24 -050031
32Run APPC Post Request
33 [Documentation] Runs an APPC post request
34 [Arguments] ${data_path} ${data} ${content}=json
35 ${auth}= Create List ${GLOBAL_APPC_USERNAME} ${GLOBAL_APPC_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040036 Log Creating session ${APPC_ENDPOINT}
37 ${session}= Create Session appc ${APPC_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050038 ${uuid}= Generate UUID
39 ${headers}= Create Dictionary Accept=application/${content} Content-Type=application/${content} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
40 ${resp}= Post Request appc ${data_path} data=${data} headers=${headers}
41 Log Received response from appc ${resp.text}
42 [Return] ${resp}
43
44Run APPC Put Request
45 [Documentation] Runs an APPC post request
46 [Arguments] ${data_path} ${data} ${content}=xml
47 ${auth}= Create List ${GLOBAL_APPC_USERNAME} ${GLOBAL_APPC_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040048 Log Creating session ${APPC_ENDPOINT}
49 ${session}= Create Session appc ${APPC_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050050 ${uuid}= Generate UUID
51 ${headers}= Create Dictionary Accept=application/${content} Content-Type=application/${content} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
52 ${resp}= Put Request appc ${data_path} data=${data} headers=${headers}
53 Log Received response from appc ${resp.text}
54 [Return] ${resp}
Jerry Flood81d33fb2017-11-21 16:21:21 -050055
DR695Hccff30b2017-02-17 18:44:24 -050056Create Mount Point In APPC
57 [Documentation] Go tell APPC about the PGN we just spun up...
58 [Arguments] ${nodeid} ${host} ${port}=${GLOBAL_PGN_PORT} ${username}=admin ${password}=admin
59 ${dict}= Create Dictionary nodeid=${nodeid} host=${host} port=${port} username=${username} password=${password}
60 ${template}= OperatingSystem.Get File ${APPC_MOUNT_XML}
Jerry Flood81d33fb2017-11-21 16:21:21 -050061 ${data}= Template String ${template} ${dict}
DR695Hccff30b2017-02-17 18:44:24 -050062 ${resp}= Run APPC Put Request ${APPC_INDEX PATH}${APPC_CREATE_MOUNTPOINT_PATH}${nodeid} ${data}
DR695Hb034c282018-02-23 18:33:19 -050063 Should Be True 200 <= ${resp.status_code} < 300
Tal Karbachinskyb97d9302018-02-08 10:58:26 +020064 [Return] ${resp}
Aaron Hayc3f081d2018-08-05 13:01:17 -040065
66Preload APPC CDT GUI
67 [Documentation] APPC CDT GUI Preload
68 [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}
69 # Setup Browser Now being managed by test case
70 ##Setup Browser
71 Go To ${APPC_CDT_LOGIN_URL}#/home
72 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
73 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
74 Log Logging in to ${APPC_CDT_ENDPOINT}
75 Handle Proxy Warning
76 Wait Until Page Contains WELCOME ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
77 Go To ${APPC_CDT_LOGIN_URL}#/vnfs
78 Wait Until Element Is Visible id=userId ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
79 Input Text id=userId ${username}
80 Click Button Submit
81 Page Should Contain ${username}
82 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}
83 Click Button Create New VNF Type or VNFC Type
84 Page Should Contain Enter VNF type and VNFC to proceed
85 Click Button Proceed anyway
86 Click Button Upload Reference File
87 Choose File id=inputFile ${reference_file}
88 Select From List By Value name=templateIdentifier vLB
89 Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
90 Click Link Template
91 Click Button Upload Template File
92 Choose File id=inputFile ${template_file}
93 Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
94 Click Link Parameter Definition
95 Click Button UPLOAD PD FILE
96 Choose File id=inputFile1 ${parameterdefinition_file}
97 Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
98 Click Link Reference Data
99 Select From List By Value name=templateIdentifier vLB
100 Click Button saveToAppc
101 Go To ${APPC_CDT_LOGIN_URL}#/vnfs
102 Wait Until Page Contains ${reference_file_name} ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
103 Log Logged in to ${APPC_CDT_ENDPOINT}