1 # -*- coding: utf-8 -*-
4 # Copyright 2019 Tech Mahindra Limited
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
12 # http://www.apache.org/licenses/LICENSE-2.0
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
22 # 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
27 ${success_return_code} 0
28 ${name} "helloworld-os"
31 ${authurl} "https://169.254.169.245/"
34 ${tenant} "robottest2"
39 [Documentation] Create a new vim account
41 ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc}
43 Should Be Equal As Integers ${rc} ${success_return_code}
47 [Documentation] Get a vim account list
49 ${rc} ${stdout}= Run and Return RC and Output osm vim-list
51 Log To Console ${stdout}
52 Should Be Equal As Integers ${rc} ${success_return_code}
56 [Documentation] delete vim account details
58 ${rc} ${stdout}= Run and Return RC and Output osm vim-delete ${name}
60 Should Be Equal As Integers ${rc} ${success_return_code}
63 VIM Setup To Launch Network Services
64 [Documentation] Setup a VIM to launch network services
66 ${vmware_url}= Get Environment Variable VCD_AUTH_URL ${EMPTY}
67 ${openstack_url}= Get Environment Variable OS_AUTH_URL ${EMPTY}
68 ${vmware_vim}= Run Keyword And Return If '${vmware_url}'!='${EMPTY}' Setup Vmware Vim ${vmware_url} 'vmware' 'pytest system test'
69 ${openstack_vim}= Run Keyword And Return If '${openstack_url}'!='${EMPTY}' Setup Openstack Vim ${openstack_url} 'openstack' 'pytest system test'
75 [Documentation] Openstack Vim Account Setup
76 [Arguments] ${authurl} ${type} ${desc}
78 ${user}= Get Environment Variable OS_USERNAME ''
79 ${password}= Get Environment Variable OS_PASSWORD ''
80 ${tenant}= Get Environment Variable OS_PROJECT_NAME ''
81 ${vim-config}= Get Environment Variable OS_VIM_CONFIG ''
82 ${vim_name}= GENERATE NAME
84 ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim_name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} --config ${vim-config}
86 Should Be Equal As Integers ${rc} ${success_return_code}
87 Append To List ${vim} ${stdout}
92 [Documentation] Vmware Vim Account Setup
93 [Arguments] ${authurl} ${type} ${desc}
95 ${user}= Get Environment Variable VCD_USERNAME ''
96 ${password}= Get Environment Variable VCD_PASSWORD ''
97 ${tenant}= Get Environment Variable VCD_TENANT_NAME ''
98 ${vcd-org}= Get Environment Variable VCD_ORGANIZATION ''
99 ${vim-config}= Get Environment Variable VCD_VIM_CONFIG ''
100 ${vim_name}= GENERATE NAME
102 ${rc} ${stdout}= Run and Return RC and Output osm vim-create --name ${vim_name} --user ${user} --password ${password} --auth_url ${authurl} --tenant ${tenant} --account_type ${type} --description ${desc} --config ${vim-config}
104 Should Be Equal As Integers ${rc} ${success_return_code}
105 Append To List ${vim} ${stdout}
109 Force Delete Vim Account
110 [Documentation] delete vim account details
111 [Arguments] ${vim_name}
113 ${rc} ${stdout}= Run and Return RC and Output osm vim-delete ${vim_name}
115 Should Be Equal As Integers ${rc} ${success_return_code}