# limitations under the License.
*** Settings ***
-Documentation Library to manage VIM Targets.
+Documentation Library to manage VIM Targets.
Library String
Library Collections
*** Keywords ***
Create VIM Target
- [Documentation] Create a VIM Target in OSM.
+ [Documentation] Create a VIM Target in OSM.
... The optional parameters (such as 'config' or 'sdn_controller') are given to this function in name=value format. These parameters will be appended to the 'osm vim-create' command with the next syntax: --param_name=param_value
... Return the ID of the created VIM Target.
... Example of execution:
- ... \${vim_account_id}= Create VIM Target \${vim_name} \${vim_user} \${vim_password} \${vim_auth_url} \${vim_tenant} \${vim_account_type} config='{...}'
+ ... \${vim_account_id}= Create VIM Target \${vim_name} \${vim_user} \${vim_password} \${vim_auth_url} \${vim_tenant} \${vim_account_type} config='{...}'
- [Arguments] ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} @{optional_parameters}
+ [Arguments] ${vim_name} ${vim_user} ${vim_password} ${vim_auth_url} ${vim_tenant} ${vim_account_type} @{optional_parameters}
- ${osm_vim_create_command}= Set Variable osm vim-create --name ${vim_name} --user ${vim_user} --password ${vim_password} --auth_url ${vim_auth_url} --tenant ${vim_tenant} --account_type ${vim_account_type}
- FOR ${param} IN @{optional_parameters}
- ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters
- ${osm_vim_create_command}= Catenate ${osm_vim_create_command} --${param_name}=${param_value}
+ ${osm_vim_create_command}= Set Variable osm vim-create --name ${vim_name} --user ${vim_user} --password ${vim_password} --auth_url ${vim_auth_url} --tenant ${vim_tenant} --account_type ${vim_account_type}
+ FOR ${param} IN @{optional_parameters}
+ ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in optional parameters
+ ${osm_vim_create_command}= Catenate ${osm_vim_create_command} --${param_name}=${param_value}
END
- ${rc} ${stdout}= Run and Return RC and Output ${osm_vim_create_command}
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
- [Return] ${stdout}
+ ${rc} ${stdout}= Run and Return RC and Output ${osm_vim_create_command}
+ Log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ [Return] ${stdout}
Delete VIM Target
[Arguments] ${vim_name}
- ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm vim-delete ${vim_name}
- log ${stdout}
- Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for VIM Target ${vim_name}
+ ${rc} ${stdout}= Run Keyword And Continue On Failure Run and Return RC and Output osm vim-delete ${vim_name}
+ Log ${stdout}
+ Wait Until Keyword Succeeds ${delete_max_wait_time} ${delete_pol_time} Check for VIM Target ${vim_name}
Get VIM Targets
- ${rc} ${stdout}= Run and Return RC and Output osm vim-list
- log ${stdout}
- Should Be Equal As Integers ${rc} ${success_return_code}
+ ${rc} ${stdout}= Run and Return RC and Output osm vim-list
+ Log ${stdout}
+ Should Be Equal As Integers ${rc} ${success_return_code}
Check for VIM Target
- [Arguments] ${vim_name}
+ [Arguments] ${vim_name}
- ${rc} ${stdout}= Run and Return RC and Output osm vim-list | awk '{print $2}' | grep ${vim_name}
- Should Not Be Equal As Strings ${stdout} ${vim_name}
+ ${rc} ${stdout}= Run and Return RC and Output osm vim-list | awk '{print $2}' | grep ${vim_name}
+ Should Not Be Equal As Strings ${stdout} ${vim_name}
Check for VIM Target Metric
- [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${vim_account_id}= Get VIM Target ID ${vim_name}
- Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ ${vim_account_id}= Get VIM Target ID ${vim_name}
+ Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Has Metric ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Check for VIM Target Status
- [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_name} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${vim_account_id}= Get VIM Target ID ${vim_name}
- Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ ${vim_account_id}= Get VIM Target ID ${vim_name}
+ Wait Until Keyword Succeeds ${vim_status_max_wait_time} ${vim_status_pol_time} Check If VIM Target Is Available ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
Get VIM Target ID
- [Arguments] ${vim_name}
+ [Arguments] ${vim_name}
- ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $4}'
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=VIM Target '${vim_name}' not found values=false
- [Return] ${stdout}
+ ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $4}'
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ Should Not Be Equal As Strings ${stdout} ${EMPTY} msg=VIM Target '${vim_name}' not found values=false
+ [Return] ${stdout}
Check VIM Target Operational State
- [Arguments] ${vim_name}
+ [Arguments] ${vim_name}
- Wait Until Keyword Succeeds ${vim_opstate_max_wait_time} ${vim_opstate_pol_time} Check If VIM Target Is Enabled ${vim_name}
+ Wait Until Keyword Succeeds ${vim_opstate_max_wait_time} ${vim_opstate_pol_time} Check If VIM Target Is Enabled ${vim_name}
Check If VIM Target Is Enabled
- [Arguments] ${vim_name}
+ [Arguments] ${vim_name}
- ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $6}'
- Should Be Equal As Integers ${rc} ${success_return_code}
- Should Be Equal As Strings ${stdout} ENABLED msg=VIM Target '${vim_name}' is not enabled values=false
+ ${rc} ${stdout}= Run and Return RC and Output osm vim-list | grep " ${vim_name} " | awk '{print $6}'
+ Should Be Equal As Integers ${rc} ${success_return_code}
+ Should Be Equal As Strings ${stdout} ENABLED msg=VIM Target '${vim_name}' is not enabled values=false
Check If VIM Target Is Available
- [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id}
- Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false
+ ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_vim_status vim_account_id=${vim_account_id}
+ Should Be Equal As Integers ${metric} 1 msg=VIM Target '${vim_account_id}' is not active values=false
Check If VIM Target Has Metric
- [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port}
+ [Arguments] ${vim_account_id} ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password}
- ${metric}= Get Metric ${prometheus_host} ${prometheus_port} osm_vim_status vim_account_id=${vim_account_id}
+ ${metric}= Get Metric ${prometheus_host} ${prometheus_port} ${prometheus_user} ${prometheus_password} osm_vim_status vim_account_id=${vim_account_id}
Should Be True ${metric} <2 msg=VIM Target '${vim_account_id}' has no metric