Merge "fixing xos-gui unit test name"
diff --git a/jjb/api-test.yaml b/jjb/api-test.yaml
index 595369f..aba4308 100644
--- a/jjb/api-test.yaml
+++ b/jjb/api-test.yaml
@@ -26,15 +26,38 @@
           build-timeout: '60'
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
-    node: 'ubuntu16.04-basebuild-4c-8g'
+    parameters:
+      - string:
+         name: executorNode
+         default: 'ubuntu16.04-basebuild-4c-8g'
+         description: 'Name of the Jenkins node to run the job on'
+
+      - string:
+         name: manifestUrl
+         default: '{gerrit-server-url}/{cord-repo-manifest}'
+         description: 'URL to the repo manifest'
+
+      - string:
+         name: manifestBranch
+         default: '$GERRIT_BRANCH'
+         description: 'Name of the repo branch to use'
+
+      - string:
+         name: gerritProject
+         default: '$GERRIT_PROJECT'
+         description: 'Name of the Gerrit project'
+
+      - string:
+         name: gerritChangeNumber
+         default: '$GERRIT_CHANGE_NUMBER'
+         description: 'Changeset number in Gerrit'
+
+      - string:
+         name: gerritPatchsetNumber
+         default: '$GERRIT_PATCHSET_NUMBER'
+         description: 'PatchSet number in Gerrit'
+
     project-type: pipeline
     concurrent: true
 
-    # Run the master branch Jenkinsfile from cord-tester against all other revisions
-    pipeline-scm:
-      script-path: 'Jenkinsfile/verify-api-tests-JenkinsFile'
-      scm:
-        - git:
-            url: '{gerrit-server-url}/cord-tester'
-            branches:
-              - 'master'
+    dsl: !include-raw-escape: pipeline/all-xos-api-test.groovy
diff --git a/jjb/cord-test/ecord-build.yaml b/jjb/cord-test/ecord-build.yaml
index 0092ebf..d038eb3 100644
--- a/jjb/cord-test/ecord-build.yaml
+++ b/jjb/cord-test/ecord-build.yaml
@@ -38,12 +38,13 @@
          disabled: true
 
       # ONLAB ECORD build jobs (ecord-global)
-      - 'build_pod_manual':
-         pod: 'onlab-ecord-global'
+      - 'build_ecord_pod_manual':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-global.yml'
          profile: 'ecord-global'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile.newBuildSystem'
+         local_pod_name: 'onlab-ecord-global'
 
       # qct pod 3 test jobs (ecord-global)
       - 'build_pod_test':
@@ -69,12 +70,13 @@
          Jenkinsfile: 'Jenkinsfile-ecord-global'
 
       # ONLAB Global POD test jobs (ecord-global)
-      - 'build_pod_manual_test':
-         pod: 'onlab-ecord-global'
+      - 'build_ecord_pod_manual_test':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-global.yml'
          profile: 'ecord-global'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile-ecord-global'
+         local_pod_name: 'onlab_ecord-global'
 
       # qct pod 3 build jobs (ecord-local)
       - 'build_pod_first':
@@ -102,26 +104,29 @@
          fromBranch: 'cord-5.0'
 
       # ONLAB LOCAL build jobs (ecord-local)
-      - 'build_pod_manual':
-         pod: 'onlab-ecord-local-pod1'
+      - 'build_ecord_pod_manual':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-local-pod1.yml'
          profile: 'ecord-local'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile.newBuildSystem'
+         local_pod_name: 'onlab-ecord-local-pod1'
 
-      - 'build_pod_manual':
-         pod: 'onlab-ecord-local-pod2'
+      - 'build_ecord_pod_manual':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-local-pod2.yml'
          profile: 'ecord-local'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile.newBuildSystem'
+         local_pod_name: 'onlab-ecord-local-pod2'
 
-      - 'build_pod_manual':
-         pod: 'onlab-ecord-local-pod3'
+      - 'build_ecord_pod_manual':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-local-pod3.yml'
          profile: 'ecord-local'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile.newBuildSystem'
+         local_pod_name: 'onlab-ecord-local-pod3'
 
       # qct pod 3 test jobs (ecord-local)
       - 'build_pod_test':
@@ -146,23 +151,26 @@
          Jenkinsfile: 'Jenkinsfile-ecord-local'
 
       # ONLAB Local POD test jobs (ecord-local)
