Merge "Enable VTN Coordinator Integration Tests"
[integration/test.git] / test / csit / libraries / KarafKeywords.txt
1 *** Settings ***
2 Library           SSHLibrary
3 Library           OperatingSystem
4
5 *** Variables ***
6 ${karaf_shell_port}     8101
7 ${karaf_prompt}         opendaylight-user
8 ${karaf_user}           karaf
9 ${karaf_password}       karaf
10
11 *** Keywords ***
12 Verify Feature Is Installed
13     [Documentation]     Will Succeed if the given ${feature_name} is found in the output of "feature:list -i"
14     [Arguments]     ${feature_name}     ${controller}=${CONTROLLER}     ${karaf_port}=${karaf_shell_port}
15     ${output}=  Issue Command On Karaf Console  feature:list -i | grep ${feature_name}     ${controller}   ${karaf_port}
16     Should Contain  ${output}   ${feature_name}
17     [Return]    ${output}
18
19 Verify Feature Is Not Installed
20     [Documentation]     Will Succeed if the given ${feature_name} is NOT found in the output of "feature:list -i"
21     [Arguments]     ${feature_name}     ${controller}=${CONTROLLER}     ${karaf_port}=${karaf_shell_port}
22     ${output}=  Issue Command On Karaf Console  feature:list -i | grep ${feature_name}     ${controller}   ${karaf_port}
23     Should Not Contain  ${output}   ${feature_name}
24     [Return]    ${output}
25
26 Issue Command On Karaf Console
27     [Documentation]     Will execute the given ${cmd} by ssh'ing to the karaf console running on ${CONTROLLER}
28     [Arguments]     ${cmd}     ${controller}=${CONTROLLER}     ${karaf_port}=${karaf_shell_port}
29     Open Connection    ${controller}    port=${karaf_port}  prompt=${karaf_prompt}
30     Login    ${karaf_user}    ${karaf_password}
31     ${output}=  Execute Command     ${cmd}
32     Close Connection
33     Log     ${output}
34     [Return]    ${output}