Merge "Parameterize branch for omec installation jobs"
diff --git a/jjb/comac-in-a-box.yaml b/jjb/comac-in-a-box.yaml
new file mode 100644
index 0000000..8fa4a6f
--- /dev/null
+++ b/jjb/comac-in-a-box.yaml
@@ -0,0 +1,76 @@
+# COMAC in a box test for helm-charts repo
+
+- job-template:
+    id: 'comac-in-a-box'
+    name: '{name}'
+    project-type: pipeline
+
+    pipeline-script: 'comac-in-a-box.groovy'
+
+    description: |
+      Automated build on AMI executor using {pipeline-script}. <br /><br />
+      Created from job-template {id} from ci-management/jjb/charts.yaml <br />
+      Created by Jeremy Ronquillo, jeremyr@opennetworking.org <br />
+      Copyright (c) 2020 Open Networking Foundation (ONF)
+
+    triggers:
+      - gerrit:
+          server-name: '{gerrit-server-name}'
+          dependency-jobs: '{dependency-jobs}'
+          trigger-on:
+            - patchset-created-event:
+                exclude-drafts: true
+                exclude-trivial-rebase: false
+                exclude-no-code-change: true
+            - draft-published-event
+            - comment-added-contains-event:
+                comment-contains-value: '(?i)^.*recheck$'
+          projects:
+            - project-compare-type: REG_EXP
+              project-pattern: 'helm-charts'
+              branches:
+                - branch-compare-type: REG_EXP
+                  branch-pattern: '{all-branches-regexp}'
+              file-paths:
+                - compare-type: REG_EXP
+                  pattern: 'omec/.*'
+                - compare-type: REG_EXP
+                  pattern: 'aether-apps/.*'
+
+    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: buildNode
+          default: 'comac_in_a_box'
+          description: 'Name of the Jenkins executor node to run the job on'
+      - string:
+          name: GERRIT_REFSPEC
+          default: '$GERRIT_REFSPEC'
+          description: 'Gerrit ref to fetch.' 
+      - string:
+          name: gitUrl
+          default: '{gerrit-server-url}/$GERRIT_PROJECT'
+          description: 'URL to the git repo'
+    scm:
+      - lf-infra-gerrit-scm:
+          git-url: '$GIT_URL/$GERRIT_PROJECT'
+          refspec: '$GERRIT_REFSPEC'
+          branch: '$GERRIT_BRANCH'
+          submodule-disable: '{submodule-disable}'
+          submodule-recursive: 'false'
+          submodule-timeout: '{submodule-timeout}'
+          choosing-strategy: gerrit
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    concurrent: false
+
+    dsl: !include-raw-escape: pipeline/{pipeline-script}
diff --git a/jjb/defaults.yaml b/jjb/defaults.yaml
index c48cf5f..7eb22bd 100644
--- a/jjb/defaults.yaml
+++ b/jjb/defaults.yaml
@@ -90,7 +90,7 @@
 
     # matching repos that should be version tagged by the version-tag job
     # (basically the same as imagebuilder projects + helm charts + tools