-      - 'build_pod_manual_test':
-         pod: 'onlab-ecord-local-pod1'
+      - 'build_ecord_pod_manual_test':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-local-pod1.yml'
          profile: 'ecord-local'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile-ecord-local'
+         local_pod_name: 'onlab-ecord-local-pod1'
 
-      - 'build_pod_manual_test':
-         pod: 'onlab-ecord-local-pod2'
+      - 'build_ecord_pod_manual_test':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-local-pod2.yml'
          profile: 'ecord-local'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile-ecord-local'
+         local_pod_name: 'onlab-ecord-local-pod2'
 
-      - 'build_pod_manual_test':
-         pod: 'onlab-ecord-local-pod3'
+      - 'build_ecord_pod_manual_test':
+         pod: 'onf-build'
          pod_config: 'onlab-ecord-local-pod3.yml'
          profile: 'ecord-local'
          branch: 'cord-4.1'
          Jenkinsfile: 'Jenkinsfile-ecord-local'
+         local_pod_name: 'onlab-ecord-local-pod3'
diff --git a/jjb/cord-test/nightly-build-pipeline.yaml b/jjb/cord-test/nightly-build-pipeline.yaml
index 0e53f9b..066a0f1 100644
--- a/jjb/cord-test/nightly-build-pipeline.yaml
+++ b/jjb/cord-test/nightly-build-pipeline.yaml
@@ -298,3 +298,114 @@
       - reverse:
           jobs: 'build_{profile}_{pod}_manual_{branch}'
           result: 'failure'
+
+- job-template:
+    name: 'build_{profile}_{local_pod_name}_{branch}'
+    id: build_ecord_pod_manual
+    description: |
+                  <!-- Managed by Jenkins Job Builder -->
+                  Manual Build on ECORD POD {pod} using {pod_config} <br /><br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/cord-test-pipeline.yaml <br />
+                  Created by QA (Suchitra Vemuri - suchitra@opennetworking.org ) <br />
+                  Copyright (c) 2018 Open Networking Foundation (ONF)
+
+    <<: *test-pipe-job-boiler-plate
+
+    parameters:
+      - string:
+         name: devNodeName
+         default: '{pod}'
+         description: 'Jenkins node name of Dev Node'
+
+      - string:
+         name: configRepoUrl
+         default: 'https://gerrit.opencord.org/pod-configs'
+         description: 'The URL of the POD configs repository'
+
+      - string:
+         name: configRepoBaseDir
+         default: 'pod-configs/'
+         description: 'The directory inside the POD configs repository'
+
+      - string:
+         name: configRepoFile
+         default: 'deployment-configs/{pod_config}'
+         description: 'The deployment config file'
+
+      - string:
+         name: branch
+         default: '{branch}'
+
+      - string:
+         name: notificationEmail
+         default: 'kailash@opennetworking.org, you@opennetworking.org, suchitra@opennetworking.org'
+         description: ''
+
+    concurrent: true
+
+    pipeline-scm:
+      script-path: '{Jenkinsfile}'
+      scm:
+        - git:
+           url: '{gerrit-server-url}/cord'
+           branches:
+             - '{branch}'
+
+- job-template:
+    name: 'build_{profile}_{local_pod_name}_{branch}_test'
+    id: build_ecord_pod_manual_test
+    description: |
+                  <!-- Managed by Jenkins Job Builder -->
+                  Post Tests on {pod} triggered by build_{pod}_{branch} <br /><br />
+                  Created from job-template {id} from ci-management/jjb/cord-test/cord-test-pipeline.yaml <br />
+                  Created by QA (Suchitra Vemuri - suchitra@opennetworking.org) <br />
+                  Copyright (c) 2017 Open Networking Foundation (ONF)
+
+    branches: '{branch}'
+
+    <<: *test-pipe-job-boiler-plate
+
+    parameters:
+      - string:
+         name: devNodeName
+         default: '{pod}'
+         description: 'Jenkins node name of Dev Node'
+
+      - string:
+         name: configRepoUrl
+         default: 'https://gerrit.opencord.org/pod-configs'
+         description: 'The URL of the POD configs repository'
+
+      - string:
+         name: configRepoBaseDir
+         default: 'pod-configs/'
+         description: 'The directory inside the POD configs repository'
+
+      - string:
+         name: configRepoFile
+         default: 'deployment-configs/{pod_config}'
+         description: 'The deployment config file'
+
+      - string:
+         name: branch
+         default: '{branch}'
+
+      - string:
+         name: notificationEmail
+         default: 'kailash@opennetworking.org, you@opennetworking.org, suchitra@opennetworking.org'
+         description: ''
+
+    concurrent: true
+
+    pipeline-scm:
+      script-path: '{Jenkinsfile}'
+      scm:
+        - git:
+           url: '{gerrit-server-url}/cord-tester'
+           branches:
+             - '{branch}'
+
+    triggers:
+      - reverse:
+          jobs: 'build_{profile}_{pod}_manual_{branch}'
+          result: 'failure'
diff --git a/jjb/lint.yaml b/jjb/lint.yaml
index 754f1fc..566bca2 100644
--- a/jjb/lint.yaml
+++ b/jjb/lint.yaml
@@ -130,3 +130,45 @@
           helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
 
       - shell: !include-raw-escape: shell/helmlint.sh
