enabling siab tests on helm-charts checkins

Change-Id: I14bebb2f7ddc7ae583d2d3b3e3d71227f4637889
diff --git a/jjb/pipeline/siab-test.groovy b/jjb/pipeline/siab-test.groovy
new file mode 100644
index 0000000..7994bf6
--- /dev/null
+++ b/jjb/pipeline/siab-test.groovy
@@ -0,0 +1,128 @@
+/* seba-in-a-box build+test */
+
+pipeline {
+
+  /* no label, executor is determined by JJB */
+  agent {
+    label "${params.executorNode}"
+  }
+
+  stages {
+
+    stage ("Clean workspace") {
+      steps {
+            sh 'rm -rf *'
+          }
+        }
+
+    stage('repo') {
+      steps {
+        checkout(changelog: false, \
+          poll: false,
+          scm: [$class: 'RepoScm', \
+            manifestRepositoryUrl: "${params.manifestUrl}", \
+            manifestBranch: "${params.manifestBranch}", \
+            currentBranch: true, \
+            destinationDir: 'cord', \
+            forceSync: true,
+            resetFirst: true, \
+            quiet: true, \
+            jobs: 4, \
+            showAllChanges: true] \
+          )
+      }
+    }
+
+    stage('patch') {
+      steps {
+        sh """
+           pushd $WORKSPACE/cord
+           repo download helm-charts "${gerritChangeNumber}/${gerritPatchsetNumber}"
+           popd
+           """
+      }
+    }
+
+
+    stage ('Reset Kubeadm') {
+      steps {
+        sh """
+            pushd $WORKSPACE/cord/automation-tools/seba-in-a-box
+            make reset-kubeadm
+            popd
+            """
+            }
+        }
+
+    stage ('Install SEBA') {
+      steps {
+        sh """
+            pushd $WORKSPACE/cord/automation-tools/seba-in-a-box
+            make
+            popd
+            """
+            }
+        }
+
+    stage ('Run E2E Tests') {
+      steps {
+        sh """
+            pushd $WORKSPACE/cord/automation-tools/seba-in-a-box
+            make run-tests ${params.Test_Tags} || true
+            popd
+            """
+            }
+        }
+
+    stage ('Display Kafka Events') {
+      steps {
+        sh """
+            pushd $WORKSPACE/cord/automation-tools/seba-in-a-box
+            CORD_KAFKA_IP=\$(kubectl exec cord-kafka-0 -- ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 192)
+            kafkacat -e -C -b \$CORD_KAFKA_IP -t onu.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0'
+            kafkacat -e -C -b \$CORD_KAFKA_IP -t authentication.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0'
+            kafkacat -e -C -b \$CORD_KAFKA_IP -t dhcp.events -f 'Topic %t [%p] at offset %o: key %k: %s\n >0'
+            popd
+            """
+            }
+        }
+
+     stage('Publish') {
+      steps {
+        sh """
+           if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs
+           cp -r $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/WorkflowValidations/*ml ./RobotLogs
+           """
+        step([$class: 'RobotPublisher',
+            disableArchiveOutput: false,
+            logFileName: 'RobotLogs/log*.html',
+            otherFiles: '',
+            outputFileName: 'RobotLogs/output*.xml',
+            outputPath: '.',
+            passThreshold: 100,
+            reportFileName: 'RobotLogs/report*.html',
+            unstableThreshold: 0]);
+      }
+    }
+
+  }
+
+    post {
+        always {
+          sh '''
+             sudo cp /var/log/containers/*.log $WORKSPACE/
+             sudo chown cord:cord $WORKSPACE/*log
+             '''
+             archiveArtifacts artifacts: '*.log'
+             step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "andy@opennetworking.org, kailash@opennetworking.org", sendToIndividuals: false])
+        }
+        failure {
+          sh '''
+             curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices
+             curl -X GET -u karaf:karaf http://127.0.0.1:30120/onos/v1/devices/of:0000000000000001/ports
+             curl -X GET http://127.0.0.1:30125/api/v1/devices
+             curl -X GET http://127.0.0.1:30125/api/v1/logical_devices
+             '''
+        }
+    }
+}
diff --git a/jjb/siab.yaml b/jjb/siab.yaml
index e3baf22..2a87e90 100644
--- a/jjb/siab.yaml
+++ b/jjb/siab.yaml
@@ -9,6 +9,7 @@
     jobs:
       - 'siab-stable'
       - 'siab-latest'
+      - 'siab-test'
 
 - job-template:
     id: 'siab-stable'
@@ -100,3 +101,58 @@
                  TZ=America/Los_Angeles
                  59 */2 * * *
 
+
+- job-template:
+    id: 'siab-test'
+    name: 'seba-in-a-box-build-test'
+
+    description: |
+      <!-- Managed by Jenkins Job Builder -->
+      Created by {id} job-template from ci-management/jjb/siba.yaml  <br /><br />
+      E2E Validation for Seba-in-a-Box
+
+    properties:
+      - cord-infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+          artifact-num-to-keep: '{artifact-num-to-keep}'
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    parameters:
+      - string:
+          name: executorNode
+          default: 'qct-pod1-node2'
+          description: 'Name of the Jenkins node to run the job on'
+
+
+      - string:
+            name: gerritChangeNumber
+            default: '$GERRIT_CHANGE_NUMBER'
+            description: 'Changeset number in Gerrit'
+
+      - string:
+            name: gerritPatchsetNumber
+            default: '$GERRIT_PATCHSET_NUMBER'
+            description: 'PatchSet number in Gerrit'
+
+      - string:
+          name: Test_Tags
+          default: 'TESTTAGS=test1'
+          description: ''
+
+    project-type: pipeline
+    concurrent: false
+
+    dsl: !include-raw-escape: pipeline/siab-test.groovy
+
+    triggers:
+      - cord-infra-gerrit-trigger-patchset:
+          gerrit-server-name: '{gerrit-server-name}'
+          project-regexp: 'helm-charts'
+          branch-regexp: 'master'
+          dependency-jobs: '{dependency-jobs}'
+          file-include-regexp: '{all-files-regexp}'
+