Install latest stable version of Juju
[osm/devops.git] / robot-systest / testsuite / cli / TS04__Hackfest_Simplecharm_NS.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. Feature 7829: Mrityunjay Yadav, Jayant Madavi : MY00514913@techmahindra.com : 06-aug-2019
23 ##
24
25
26 *** Settings ***
27 Documentation    Test Suite to create hackfest simplecharm ns
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/ns_lib.robot
34 Resource    ../../lib/cli/vim_account_lib.robot
35 Library     ../../lib/custom_lib.py
36 Variables   ../../resource/cli/hackfest_simplecharm_ns_data.py
37
38 Suite Teardown     Run Keyword And Ignore Error    Test Cleanup
39
40
41 *** Variables ***
42 @{vnfd_ids}
43 ${nsd_id}
44 @{nsd_ids}
45 @{ns_ids}
46 @{vim}
47 ${vnfdftpPath}    https://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/packages/hackfest_simplecharm_vnf.tar.gz
48 ${nsdftpPath}    https://osm-download.etsi.org/ftp/osm-6.0-six/7th-hackfest/packages/hackfest_simplecharm_ns.tar.gz
49
50
51 *** Test Cases ***
52 Create Hackfest Simple Charm VNF Descriptor
53     [Tags]   hackfest_simplecharm    comprehensive
54
55     #Build VNF Descriptor    ${vnfdPckgPath}
56     #Workarround for charm build issue
57     ${rc}   ${stdout}=      Run and Return RC and Output            wget -P '${CURDIR}${/}../../..${vnfdPckgPath}${/}build/' ${vnfdftpPath}
58     ${vnfd_id}=    Create VNFD    '${CURDIR}${/}../../..${vnfdPckgPath}${vnfdPckg}'
59     Append To List     ${vnfd_ids}       ${vnfd_id}
60
61
62 Create Hackfest Simple Charm NS Descriptor
63     [Tags]   hackfest_simplecharm    comprehensive
64
65     #Build NS Descriptor    ${nsdPckgPath}
66         ${rc}   ${stdout}=      Run and Return RC and Output        wget -P '${CURDIR}${/}../../..${nsdPckgPath}${/}build/' ${nsdftpPath}
67     ${nsd_id}=    Create NSD    '${CURDIR}${/}../../..${nsdPckgPath}${nsdPckg}'
68     Append To List     ${nsd_ids}       ${nsd_id}
69
70
71 Network Service Instance Test
72     [Documentation]  Launch and terminate network services
73     [Tags]   hackfest_simplecharm    comprehensive
74     [Setup]  VIM Setup To Launch Network Services
75     [Teardown]  Run Keyword And Ignore Error    Network Service Instance Cleanup
76
77     Should Not Be Empty    ${vim}    VIM details not provided
78     :FOR    ${vim_name}    IN    @{vim}
79     \    Launch Network Services and Return    ${vim_name}
80
81
82 Delete NS Descriptor Test
83     [Tags]   hackfest_simplecharm    comprehensive
84
85     :FOR    ${nsd}  IN   @{nsd_ids}
86     \   Delete NSD      ${nsd}
87
88
89 Delete VNF Descriptor Test
90     [Tags]   hackfest_simplecharm    comprehensive
91
92     :FOR    ${vnfd_id}  IN   @{vnfd_ids}
93     \   Delete VNFD     ${vnfd_id}
94
95
96 *** Keywords ***
97 Test Cleanup
98     [Documentation]  Test Suit Cleanup: Forcefully delete NSD and VNFD
99
100     :FOR    ${nsd}  IN   @{nsd_ids}
101     \   Force Delete NSD      ${nsd_id}
102
103     :FOR    ${vnfd_id}  IN   @{vnfd_ids}
104     \   Force Delete VNFD     ${vnfd_id}
105
106
107 Network Service Instance Cleanup
108     [Documentation]  Forcefully delete created network service instances and vim account
109
110     :FOR    ${ns_id}  IN   @{ns_ids}
111     \   Force Delete NS   ${ns_id}
112
113     :FOR    ${vim_id}  IN   @{vim}
114     \   Force Delete Vim Account    ${vim_id}