+
+
+# run `shellcheck` to validate shell scripts charts
+- job-template:
+    id: verify-shellcheck
+    name: 'verify_{project}_shellcheck'
+    description: |
+      Created by {id} job-template from ci-management/jjb/lint.yaml
+
+    triggers:
+      - cord-infra-gerrit-trigger-patchset:
+          gerrit-server-name: '{gerrit-server-name}'
+          project-regexp: '^{project}$'
+          branch-regexp: '{branch-regexp}'
+          file-include-regexp: '{all-files-regexp}'
+          dependency-jobs: '{dependency-jobs}'
+
+    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}'
+
+    scm:
+      - lf-infra-gerrit-scm:
+          git-url: '$GIT_URL/$GERRIT_PROJECT'
+          refspec: '$GERRIT_REFSPEC'
+          branch: '$GERRIT_BRANCH'
+          submodule-recursive: 'false'
+          choosing-strategy: gerrit
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    node: '{build-node}'
+    project-type: freestyle
+    concurrent: true
+
+    builders:
+      - shell: !include-raw-escape: shell/shcheck.sh
diff --git a/jjb/maven/vtn.yaml b/jjb/maven/vtn.yaml
new file mode 100644
index 0000000..c7ceee3
--- /dev/null
+++ b/jjb/maven/vtn.yaml
@@ -0,0 +1,16 @@
+---
+# maven job for 'vtn' repo
+
+- project:
+    name: vtn
+    project: '{name}'
+
+    jobs:
+      - 'vtn-gerrit':
+          branch-regexp: '{supported-branches-regexp}'
+
+- job-group:
+    name: 'vtn-gerrit'
+    jobs:
+      - 'verify-licensed'
+      - 'maven-install'
diff --git a/jjb/pipeline/all-xos-api-test.groovy b/jjb/pipeline/all-xos-api-test.groovy
new file mode 100644
index 0000000..e80be81
--- /dev/null
+++ b/jjb/pipeline/all-xos-api-test.groovy
@@ -0,0 +1,164 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+PROFILE="null"
+CORE_CONTAINER="null"
+
+pipeline {
+
+    /* no label, executor is determined by JJB */
+    agent {
+        label "${params.executorNode}"
+    }
+
+  stages {
+
+    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 cord
+           PROJECT_PATH=\$(xmllint --xpath "string(//project[@name=\\\"${gerritProject}\\\"]/@path)" .repo/manifest.xml)
+           repo download "\$PROJECT_PATH" "${gerritChangeNumber}/${gerritPatchsetNumber}"
+           popd
+           """
+      }
+    }
+    stage('Build') {
+      steps {
+        sh """
+        if [[ "$GERRIT_PROJECT" =~ ^(platform-install|xos|cord|rcord|vrouter|vsg|vtn|vtr|fabric|openstack|chameleon|exampleservice|simpleexampleservice|onos-service|olt-service|cord-tester|kubernetes-service)\$ ]]; then
+            PROFILE=rcord-local.yml
+        fi
+        if [[ "$GERRIT_PROJECT" =~ ^(ecord|vEE|vEG)\$ ]]; then
+            PROFILE=ecord-local.yml
+        fi
+        if [[ "$GERRIT_PROJECT" =~ ^(mcord|vspgwu|venb|vspgwc|vEPC)\$ ]]; then
+            PROFILE=mcord-ng40-local.yml
+        fi
+        if [[ "$GERRIT_PROJECT" =~ ^(vMME|vHSS)\$ ]]; then
+            PROFILE=mcord-cavium-local.yml
+        fi
+        cd $WORKSPACE/cord/build/
+        make PODCONFIG=\$PROFILE config
+        make -j4 build
+        if [ '$GERRIT_BRANCH' = 'master' ]; then
+          make xos-wait-dynamicload
+        fi
+        """
+      }
+    }
+    stage('Setup') {
+      steps {
+        sh """
+        if [[ "$GERRIT_PROJECT" =~ ^(platform-install|xos|cord|rcord|vrouter|vsg|vtn|vtr|fabric|openstack|chameleon|exampleservice|simpleexampleservice|onos-service|olt-service|cord-tester|kubernetes-service)\$ ]]; then
+            CORE_CONTAINER=rcord_xos_core_1
+        fi
+        if [[ "$GERRIT_PROJECT" =~ ^(ecord|vEE|vEG)\$ ]]; then
+            CORE_CONTAINER=ecord_xos_core_1
+        fi
+        if [[ "$GERRIT_PROJECT" =~ ^(mcord|vspgwu|venb|vspgwc|vEPC)\$ ]]; then
+            CORE_CONTAINER=mcordng40_xos_core_1
+        fi
+        if [[ "$GERRIT_PROJECT" =~ ^(vMME|vHSS)\$ ]]; then
+            CORE_CONTAINER=mcordcavium_xos_core_1
+        fi
+        docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosapitests.xtarget
+        docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xosserviceapitests.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xosserviceapitests.xtarget
+        docker cp $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/targets/xoslibrary.xtarget \$CORE_CONTAINER:/opt/xos/lib/xos-genx/xosgenx/targets/xoslibrary.xtarget
+        docker exec -i \$CORE_CONTAINER /bin/bash -c "xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xosapitests.xtarget /opt/xos/core/models/core.xproto" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/XOSCoreAPITests.robot
+        SERVICES=\$(docker exec -i \$CORE_CONTAINER /bin/bash -c "cd /opt/xos/dynamic_services/;find -name '*.xproto'" | awk -F[//] '{print \$2}')
+        export testname=_service_api.robot
+        export library=_library.robot
+        for i in \$SERVICES; do bash -c "docker exec -i \$CORE_CONTAINER /bin/bash -c 'xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xosserviceapitests.xtarget /opt/xos/dynamic_services/\$i/\$i.xproto /opt/xos/core/models/core.xproto'" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/\$i\$testname; done
+        for i in \$SERVICES; do bash -c "docker exec -i \$CORE_CONTAINER /bin/bash -c 'xosgenx --target /opt/xos/lib/xos-genx/xosgenx/targets/./xoslibrary.xtarget /opt/xos/dynamic_services/\$i/\$i.xproto /opt/xos/core/models/core.xproto'" > $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests/\$i\$library; done
+        """
+        }
+      }
+    stage('Test') {
+        steps {
+            sh """
+            if [[ "$GERRIT_PROJECT" =~ ^(platform-install|xos|cord|rcord|vrouter|vsg|vtn|vtr|fabric|openstack|chameleon|exampleservice|simpleexampleservice|onos-service|olt-service|cord-tester|kubernetes-service)\$ ]]; then
+                CORE_CONTAINER=rcord_xos_core_1
+            fi
+            if [[ "$GERRIT_PROJECT" =~ ^(ecord|vEE|vEG)\$ ]]; then
+                CORE_CONTAINER=ecord_xos_core_1
+            fi
+            if [[ "$GERRIT_PROJECT" =~ ^(mcord|vspgwu|venb|vspgwc|vEPC)\$ ]]; then
+                CORE_CONTAINER=mcordng40_xos_core_1
+            fi
+            if [[ "$GERRIT_PROJECT" =~ ^(vMME|vHSS)\$ ]]; then
+                CORE_CONTAINER=mcordcavium_xos_core_1
+            fi
+                export testname=_service_api.robot
+                export library=_library.robot
+                SERVICES=\$(docker exec -i \$CORE_CONTAINER /bin/bash -c "cd /opt/xos/dynamic_services/;find -name '*.xproto'" | awk -F[//] '{print \$2}')
+                echo \$SERVICES
+                export SERVER_IP=localhost
+                export SERVER_PORT=9101
+                export XOS_USER=xosadmin@opencord.org
+                export XOS_PASSWD=\$(cat $WORKSPACE/cord/build/platform-install/credentials/xosadmin@opencord.org)
+                cd $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Properties/
+                sed -i \"s/^\\(SERVER_IP = \\).*/\\1\'127.0.0.1\'/\" RestApiProperties.py
+                sed -i \"s/^\\(SERVER_PORT = \\).*/\\1\'9101\'/\" RestApiProperties.py
+                sed -i \"s/^\\(XOS_USER = \\).*/\\1\'xosadmin@opencord.org\'/\" RestApiProperties.py
+                sed -i \"s/^\\(XOS_PASSWD = \\).*/\\1\'\$(cat $WORKSPACE/cord/build/platform-install/credentials/xosadmin@opencord.org)\'/\" RestApiProperties.py
+                sed -i \"s/^\\(PASSWD = \\).*/\\1\'\$(cat $WORKSPACE/cord/build/platform-install/credentials/xosadmin@opencord.org)\'/\" RestApiProperties.py
+                cd $WORKSPACE/cord/test/cord-tester/src/test/cord-api/Tests
+                pybot -d Log -T -e TenantWithContainer -e Port -e ControllerImages -e ControllerNetwork -e ControllerSlice -e ControllerUser XOSCoreAPITests.robot  || true
+                for i in \$SERVICES; do bash -c "pybot -d Log -T -e AddressManagerServiceInstance -v TESTLIBRARY:\$i\$library \$i\$testname"; sleep 2; done || true
+                """
+            }
+    }
+    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/Log/*ml ./RobotLogs
+            """
+            step([$class: 'RobotPublisher',
+                disableArchiveOutput: false,
+                logFileName: 'RobotLogs/log*.html',
+                otherFiles: '',
+                outputFileName: 'RobotLogs/output*.xml',
+                outputPath: '.',
+                passThreshold: 95,
+                reportFileName: 'RobotLogs/report*.html',
+                unstableThreshold: 0]);
+        }
+    }
+    }
+    post {
+        always {
+            step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "kailash@opennetworking.org", sendToIndividuals: false])
+        }
+    }
+}
diff --git a/jjb/shell/ansiblelint.sh b/jjb/shell/ansiblelint.sh
index beb0891..f97d186 100755
--- a/jjb/shell/ansiblelint.sh
+++ b/jjb/shell/ansiblelint.sh
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# ansiblelint.sh - check all yaml files that they pass the ansible-lint tool
+
 set +e -u -o pipefail
 fail_ansible=0
 
