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} ${user}=${CONTROLLER_USER} ${password}=${CONTROLLER_PASSWORD} ${prompt}=${DEFAULT_LINUX_PROMPT} ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
13 [Documentation] Fails if the provided ${message} is found in the karaf.log file. Uses grep to search. The
14 ... karaf.log file can be overridden with ${log_file} to be any file on the given system @ ${ip}
15 ${output}= Run Command On Controller ${ip} grep ${message} ${log_file} user=${user} password=${password} prompt=${prompt}
16 Should Not Contain ${output} ${message}
18 Verify Feature Is Installed
19 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
20 [Documentation] Will Succeed if the given ${feature_name} is found in the output of "feature:list -i"
21 ${output}= Issue Command On Karaf Console feature:list -i | grep ${feature_name} ${controller} ${karaf_port}
22 Should Contain ${output} ${feature_name}
25 Verify Feature Is Not Installed
26 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
27 [Documentation] Will Succeed if the given ${feature_name} is NOT found in the output of "feature:list -i"
28 ${output}= Issue Command On Karaf Console feature:list -i | grep ${feature_name} ${controller} ${karaf_port}
29 Should Not Contain ${output} ${feature_name}
32 Issue Command On Karaf Console
33 [Arguments] ${cmd} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=5
34 [Documentation] Will execute the given ${cmd} by ssh'ing to the karaf console running on ${CONTROLLER}
35 Open Connection ${controller} port=${karaf_port} prompt=${KARAF_PROMPT} timeout=${timeout}
36 Login ${KARAF_USER} ${KARAF_PASSWORD}
38 ${output} Read Until ${KARAF_PROMPT}
43 Verify Bundle Is Installed
44 [Arguments] ${bundle_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
45 [Documentation] Will succeed if the given ${bundle name} is present in the output of "bundle:list -s "
46 ${output}= Issue Command On Karaf Console bundle:list -s | grep ${bundle_name} ${controller} ${karaf_port}
47 Should Contain ${output} ${bundle_name}
50 Verify Bundle Is Not Installed
51 [Arguments] ${bundle_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT}
52 [Documentation] Will succeed if the given ${bundle_name} is NOT found in the output of "bundle:list -s"
53 ${output}= Issue Command On Karaf Console bundle:list -i | grep ${bundle_name} ${controller} ${karaf_port}
54 Should Not Contain ${output} ${bundle_name}
57 Check Karaf Log Has Messages
58 [Arguments] ${filter_string} @{message_list}
59 [Documentation] Will succeed if the @{messages} are found in \ the output of "log:display"
60 ${output}= Issue Command On Karaf Console log:display | grep ${filter_string}
61 : FOR ${message} IN @{message_list}
62 \ Should Contain ${output} ${message}
66 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=15
67 [Documentation] Will Install the given ${feature_name}
69 ${output}= Issue Command On Karaf Console feature:install ${feature_name} ${controller} ${karaf_port} ${timeout}
74 [Arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${KARAF_SHELL_PORT} ${timeout}=15
75 [Documentation] Will UnInstall the given ${feature_name}
76 ${output}= Issue Command On Karaf Console feature:uninstall ${feature_name} ${controller} ${karaf_port} ${timeout}