Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** settings *** |
| 2 | Resource ../../common.robot |
| 3 | Library Collections |
| 4 | Library RequestsLibrary |
| 5 | Library OperatingSystem |
| 6 | Library json |
| 7 | Library HttpLibrary.HTTP |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 8 | Library ONAPLibrary.Utilities |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 9 | |
| 10 | *** Variables *** |
| 11 | @{return_ok_list}= 200 201 202 204 |
| 12 | ${queryswagger_url} /api/nslcm/v1/swagger.json |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 13 | ${ns_url} /api/nslcm/v1/ns |
fujinhua | d5a3283 | 2019-04-19 09:45:49 +0800 | [diff] [blame] | 14 | ${get_subscriptions_url} /api/nslcm/v1/subscriptions |
fujinhua | 7aa8cd3 | 2019-04-05 08:20:53 +0800 | [diff] [blame] | 15 | ${healthcheck_url} /api/nslcm/v1/health_check |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 16 | ${get_job_url} /api/nslcm/v1/jobs |
| 17 | ${vnfs_url} /api/nslcm/v1/ns/vnfs |
| 18 | ${terminate_vnfs_url} /api/nslcm/v1/ns/terminatevnf |
| 19 | ${vls_url} /api/nslcm/v1/ns/vls |
| 20 | ${sfcs_url} /api/nslcm/v1/ns/sfcs |
| 21 | ${pnfs_url} /api/nslcm/v1/pnfs |
| 22 | |
| 23 | ${ns_instances_url} /api/nslcm/v1/ns_instances |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 24 | |
| 25 | #json files |
| 26 | ${create_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_ns.json |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 27 | ${heal_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/heal_ns.json |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 28 | ${scale_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/scale_ns.json |
| 29 | ${update_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns.json |
| 30 | ${terminate_ns_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_ns.json |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 31 | ${create_vnf_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_vnf.json |
| 32 | ${terminate_vnf_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json |
| 33 | ${create_vl_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_vl.json |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 34 | ${create_subscriptions_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_subscription.json |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 35 | |
| 36 | ${create_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 37 | ${terminate_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 38 | ${update_ns_instance_json} ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 39 | |
| 40 | #global variables |
| 41 | ${nsInstId} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 42 | ${jobInstId} |
| 43 | ${vnfInstId} |
| 44 | ${vlInstId} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 45 | ${nsInstanceId} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 46 | |
| 47 | *** Test Cases *** |
| 48 | NslcmSwaggerTest |
| 49 | [Documentation] query swagger info of nslcm |
| 50 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
| 51 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
| 52 | ${resp}= Get Request web_session ${queryswagger_url} |
| 53 | ${responese_code}= Convert To String ${resp.status_code} |
| 54 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 55 | ${response_json} json.loads ${resp.content} |
| 56 | ${swagger_version}= Convert To String ${response_json['swagger']} |
| 57 | Should Be Equal ${swagger_version} 2.0 |
| 58 | |
| 59 | NslcmSwaggerByMSBTest |
| 60 | [Documentation] query swagger info of nslcm by MSB |
| 61 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 62 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 63 | ${resp}= Get Request web_session ${queryswagger_url} |
| 64 | ${responese_code}= Convert To String ${resp.status_code} |
| 65 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 66 | ${response_json} json.loads ${resp.content} |
| 67 | ${swagger_version}= Convert To String ${response_json['swagger']} |
| 68 | Should Be Equal ${swagger_version} 2.0 |
| 69 | |
| 70 | CreateNSTest |
| 71 | [Documentation] Create NS function test |
| 72 | ${json_value}= json_from_file ${create_ns_json} |
| 73 | ${json_string}= string_from_json ${json_value} |
| 74 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 75 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 76 | Set Request Body ${json_string} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 77 | ${resp}= Post Request web_session ${ns_url} ${json_string} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 78 | ${responese_code}= Convert To String ${resp.status_code} |
| 79 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 80 | ${response_json} json.loads ${resp.content} |
| 81 | ${nsInstId}= Convert To String ${response_json['nsInstanceId']} |
| 82 | Set Global Variable ${nsInstId} |
| 83 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 84 | CreateVnfTest |
| 85 | [Documentation] Create vnf function test |
| 86 | ${json_value}= json_from_file ${create_vnf_json} |
| 87 | Set To Dictionary ${json_value} nsInstanceId=${nsInstId} |
| 88 | ${json_string}= string_from_json ${json_value} |
| 89 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 90 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 91 | Set Request Body ${json_string} |
| 92 | ${resp}= Post Request web_session ${vnfs_url} ${json_string} |
| 93 | ${responese_code}= Convert To String ${resp.status_code} |
| 94 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 95 | ${response_json} json.loads ${resp.content} |
| 96 | ${vnfInstId}= Convert To String ${response_json['vnfInstId']} |
| 97 | Set Global Variable ${vnfInstId} |
| 98 | |
| 99 | QueryVnfTest |
| 100 | [Documentation] Query vnf function test |
| 101 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 102 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 103 | ${resp}= Get Request web_session ${vnfs_url}/${vnfInstId} |
| 104 | ${responese_code}= Convert To String ${resp.status_code} |
| 105 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 106 | |
| 107 | TerminateVnfTest |
| 108 | [Documentation] Terminate vnf function test |
| 109 | ${json_value}= json_from_file ${terminate_vnf_json} |
| 110 | ${json_string}= string_from_json ${json_value} |
| 111 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 112 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 113 | Set Request Body ${json_string} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 114 | ${resp}= Post Request web_session ${terminate_vnfs_url}/${vnfInstId} ${json_string} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 115 | ${responese_code}= Convert To String ${resp.status_code} |
| 116 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 117 | |
| 118 | CreateVlTest |
| 119 | [Documentation] Create vl function test |
| 120 | ${json_value}= json_from_file ${create_vl_json} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 121 | Set To Dictionary ${json_value} nsInstanceId=${nsInstId} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 122 | ${json_string}= string_from_json ${json_value} |
| 123 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 124 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 125 | Set Request Body ${json_string} |
| 126 | ${resp}= Post Request web_session ${vls_url} ${json_string} |
| 127 | ${responese_code}= Convert To String ${resp.status_code} |
| 128 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 129 | ${response_json} json.loads ${resp.content} |
| 130 | ${vlInstId}= Convert To String ${response_json['vlId']} |
| 131 | Set Global Variable ${vlInstId} |
| 132 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 133 | DeleteVlTest |
| 134 | [Documentation] Delete vl function test |
| 135 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 136 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 137 | ${resp}= Delete Request web_session ${vls_url}/${vlInstId} |
| 138 | ${responese_code}= Convert To String ${resp.status_code} |
| 139 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 140 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 141 | ScaleNSTest |
| 142 | [Documentation] Scale Ns function test |
| 143 | ${json_value}= json_from_file ${scale_ns_json} |
| 144 | ${json_string}= string_from_json ${json_value} |
| 145 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 146 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 147 | Set Request Body ${json_string} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 148 | ${resp}= Post Request web_session ${ns_url}/${nsInstId}/scale ${json_string} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 149 | ${responese_code}= Convert To String ${resp.status_code} |
| 150 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 151 | |
| 152 | HealNSTest |
| 153 | [Documentation] Heal Ns function test |
| 154 | ${json_value}= json_from_file ${heal_ns_json} |
| 155 | ${json_string}= string_from_json ${json_value} |
| 156 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 157 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 158 | Set Request Body ${json_string} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 159 | ${resp}= Post Request web_session ${ns_url}/${nsInstId}/heal ${json_string} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 160 | ${responese_code}= Convert To String ${resp.status_code} |
| 161 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 162 | ${response_json} json.loads ${resp.content} |
| 163 | ${jobInstId}= Convert To String ${response_json['jobId']} |
| 164 | Set Global Variable ${jobInstId} |
| 165 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 166 | GetJobTest |
| 167 | [Documentation] Query Ns Job function test |
| 168 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 169 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 170 | ${resp}= Get Request web_session ${get_job_url}/${jobInstId} |
| 171 | ${responese_code}= Convert To String ${resp.status_code} |
| 172 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 173 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 174 | UpdateNSTest |
| 175 | [Documentation] Scale Ns function test |
| 176 | ${json_value}= json_from_file ${update_ns_json} |
| 177 | ${json_string}= string_from_json ${json_value} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 178 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 179 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 180 | Set Request Body ${json_string} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 181 | ${resp}= Post Request web_session ${ns_url}/${nsInstId}/update ${json_string} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 182 | ${responese_code}= Convert To String ${resp.status_code} |
| 183 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 184 | |
| 185 | TerminateNSTest |
| 186 | [Documentation] Terminate Ns function test |
| 187 | ${json_value}= json_from_file ${terminate_ns_json} |
| 188 | ${json_string}= string_from_json ${json_value} |
| 189 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 190 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 191 | Set Request Body ${json_string} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 192 | ${resp}= Post Request web_session ${ns_url}/${nsInstId}/terminate ${json_string} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 193 | ${responese_code}= Convert To String ${resp.status_code} |
| 194 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 195 | |
| 196 | DeleteNSTest |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 197 | [Documentation] Delete NS function test |
| 198 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 199 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 200 | ${resp}= Delete Request web_session ${ns_url}/${nsInstId} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 201 | ${responese_code}= Convert To String ${resp.status_code} |
| 202 | List Should Contain Value ${return_ok_list} ${responese_code} |
fujinhua | 7aa8cd3 | 2019-04-05 08:20:53 +0800 | [diff] [blame] | 203 | |
| 204 | LcmHealthCheckTest |
| 205 | [Documentation] check health for nslcm by MSB |
| 206 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 207 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
fujinhua | 7aa8cd3 | 2019-04-05 08:20:53 +0800 | [diff] [blame] | 208 | ${resp}= Get Request web_session ${healthcheck_url} |
| 209 | ${responese_code}= Convert To String ${resp.status_code} |
| 210 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 211 | ${response_json} json.loads ${resp.content} |
| 212 | ${health_status}= Convert To String ${response_json['status']} |
| 213 | Should Be Equal ${health_status} active |
fujinhua | 898e2cb | 2019-04-18 19:29:04 +0800 | [diff] [blame] | 214 | |
| 215 | LcmGetNsTest |
| 216 | [Documentation] get ns instances for nslcm by MSB |
| 217 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 218 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 219 | ${resp}= Get Request web_session ${ns_url} |
fujinhua | 898e2cb | 2019-04-18 19:29:04 +0800 | [diff] [blame] | 220 | ${responese_code}= Convert To String ${resp.status_code} |
| 221 | List Should Contain Value ${return_ok_list} ${responese_code} |
fujinhua | d5a3283 | 2019-04-19 09:45:49 +0800 | [diff] [blame] | 222 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 223 | QueryAllPnfsTest |
| 224 | [Documentation] Query all pnfs function test |
| 225 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 226 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 227 | ${resp}= Get Request web_session ${pnfs_url} |
| 228 | ${responese_code}= Convert To String ${resp.status_code} |
| 229 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 230 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 231 | CreateNSInstanceTest |
| 232 | [Documentation] Create NS Instance function test |
| 233 | ${json_value}= json_from_file ${create_ns_instance_json} |
| 234 | ${json_string}= string_from_json ${json_value} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 235 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json globalcustomerid=global-customer-id-test1 servicetype=service-type-test1 |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 236 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 237 | Set Request Body ${json_string} |
| 238 | ${resp}= Post Request web_session ${ns_instances_url} ${json_string} |
| 239 | ${responese_code}= Convert To String ${resp.status_code} |
| 240 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 241 | ${response_json} json.loads ${resp.content} |
zhaoliping123 | e9ef028 | 2019-10-23 09:06:10 +0800 | [diff] [blame] | 242 | ${nsInstanceId}= Convert To String ${response_json['nsInstanceId']} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 243 | Set Global Variable ${nsInstanceId} |
| 244 | |
| 245 | QueryNSInstancesTest |
| 246 | [Documentation] Query Ns Instances function test |
| 247 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 248 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 249 | ${resp}= Get Request web_session ${ns_instances_url} |
| 250 | ${responese_code}= Convert To String ${resp.status_code} |
| 251 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 252 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 253 | UpdateNSInstanceTest |
| 254 | [Documentation] Scale Ns Instance function test |
| 255 | ${json_value}= json_from_file ${update_ns_instance_json} |
| 256 | ${json_string}= string_from_json ${json_value} |
| 257 | Log ${json_string} |
| 258 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 259 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 260 | Set Request Body ${json_string} |
| 261 | ${resp}= Post Request web_session ${ns_instances_url}/${nsInstId}/update ${json_string} |
| 262 | ${responese_code}= Convert To String ${resp.status_code} |
| 263 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 264 | |
| 265 | TerminateNSInstanceTest |
| 266 | [Documentation] Terminate Ns Instance function test |
| 267 | ${json_value}= json_from_file ${terminate_ns_instance_json} |
| 268 | ${json_string}= string_from_json ${json_value} |
| 269 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 270 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 271 | Set Request Body ${json_string} |
| 272 | ${resp}= Post Request web_session ${ns_instances_url}/${nsInstanceId}/terminate ${json_string} |
| 273 | ${responese_code}= Convert To String ${resp.status_code} |
| 274 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 275 | |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 276 | LcmCreateSubscriptionsTest |
| 277 | [Documentation] Postdeal Ns function test |
| 278 | ${json_value}= json_from_file ${create_subscriptions_json} |
| 279 | ${json_string}= string_from_json ${json_value} |
| 280 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 281 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 282 | Set Request Body ${json_string} |
| 283 | ${resp}= Post Request web_session ${get_subscriptions_url} ${json_string} |
| 284 | ${responese_code}= Convert To String ${resp.status_code} |
| 285 | List Should Contain Value ${return_ok_list} ${responese_code} |
| 286 | |
fujinhua | d5a3283 | 2019-04-19 09:45:49 +0800 | [diff] [blame] | 287 | LcmGetSubscriptionsTest |
| 288 | [Documentation] get subscriptions for nslcm by MSB |
| 289 | ${headers} Create Dictionary Content-Type=application/json Accept=application/json |
dengyh | 5c55990 | 2020-07-01 15:20:42 +0800 | [diff] [blame] | 290 | Create Session web_session http://${NSLCM_IP}:8403 headers=${headers} |
fujinhua | d5a3283 | 2019-04-19 09:45:49 +0800 | [diff] [blame] | 291 | ${resp}= Get Request web_session ${get_subscriptions_url} |
| 292 | ${responese_code}= Convert To String ${resp.status_code} |
zhaoliping123 | 179d6fc | 2019-10-15 15:20:08 +0800 | [diff] [blame] | 293 | List Should Contain Value ${return_ok_list} ${responese_code} |