1 # -*- coding: utf-8 -*-
4 # Copyright 2019 Tech Mahindra Limited
8 # Licensed under the Apache License, Version 2.0 (the "License"); you may
9 # not use this file except in compliance with the License. You may obtain
10 # a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 # License for the specific language governing permissions and limitations
22 # 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019 : network slicing test library
27 Documentation Test Suite to create hackfest basic nestwork service
28 Library OperatingSystem
31 Resource ../../lib/cli/vnfd_lib.robot
32 Resource ../../lib/cli/nsd_lib.robot
33 Resource ../../lib/cli/vim_account_lib.robot
34 Resource ../../lib/cli/network_slicing_lib.robot
35 Library ../../lib/custom_lib.py
37 Suite Teardown Run Keyword And Ignore Error Test Cleanup
47 ${vnfdPckg} slice_hackfest_vnfd.tar.gz
48 ${nsdPckg} slice_hackfest_nsd.tar.gz
49 ${nstPckg} slice_hackfest_nst.yaml
50 ${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_vnfd.tar.gz
51 ${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_nsd.tar.gz
52 ${nstftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/slice_hackfest_nst.yaml
53 ${nst_config} '{netslice-vld: [{name: mgmtnet, vim-network-name: mgmt}]}'
57 Create Slice Hackfest VNF Descriptor
58 [Tags] slice_hackfest comprehensive
59 [Documentation] Create Slice Hackfest VNF Descriptor Test
61 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${vnfdftpPath}
62 ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/slice${/}${vnfdPckg}'
63 Append To List ${vnfd_ids} ${vnfd_id}
66 Create Slice Hackfest NS Descriptor
67 [Tags] slice_hackfest comprehensive
68 [Documentation] Create Slice Hackfest NS Descriptor Test
70 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${nsdftpPath}
71 ${nsd_id}= Create NSD '${CURDIR}${/}../../resource/cli/slice${/}${nsdPckg}'
72 Append To List ${nsd_ids} ${nsd_id}
75 Create Slice Hackfest Network Slice Template
76 [Tags] slice_hackfest comprehensive
77 [Documentation] Create Slice Hackfest Network Slice Template Test
79 # set suite variable ${nst_id}
80 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/slice/' ${nstftpPath}
81 ${nst_id}= Create NST '${CURDIR}${/}../../resource/cli/slice${/}${nstPckg}'
82 Set Suite Variable ${nst_id}
85 Instanciate Network Slice
86 [Tags] slice_hackfest comprehensive
87 [Documentation] Instantiate Network Slice Test
89 :FOR ${vim_name} IN @{vim}
90 \ Launch Network Slice Instance ${vim_name} ${nst_id} ${nst_config}
93 Terminate Network Slice Instance
94 [Tags] slice_hackfest comprehensive
95 [Documentation] Terminate Network Slice Instance Test
97 :FOR ${nsi} IN @{nsi_list}
98 \ Delete Network Slice Instance ${nsi}
103 [Documentation] Test Suit Cleanup: delete NST, NSD and VNFD
107 # :FOR ${nsi} IN @{nsi_list}
108 # \ Delete Network Slice Instance ${nsi}
110 :FOR ${nsd} IN @{nsd_ids}
113 :FOR ${vnfd} IN @{vnfd_ids}
114 \ Delete VNFD ${vnfd}
116 # :FOR ${vim_id} IN @{vim}
117 # \ Delete Vim Account ${vim_id}