1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 # See the License for the specific language governing permissions and
11 # limitations under the License.
14 ${success_return_code} 0
15 ${ns_launch_max_wait_time} 5min
16 ${ns_launch_pol_time} 30sec
17 ${ns_delete_max_wait_time} 1min
18 ${ns_delete_pol_time} 15sec
21 Create Network Service
22 [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} ${publickey}
24 ${config_attr} Set Variable If '${ns_config}'!='${EMPTY}' --config '${ns_config}' \
25 ${sshkeys_attr} Set Variable If '${publickey}'!='${EMPTY}' --ssh_keys ${publickey} \
27 ${ns_id}= Instantiate Network Service ${ns_name} ${nsd} ${vim_name} ${config_attr} ${sshkeys_attr}
30 WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name}
31 Check For NS Instance For Failure ${ns_name}
34 Instantiate Network Service
35 [Arguments] ${ns_name} ${nsd} ${vim_name} ${ns_extra_args}
37 ${rc} ${stdout}= Run and Return RC and Output osm ns-create --ns_name ${ns_name} --nsd_name ${nsd} --vim_account ${vim_name} ${ns_extra_args}
39 Should Be Equal As Integers ${rc} ${success_return_code}
42 Get Vnf Management Ip Address
43 [Arguments] ${ns_id} ${vnf_member_index}
45 Should Not Be Empty ${ns_id}
46 Should Not Be Empty ${vnf_member_index}
47 ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $14}' 2>&1
49 Should Be Equal As Integers ${rc} ${success_return_code}
52 Check For NS Instance To Configured
53 [Arguments] ${ns_name}
55 ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}"
57 Should Be Equal As Integers ${rc} ${success_return_code}
58 Should Contain Any ${stdout} READY BROKEN
60 Check For NS Instance For Failure
61 [Arguments] ${ns_name}
63 ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}"
65 Should Be Equal As Integers ${rc} ${success_return_code}
66 Should Not Contain ${stdout} BROKEN
68 Check For NS Instance To Be Deleted
71 ${rc} ${stdout}= Run and Return RC and Output osm ns-list | awk '{print $2}' | grep ${ns}
72 Should Not Be Equal As Strings ${stdout} ${ns}
75 [Documentation] Delete ns
78 ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns}
80 Should Be Equal As Integers ${rc} ${success_return_code}
82 WAIT UNTIL KEYWORD SUCCEEDS ${ns_delete_max_wait_time} ${ns_delete_pol_time} Check For NS Instance To Be Deleted ${ns}