add support for JVM monitoring
[releng/builder.git] / jjb / integration / common-functions.sh
index e38b07ae033d3c0548c402b7bea239fdda3318f6..c33a9b0506023ad10596bfc767e6334c27ee642b 100644 (file)
@@ -223,6 +223,10 @@ function get_test_suites() {
         testplan_filepath="${WORKSPACE}/test/csit/testplans/${TESTPLAN}"
     fi
 
+    add_test="integration/test/csit/suites/integration/Create_JVM_Plots.robot" # we should always add for preparing JVM monitoring
+    echo >> "$testplan_filepath"
+    echo "${add_test}" >> "$testplan_filepath"
+
     echo "Changing the testplan path..."
     sed "s:integration:${WORKSPACE}:" "${testplan_filepath}" > testplan.txt
     cat testplan.txt
@@ -282,6 +286,25 @@ function run_plan() {
     printf "Finished running %s plans\\n" "${type}"
 } # function run_plan()
 
+# Run scripts to support JVM monitoring.
+function add_jvm_support()
+{
+    # TODO unite short and long version to one script and parametrize the input: short/long/any number
+    if [ "${ELASTICSEARCHATTRIBUTE}" == "short" ]; then
+        run_script="${WORKSPACE}/test/csit/scripts/set_elasticsearch_attribute_short.sh"
+    else
+        run_script="${WORKSPACE}/test/csit/scripts/set_elasticsearch_attribute_long.sh"
+    fi
+    printf "Executing %s...\\n" "${run_script}"
+    # shellcheck source=${line} disable=SC1091
+    source "${run_script}"
+
+    run_script="${WORKSPACE}/test/csit/scripts/set_jvm_common_attribute.sh"
+    printf "Executing %s...\\n" "${run_script}"
+    # shellcheck source=${line} disable=SC1091
+    source "${run_script}"
+} # function add_jvm_support()
+
 # Return elapsed time. Usage:
 # - Call first time with no arguments and a new timer is returned.
 # - Next call with the first argument as the timer and the elapsed time is returned.
@@ -738,6 +761,9 @@ function get_features() {
         ACTUALFEATURES="odl-infrautils-ready,${CONTROLLERFEATURES}"
     fi
 
+    # Add decanter features to allow JVM monitoring
+    ACTUALFEATURES="${ACTUALFEATURES},decanter-collector-jmx,decanter-appender-elasticsearch"
+
     # Some versions of jenkins job builder result in feature list containing spaces
     # and ending in newline. Remove all that.
     ACTUALFEATURES=$(echo "${ACTUALFEATURES}" | tr -d '\n \r')