blob: b031aab44f94517ba2667fd50d92a18371eea62e [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
DR695H18872bc2019-06-13 16:16:52 -04004Library ONAPLibrary.Utilities
DR695H67afaca2019-07-23 17:13:23 -04005Library ONAPLibrary.Templating WITH NAME Templating
DR695H910097e2019-05-08 13:55:32 -04006Library SeleniumLibrary
DR695H910097e2019-05-08 13:55:32 -04007Resource browser_setup.robot
DR695Hccff30b2017-02-17 18:44:24 -05008
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/
DR695Hf1621de2019-06-20 15:37:57 -040013${APPC_MOUNT_XML} appc/vnf_mount.jinja
DR695Hbf5a3a32017-06-30 13:09:57 -040014${APPC_ENDPOINT} ${GLOBAL_APPC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPC_IP_ADDR}:${GLOBAL_APPC_SERVER_PORT}
DR695Hffe5abf2019-06-20 16:58:49 -040015${APPC_CDT_Config_Scaleout} ${EXECDIR}/robot/assets/appc/template_ConfigScaleOut_vLoadBalancer_vLoadBalancer-test0_0.0.1V_vLB.xml
16${APPC_CDT_Config_Scaleout_PD} ${EXECDIR}/robot/assets/appc/pd_ConfigScaleOut_vLoadBalancer_vLoadBalancer-test0_0.0.1V_vLB.yaml
17${APPC_CDT_Config_Scaleout_REF} ${EXECDIR}/robot/assets/appc/reference_AllAction_vLoadBalancer_vLoadBalancer-test0_0.0.1V.json
Aaron Hayc3f081d2018-08-05 13:01:17 -040018${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
DR695Hbf5a3a32017-06-30 13:09:57 -040021
DR695Hccff30b2017-02-17 18:44:24 -050022
23*** Keywords ***
24Run 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 Flood81d33fb2017-11-21 16:21:21 -050028 Should Be Equal As Strings ${resp.json()['output']['response-code']} 200
DR695Hccff30b2017-02-17 18:44:24 -050029
30Run APPC Post Request
31 [Documentation] Runs an APPC post request
32 [Arguments] ${data_path} ${data} ${content}=json
DR695Hbf5a3a32017-06-30 13:09:57 -040033 Log Creating session ${APPC_ENDPOINT}
DR695Hd0453b22019-07-31 17:28:14 -040034 ${session}= Create Session appc ${APPC_ENDPOINT} auth=${GLOBAL_APPC_AUTHENTICATION}
DR695H18872bc2019-06-13 16:16:52 -040035 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -050036 ${headers}= Create Dictionary Accept=application/${content} Content-Type=application/${content} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
37 ${resp}= Post Request appc ${data_path} data=${data} headers=${headers}
38 Log Received response from appc ${resp.text}
39 [Return] ${resp}
40
41Run APPC Put Request
42 [Documentation] Runs an APPC post request
43 [Arguments] ${data_path} ${data} ${content}=xml
DR695Hbf5a3a32017-06-30 13:09:57 -040044 Log Creating session ${APPC_ENDPOINT}
DR695Hd0453b22019-07-31 17:28:14 -040045 ${session}= Create Session appc ${APPC_ENDPOINT} auth=${GLOBAL_APPC_AUTHENTICATION}
DR695H18872bc2019-06-13 16:16:52 -040046 ${uuid}= Generate UUID4
DR695Hccff30b2017-02-17 18:44:24 -050047 ${headers}= Create Dictionary Accept=application/${content} Content-Type=application/${content} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
48 ${resp}= Put Request appc ${data_path} data=${data} headers=${headers}
49 Log Received response from appc ${resp.text}
50 [Return] ${resp}
Jerry Flood81d33fb2017-11-21 16:21:21 -050051
DR695Hccff30b2017-02-17 18:44:24 -050052Create Mount Point In APPC
53 [Documentation] Go tell APPC about the PGN we just spun up...
54 [Arguments] ${nodeid} ${host} ${port}=${GLOBAL_PGN_PORT} ${username}=admin ${password}=admin
55 ${dict}= Create Dictionary nodeid=${nodeid} host=${host} port=${port} username=${username} password=${password}
DR695H67afaca2019-07-23 17:13:23 -040056 Templating.Create Environment appc ${GLOBAL_TEMPLATE_FOLDER}
57 ${data}= Templating.Apply Template appc ${APPC_MOUNT_XML} ${dict}
DR695Hccff30b2017-02-17 18:44:24 -050058 ${resp}= Run APPC Put Request ${APPC_INDEX PATH}${APPC_CREATE_MOUNTPOINT_PATH}${nodeid} ${data}
DR695Hb034c282018-02-23 18:33:19 -050059 Should Be True 200 <= ${resp.status_code} < 300
Tal Karbachinskyb97d9302018-02-08 10:58:26 +020060 [Return] ${resp}
Aaron Hayc3f081d2018-08-05 13:01:17 -040061
62Preload APPC CDT GUI
63 [Documentation] APPC CDT GUI Preload
64 [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}
65 # Setup Browser Now being managed by test case
66 ##Setup Browser
67 Go To ${APPC_CDT_LOGIN_URL}#/home
68 Set Selenium Speed ${GLOBAL_SELENIUM_DELAY}
69 Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
70 Log Logging in to ${APPC_CDT_ENDPOINT}
71 Handle Proxy Warning
72 Wait Until Page Contains WELCOME ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
73 Go To ${APPC_CDT_LOGIN_URL}#/vnfs
74 Wait Until Element Is Visible id=userId ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
75 Input Text id=userId ${username}
76 Click Button Submit
77 Page Should Contain ${username}
78 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}
79 Click Button Create New VNF Type or VNFC Type
80 Page Should Contain Enter VNF type and VNFC to proceed
81 Click Button Proceed anyway
82 Click Button Upload Reference File
83 Choose File id=inputFile ${reference_file}
84 Select From List By Value name=templateIdentifier vLB
85 Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
86 Click Link Template
87 Click Button Upload Template File
88 Choose File id=inputFile ${template_file}
89 Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
90 Click Link Parameter Definition
91 Click Button UPLOAD PD FILE
92 Choose File id=inputFile1 ${parameterdefinition_file}
93 Sleep ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT}
94 Click Link Reference Data
95 Select From List By Value name=templateIdentifier vLB
96 Click Button saveToAppc
97 Go To ${APPC_CDT_LOGIN_URL}#/vnfs
98 Wait Until Page Contains ${reference_file_name} ${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT}
99 Log Logged in to ${APPC_CDT_ENDPOINT}