-    version-tag-projects-regexp: '^(xos.*|.*helm-charts|automation-tools|cord-tester|chameleon|rcord|mcord|ecord|acordion|addressmanager|epc-service|exampleservice|fabric.*|globalxos|hippie-oss|hss_db|hypercache|internetemulator|kubernetes-service|monitoring|olt-service|onos-service|openstack|progran|sdn-controller|simpleexampleservice|templateservice|vEE|vEG|vBBU|venb|vHSS|vMME|vnaas|vPGWC|vPGWU|vrouter|vsg|vsg-hw|vSGW|vSM|vspgwc|vspgwu|vtn-service|vtr|.*-workflow-driver|ves-agent|voltha-bbsim|openolt|sadis-server|kafka-topic-exporter|pyvoltha||plyxproto|voltha-protos|alpine-grpc-base|cordctl|voltha-go|voltha-onos|device-management|cord-workflow.*|voltha-system-tests|openairinterface|omec-.*|bbsim|omci-sim|ponsim|pppoel2relay|voltha-api-server|aaa|config|dhcpl2relay|igmp|igmpproxy|kafka-onos|mcast|olt|sadis|vtn|voltha-.*-adapter.*|voltha-lib-go|voltha-python-base|voltha-docker-tools|mn-stratum-siab|ofagent.*|bng|voltctl|openolt-scale-tester|nem-ondemand-proxy|multifabric|openolt-test|omci-lib-go|kind-voltha|voltha-docs)$'
+    version-tag-projects-regexp: '^(xos.*|.*helm-charts|automation-tools|cord-tester|chameleon|rcord|mcord|ecord|acordion|addressmanager|epc-service|exampleservice|fabric.*|globalxos|hippie-oss|hss_db|hypercache|internetemulator|kubernetes-service|monitoring|olt-service|onos-service|openstack|progran|sdn-controller|simpleexampleservice|templateservice|vEE|vEG|vBBU|venb|vHSS|vMME|vnaas|vPGWC|vPGWU|vrouter|vsg|vsg-hw|vSGW|vSM|vspgwc|vspgwu|vtn-service|vtr|.*-workflow-driver|ves-agent|voltha-bbsim|openolt|sadis-server|kafka-topic-exporter|pyvoltha||plyxproto|voltha-protos|alpine-grpc-base|cordctl|voltha-go|voltha-onos|device-management|cord-workflow.*|voltha-system-tests|openairinterface|omec-.*|bbsim|omci-sim|ponsim|pppoel2relay|voltha-api-server|aaa|config|dhcpl2relay|igmp|igmpproxy|kafka-onos|mcast|olt|sadis|vtn|voltha-.*-adapter.*|voltha-lib-go|voltha-python-base|voltha-docker-tools|mn-stratum-siab|ofagent.*|bng|voltctl|openolt-scale-tester|nem-ondemand-proxy|multifabric|openolt-test|omci-lib-go|kind-voltha|voltha-docs|mac-learning|goloxi)$'
 
     # List of all repos that contribute to the CORD guide
     cord-guide-projects-regexp: '^(att-workflow-driver|cord-tester|cordctl|exampleservice|fabric|fabric-crossconnect|hippie-oss|kubernetes-service|olt-service|onos-service|openolt|openstack|rcord|simpleexampleservice|vrouter|vtn-service|xos|xos-gui|xos-tosca)$'