@@ -24,14 +26,16 @@
 WORKSPACE=${WORKSPACE:-.}
 
 echo "=> Linting Ansible Code with $(ansible-lint --version)"
-for f in $(find "${WORKSPACE}" -type f -name "*.yml" -o -name "*.yaml"); do
-    echo "==> CHECKING: ${f}"
-    ansible-lint -p "${f}"
-    rc=$?
-    if [[ $rc != 0 ]]; then
-        echo "==> LINTING FAIL: ${f}"
-        fail_ansible=1
-    fi
-done
+
+while IFS= read -r -d '' yf
+do
+  echo "==> CHECKING: ${yf}"
+  ansible-lint -p "${yf}"
+  rc=$?
+  if [[ $rc != 0 ]]; then
+    echo "==> LINTING FAIL: ${yf}"
+    fail_ansible=1
+  fi
+done < <(find "${WORKSPACE}" \( -name "*.yml" -o -name "*.yaml" \) -print0)
 
 exit ${fail_ansible}
diff --git a/jjb/shell/helmlint.sh b/jjb/shell/helmlint.sh
index 27cf676..c0ac0f4 100755
--- a/jjb/shell/helmlint.sh
+++ b/jjb/shell/helmlint.sh
@@ -29,8 +29,8 @@
 # when not running under Jenkins, use current dir as workspace
 WORKSPACE=${WORKSPACE:-.}
 
