2 # Copyright 2019 Tech Mahindra Limited
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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
20 # 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
24 Documentation Test RBAC for platform - Visibility of packages and instances test
25 Library OperatingSystem
28 Resource ../../lib/cli/rbac_lib.robot
29 Resource ../../lib/cli/vnfd_lib.robot
30 Resource ../../lib/cli/nsd_lib.robot
31 Resource ../../lib/cli/ns_lib.robot
32 Resource ../../lib/cli/vim_account_lib.robot
33 Library ../../lib/custom_lib.py
35 Suite Setup Prerequisite For Test
36 Suite Teardown Run Keyword And Ignore Error Test Cleanup
40 ${success_return_code} 0
47 ${vnfdPckg} hackfest_basic_vnf.tar.gz
48 ${nsdPckg} hackfest_basic_ns.tar.gz
49 ${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz
50 ${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz
52 # Test data for Users Operations test
55 # Test data for Project Operations test
56 ${project_id} ${EMPTY}
60 Create VIM Account For New User
61 [Documentation] Test to create VIM account for newly created user
62 [Tags] rabc rabc_vim comprehensive nbi
64 Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services
67 Create VNF Descriptor For New User
68 [Documentation] Test to create vnfd for new user
69 [Tags] rabc rabc_vnfd comprehensive nbi
71 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/rbac/' ${vnfdftpPath}
72 ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/rbac${/}${vnfdPckg}'
73 Append To List ${vnfd_ids} ${vnfd_id}
76 Create NS Descriptor For New User
77 [Documentation] Test to create nsd for new user
78 [Tags] rabc rabc_nsd comprehensive nbi
80 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/cli/rbac/' ${nsdftpPath}
81 ${nsd_id}= Create VNFD '${CURDIR}${/}../../resource/cli/rbac${/}${nsdPckg}'
82 Append To List ${nsd_ids} ${nsd_id}
85 Instanciate Network Service For New User
86 [Documentation] Launch network services for new user
87 [Tags] rabc rabc_ns comprehensive nbi
89 :FOR ${vim_name} IN @{vim}
90 \ Launch Network Services and Return ${vim_name}
93 Delete NS Instance Test
94 [Tags] rabc rabc_ns comprehensive nbi
96 :FOR ${ns} IN @{ns_ids}
100 Delete NS Descriptor Test
101 [Tags] rabc rabc_nsd comprehensive nbi
103 :FOR ${nsd} IN @{nsd_ids}
107 Delete VNF Descriptor Test
108 [Tags] rabc rabc_vnfd comprehensive nbi
110 :FOR ${vnfd_id} IN @{vnfd_ids}
111 \ Delete VNFD ${vnfd_id}
115 Prerequisite For Test
116 ${user-name}= Generate Random String 8 [NUMBERS]
117 ${user-name}= Catenate SEPARATOR= user_ ${user-name}
118 set global variable ${user-name}
119 ${user-password}= Generate Random String 8 [NUMBERS]
120 set global variable ${user-password}
121 ${user_id}= Create User ${user-name} ${user-password}
123 ${project-name}= Generate Random String 8 [NUMBERS]
124 ${project-name}= Catenate SEPARATOR= project_ ${project-name}
125 set global variable ${project-name}
126 ${project_id}= Create Project ${project-name}
128 &{update_field1}= Create Dictionary --add-project-role=admin,project_user
129 &{update_field2}= Create Dictionary --add-project-role=${project-name},account_manager
130 @{update_user}= Create List ${update_field1} ${update_field2}
131 Update User And Verify Info ${user-name} @{update_user}
132 Login With User And Perform Operation ${user-name} ${user-password} ${project-name}
136 [Documentation] Test Suit Cleanup: Deliting Descriptor, instance and vim
138 # :FOR ${vim_id} IN @{vim}
139 # \ Delete Vim Account ${vim_id}
141 Logout and Login With Admin
143 Delete User ${user-name}
144 Delete Project ${project-name}