Adding new job for odlmicro CSIT 88/92588/14
authorVenkatrangan Govindarajan <gvrangan@gmail.com>
Thu, 17 Sep 2020 12:03:58 +0000 (17:33 +0530)
committerVenkatrangan Govindarajan <gvrangan@gmail.com>
Tue, 29 Sep 2020 09:27:00 +0000 (14:57 +0530)
- It is a non karaf controller
- Added new script to invoke the robot command  only
- odlmicro will be installed by the robot test

JIRA: ODLMICRO-32
Signed-off-by: Venkatrangan Govindarajan <gvrangan@gmail.com>
Change-Id: I1341ea98c6b1e4a68c3aded4386eedd58c2691d8

jjb/integration/integration-deploy-controller-run-test.sh
jjb/integration/integration-macros.yaml
jjb/integration/integration-run-test.sh [new file with mode: 0755]
jjb/integration/integration-templates.yaml
jjb/odlmicro/odlmicro-csit.yaml [new file with mode: 0644]

index baae769d8d977cc143397103db6951a0e68b5945..28439606c2bdaf6c96d54ddb45e09024f2ee6551 100755 (executable)
@@ -1,5 +1,10 @@
 #!/bin/bash
 #@IgnoreInspection BashAddShebang
+
+if [ "${IS_KARAF_APPL}" = "False" ] ; then
+   echo "Not a Karaf Distro skipping karaf deployment"
+   exit
+fi
 # Activate robotframework virtualenv
 # ${ROBOT_VENV} comes from the integration-install-robotframework.sh
 # script.
@@ -7,6 +12,7 @@
 source "${ROBOT_VENV}/bin/activate"
 source /tmp/common-functions.sh "${BUNDLEFOLDER}"
 
+
 echo "#################################################"
 echo "##         Configure Cluster and Start         ##"
 echo "#################################################"
index 8a1897310b796055366539be1934c291cebfada3..68f479003ee201b49a1d0cec1b3c2d42dca24783 100644 (file)
     builders:
       - shell: !include-raw: integration-deploy-controller-run-test.sh
 
+# Macro: integration-deply-non-karaf-controller-run-test
+# Operation: this macro deploys non-karaf controller application and run test
+# Used by: {project}-csit-1node-* job templates
+
+- builder:
+    name: integration-run-test
+    builders:
+      - shell: !include-raw: integration-run-test.sh
+
 # Macro: integration-configure-clustering
 # Operation: this macro configures the clustering
 # Used by: {project}-csit-3node-* job templates
