68f98faea4d1e2099cf77437a6fd1afb90c37646
[osm/devops.git] / robot-systest / testsuite / cli / TS012__Feature_7181_Allow_Instantiation_Parameters_in_CloudInit.robot
1 # -*- coding: utf-8 -*-\r
2 \r
3 ##\r
4 # Copyright 2019 TATA ELXSI\r
5 #\r
6 # All Rights Reserved.\r
7 #\r
8 # Licensed under the Apache License, Version 2.0 (the "License"); you may\r
9 # not use this file except in compliance with the License. You may obtain\r
10 # a copy of the License at\r
11 #\r
12 #         http://www.apache.org/licenses/LICENSE-2.0\r
13 #\r
14 # Unless required by applicable law or agreed to in writing, software\r
15 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
16 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
17 # License for the specific language governing permissions and limitations\r
18 # under the License.\r
19 ##\r
20 \r
21 ## Author: Ragavi D (ragavi.d@tataelxsi.co.in)\r
22 \r
23 *** Settings ***\r
24 Documentation     Test Suite to create hackfest basic nestwork service\r
25 Suite Teardown    Run Keyword And Ignore Error    Test Cleanup\r
26 Library           OperatingSystem\r
27 Library           String\r
28 Library           Collections\r
29 Resource          ../../lib/cli/vnfd_lib.robot\r
30 Resource          ../../lib/cli/nsd_lib.robot\r
31 Resource          ../../lib/cli/ns_lib.robot\r
32 Resource          ../../lib/cli/vim_account_lib.robot\r
33 Library           ../../lib/custom_lib.py\r
34 Variables         ../../resource/cli/ubuntu-cloudinit_ns_data.py\r
35 \r
36 *** Variables ***\r
37 @{vnfd_ids}\r
38 ${nsd_id}         ${EMPTY}\r
39 @{nsd_ids}\r
40 @{ns_ids}\r
41 ${ns_config}      '{vld: [ {name: mgmtnet, vim-network-name: osm-ext} ], additionalParamsForVnf: [ { member-vnf-index: "1", additionalParams: { password: "PASSWORD" } } ] }'\r
42 \r
43 *** Test Cases ***\r
44 Create Ubuntu CloudInit VNF Descriptor\r
45     [Tags]    comprehensive    ubuntu-cloudinit_ns\r
46     Build VNF Descriptor    ${vnfdPckgPath}\r
47     ${vnfd_id}=    Create VNFD    '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'\r
48     Append To List    ${vnfd_ids}    ${vnfd_id}\r
49 \r
50 Create Ubuntu CloudInit NS Descriptor\r
51     [Tags]    comprehensive    ubuntu-cloudinit_ns\r
52     Build NS Descriptor    ${nsdPckgPath}\r
53     ${nsd_id}=    Create NSD    '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'\r
54     Append To List    ${nsd_ids}    ${nsd_id}\r
55 \r
56 Network Service Instance Test\r
57     [Documentation]    Launch and terminate network services\r
58     [Tags]    comprehensive    ubuntu-cloudinit_ns\r
59     : FOR    ${vim_name}    IN    @{vim}\r
60     \    Launch Network Services and Return    ${vim_name}    ${ns_config}\r
61 \r
62 Delete NS Instance Test\r
63     [Tags]    comprehensive    ubuntu-cloudinit_ns\r
64     : FOR    ${ns}    IN    @{ns_ids}\r
65     \    Delete NS    ${ns}\r
66 \r
67 Delete NS Descriptor Test\r
68     [Tags]    comprehensive    ubuntu-cloudinit_ns\r
69     : FOR    ${nsd}    IN    @{nsd_ids}\r
70     \    Delete NSD    ${nsd}\r
71 \r
72 Delete VNF Descriptor Test\r
73     [Tags]    comprehensive    ubuntu-cloudinit_ns\r
74     : FOR    ${vnfd_id}    IN    @{vnfd_ids}\r
75     \    Delete VNFD    ${vnfd_id}\r
76 \r
77 *** Keywords ***\r
78 Test Cleanup\r
79     [Documentation]    Test Suit Cleanup: Deliting Descriptor, instance and vim\r
80     : FOR    ${ns}    IN    @{ns_ids}\r
81     \    Delete NS    ${ns}\r
82     : FOR    ${nsd}    IN    @{nsd_ids}\r
83     \    Delete NSD    ${nsd}\r
84     : FOR    ${vnfd}    IN    @{vnfd_ids}\r
85     \    Delete VNFD    ${vnfd}\r
86     #    :FOR    ${vim_id}    IN    @{vim}\r
87     #    Delete Vim Account    ${vim_id}\r