Migrating robot-systests to osm/tests repository
[osm/devops.git] / robot-systest / deprecated / testsuite / cli / TS009__Feature_6283_Network_Slicing_Test.robot
1 # -*- coding: utf-8 -*-
2
3 ##
4 # Copyright 2019 Tech Mahindra Limited
5 #
6 # All Rights Reserved.
7 #
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
11 #
12 #         http://www.apache.org/licenses/LICENSE-2.0
13 #
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
18 # under the License.
19 ##
20
21 ## Change log:
22 # 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019 : network slicing test library
23 ##
24
25
26 *** Settings ***
27 Documentation    Test Suite to create hackfest basic nestwork service
28 Library     OperatingSystem
29 Library     String
30 Library     Collections
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
36
37 Suite Teardown     Run Keyword And Ignore Error    Test Cleanup
38
39
40 *** Variables ***
41 ${vnfd_id}
42 @{vnfd_ids}
43 ${nsd_id}
44 @{nsd_ids}
45 ${nst_id}
46 @{nsi_list}
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}]}'
54
55
56 *** Test Cases ***
57 Create Slice Hackfest VNF Descriptor
58     [Tags]   slice_hackfest    comprehensive
59     [Documentation]  Create Slice Hackfest VNF Descriptor Test
60
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}
64
65
66 Create Slice Hackfest NS Descriptor
67     [Tags]   slice_hackfest    comprehensive
68     [Documentation]  Create Slice Hackfest NS Descriptor Test
69
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}
73
74
75 Create Slice Hackfest Network Slice Template
76     [Tags]   slice_hackfest    comprehensive
77     [Documentation]  Create Slice Hackfest Network Slice Template Test
78
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}
83
84
85 Instanciate Network Slice
86     [Tags]  slice_hackfest    comprehensive
87     [Documentation]  Instantiate Network Slice Test
88
89     :FOR    ${vim_name}    IN    @{vim}
90     \    Launch Network Slice Instance    ${vim_name}    ${nst_id}    ${nst_config}
91
92
93 Terminate Network Slice Instance
94     [Tags]  slice_hackfest    comprehensive
95     [Documentation]  Terminate Network Slice Instance Test
96
97     :FOR    ${nsi}    IN    @{nsi_list}
98     \    Delete Network Slice Instance    ${nsi}
99
100
101 *** Keywords ***
102 Test Cleanup
103     [Documentation]  Test Suit Cleanup: delete NST, NSD and VNFD
104
105     Delete NST    ${nst_id}
106
107 #    :FOR    ${nsi}    IN    @{nsi_list}
108 #    \    Delete Network Slice Instance    ${nsi}
109
110     :FOR    ${nsd}  IN   @{nsd_ids}
111     \   Delete NSD      ${nsd}
112
113     :FOR    ${vnfd}  IN   @{vnfd_ids}
114     \   Delete VNFD     ${vnfd}
115
116 #    :FOR    ${vim_id}  IN   @{vim}
117 #    \   Delete Vim Account    ${vim_id}