diff --git a/jjb/integration/integration-run-test.sh b/jjb/integration/integration-run-test.sh
new file mode 100755 (executable)
index 0000000..35c54ec
--- /dev/null
@@ -0,0 +1,110 @@
+#!/bin/bash
+#@IgnoreInspection BashAddShebang
+if [ "${IS_KARAF_APPL}" = "True" ] ; then
+    echo "Karaf Deployments, Tests must have already run"
+    exit
+fi
+# Activate robotframework virtualenv
+# ${ROBOT_VENV} comes from the integration-install-robotframework.sh
+# script.
+# shellcheck source=${ROBOT_VENV}/bin/activate disable=SC1091
+source "${ROBOT_VENV}/bin/activate"
+source /tmp/common-functions.sh "${BUNDLEFOLDER}"
+echo "#################################################"
+echo "## invoke Tests for non-karaf Controllers      ##"
+echo "#################################################"
+
+
+# shellcheck disable=SC2034
+nodes_list=$(get_nodes_list)
+
+add_jvm_support
+
+if [ "${NUM_OPENSTACK_SYSTEM}" -gt 0 ]; then
+   echo "Exiting without running tests to deploy openstack for testing"
+   exit
+fi
+
+echo "Generating mininet variables..."
+for i in $(seq 1 "${NUM_TOOLS_SYSTEM}")
+do
+    MININETIP="TOOLS_SYSTEM_${i}_IP"
+    tools_variables=${tools_variables}" -v ${MININETIP}:${!MININETIP}"
+done
+
+get_test_suites SUITES
+
+echo "Starting Robot test suites ${SUITES} ..."
+# ${TESTOPTIONS}, ${SUITES} are space-separated parameters and should not be quoted.
+# shellcheck disable=SC2086
+robot -N "${TESTPLAN}" \
+      --removekeywords wuks -c critical -e exclude -e "skip_if_${DISTROSTREAM}" \
+      -v BUNDLEFOLDER:"${BUNDLEFOLDER}" \
+      -v BUNDLE_URL:"${ACTUAL_BUNDLE_URL}" \
+      -v CONTROLLER:"${ODL_SYSTEM_IP}" \
+      -v CONTROLLER_USER:"${USER}" \
+      -v GERRIT_BRANCH:"${GERRIT_BRANCH}" \
+      -v GERRIT_PROJECT:"${GERRIT_PROJECT}" \
+      -v GERRIT_REFSPEC:"${GERRIT_REFSPEC}" \
+      -v JAVA_HOME:"${JAVA_HOME}" \
+      -v JDKVERSION:"${JDKVERSION}" \
+      -v JENKINS_WORKSPACE:"${WORKSPACE}" \
+      -v MININET1:"${TOOLS_SYSTEM_2_IP}" \
+      -v MININET2:"${TOOLS_SYSTEM_3_IP}" \
+      -v MININET3:"${TOOLS_SYSTEM_4_IP}" \
+      -v MININET4:"${TOOLS_SYSTEM_5_IP}" \
+      -v MININET5:"${TOOLS_SYSTEM_6_IP}" \
+      -v MININET:"${TOOLS_SYSTEM_IP}" \
+      -v MININET_USER:"${USER}" \
+      -v NEXUSURL_PREFIX:"${NEXUSURL_PREFIX}" \
+      -v NUM_ODL_SYSTEM:"${NUM_ODL_SYSTEM}" \
+      -v NUM_TOOLS_SYSTEM:"${NUM_TOOLS_SYSTEM}" \
+      -v ODL_STREAM:"${DISTROSTREAM}" \
+      -v ODL_SYSTEM_1_IP:"${ODL_SYSTEM_IP}" \
+      -v ODL_SYSTEM_IP:"${ODL_SYSTEM_IP}" \
+      -v ODL_SYSTEM_USER:"${USER}" \
+      -v SUITES:"${SUITES}" \
+      -v TOOLS_SYSTEM_IP:"${TOOLS_SYSTEM_IP}" ${tools_variables} \
+      -v TOOLS_SYSTEM_USER:"${USER}" \
+      -v USER_HOME:"${HOME}" \
+      -v WORKSPACE:/tmp \
+      ${TESTOPTIONS} ${SUITES} || true
+
+echo "Examining the files in data/log and checking filesize"
+# shellcheck disable=SC2029
+ssh "${ODL_SYSTEM_IP}" "ls -altr /tmp/"
+# shellcheck disable=SC2029
+ssh "${ODL_SYSTEM_IP}" "du -hs /tmp/"
+
+for i in $(seq 1 "${NUM_ODL_SYSTEM}")
+do
+    CONTROLLERIP="ODL_SYSTEM_${i}_IP"
+    echo "Let's take the karaf thread dump again..."
+    ssh "${!CONTROLLERIP}" "sudo ps aux" > "${WORKSPACE}"/ps_after.log
+    pid=$(grep org.opendaylight.netconf.micro.NetconfMain "${WORKSPACE}/ps_after.log" | grep -v grep | tr -s ' ' | cut -f2 -d' ')
+    echo "karaf main: org.apache.karaf.main.Main, pid:${pid}"
+    # shellcheck disable=SC2029
+    ssh "${!CONTROLLERIP}" "${JAVA_HOME}/bin/jstack -l ${pid}" > "${WORKSPACE}/karaf_${i}_${pid}_threads_after.log" || true
+    echo "Killing ODL"
+    set +e  # We do not want to create red dot just because something went wrong while fetching logs.
+    ssh "${!CONTROLLERIP}" bash -c 'ps axf | grep org.opendaylight.netconf.micro.NetconfMain | grep -v grep | awk '"'"'{print "kill -9 " $1}'"'"' | sh'
+done
+
+sleep 5
+# FIXME: Unify the copy process between various scripts.
+# TODO: Use rsync.
+for i in $(seq 1 "${NUM_ODL_SYSTEM}")
+do
+    CONTROLLERIP="ODL_SYSTEM_${i}_IP"
+    echo "Compressing karaf.log ${i}"
+    ssh "${!CONTROLLERIP}" gzip --best "/tmp/odlmicro_netconf.log"
+    echo "Fetching compressed karaf.log ${i}"
+    scp "${!CONTROLLERIP}:/tmp/odlmicro_netconf.log.gz" "odlmicro${i}.log.gz"
+done
+
+echo "Examine copied files"
+ls -lt
+
+true  # perhaps Jenkins is testing last exit code
+
+# vim: ts=4 sw=4 sts=4 et ft=sh :
index 427bf02b8bd6d111c0b106da81f638be646653e6..f3b39a4d7121e6c9ba80d37884e17c428b9c62d2 100644 (file)
     tools_system_count: "1"
     tools_system_flavor: "odl-highcpu-2"
     tools_system_image: "ZZCI - Ubuntu 16.04 - mininet-ovs-28 - x86_64 - 20200813-051640.743"
+    controller-is-a-karaf-feature: "True"
 
     #####################
     # Job configuration #
     #####################
 
     parameters:
+      - string:
+          name: IS_KARAF_APPL
+          description: "Boolean to let pipeline know if the project has a different deployer"
+          default: "{controller-is-a-karaf-feature}"
+
       - integration-csit-parameters:
           archive-artifacts: "{archive-artifacts}"
           branch: "{branch}"
       - integration-detect-variables
       - integration-install-common-functions
       - integration-deploy-controller-run-test
+      - integration-run-test
       - integration-cleanup-tmp
 
     publishers:
diff --git a/jjb/odlmicro/odlmicro-csit.yaml b/jjb/odlmicro/odlmicro-csit.yaml
new file mode 100644 (file)
index 0000000..4f464e9
--- /dev/null
@@ -0,0 +1,37 @@
+---
+- project:
+    name: odlmicro-csit-system
+    jobs:
+      - inttest-csit-1node
+
+    # The project name
+    project: "odlmicro"
+    controller-is-a-karaf-feature: "False"
+
+    # The functionality under test
+    testplan: "{project}-{functionality}.txt"
+
+    # Project branches.
+    stream:
+      - silicon:
+          branch: "master"
+          jre: "openjdk11"
+          functionality: "netconf"
+          robot-options: >
+            -e ODLMICRO_IGN
+            -v ODL_MICRO_VERSION:1.0.1-SNAPSHOT
+            -v NETCONF_TESTTOOL_VERSION:1.9.0-SNAPSHOT
+      - aluminium:
+          branch: "stable/aluminium"
+          jre: "openjdk11"
+          functionality: "netconf"
+          robot-options: >
+            -e ODLMICRO_IGN
+            -v ODL_MICRO_VERSION:1.0.0-SNAPSHOT
+            -v NETCONF_TESTTOOL_VERSION:1.9.0-SNAPSHOT
+
+    install:
+      - manual:
+          scope: "test"
+
+    tools_system_count: 1