blob: 91c44c632d68824517d4cb72f39461e59aefe579 [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
6Library StringTemplater
7Resource 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
DR695Hbf5a3a32017-06-30 13:09:57 -040014${APPC_ENDPOINT} ${GLOBAL_APPC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPC_IP_ADDR}:${GLOBAL_APPC_SERVER_PORT}
Aaron Hayc3f081d2018-08-05 13:01:17 -040015${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
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
33 ${auth}= Create List ${GLOBAL_APPC_USERNAME} ${GLOBAL_APPC_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040034 Log Creating session ${APPC_ENDPOINT}
35 ${session}= Create Session appc ${APPC_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050036 ${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
42Run 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}
DR695Hbf5a3a32017-06-30 13:09:57 -040046 Log Creating session ${APPC_ENDPOINT}
47 ${session}= Create Session appc ${APPC_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050048 ${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 Flood81d33fb2017-11-21 16:21:21 -050053
DR695Hccff30b2017-02-17 18:44:24 -050054Create 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 Flood81d33fb2017-11-21 16:21:21 -050059 ${data}= Template String ${template} ${dict}
DR695Hccff30b2017-02-17 18:44:24 -050060 ${resp}= Run APPC Put Request ${APPC_INDEX PATH}${APPC_CREATE_MOUNTPOINT_PATH}${nodeid} ${data}
DR695Hb034c282018-02-23 18:33:19 -050061 Should Be True 200 <= ${resp.status_code} < 300
Tal Karbachinskyb97d9302018-02-08 10:58:26 +020062 [Return] ${resp}
Aaron Hayc3f081d2018-08-05 13:01:17 -040063
64Preload 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}