-for chart in $(find "${WORKSPACE}" -name Chart.yaml -print) ; do
-
+while IFS= read -r -d '' chart
+do
   chartdir=$(dirname "${chart}")
 
   # update requirements if it exists. Skip voltha as it has non-clean reqirements
@@ -49,7 +49,7 @@
   if [[ $rc != 0 ]]; then
     fail_lint=1
   fi
-done
+done < <(find "${WORKSPACE}" -name Chart.yaml -print0)
 
 if [[ $fail_lint != 0 ]]; then
   exit 1
diff --git a/jjb/shell/jflint.sh b/jjb/shell/jflint.sh
index 8ece6b7..e7b76f0 100755
--- a/jjb/shell/jflint.sh
+++ b/jjb/shell/jflint.sh
@@ -1,5 +1,19 @@
 #!/usr/bin/env bash
 
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 # jflint.sh - lint for Jenkins declarative pipeline jobs
 #
 # curl commands from: https://jenkins.io/doc/book/pipeline/development/#linter
diff --git a/jjb/shell/licensecheck.sh b/jjb/shell/licensecheck.sh
index 42b6b87..e40802a 100755
--- a/jjb/shell/licensecheck.sh
+++ b/jjb/shell/licensecheck.sh
@@ -1,14 +1,21 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
 
 # licensecheck.sh
 # checks for copyright/license headers on files
 # excludes filename extensions where this check isn't pertinent
 