diff --git a/jjb/pipeline/comac-in-a-box.groovy b/jjb/pipeline/comac-in-a-box.groovy
new file mode 100644
index 0000000..a4a4688
--- /dev/null
+++ b/jjb/pipeline/comac-in-a-box.groovy
@@ -0,0 +1,58 @@
+// Copyright 2020-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.
+
+// comac-in-a-box build+test
+// steps taken from https://guide.opencord.org/profiles/comac/install/ciab.html
+
+pipeline {
+
+  /* no label, executor is determined by JJB */
+  agent {
+    label "${params.buildNode}"
+  }
+
+  options {
+    timeout(time: 1, unit: 'HOURS')
+  }
+
+  stages {
+    stage ("Fetch Helm-Charts Changes"){
+      steps {
+        sh label: 'Fetch helm-charts Gerrit Changes', script: """
+          cd cord/helm-charts/
+          pwd
+          if [ ! -z "${GERRIT_REFSPEC}" ]
+          then
+            echo "Checking out Gerrit patchset: ${GERRIT_REFSPEC}"
+            git fetch ${gitUrl} ${GERRIT_REFSPEC} && git checkout FETCH_HEAD
+          else
+            echo "GERRIT_REFSPEC not provided. Checking out master branch."
+            git checkout master
+          fi
+          """
+      }
+    }
+
+    stage ("Run COMAC-in-a-box"){
+      steps {
+        sh label: 'Run Makefile', script: '''
+          HOME=$(pwd)
+          cd automation-tools/comac-in-a-box/
+          sudo make reset-test
+          sudo make test
+          '''
+      }
+    }
+  }
+}
diff --git a/jjb/pipeline/voltha-physical-build-and-tests.groovy b/jjb/pipeline/voltha-physical-build-and-tests.groovy
index abc7929..86c394d 100644
--- a/jjb/pipeline/voltha-physical-build-and-tests.groovy
+++ b/jjb/pipeline/voltha-physical-build-and-tests.groovy
@@ -164,10 +164,10 @@
 
     stage('Deploy Voltha') {
       environment {
-        WITH_SIM_ADAPTERS="n"
-        WITH_RADIUS="y"
-        DEPLOY_K8S="n"
-        VOLTHA_LOG_LEVEL="debug"
+        WITH_SIM_ADAPTERS="no"
+        WITH_RADIUS="yes"
+        DEPLOY_K8S="no"
+        VOLTHA_LOG_LEVEL="DEBUG"
       }
       steps {
         script {
@@ -207,6 +207,14 @@
           echo \$EXTRA_HELM_FLAGS
           kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
           ./voltha up
+
+          # Remove noise from voltha-core logs
+          voltctl loglevel set WARN read-write-core#github.com/opencord/voltha-go/db/model
+          voltctl loglevel set WARN read-write-core#github.com/opencord/voltha-lib-go/v3/pkg/kafka
+          # Remove noise from openolt logs
+          voltctl loglevel set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db
+          voltctl loglevel set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe
+          voltctl loglevel set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka
           """
         }
       }
diff --git a/jjb/pipeline/voltha-physical-functional-tests.groovy b/jjb/pipeline/voltha-physical-functional-tests.groovy
index 9f007e7..1ac0a71 100644
--- a/jjb/pipeline/voltha-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha-physical-functional-tests.groovy
@@ -70,6 +70,14 @@
         curl -o $WORKSPACE/bin/voltctl -sSL https://github.com/opencord/voltctl/releases/download/v\${VC_VERSION}/voltctl-\${VC_VERSION}-\${HOSTOS}-\${HOSTARCH}
         chmod 755 $WORKSPACE/bin/voltctl
         voltctl version --clientonly
+
+        # Remove noise from voltha-core logs
+        voltctl loglevel set WARN read-write-core#github.com/opencord/voltha-go/db/model
+        voltctl loglevel set WARN read-write-core#github.com/opencord/voltha-lib-go/v3/pkg/kafka
+        # Remove noise from openolt logs
+        voltctl loglevel set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db
+        voltctl loglevel set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe
+        voltctl loglevel set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka
         """
       }
     }
diff --git a/jjb/verify/goloxi.yaml b/jjb/verify/goloxi.yaml
new file mode 100644
index 0000000..c9f6f43
--- /dev/null
+++ b/jjb/verify/goloxi.yaml
@@ -0,0 +1,19 @@
+---
+# verification jobs for 'goloxi' repo
+
+- project:
+    name: goloxi
+    project: '{name}'
+
+    jobs:
+      - 'verify-goloxi-jobs':
+          branch-regexp: '{all-branches-regexp}'
+
+- job-group:
+    name: 'verify-goloxi-jobs'
+    jobs:
+      - 'verify-licensed'
+      - 'tag-collision-reject'
+      - 'make-unit-test':
+          unit-test-targets: 'test'
+          junit-allow-empty-results: true
diff --git a/jjb/verify/helm-charts.yaml b/jjb/verify/helm-charts.yaml
index 137586b..2c9ffe4 100644
--- a/jjb/verify/helm-charts.yaml
+++ b/jjb/verify/helm-charts.yaml
@@ -16,6 +16,8 @@
           branch: 'cord-6.0'
           name-extension: '-cord6.0'
           timed-trigger: '{once-a-day}'
+      - 'comac-in-a-box':
+          name: 'comac-in-a-box'
 
 - job-group:
     name: 'verify-helm-charts-jobs'
diff --git a/jjb/verify/mac-learning.yaml b/jjb/verify/mac-learning.yaml
new file mode 100644
index 0000000..c27a444
--- /dev/null
+++ b/jjb/verify/mac-learning.yaml
@@ -0,0 +1,18 @@
+---
+# jobs for 'mac-learning' repo
+
+- project:
+    name: mac-learning
+    project: '{name}'
+
+    jobs:
+      - 'mac-learning-jobs':
+          branch-regexp: '^(.*)$'
+
+- job-group:
+    name: 'mac-learning-jobs'
+    jobs:
+      - 'verify-licensed'
+      - 'tag-collision-reject'
+      - 'maven-test'
+      - 'maven-publish'