Add some test cases for VF-C to CSIT
[integration/csit.git] / tests / vfc / nfvo-lcm / test.robot
1 *** settings ***
2 Resource    ../../common.robot
3 Library     Collections
4 Library     RequestsLibrary
5 Library     OperatingSystem
6 Library     json
7 Library     HttpLibrary.HTTP
8
9 *** Variables ***
10 @{return_ok_list}=   200  201  202  204
11 ${queryswagger_url}    /api/nslcm/v1/swagger.json
12 ${create_ns_url}       /api/nslcm/v1/ns
13 ${delete_ns_url}       /api/nslcm/v1/ns
14 ${get_ns_url}          /api/nslcm/v1/ns
15 ${get_subscriptions_url}          /api/nslcm/v1/subscriptions
16 ${healthcheck_url}     /api/nslcm/v1/health_check
17 ${get_job_url}     /api/nslcm/v1/jobs
18 ${vnfs_url}     /api/nslcm/v1/ns/vnfs
19 ${terminate_vnfs_url}     /api/nslcm/v1/ns/terminatevnf
20 ${vls_url}     /api/nslcm/v1/ns/vls
21 ${sfcs_url}     /api/nslcm/v1/ns/sfcs
22 ${pnfs_url}     /api/nslcm/v1/pnfs
23
24 ${ns_instances_url}    /api/nslcm/v1/ns_instances
25
26 #json files
27 ${create_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_ns.json
28 ${heal_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/heal_ns.json
29 ${instantiate_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/instantiate_ns.json
30 ${postdeal_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/postdeal_ns.json
31 ${scale_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/scale_ns.json
32 ${update_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns.json
33 ${terminate_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_ns.json
34 ${update_job_ns_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_job_ns.json
35 ${create_vnf_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_vnf.json
36 ${terminate_vnf_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_vnf.json
37 ${create_vl_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_vl.json
38 ${create_sfcs_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_sfc.json
39 ${create_subscriptions_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_subscription.json
40 ${create_pnfs_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_pnf.json
41
42 ${create_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/create_ns_instance.json
43 ${heal_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/heal_ns_instance.json
44 ${instantiate_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/instantiate_ns_instance.json
45 ${postdeal_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/postdeal_ns_instance.json
46 ${scale_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/scale_ns_instance.json
47 ${update_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/update_ns_instance.json
48 ${terminate_ns_instance_json}    ${SCRIPTS}/../tests/vfc/nfvo-lcm/jsoninput/terminate_ns_instance.json
49
50 #global variables
51 ${nsInstId}
52 ${jobInstId}
53 ${vnfInstId}
54 ${vlInstId}
55 ${sfcInstId}
56 ${pnfId}
57 ${nsInstanceId}
58
59 *** Test Cases ***
60 NslcmSwaggerTest
61     [Documentation]    query swagger info of nslcm
62     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
63     Create Session    web_session    http://${NSLCM_IP}:8403    headers=${headers}
64     ${resp}=  Get Request    web_session    ${queryswagger_url}
65     ${responese_code}=     Convert To String      ${resp.status_code}
66     List Should Contain Value    ${return_ok_list}   ${responese_code}
67     ${response_json}    json.loads    ${resp.content}
68     ${swagger_version}=    Convert To String      ${response_json['swagger']}
69     Should Be Equal    ${swagger_version}    2.0
70
71 NslcmSwaggerByMSBTest
72     [Documentation]    query swagger info of nslcm by MSB
73     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
74     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
75     ${resp}=  Get Request    web_session    ${queryswagger_url}
76     ${responese_code}=     Convert To String      ${resp.status_code}
77     List Should Contain Value    ${return_ok_list}   ${responese_code}
78     ${response_json}    json.loads    ${resp.content}
79     ${swagger_version}=    Convert To String      ${response_json['swagger']}
80     Should Be Equal    ${swagger_version}    2.0
81
82 CreateNSTest
83     [Documentation]    Create NS function test
84     ${json_value}=     json_from_file      ${create_ns_json}
85     ${json_string}=     string_from_json   ${json_value}
86     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
87     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
88     Set Request Body    ${json_string}
89     ${resp}=    Post Request    web_session     ${create_ns_url}    ${json_string}
90     ${responese_code}=     Convert To String      ${resp.status_code}
91     List Should Contain Value    ${return_ok_list}   ${responese_code}
92     ${response_json}    json.loads    ${resp.content}
93     ${nsInstId}=    Convert To String      ${response_json['nsInstanceId']}
94     Set Global Variable     ${nsInstId}
95
96 CreateSfcTest
97     [Documentation]    Create sfc function test
98     ${json_value}=     json_from_file      ${create_sfcs_json}
99     Set To Dictionary    ${json_value}    nsInstanceId=${nsInstId}
100     ${json_string}=     string_from_json   ${json_value}
101     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
102     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
103     Set Request Body    ${json_string}
104     ${resp}=    Post Request    web_session     ${sfcs_url}    ${json_string}
105     ${responese_code}=     Convert To String      ${resp.status_code}
106     List Should Contain Value    ${return_ok_list}   ${responese_code}
107     ${response_json}    json.loads    ${resp.content}
108     ${sfcInstId}=    Convert To String      ${response_json['sfcInstId']}
109     Set Global Variable     ${sfcInstId}
110
111 QuerySfcTest
112     [Documentation]    Query sfc function test
113     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
114     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
115     ${resp}=  Get Request    web_session    ${sfcs_url}/${sfcInstId}
116     ${responese_code}=     Convert To String      ${resp.status_code}
117     List Should Contain Value    ${return_ok_list}   ${responese_code}
118
119 DeleteSfcTest
120     [Documentation]    Delete sfc function test
121     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
122     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
123     ${resp}=    Delete Request    web_session     ${sfcs_url}/${sfcInstId}
124     ${responese_code}=     Convert To String      ${resp.status_code}
125     List Should Contain Value    ${return_ok_list}   ${responese_code}
126
127 CreateVnfTest
128     [Documentation]    Create vnf function test
129     ${json_value}=     json_from_file      ${create_vnf_json}
130     Set To Dictionary    ${json_value}    nsInstanceId=${nsInstId}
131     ${json_string}=     string_from_json   ${json_value}
132     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
133     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
134     Set Request Body    ${json_string}
135     ${resp}=    Post Request    web_session     ${vnfs_url}    ${json_string}
136     ${responese_code}=     Convert To String      ${resp.status_code}
137     List Should Contain Value    ${return_ok_list}   ${responese_code}
138     ${response_json}    json.loads    ${resp.content}
139     ${vnfInstId}=    Convert To String      ${response_json['vnfInstId']}
140     Set Global Variable     ${vnfInstId}
141
142 QueryVnfTest
143     [Documentation]    Query vnf function test
144     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
145     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
146     ${resp}=  Get Request    web_session    ${vnfs_url}/${vnfInstId}
147     ${responese_code}=     Convert To String      ${resp.status_code}
148     List Should Contain Value    ${return_ok_list}   ${responese_code}
149
150 TerminateVnfTest
151     [Documentation]    Terminate vnf function test
152     ${json_value}=     json_from_file      ${terminate_vnf_json}
153     ${json_string}=     string_from_json   ${json_value}
154     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
155     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
156     Set Request Body    ${json_string}
157     ${resp}=    Post Request    web_session     ${terminate_vnfs_url}    ${json_string}
158     ${responese_code}=     Convert To String      ${resp.status_code}
159     List Should Contain Value    ${return_ok_list}   ${responese_code}
160
161 CreateVlTest
162     [Documentation]    Create vl function test
163     ${json_value}=     json_from_file      ${create_vl_json}
164         Set To Dictionary    ${json_value}    nsInstanceId=${nsInstId}
165     ${json_string}=     string_from_json   ${json_value}
166     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
167     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
168     Set Request Body    ${json_string}
169     ${resp}=    Post Request    web_session     ${vls_url}    ${json_string}
170     ${responese_code}=     Convert To String      ${resp.status_code}
171     List Should Contain Value    ${return_ok_list}   ${responese_code}
172     ${response_json}    json.loads    ${resp.content}
173     ${vlInstId}=    Convert To String      ${response_json['vlId']}
174     Set Global Variable     ${vlInstId}
175
176 QueryVlTest
177     [Documentation]    Query vl function test
178     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
179     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
180     ${resp}=  Get Request    web_session    ${vls_url}/${vlInstId}
181     ${responese_code}=     Convert To String      ${resp.status_code}
182     List Should Contain Value    ${return_ok_list}   ${responese_code}
183
184 DeleteVlTest
185     [Documentation]    Delete vl function test
186     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
187     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
188     ${resp}=    Delete Request    web_session     ${vls_url}/${vlInstId}
189     ${responese_code}=     Convert To String      ${resp.status_code}
190     List Should Contain Value    ${return_ok_list}   ${responese_code}
191
192 InstantiateNSTest
193     [Documentation]    Instantiate Ns function test
194     ${json_value}=     json_from_file      ${instantiate_ns_json}
195     ${json_string}=     string_from_json   ${json_value}
196     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
197     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
198     Set Request Body    ${json_string}
199     ${resp}=    Post Request    web_session     ${create_ns_url}/${nsInstId}/instantiate    ${json_string}
200     ${responese_code}=     Convert To String      ${resp.status_code}
201     List Should Contain Value    ${return_ok_list}   ${responese_code}
202
203 QueryNSTest
204     [Documentation]    Query Ns function test
205     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
206     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
207     ${resp}=  Get Request    web_session    ${get_ns_url}/${nsInstId}
208     ${responese_code}=     Convert To String      ${resp.status_code}
209     List Should Contain Value    ${return_ok_list}   ${responese_code}
210
211 ScaleNSTest
212     [Documentation]    Scale Ns function test
213     ${json_value}=     json_from_file      ${scale_ns_json}
214     ${json_string}=     string_from_json   ${json_value}
215     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
216     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
217     Set Request Body    ${json_string}
218     ${resp}=    Post Request    web_session     ${create_ns_url}/${nsInstId}/scale    ${json_string}
219     ${responese_code}=     Convert To String      ${resp.status_code}
220     List Should Contain Value    ${return_ok_list}   ${responese_code}
221
222 HealNSTest
223     [Documentation]    Heal Ns function test
224     ${json_value}=     json_from_file      ${heal_ns_json}
225     ${json_string}=     string_from_json   ${json_value}
226     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
227     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
228     Set Request Body    ${json_string}
229     ${resp}=    Post Request    web_session     ${create_ns_url}/${nsInstId}/heal    ${json_string}
230     ${responese_code}=     Convert To String      ${resp.status_code}
231     List Should Contain Value    ${return_ok_list}   ${responese_code}
232     ${response_json}    json.loads    ${resp.content}
233     ${jobInstId}=    Convert To String      ${response_json['jobId']}
234     Set Global Variable     ${jobInstId}
235
236 UpdateJobTest
237     [Documentation]    Update Ns Job function test
238     ${json_value}=     json_from_file      ${update_job_ns_json}
239     ${json_string}=     string_from_json   ${json_value}
240     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
241     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
242     Set Request Body    ${json_string}
243     ${resp}=    Post Request    web_session     ${get_job_url}/${jobInstId}    ${json_string}
244     ${responese_code}=     Convert To String      ${resp.status_code}
245     List Should Contain Value    ${return_ok_list}   ${responese_code}
246     ${response_json}    json.loads    ${resp.content}
247
248 GetJobTest
249     [Documentation]    Query Ns Job function test
250     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
251     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
252     ${resp}=  Get Request    web_session    ${get_job_url}/${jobInstId}
253     ${responese_code}=     Convert To String      ${resp.status_code}
254     List Should Contain Value    ${return_ok_list}   ${responese_code}
255
256 PostdealNSTest
257     [Documentation]    Postdeal Ns function test
258     ${json_value}=     json_from_file      ${postdeal_ns_json}
259     ${json_string}=     string_from_json   ${json_value}
260     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
261     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
262     Set Request Body    ${json_string}
263     ${resp}=    Post Request    web_session     ${create_ns_url}/${nsInstId}/postdeal    ${json_string}
264     ${responese_code}=     Convert To String      ${resp.status_code}
265     List Should Contain Value    ${return_ok_list}   ${responese_code}
266
267 UpdateNSTest
268     [Documentation]    Scale Ns function test
269     ${json_value}=     json_from_file      ${update_ns_json}
270     ${json_string}=     string_from_json   ${json_value}
271     Log    ${json_string}
272     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
273     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
274     Set Request Body    ${json_string}
275     ${resp}=    Post Request    web_session     ${create_ns_url}/${nsInstId}/update    ${json_string}
276     ${responese_code}=     Convert To String      ${resp.status_code}
277     List Should Contain Value    ${return_ok_list}   ${responese_code}
278
279 TerminateNSTest
280     [Documentation]    Terminate Ns function test
281     ${json_value}=     json_from_file      ${terminate_ns_json}
282     ${json_string}=     string_from_json   ${json_value}
283     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
284     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
285     Set Request Body    ${json_string}
286     ${resp}=    Post Request    web_session     ${create_ns_url}/${nsInstId}/terminate    ${json_string}
287     ${responese_code}=     Convert To String      ${resp.status_code}
288     List Should Contain Value    ${return_ok_list}   ${responese_code}
289
290 DeleteNSTest
291     [Documentation]    Delete NS function test
292     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
293     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
294     ${resp}=    Delete Request    web_session     ${delete_ns_url}/${nsInstId}
295     ${responese_code}=     Convert To String      ${resp.status_code}
296     List Should Contain Value    ${return_ok_list}   ${responese_code}
297
298 LcmHealthCheckTest
299     [Documentation]    check health for nslcm by MSB
300     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
301     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
302     ${resp}=  Get Request    web_session    ${healthcheck_url}
303     ${responese_code}=     Convert To String      ${resp.status_code}
304     List Should Contain Value    ${return_ok_list}   ${responese_code}
305     ${response_json}    json.loads    ${resp.content}
306     ${health_status}=    Convert To String      ${response_json['status']}
307     Should Be Equal    ${health_status}    active
308
309 LcmGetNsTest
310     [Documentation]    get ns instances for nslcm by MSB
311     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
312     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
313     ${resp}=  Get Request    web_session    ${get_ns_url}
314     ${responese_code}=     Convert To String      ${resp.status_code}
315     List Should Contain Value    ${return_ok_list}   ${responese_code}
316
317 CreatePnfsTest
318     [Documentation]    Create pnf function test
319     ${json_value}=     json_from_file      ${create_pnfs_json}
320     ${json_string}=     string_from_json   ${json_value}
321     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
322     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
323     Set Request Body    ${json_string}
324     ${resp}=    Post Request    web_session     ${pnfs_url}    ${json_string}
325     ${responese_code}=     Convert To String      ${resp.status_code}
326     List Should Contain Value    ${return_ok_list}   ${responese_code}
327     ${response_json}    json.loads    ${resp.content}
328     ${pnfId}=    Convert To String      ${response_json['pnfId']}
329     Set Global Variable     ${pnfId}
330
331 QueryAllPnfsTest
332     [Documentation]    Query all pnfs function test
333     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
334     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
335     ${resp}=  Get Request    web_session    ${pnfs_url}
336     ${responese_code}=     Convert To String      ${resp.status_code}
337     List Should Contain Value    ${return_ok_list}   ${responese_code}
338
339 QueryPnfsTest
340     [Documentation]    Query pnf function test
341     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
342     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
343     ${resp}=  Get Request    web_session    ${pnfs_url}/${pnfId}
344     ${responese_code}=     Convert To String      ${resp.status_code}
345     List Should Contain Value    ${return_ok_list}   ${responese_code}
346
347 DeletePnfTest
348     [Documentation]    Delete pnf function test
349     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
350     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
351     ${resp}=    Delete Request    web_session     ${pnfs_url}/${pnfId}
352     ${responese_code}=     Convert To String      ${resp.status_code}
353     List Should Contain Value    ${return_ok_list}   ${responese_code}
354
355 CreateNSInstanceTest
356     [Documentation]    Create NS Instance function test
357     ${json_value}=     json_from_file      ${create_ns_instance_json}
358     ${json_string}=     string_from_json   ${json_value}
359     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
360     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
361     Set Request Body    ${json_string}
362     ${resp}=    Post Request    web_session     ${ns_instances_url}    ${json_string}
363     ${responese_code}=     Convert To String      ${resp.status_code}
364     List Should Contain Value    ${return_ok_list}   ${responese_code}
365     ${response_json}    json.loads    ${resp.content}
366     ${nsInstanceId}=    Convert To String      ${response_json['id']}
367     Set Global Variable     ${nsInstanceId}
368
369 QueryNSInstancesTest
370     [Documentation]    Query Ns Instances function test
371     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
372     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
373     ${resp}=  Get Request    web_session    ${ns_instances_url}
374     ${responese_code}=     Convert To String      ${resp.status_code}
375     List Should Contain Value    ${return_ok_list}   ${responese_code}
376
377 QueryNSIntanceTest
378     [Documentation]    Query One Ns Instance function test
379     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
380     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
381     ${resp}=  Get Request    web_session    ${ns_instances_url}/${nsInstanceId}
382     ${responese_code}=     Convert To String      ${resp.status_code}
383     List Should Contain Value    ${return_ok_list}   ${responese_code}
384
385 InstantiateNSInstanceTest
386     [Documentation]    Instantiate Ns function test
387     ${json_value}=     json_from_file      ${instantiate_ns_instance_json}
388     ${json_string}=     string_from_json   ${json_value}
389     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
390     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
391     Set Request Body    ${json_string}
392     ${resp}=    Post Request    web_session     ${ns_instances_url}/${nsInstanceId}/instantiate    ${json_string}
393     ${responese_code}=     Convert To String      ${resp.status_code}
394     List Should Contain Value    ${return_ok_list}   ${responese_code}
395
396 ScaleNSInstanceTest
397     [Documentation]    Scale Ns Instance function test
398     ${json_value}=     json_from_file      ${scale_ns_instance_json}
399     ${json_string}=     string_from_json   ${json_value}
400     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
401     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
402     Set Request Body    ${json_string}
403     ${resp}=    Post Request    web_session     ${ns_instances_url}/${nsInstanceId}/scale    ${json_string}
404     ${responese_code}=     Convert To String      ${resp.status_code}
405     List Should Contain Value    ${return_ok_list}   ${responese_code}
406
407 HealNSInstanceTest
408     [Documentation]    Heal Ns Instance function test
409     ${json_value}=     json_from_file      ${heal_ns_instance_json}
410     ${json_string}=     string_from_json   ${json_value}
411     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
412     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
413     Set Request Body    ${json_string}
414     ${resp}=    Post Request    web_session     ${ns_instances_url}/${nsInstanceId}/heal    ${json_string}
415     ${responese_code}=     Convert To String      ${resp.status_code}
416     List Should Contain Value    ${return_ok_list}   ${responese_code}
417
418 UpdateNSInstanceTest
419     [Documentation]    Scale Ns Instance function test
420     ${json_value}=     json_from_file      ${update_ns_instance_json}
421     ${json_string}=     string_from_json   ${json_value}
422     Log    ${json_string}
423     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
424     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
425     Set Request Body    ${json_string}
426     ${resp}=    Post Request    web_session     ${ns_instances_url}/${nsInstId}/update    ${json_string}
427     ${responese_code}=     Convert To String      ${resp.status_code}
428     List Should Contain Value    ${return_ok_list}   ${responese_code}
429
430 TerminateNSInstanceTest
431     [Documentation]    Terminate Ns Instance function test
432     ${json_value}=     json_from_file      ${terminate_ns_instance_json}
433     ${json_string}=     string_from_json   ${json_value}
434     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
435     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
436     Set Request Body    ${json_string}
437     ${resp}=    Post Request    web_session     ${ns_instances_url}/${nsInstanceId}/terminate    ${json_string}
438     ${responese_code}=     Convert To String      ${resp.status_code}
439     List Should Contain Value    ${return_ok_list}   ${responese_code}
440
441 DeleteNSInstanceTest
442     [Documentation]    Delete NS Instance function test
443     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
444     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
445     ${resp}=    Delete Request    web_session     ${ns_instances_url}/${nsInstanceId}
446     ${responese_code}=     Convert To String      ${resp.status_code}
447     List Should Contain Value    ${return_ok_list}   ${responese_code}
448
449 LcmCreateSubscriptionsTest
450     [Documentation]    Postdeal Ns function test
451     ${json_value}=     json_from_file      ${create_subscriptions_json}
452     ${json_string}=     string_from_json   ${json_value}
453     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
454     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
455     Set Request Body    ${json_string}
456     ${resp}=    Post Request    web_session     ${get_subscriptions_url}    ${json_string}
457     ${responese_code}=     Convert To String      ${resp.status_code}
458     List Should Contain Value    ${return_ok_list}   ${responese_code}
459
460 LcmGetSubscriptionsTest
461     [Documentation]    get subscriptions for nslcm by MSB
462     ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
463     Create Session    web_session    http://${MSB_IAG_IP}:80    headers=${headers}
464     ${resp}=  Get Request    web_session    ${get_subscriptions_url}
465     ${responese_code}=     Convert To String      ${resp.status_code}
466     List Should Contain Value    ${return_ok_list}   ${responese_code}