Remove regression tag from disabled daily tests
[osm/tests.git] / robot-systest / deprecated / testsuite / cli / TS014__Feature_7921_MongoDB_Filesystem_Test.robot
1 ##
2 # Copyright 2019 Tech Mahindra Limited
3 #
4 # All Rights Reserved.
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
9 #
10 #         http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
16 # under the License.
17 ##
18
19 ## Change log:
20 # 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
21 ##
22
23 *** Settings ***
24 Library     OperatingSystem
25 Library     String
26 Library     Collections
27 Resource    ../../lib/cli/vnfd_lib.robot
28 Resource    ../../lib/cli/nsd_lib.robot
29 Resource    ../../lib/cli/ns_lib.robot
30 Resource    ../../lib/cli/vim_account_lib.robot
31 Library     ../../lib/custom_lib.py
32
33 Suite Setup    Prerequisite For Test
34 Suite Teardown  Run Keyword And Ignore Error    Test Cleanup
35
36
37 *** Variables ***
38 ${success_return_code}    0
39
40 @{vim}
41 @{vnfd_ids}
42 ${nsd_id}
43 @{nsd_ids}
44 @{ns_ids}
45 ${vnfdPckg}    hackfest_basic_vnf.tar.gz
46 ${nsdPckg}    hackfest_basic_ns.tar.gz
47 ${vnfdftpPath}    https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz
48 ${nsdftpPath}    https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz
49
50
51 *** Test Cases ***
52 Create VNF Descriptor Test
53     [Tags]  comprehensive    feature7921
54
55     ${rc}   ${stdout}=      Run and Return RC and Output    wget -P '${CURDIR}${/}../../resource/' ${vnfdftpPath}
56     ${vnfd_id}=    Create VNFD    '${CURDIR}${/}../../resource${/}${vnfdPckg}'
57     Append To List     ${vnfd_ids}       ${vnfd_id}
58
59
60 Create NS Descriptor Test
61     [Tags]  comprehensive    feature7921
62
63     ${rc}   ${stdout}=      Run and Return RC and Output    wget -P '${CURDIR}${/}../../resource/' ${nsdftpPath}
64     ${nsd_id}=    Create VNFD    '${CURDIR}${/}../../resource${/}${nsdPckg}'
65     Append To List     ${nsd_ids}       ${nsd_id}
66
67
68 Instanciate Network Service Test
69     [Tags]  comprehensive    feature7921
70     [Setup]  Wait Until Keyword Succeeds    2x    30sec    VIM Setup To Launch Network Services
71
72     :FOR    ${vim_name}    IN    @{vim}
73     \    Launch Network Services and Return    ${vim_name}
74
75
76 Delete NS Instance Test
77     [Tags]  comprehensive    feature7921
78
79     :FOR    ${ns}  IN   @{ns_ids}
80     \   Delete NS   ${ns}
81
82
83 Delete NS Descriptor Test
84     [Tags]  comprehensive    feature7921
85
86     :FOR    ${nsd}  IN   @{nsd_ids}
87     \   Delete NSD      ${nsd}
88
89
90 Delete VNF Descriptor Test
91     [Tags]  comprehensive    feature7921
92
93     :FOR    ${vnfd_id}  IN   @{vnfd_ids}
94     \   Delete VNFD     ${vnfd_id}
95
96
97 *** Keywords ***
98 Prerequisite For Test
99     [Documentation]  Update docker service to use mongodb as file system
100
101     Update NBI Service
102     Update LCM Service
103
104
105 Update NBI Service
106     ${rc}   ${stdout}=      Run and Return RC and Output    docker service update osm_nbi --force --env-add OSMNBI_STORAGE_DRIVER=mongo --env-add OSMNBI_STORAGE_PATH=/app/storage --env-add OSMNBI_STORAGE_COLLECTION=files --env-add OSMNBI_STORAGE_URI=mongodb://mongo:27017
107     Should Be Equal As Integers         ${rc}     ${success_return_code}
108     Sleep    30s    Wait for NBI service to be update
109
110
111 Update LCM Service
112     ${rc}   ${stdout}=      Run and Return RC and Output    docker service update osm_lcm --force --env-add OSMLCM_STORAGE_DRIVER=mongo --env-add OSMLCM_STORAGE_PATH=/app/storage --env-add OSMLCM_STORAGE_COLLECTION=files --env-add OSMLCM_STORAGE_URI=mongodb://mongo:27017
113     Should Be Equal As Integers         ${rc}     ${success_return_code}
114     Sleep    30s    Wait for LCM service to be update
115
116
117 Test Cleanup
118 #    :FOR    ${vim_id}  IN   @{vim}
119 #    \   Delete Vim Account    ${vim_id}
120
121     ${rc}   ${stdout}=      Run and Return RC and Output    docker service rollback osm_nbi
122     Should Be Equal As Integers         ${rc}     ${success_return_code}
123     ${rc}   ${stdout}=      Run and Return RC and Output    docker service rollback osm_lcm
124     Should Be Equal As Integers         ${rc}     ${success_return_code}