-# this could be rewritten with better form. Currently is a cut/paste from the
-# Jenkins job with minimal changes (BSD/OS X xargs params compat, sort of
-# excluded file extensions).
+set +e -u -o pipefail
+fail_licensecheck=0
 
-find . -name ".git" -prune -o -type f \
+while IFS= read -r -d '' f
+do
+  grep -q "Copyright\|Apache License" "${f}"
+  rc=$?
+  if [[ $rc != 0 ]]; then
+    echo "ERROR: $f does not contain License Header"
+    fail_licensecheck=1
+  fi
+done < <(find . -name ".git" -prune -o -type f \
   -name "*.*" \
   ! -name "*.PNG" \
   ! -name "*.asc" \
@@ -82,6 +89,7 @@
   ! -path "*conf*" \
   ! -path "*git*" \
   ! -path "*swagger*" \
-  -print0 |   \
-  xargs -0 -n1 sh -c 'if ! grep -q "Copyright\|Apache License" $0; then echo "ERROR: $0 does not contain Copyright header"; exit 1; fi;'
+  -print0 )
+
+exit ${fail_licensecheck}
 
diff --git a/jjb/shell/shcheck.sh b/jjb/shell/shcheck.sh
new file mode 100755
index 0000000..2abe89c
--- /dev/null
+++ b/jjb/shell/shcheck.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# shcheck.sh - check shell scripts with shellcheck
+
+set +e -u -o pipefail
+fail_shellcheck=0
+
+# verify that we have shellcheck-lint installed
+command -v shellcheck  >/dev/null 2>&1 || { echo "shellcheck not found, please install it" >&2; exit 1; }
+
+# when not running under Jenkins, use current dir as workspace
+WORKSPACE=${WORKSPACE:-.}
+
+echo "=> Linting shell script with $(shellcheck --version)"
+
+while IFS= read -r -d '' sf
+do
+  echo "==> CHECKING: ${sf}"
+  shellcheck "${sf}"
+  rc=$?
+  if [[ $rc != 0 ]]; then
+    echo "==> LINTING FAIL: ${sf}"
+    fail_shellcheck=1
+  fi
+done < <(find "${WORKSPACE}" \( -name "*.sh" -o -name "*.bash" \) -print0)
+
+exit ${fail_shellcheck}
+
diff --git a/jjb/verify/automation-tools.yaml b/jjb/verify/automation-tools.yaml
new file mode 100644
index 0000000..4a0cb63
--- /dev/null
+++ b/jjb/verify/automation-tools.yaml
@@ -0,0 +1,22 @@
+---
+# verification jobs for 'automation-tools' repo
+
+- project:
+    name: automation-tools
+    project: '{name}'
+
+    jobs:
+      - 'verify-automation-tools-jobs':
+          branch-regexp: '{supported-branches-regexp}'
+
+- job-group:
+    name: 'verify-automation-tools-jobs'
+    jobs:
+      - 'verify-licensed'
+      - 'verify-ansible-lint':
+          dependency-jobs: 'verify_automation-tools_licensed'
+      - 'verify-shellcheck':
+          dependency-jobs: 'verify_automation-tools_ansible-lint'
+      - 'verify-sonarqube':
+          dependency-jobs: 'verify_automation-tools_shellcheck'
+
diff --git a/jjb/verify/kubernetes-service.yaml b/jjb/verify/kubernetes-service.yaml
index ee8d3e0..f089317 100644
--- a/jjb/verify/kubernetes-service.yaml
+++ b/jjb/verify/kubernetes-service.yaml
@@ -6,7 +6,7 @@
     project: '{name}'
 
     jobs:
