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. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 08-nov-2019
26 ${success_return_code} 0
27 ${delete_max_wait_time} 1min
28 ${delete_pol_time} 15sec
29 ${ns_launch_max_wait_time} 5min
30 ${ns_launch_pol_time} 30sec
35 [Documentation] Create nst at osm
36 [Arguments] ${nst_pkg}
38 ${rc} ${stdout}= Run and Return RC and Output osm nst-create ${nst_pkg}
39 Should Be Equal As Integers ${rc} ${success_return_code}
45 [Documentation] delete nst at osm
48 ${rc} ${stdout}= Run and Return RC and Output osm nst-delete ${nst}
49 Should Be Equal As Integers ${rc} ${success_return_code}
54 Launch Network Slice Instance
55 [Arguments] ${vim_name} ${nst_name} ${ns_config}=''
57 ${nsi_name}= GENERATE NAME
58 Run Keyword If ${ns_config}!='' Create Network Slice With Config ${nsi_name} ${nst_name} ${vim_name} ${ns_config}
59 ... ELSE Create Network Slice Without Config ${nsi_name} ${nst_name} ${vim_name}
61 WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For Network Slice Instance To Configured ${nsi_name}
62 Check For Network Slice Instance For Failure ${nsi_name}
65 Create Network Slice With Config
66 [Arguments] ${nsi_name} ${nst_name} ${vim} ${config}
68 ${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${nsi_name} --nst_name ${nst_name} --vim_account ${vim} --config ${config}
69 Should Be Equal As Integers ${rc} ${success_return_code}
71 Append To List ${nsi_list} ${nsi_name}
74 Create Network Slice Without Config
75 [Arguments] ${nsi_name} ${nst_name} ${vim}
77 ${rc} ${stdout}= Run and Return RC and Output osm nsi-create --nsi_name ${nsi_name} --nst_name ${nst_name} --vim_account ${vim}
78 Should Be Equal As Integers ${rc} ${success_return_code}
80 Append To List ${nsi_list} ${nsi_name}
83 Check For Network Slice Instance For Failure
84 [Arguments] ${nsi_name}
86 ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${nsi_name}"
87 Should Be Equal As Integers ${rc} ${success_return_code}
89 Should Not Contain ${stdout} failed
92 Check For Network Slice Instance To Configured
93 [Arguments] ${nsi_name}
95 ${rc} ${stdout}= Run and Return RC and Output osm nsi-list --filter name="${nsi_name}"
96 Should Be Equal As Integers ${rc} ${success_return_code}
98 Should Contain Any ${stdout} configured failed
101 Delete Network Slice Instance
102 [Documentation] Delete ns
105 ${rc} ${stdout}= Run and Return RC and Output osm nsi-delete ${nsi}
106 Should Be Equal As Integers ${rc} ${success_return_code}
109 WAIT UNTIL KEYWORD SUCCEEDS ${delete_max_wait_time} ${delete_pol_time} Check For NSI Instance To Be Delete ${nsi}
112 Check For NSI Instance To Be Delete
115 ${rc} ${stdout}= Run and Return RC and Output osm nsi-list
116 Should Be Equal As Integers ${rc} ${success_return_code}
118 Should Not Contain ${stdout} ${nsi}