| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 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 |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 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. |
| 12 | |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 13 | *** Settings *** |
| 14 | Documentation Library to deploy and delete NS, and run operations on them. |
| 15 | |
| 16 | Library DateTime |
| 17 | |
| 18 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 19 | *** Variables *** |
| 20 | ${success_return_code} 0 |
| 21 | ${ns_launch_pol_time} 30sec |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 22 | ${ns_delete_pol_time} 15sec |
| 23 | ${ns_action_max_wait_time} 1min |
| 24 | ${ns_action_pol_time} 15sec |
| aguilarherna | ff0b39e | 2021-03-12 11:43:55 +0100 | [diff] [blame] | 25 | ${vnf_scale_pol_time} 15sec |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 26 | ${vim_timeout_multiplier} %{OSM_VIM_MULTIPLIER_TIMEOUT=1.0} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 27 | |
| 28 | |
| 29 | *** Keywords *** |
| 30 | Create Network Service |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 31 | [Arguments] ${nsd} ${vim_name} ${ns_name} ${ns_config} ${publickey} ${ns_launch_max_wait_time}=5min ${config_file}=${EMPTY} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 32 | |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 33 | ${ns_launch_max_wait_time}= Convert Time ${ns_launch_max_wait_time} result_format=number |
| 34 | ${ns_launch_max_wait_time}= Evaluate ${ns_launch_max_wait_time} * ${vim_timeout_multiplier} |
| 35 | Log ${ns_launch_max_wait_time} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 36 | ${config_attr} Set Variable If '${ns_config}'!='${EMPTY}' --config '${ns_config}' \ |
| 37 | ${sshkeys_attr} Set Variable If '${publickey}'!='${EMPTY}' --ssh_keys ${publickey} \ |
| calvinosanc1 | 9b272c5 | 2020-07-03 17:28:12 +0200 | [diff] [blame] | 38 | ${config_file_attr} Set Variable If '${config_file}'!='${EMPTY}' --config_file '${config_file}' \ |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 39 | |
| calvinosanc1 | 9b272c5 | 2020-07-03 17:28:12 +0200 | [diff] [blame] | 40 | ${ns_id}= Instantiate Network Service ${ns_name} ${nsd} ${vim_name} ${config_attr} ${sshkeys_attr} ${config_file_attr} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 41 | log ${ns_id} |
| 42 | |
| 43 | WAIT UNTIL KEYWORD SUCCEEDS ${ns_launch_max_wait_time} ${ns_launch_pol_time} Check For NS Instance To Configured ${ns_name} |
| 44 | Check For NS Instance For Failure ${ns_name} |
| 45 | [Return] ${ns_id} |
| 46 | |
| 47 | |
| 48 | Instantiate Network Service |
| 49 | [Arguments] ${ns_name} ${nsd} ${vim_name} ${ns_extra_args} |
| 50 | |
| 51 | ${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} |
| 52 | log ${stdout} |
| 53 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 54 | [Return] ${stdout} |
| 55 | |
| 56 | |
| aticig | 6cd7480 | 2022-05-11 19:31:46 +0300 | [diff] [blame] | 57 | Update Network Service |
| 58 | [Arguments] ${ns_id} ${update_type} ${ns_update_config} ${ns_update_timeout} |
| 59 | |
| 60 | ${rc} ${stdout}= Run and Return RC and Output osm ns-update ${ns_id} --updatetype ${update_type} --config ${ns_update_config} --timeout ${ns_update_timeout} --wait |
| 61 | log ${stdout} |
| 62 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 63 | [Return] ${stdout} |
| 64 | |
| 65 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 66 | Get Vnf Management Ip Address |
| 67 | [Arguments] ${ns_id} ${vnf_member_index} |
| 68 | |
| 69 | Should Not Be Empty ${ns_id} |
| 70 | Should Not Be Empty ${vnf_member_index} |
| 71 | ${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 |
| 72 | log ${stdout} |
| 73 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 74 | [Return] ${stdout} |
| 75 | |
| 76 | |
| aguilarherna | ee95f36 | 2021-02-25 17:15:50 +0100 | [diff] [blame] | 77 | Get Vnf Id |
| 78 | [Arguments] ${ns_id} ${vnf_member_index} |
| 79 | |
| 80 | Should Not Be Empty ${ns_id} |
| 81 | Should Not Be Empty ${vnf_member_index} |
| 82 | ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $2}' 2>&1 |
| 83 | log ${stdout} |
| 84 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 85 | [Return] ${stdout} |
| 86 | |
| 87 | |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 88 | Get Ns Id |
| 89 | [Arguments] ${ns_name} |
| 90 | |
| 91 | Should Not Be Empty ${ns_name} |
| 92 | ${rc} ${stdout}= Run and Return RC and Output osm ns-list | grep ${ns_name} | awk '{print $4}' 2>&1 |
| 93 | log ${stdout} |
| 94 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 95 | Should Not Be Empty ${stdout} |
| 96 | [Return] ${stdout} |
| 97 | |
| 98 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 99 | Get Ns Vnf List |
| 100 | [Arguments] ${ns_id} |
| 101 | |
| 102 | Should Not Be Empty ${ns_id} |
| 103 | @{vnf_list_string}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 |
| 104 | # Returns a String of vnf_id and needs to be converted into a list |
| 105 | @{vnf_list} = Split String ${vnf_list_string}[1] |
| 106 | Log List ${vnf_list} |
| 107 | [Return] @{vnf_list} |
| 108 | |
| 109 | |
| 110 | Get Ns Ip List |
| 111 | [Arguments] @{vnf_list} |
| 112 | |
| 113 | should not be empty @{vnf_list} |
| 114 | @{temp_list}= Create List |
| 115 | FOR ${vnf_id} IN @{vnf_list} |
| 116 | log ${vnf_id} |
| 117 | @{vnf_ip_list} Get Vnf Ip List ${vnf_id} |
| 118 | @{temp_list}= Combine Lists ${temp_list} ${vnf_ip_list} |
| 119 | END |
| 120 | should not be empty ${temp_list} |
| 121 | [return] @{temp_list} |
| 122 | |
| 123 | |
| 124 | Get Vnf Ip List |
| 125 | [arguments] ${vnf_id} |
| 126 | |
| 127 | should not be empty ${vnf_id} |
| garciaale | c88e004 | 2020-12-07 21:03:33 +0000 | [diff] [blame] | 128 | @{vnf_ip_list_string}= run and return rc and output osm vnf-list --filter id=${vnf_id} | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' | sort -t: -u -k1,1 2>&1 |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 129 | # returns a string of ip addresses and needs to be converted into a list |
| 130 | should not be empty ${vnf_ip_list_string}[1] |
| 131 | @{vnf_ip_list} = split string ${vnf_ip_list_string}[1] |
| 132 | log list ${vnf_ip_list} |
| 133 | should not be empty ${vnf_ip_list} |
| 134 | [return] @{vnf_ip_list} |
| 135 | |
| 136 | |
| 137 | Check For Ns Instance To Configured |
| 138 | [arguments] ${ns_name} |
| 139 | |
| beierlm | eb5556e | 2021-05-12 04:53:49 -0400 | [diff] [blame] | 140 | ${rc} ${stdout}= Run and Return RC and Output openstack server list |
| 141 | log ${stdout} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 142 | ${rc} ${stdout}= run and return rc and output osm ns-list --filter name="${ns_name}" |
| 143 | log ${stdout} |
| 144 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 145 | Should Contain Any ${stdout} READY BROKEN |
| 146 | |
| 147 | Check For NS Instance For Failure |
| 148 | [Arguments] ${ns_name} |
| 149 | |
| beierlm | eb5556e | 2021-05-12 04:53:49 -0400 | [diff] [blame] | 150 | ${rc} ${stdout}= Run and Return RC and Output openstack server list |
| 151 | log ${stdout} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 152 | ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}" |
| 153 | log ${stdout} |
| 154 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 155 | Should Not Contain ${stdout} BROKEN |
| 156 | |
| 157 | Check For NS Instance To Be Deleted |
| 158 | [Arguments] ${ns} |
| 159 | |
| beierlm | eb5556e | 2021-05-12 04:53:49 -0400 | [diff] [blame] | 160 | ${rc} ${stdout}= Run and Return RC and Output openstack server list |
| 161 | log ${stdout} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 162 | ${rc} ${stdout}= Run and Return RC and Output osm ns-list | awk '{print $2}' | grep ${ns} |
| 163 | Should Not Be Equal As Strings ${stdout} ${ns} |
| 164 | |
| 165 | Delete NS |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 166 | [Documentation] Delete ns |
| 167 | [Arguments] ${ns} ${ns_delete_max_wait_time}=4min |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 168 | |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 169 | ${ns_delete_max_wait_time}= Convert Time ${ns_delete_max_wait_time} result_format=number |
| 170 | ${ns_delete_max_wait_time}= Evaluate ${ns_delete_max_wait_time} * ${vim_timeout_multiplier} |
| 171 | Log ${ns_delete_max_wait_time} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 172 | ${rc} ${stdout}= Run and Return RC and Output osm ns-delete ${ns} |
| garciadeblas | 4397917 | 2021-03-26 10:46:13 +0100 | [diff] [blame] | 173 | Log ${stdout} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 174 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 175 | |
| 176 | WAIT UNTIL KEYWORD SUCCEEDS ${ns_delete_max_wait_time} ${ns_delete_pol_time} Check For NS Instance To Be Deleted ${ns} |
| 177 | |
| 178 | Execute NS Action |
| 179 | [Documentation] Execute an action over the desired NS. |
| 180 | ... Parameters are given to this function in key=value format (one argument per key/value pair). |
| 181 | ... Return the ID of the operation associated to the executed action. |
| 182 | ... Examples of execution: |
| 183 | ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} |
| 184 | ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} |
| 185 | |
| 186 | [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} @{action_params} |
| 187 | |
| 188 | ${params}= Set Variable ${EMPTY} |
| 189 | FOR ${param} IN @{action_params} |
| 190 | ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters |
| 191 | ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", |
| 192 | END |
| 193 | ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} |
| 194 | ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' |
| 195 | ... ELSE Set Variable ${osm_ns_action_command} |
| 196 | ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} |
| 197 | ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} |
| 198 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| 199 | Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Completed ${stdout} |
| 200 | [Return] ${stdout} |
| 201 | |
| 202 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 203 | Execute NS K8s Action |
| 204 | [Documentation] Execute an action over the desired K8s NS. |
| 205 | ... Parameters are given to this function in key=value format (one argument per key/value pair). |
| 206 | ... Return the ID of the operation associated to the executed action. |
| 207 | ... Examples of execution: |
| 208 | ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} |
| 209 | ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} |
| 210 | |
| 211 | [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} ${kdu_name} @{action_params} |
| 212 | |
| 213 | ${params}= Set Variable ${EMPTY} |
| 214 | FOR ${param} IN @{action_params} |
| 215 | ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters |
| 216 | ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", |
| 217 | END |
| 218 | ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} --kdu_name ${kdu_name} |
| 219 | ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' |
| 220 | ... ELSE Set Variable ${osm_ns_action_command} |
| 221 | ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} |
| 222 | ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} |
| 223 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| 224 | Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Completed ${stdout} |
| 225 | [Return] ${stdout} |
| 226 | |
| 227 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 228 | Execute Manual VNF Scale |
| 229 | [Documentation] Execute a manual VNF Scale action. |
| 230 | ... The parameter 'scale_type' must be SCALE_IN or SCALE_OUT. |
| 231 | ... Return the ID of the operation associated to the executed scale action. |
| 232 | |
| garciadeblas | 686ed53 | 2021-05-13 12:38:53 +0200 | [diff] [blame] | 233 | [Arguments] ${ns_name} ${vnf_member_index} ${scaling_group} ${scale_type} ${vnf_scale_max_wait_time}=2min |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 234 | |
| garciadeblas | 686ed53 | 2021-05-13 12:38:53 +0200 | [diff] [blame] | 235 | ${vnf_scale_max_wait_time}= Convert Time ${vnf_scale_max_wait_time} result_format=number |
| 236 | ${vnf_scale_max_wait_time}= Evaluate ${vnf_scale_max_wait_time} * ${vim_timeout_multiplier} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 237 | Should Contain Any ${scale_type} SCALE_IN SCALE_OUT msg=Unknown scale type: ${scale_type} values=False |
| 238 | ${osm_vnf_scale_command}= Set Variable osm vnf-scale --scaling-group ${scaling_group} |
| 239 | ${osm_vnf_scale_command}= Run Keyword If '${scale_type}'=='SCALE_IN' Catenate ${osm_vnf_scale_command} --scale-in |
| 240 | ... ELSE Catenate ${osm_vnf_scale_command} --scale-out |
| 241 | ${osm_vnf_scale_command}= Catenate ${osm_vnf_scale_command} ${ns_name} ${vnf_member_index} |
| 242 | ${rc} ${stdout}= Run and Return RC and Output ${osm_vnf_scale_command} |
| 243 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| aguilarherna | ff0b39e | 2021-03-12 11:43:55 +0100 | [diff] [blame] | 244 | Wait Until Keyword Succeeds ${vnf_scale_max_wait_time} ${vnf_scale_pol_time} Check For NS Operation Completed ${stdout} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 245 | [Return] ${stdout} |
| 246 | |
| 247 | |
| 248 | Get Operations List |
| 249 | [Arguments] ${ns_name} |
| 250 | |
| 251 | ${rc} ${stdout}= Run and Return RC and Output osm ns-op-list ${ns_name} |
| 252 | log ${stdout} |
| 253 | log ${rc} |
| 254 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 255 | |
| 256 | |
| 257 | Check For NS Operation Completed |
| 258 | [Documentation] Check wheter the status of the desired operation is "COMPLETED" or not. |
| 259 | |
| 260 | [Arguments] ${ns_operation_id} |
| 261 | |
| beierlm | dcd7307 | 2021-04-14 05:38:04 -0400 | [diff] [blame] | 262 | ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 263 | log ${stdout} |
| 264 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 265 | Should Contain ${stdout} COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False |
| 266 | |
| 267 | |
| 268 | Get Ns Vnfr Ids |
| 269 | [Documentation] Return a list with the IDs of the VNF records of a NS instance. |
| 270 | |
| 271 | [Arguments] ${ns_id} |
| 272 | |
| 273 | ${rc} ${stdout}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1 |
| 274 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| 275 | @{vdur} = Split String ${stdout} |
| 276 | [Return] @{vdur} |
| 277 | |
| 278 | |
| 279 | Get Vnf Vdur Names |
| 280 | [Documentation] Return a list with the names of the VDU records of a VNF instance. |
| 281 | |
| 282 | [Arguments] ${vnf_id} |
| 283 | |
| beierlm | dcd7307 | 2021-04-14 05:38:04 -0400 | [diff] [blame] | 284 | ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq .vdur[].name | tr -d \\" |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 285 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| 286 | @{vdur} = Split String ${stdout} |
| 287 | [Return] @{vdur} |
| 288 | |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 289 | |
| 290 | Get Vnf Kdu Replica Count |
| 291 | [Documentation] Return the number of KDU replicas (empty if none) of a VNF instance. |
| 292 | |
| 293 | [Arguments] ${vnf_id} ${kdu_name} |
| 294 | |
| beierlm | dcd7307 | 2021-04-14 05:38:04 -0400 | [diff] [blame] | 295 | ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --kdu ${kdu_name} | yq .config.replicaCount | tr -d \\" |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 296 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| aguilarherna | 316f7ef | 2021-04-15 15:42:44 +0000 | [diff] [blame] | 297 | ${return} = Set Variable If '${stdout}' == 'null' ${EMPTY} ${stdout} |
| 298 | [Return] ${return} |
| aguilarherna | 045bd33 | 2021-03-25 10:25:59 +0100 | [diff] [blame] | 299 | |
| aktas | de5e4a6 | 2021-08-27 09:13:00 +0300 | [diff] [blame] | 300 | |
| 301 | Get Application Names |
| 302 | [Documentation] Return the list of the application of a VNF instance. |
| 303 | |
| 304 | [Arguments] ${ns_name} |
| 305 | |
| 306 | ${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq ._admin.deployed.VCA[].application | tr -d \\" |
| 307 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False |
| 308 | @{app_names} = Split String ${stdout} |
| rodriguezgar | fbedfe0 | 2022-02-24 20:05:42 +0100 | [diff] [blame] | 309 | [Return] ${app_names} |
| 310 | |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 311 | |
| 312 | Get VDU Affinity Group Name |
| 313 | [Documentation] Return the affinity group name for a NF |
| 314 | |
| 315 | [Arguments] ${ns_name} ${vnf_id} ${vdur_id} |
| 316 | |
| Alexis Romero | 6b82eaf | 2022-04-07 14:49:27 +0200 | [diff] [blame] | 317 | ${rc} ${affinity_group_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."affinity-or-anti-affinity-group-id"[0]' | tr -d \\" 2>&1 |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 318 | log ${affinity_group_id} |
| 319 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_id} values=False |
| Alexis Romero | 6b82eaf | 2022-04-07 14:49:27 +0200 | [diff] [blame] | 320 | ${rc} ${affinity_group_name}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq '."affinity-or-anti-affinity-group"[] | select(.id == "'${affinity_group_id}'")' | yq '.name' | tr -d \\" 2>&1 |
| Alexis Romero | dd1b09d | 2022-03-16 06:51:43 +0100 | [diff] [blame] | 321 | log ${affinity_group_name} |
| 322 | Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_name} values=False |
| 323 | [Return] ${affinity_group_name} |