-      - 'verify-kubernetes-service-jobs':
+      - 'verify-vsg-jobs':
           branch-regexp: '{supported-branches-regexp}'
 
 - job-group:
@@ -15,3 +15,7 @@
       - 'verify-licensed'
       - 'verify-sonarqube':
           dependency-jobs: 'verify_kubernetes-service_licensed'
+      - 'xos-unit-test':
+          dependency-jobs: 'verify_kubernetes-service_sonarqube'
+      - 'api-test':
+          dependency-jobs: 'verify_kubernetes-service_unit-test'
diff --git a/jjb/verify/simpleexampleservice.yaml b/jjb/verify/simpleexampleservice.yaml
index 397c324..80f2f74 100644
--- a/jjb/verify/simpleexampleservice.yaml
+++ b/jjb/verify/simpleexampleservice.yaml
@@ -15,5 +15,7 @@
       - 'verify-licensed'
       - 'verify-sonarqube':
           dependency-jobs: 'verify_simpleexampleservice_licensed'
-      - 'api-test':
+      - 'xos-unit-test':
           dependency-jobs: 'verify_simpleexampleservice_sonarqube'
+      - 'api-test':
+          dependency-jobs: 'verify_simpleexampleservice_unit-test'
diff --git a/jjb/verify/vtn-service.yaml b/jjb/verify/vtn-service.yaml
new file mode 100644
index 0000000..a1816c5
--- /dev/null
+++ b/jjb/verify/vtn-service.yaml
@@ -0,0 +1,19 @@
+---
+# verification jobs for 'vtn' repo
+
+- project:
+    name: vtn-service
+    project: '{name}'
+
+    jobs:
+      - 'verify-vtn-service-jobs':
+          branch-regexp: '{supported-branches-regexp}'
+
+- job-group:
+    name: 'verify-vtn-service-jobs'
+    jobs:
+      - 'verify-licensed'
+      - 'verify-sonarqube':
+          dependency-jobs: 'verify_vtn-service_licensed'
+      - 'api-test':
+          dependency-jobs: 'verify_vtn-service_sonarqube'
diff --git a/jjb/verify/vtn.yaml b/jjb/verify/vtn.yaml
deleted file mode 100644
index 0191a2d..0000000
--- a/jjb/verify/vtn.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-# verification jobs for 'vtn' repo
-
-- project:
-    name: vtn
-    project: '{name}'
-
-    jobs:
-      - 'verify-vtn-jobs':
-          branch-regexp: '{supported-branches-regexp}'
-
-- job-group:
-    name: 'verify-vtn-jobs'
-    jobs:
-      - 'verify-licensed'
-      - 'verify-sonarqube':
-          dependency-jobs: 'verify_vtn_licensed'
-      - 'api-test':
-          dependency-jobs: 'verify_vtn_sonarqube'
-      - 'maven-install'
diff --git a/jjb/xos-rest-gw.yaml b/jjb/xos-rest-gw.yaml
new file mode 100644
index 0000000..5e50489
--- /dev/null
+++ b/jjb/xos-rest-gw.yaml
@@ -0,0 +1,47 @@
+---
+# xos-rest-gw test
+
+- project:
+    name: xos-rest-gw
+
+    project-name: '{name}'
+
+    jobs:
+      - 'xos-rest-gw'
+
+- job:
+    name: 'xos-rest-gw'
+
+    description: |
+      <!-- Managed by Jenkins Job Builder -->
+      Created by {id} job-template from ci-management/jjb/xos-rest-gw.yaml  <br /><br />
+      Test for the XOS Rest Gateway that combine REST APIs and WebSocket
+
+    triggers:
+      - cord-infra-gerrit-trigger-patchset:
+          gerrit-server-name: '{gerrit-server-name}'
+          project-regexp: '^xos-rest-gw'
+          branch-regexp: '{branch-regexp}'
+          dependency-jobs: '{dependency-jobs}'
+          file-include-regexp: '{all-files-regexp}'
+
+    properties:
+      - cord-infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+          artifact-num-to-keep: '{artifact-num-to-keep}'
+
+    # `npm install` can take >10m depending on connectivity
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: 20
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    node: 'ubuntu16.04-basebuild-1c-2g'
+    project-type: freestyle
+    concurrent: true
+
+    builders:
+      - shell: |
+          #/usr/bin/env bash
+          npm install
+          npm test