3 Library OperatingSystem
4 Variables ../variables/Variables.py
8 ${BUNDLEFOLDER} distribution-karaf-0.3.0-SNAPSHOT
11 Check Karaf Log File Does Not Have Messages
12 [Arguments] ${ip} ${message} ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
13 ${output}= Run Command On Remote System ${ip} grep ${message} ${log_file}
14 Should Not Contain ${output} ${message}
16 Verify Feature Is Installed
17 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
18 [Documentation] Will Succeed if the given ${feature_name} is found in the output of "feature:list -i"
19 ${output}= Issue Command On Karaf Console feature:list -i | grep ${feature_name} ${controller} ${karaf_port}
20 Should Contain ${output} ${feature_name}
23 Verify Feature Is Not Installed
24 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
25 [Documentation] Will Succeed if the given ${feature_name} is NOT found in the output of "feature:list -i"
26 ${output}= Issue Command On Karaf Console feature:list -i | grep ${feature_name} ${controller} ${karaf_port}
27 Should Not Contain ${output} ${feature_name}
30 Issue Command On Karaf Console
31 [Arguments] ${cmd} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=5
32 [Documentation] Will execute the given ${cmd} by ssh'ing to the karaf console running on ${CONTROLLER}
33 Open Connection ${controller} port=${karaf_port} prompt=${KARAF_PROMPT} timeout=${timeout}
34 Login ${KARAF_USER} ${KARAF_PASSWORD}
36 ${output} Read Until ${KARAF_PROMPT}
41 Verify Bundle Is Installed
42 [Arguments] ${bundle_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
43 [Documentation] Will succeed if the given ${bundle name} is present in the output of "bundle:list -s "
44 ${output}= Issue Command On Karaf Console bundle:list -s | grep ${bundle_name} ${controller} ${karaf_port}
45 Should Contain ${output} ${bundle_name}
48 Verify Bundle Is Not Installed
49 [Arguments] ${bundle_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
50 [Documentation] Will succeed if the given ${bundle_name} is NOT found in the output of "bundle:list -s"
51 ${output}= Issue Command On Karaf Console bundle:list -i | grep ${bundle_name} ${controller} ${karaf_port}
52 Should Not Contain ${output} ${bundle_name}
55 Check Karaf Log Has Messages
56 [Arguments] ${filter_string} @{message_list}
57 [Documentation] Will succeed if the @{messages} are found in \ the output of "log:display"
58 ${output}= Issue Command On Karaf Console log:display | grep ${filter_string}
59 : FOR ${message} IN @{message_list}
60 \ Should Contain ${output} ${message}
64 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=15
65 [Documentation] Will Install the given ${feature_name}
67 ${output}= Issue Command On Karaf Console feature:install ${feature_name} ${controller} ${karaf_port} ${timeout}
72 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=15
73 [Documentation] Will UnInstall the given ${feature_name}
74 ${output}= Issue Command On Karaf Console feature:uninstall ${feature_name} ${controller} ${karaf_port} ${timeout}