---

# -----------------------------------------------------------------------
# Copyright 2017-2025 Open Networking Foundation Contributors
#
# 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.
# -----------------------------------------------------------------------
# SPDX-FileCopyrightText: 2017-2025 Open Networking Foundation Contributors
# SPDX-License-Identifier: Apache-2.0
# -----------------------------------------------------------------------
# Entropy: 0fcb5ffa-d1a4-11ee-be5e-9f44b7181764
# -----------------------------------------------------------------------
# Intent: voltha 2.0 tests, end-2-end pipeline jobs.
# -----------------------------------------------------------------------

- _voltha_214_common: &voltha_214_common
    name: voltha-2.14-common
    pipeline-script: 'voltha/bbsim-tests.groovy'
    pipeline-branch: 'voltha-2.14'
    code-branch: 'voltha-2.14'
    time-trigger: "H H/23 * * *"

- project:
    name: voltha-e2e

    project-name: '{name}'
    manualBranch: ''
    olts: 1
    onus: 1
    pons: 1
    withAlarms: true
    make-target-failtest: bbsim-failurescenarios
    make-target-errortest: bbsim-errorscenarios
    make-target-alarmtest: bbsim-alarms-kind
    make-target-multipleolt: bbsim-multiolt-kind
    make-target-1t4gemtest: 1t4gem-openonu-go-adapter-test
    make-target-1t8gemtest: 1t8gem-openonu-go-adapter-test
    make-target-reconciletest: reconcile-openonu-go-adapter-test-att
    make-target-reconciledttest: reconcile-openonu-go-adapter-test-dt
    make-target-reconciletttest: reconcile-openonu-go-adapter-test-tt

    jobs:

      # -----------------------------------------------------------------------
      # voltha-2.14 Jobs
      # -----------------------------------------------------------------------

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-multiple-olts-test-bbsim-2.14'
          olts: 2
          extraHelmFlags: '--set onu=2,pon=2'
          testTargets: |
            - target: functional-multi-olt
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-multiolt-failurescenarios
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiolt-errorscenarios
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiolt-kind
              workflow: att
              flags: ""
              teardown: false
              logging: true

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-multi-uni-test-bbsim-2.14'
          extraHelmFlags: '--set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF'
          testTargets: |
            - target: functional-single-kind-multiuni-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-multiuni-failurescenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiuni-errorscenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-multi-uni-multiple-olts-test-bbsim-2.14'
          olts: 2
          extraHelmFlags: '--set onu=2,pon=2 --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF'
          testTargets: |
            - target: functional-multiuni-multiolt-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-multiuni-multiolt-failurescenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiuni-multiolt-errorscenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true
          timeout: 180

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-openonu-go-test-bbsim-2.14'
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: mib-upload-templating-openonu-go-adapter-test
              workflow: att
              flags: "--set pon=2,onu=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true --set global.extended_omci_support.enabled=true "
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-passed-test
              workflow: att
              flags: "--set omci_response_rate=9 --set voltha-adapter-openonu.adapter_open_onu.omci_timeout=1s"
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-failed-test
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,omci_response_rate=7"
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-att
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-dt
              workflow: dt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-tt
              workflow: tt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-robustness-test-single-kind-dt
              workflow: dt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1"
              teardown: true
              logging: true
            - target: onu-robustness-test-multi-uni-kind-tt
              workflow: tt
              flags: "--set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF,kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1"
              teardown: true
              logging: true
          timeout: 240

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'patchset-voltha-2.14-openonu-go-test-bbsim'
          trigger-comment: "voltha 2.14 test openonu singleolt"
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: mib-upload-templating-openonu-go-adapter-test
              workflow: att
              flags: "--set pon=2,onu=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true --set global.extended_omci_support.enabled=true "
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-passed-test
              workflow: att
              flags: "--set omci_response_rate=9 --set voltha-adapter-openonu.adapter_open_onu.omci_timeout=1s"
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-failed-test
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,omci_response_rate=7"
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-att
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-dt
              workflow: dt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-tt
              workflow: tt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
          timeout: 210

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-multiple-olts-openonu-go-test-bbsim-2.14'
          extraHelmFlags: '--set onu=2,pon=2'
          olts: 2
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
          time-trigger: "H H/23 * * *"
          timeout: 270

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'patchset-voltha-2.14-multiple-olts-openonu-go-test-bbsim'
          trigger-comment: "voltha 2.14 test openonu multiolt"
          extraHelmFlags: '--set onu=2,pon=2'
          olts: 2
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
          timeout: 270

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-test-DMI-2.14'
          testTargets: |
            - target: bbsim-dmi-hw-management-test
              workflow: att
              flags: ""
              teardown: true
              logging: true

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-etcd-test-2.14'
          build-node: 'ubuntu18.04-basebuild-4c-8g'
          extraHelmFlags: '--set onu=2,pon=2'
          testTargets: |
            - target: sanity-multi-kind
              workflow: att
              flags: ""
              teardown: true
              logging: true

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-unitag-subscriber-tt-test-bbsim-2.14'
          extraHelmFlags: '--set onos-classic.replicas=3,onos-classic.atomix.replicas=3 --set voltha.onos_classic.replicas=3 '
          logLevel: 'DEBUG'
          robot-args: '-v unitag_sub:True'
          testTargets: |
            - target: functional-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-failurescenarios-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: functional-single-kind-multiuni-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true

      - 'voltha-periodic-test':
          <<: *voltha_214_common
          name: 'periodic-voltha-memory-leak-test-bbsim-2.14'
          build-node: 'ubuntu18.04-basebuild-4c-8g'
          withMonitoring: true
          logLevel: 'DEBUG'
          testTargets: |
            - target: memory-leak-test-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
          timeout: 230

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-multiple-olts-test-bbsim'
          code-branch: 'master'
          olts: 2
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2'
          time-trigger: "H H/23 * * *"
          testTargets: |
            - target: functional-multi-olt
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-multiolt-failurescenarios
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiolt-errorscenarios
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiolt-kind
              workflow: att
              flags: ""
              teardown: false
              logging: true

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-multi-uni-test-bbsim'
          code-branch: 'master'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF'
          time-trigger: "H H/23 * * *"
          testTargets: |
            - target: functional-single-kind-multiuni-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-multiuni-failurescenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiuni-errorscenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true

      - 'voltha-periodic-test':
          name: 'periodic-voltha-multi-uni-multiple-olts-test-bbsim'
          code-branch: 'master'
          olts: 2
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2 --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF'
          time-trigger: "H H/23 * * *"
          testTargets: |
            - target: functional-multiuni-multiolt-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-multiuni-multiolt-failurescenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true
            - target: bbsim-multiuni-multiolt-errorscenarios-att
              workflow: att
              flags: ""
              teardown: false
              logging: true
          timeout: 360

      # -----------------------------------------------------------------------
      # openonu Go periodic tests
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-openonu-go-test-bbsim'
          code-branch: 'master'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master'
          time-trigger: "H H/12 * * *"
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: mib-upload-templating-openonu-go-adapter-test
              workflow: att
              flags: "--set pon=2,onu=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true --set global.extended_omci_support.enabled=true "
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-passed-test
              workflow: att
              flags: "--set omci_response_rate=9 --set voltha-adapter-openonu.adapter_open_onu.omci_timeout=1s"
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-failed-test
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,omci_response_rate=7"
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-att
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-dt
              workflow: dt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-tt
              workflow: tt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-robustness-test-single-kind-dt
              workflow: dt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1"
              teardown: true
              logging: true
            - target: onu-robustness-test-multi-uni-kind-tt
              workflow: tt
              flags: "--set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF,kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1"
              teardown: true
              logging: true
          timeout: 240

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'patchset-voltha-openonu-go-test-bbsim'
          trigger-comment: "voltha test openonu singleolt"
          code-branch: '$GERRIT_BRANCH'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master'
          gerritProject: '$GERRIT_PROJECT'
          gerritRefspec: '$GERRIT_REFSPEC'
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: mib-upload-templating-openonu-go-adapter-test
              workflow: att
              flags: "--set pon=2,onu=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true --set global.extended_omci_support.enabled=true "
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-passed-test
              workflow: att
              flags: "--set omci_response_rate=9 --set voltha-adapter-openonu.adapter_open_onu.omci_timeout=1s"
              teardown: true
              logging: true
            - target: openonu-go-adapter-omci-hardening-failed-test
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,omci_response_rate=7"
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-att
              workflow: att
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-dt
              workflow: dt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
            - target: onu-mib-audit-test-single-kind-tt
              workflow: tt
              flags: "--set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1,voltha-adapter-openonu.global.mib_audit.interval=60s"
              teardown: true
              logging: true
          timeout: 210

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-multiple-olts-openonu-go-test-bbsim'
          code-branch: 'master'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2'
          olts: 2
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
          time-trigger: "H H/12 * * *"
          timeout: 270

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'patchset-voltha-multiple-olts-openonu-go-test-bbsim'
          trigger-comment: "voltha test openonu multiolt"
          code-branch: '$GERRIT_BRANCH'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2'
          gerritProject: '$GERRIT_PROJECT'
          gerritRefspec: '$GERRIT_REFSPEC'
          logLevel: 'DEBUG'
          testTargets: |
            - target: 1t1gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t4gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: 1t8gem-openonu-go-adapter-multi-olt-test
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-test-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: reconcile-openonu-go-adapter-multi-olt-multi-uni-test-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-omci-get-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-onu-flows-check-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
          olts: 2
          timeout: 270

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'patchset-voltha-pm-data-test-bbsim'
          trigger-comment: "voltha test pm data singleolt"
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
          code-branch: '$GERRIT_BRANCH'
          gerritProject: '$GERRIT_PROJECT'
          gerritRefspec: '$GERRIT_REFSPEC'
          logLevel: 'DEBUG'
          testTargets: |
            - target: voltha-pm-data-single-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-pm-data-single-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-pm-data-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
          timeout: 140
## YY
#-----------------------------------------------------------------------
# Intent: Pipeline jobs refactored into voltha-e2e/votlha-x.1x
# What to do with patchset-* (?)
#-----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'patchset-voltha-multiple-olts-pm-data-test-bbsim'
          trigger-comment: "voltha test pm data multiolt"
          code-branch: '$GERRIT_BRANCH'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2 --set kafka.externalAccess.enabled=true,kafka.externalAccess.service.type=NodePort,kafka.externalAccess.service.nodePorts[0]=30201,kafka.externalAccess.service.domain=127.0.0.1'
          gerritProject: '$GERRIT_PROJECT'
          gerritRefspec: '$GERRIT_REFSPEC'
          logLevel: 'DEBUG'
          testTargets: |
            - target: voltha-pm-data-multiolt-kind-att
              workflow: att
              flags: ""
              teardown: true
              logging: true
            - target: voltha-pm-data-multiolt-kind-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
            - target: voltha-pm-data-multiolt-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
          olts: 2
          timeout: 180

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-test-DMI'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master'
          code-branch: 'master'
          time-trigger: "H H/23 * * *"
          testTargets: |
            - target: bbsim-dmi-hw-management-test
              workflow: att
              flags: ""
              teardown: true
              logging: true

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-etcd-test'
          build-node: 'ubuntu18.04-basebuild-4c-8g'
          code-branch: 'master'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2'
          time-trigger: "H H/12 * * *"
          testTargets: |
            - target: sanity-multi-kind
              workflow: att
              flags: ""
              teardown: true
              logging: true

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-unitag-subscriber-tt-test-bbsim'
          code-branch: 'master'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 --set voltha.onos_classic.replicas=3 '
          time-trigger: "H H/23 * * *"
          logLevel: 'DEBUG'
          robot-args: '-v unitag_sub:True'
          testTargets: |
            - target: functional-single-kind-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: bbsim-failurescenarios-tt
              workflow: tt
              flags: ""
              teardown: true
              logging: true
            - target: functional-single-kind-multiuni-tt
              workflow: tt
              flags: " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=0x00FF "
              teardown: true
              logging: true

      # -----------------------------------------------------------------------
      # -----------------------------------------------------------------------
      - 'voltha-periodic-test':
          name: 'periodic-voltha-tt-maclearner-sanity-test-bbsim'
          code-branch: 'master'
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 --set voltha.onos_classic.replicas=3 '
          time-trigger: "H H/23 * * *"
          logLevel: 'DEBUG'
          enableMacLearning: true
          testTargets: |
            - target: sanity-kind-tt-maclearning
              workflow: tt
              flags: ""
              teardown: true
              logging: true

      # Attention: Due VOL-4703 is not corrected memory leak tests will run in pipeline for DT workflow only!
      - 'voltha-periodic-test':
          name: 'periodic-voltha-memory-leak-test-bbsim'
          build-node: 'ubuntu18.04-basebuild-4c-8g'
          code-branch: 'master'
          time-trigger: "H H/23 * * *"
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,controlledActivation=only-onu'
          withMonitoring: true
          logLevel: 'DEBUG'
          testTargets: |
            - target: memory-leak-test-single-pon-multi-onu-dt
              workflow: dt
              flags: ""
              teardown: true
              logging: true
          timeout: 230

      - 'voltha-periodic-test':
          name: 'periodic-voltha-tim-multiple-olts-test-bbsim'
          code-branch: 'master'
          olts: 2
          extraHelmFlags: '--set global.image_tag=master --set onos-classic.image.tag=master --set onu=2,pon=2'
          time-trigger: "H H/23 * * *"
          testTargets: |
            - target: sanity-kind-tim-multi-olt-multi-pon-multi-onu
              workflow: tim
              flags: ""
              teardown: true
              logging: true

- job-template:
    id: 'voltha-periodic-test'
    name: '{name}'
    pipeline-script: 'voltha/bbsim-tests.groovy'
    pipeline-branch: 'master'
    build-node: 'ubuntu18.04-basebuild-8c-15g'
    robot-args: ''
    gerritProject: ''
    gerritRefspec: ''
    volthaSystemTestsChange: ''
    volthaHelmChartsChange: ''
    extraHelmFlags: ''
    registry: mirror.registry.opennetworking.org
    sandbox: true
    olts: 1
    timeout: 130
    logLevel: 'INFO'
    enableMacLearning: false
    withMonitoring: false

    trigger-comment: vv7CBoQQYYonvaN8xcru
    time-trigger: 0 0 29 2 *

    description: |
      <!-- Managed by Jenkins Job Builder -->
      Created by {id} job-template from ci-management/jjb/voltha-e2e.yaml  <br /><br />
      E2E Validation for Voltha 2.X

    properties:
      - onf-infra-volthadevs-permissions
      - cord-infra-properties:
          build-days-to-keep: '{big-build-days-to-keep}'
          artifact-num-to-keep: '{big-artifact-num-to-keep}'

    wrappers:
      - lf-infra-wrappers:
          build-timeout: '{build-timeout}'
          jenkins-ssh-credential: '{jenkins-ssh-credential}'

    parameters:
      - string:
          name: buildNode
          default: '{build-node}'
          description: 'Name of the Jenkins node to run the job on'

      - string:
          name: extraHelmFlags
          default: '{extraHelmFlags}'
          description: 'Helm flags (passed to each deployment)'

      # test configuration
      # this is a parameter to drive the test execution, VOLTHA is redeployed each time with
      # the provided configuration and then the make target is invoked,
      # example value (has to be valid YAML):
      # testTargets: |
      #   - target: 1t1gem-openonu-go-adapter-test
      #     workflow: att
      #     flags: ""
      #     teardown: true
      #     logging: true
      - text:
          name: testTargets
          default: '{testTargets}'
          description: 'Test configuration, see the ci-management job definition for more info'

      - string:
          name: branch
          default: '{code-branch}'
          description: 'Repo manifest branch for code checkout'

      - string:
          name: gerritProject
          default: '{gerritProject}'
          description: 'Name of the Gerrit project'

      - string:
          name: gerritRefspec
          default: '{gerritRefspec}'
          description: 'PatchSet REFSPEC in Gerrit, example value: "refs/changes/79/18779/13"'

      # applicable for voltha-2.9 (excluding) onwards
      - bool:
          name: enableMacLearning
          default: '{enableMacLearning}'
          description: "Deploy and test with ONOS Mac-Learning app"

      - string:
          name: extraRobotArgs
          default: '{robot-args}'
          description: 'Arguments to pass to robot'

      - string:
          name: volthaSystemTestsChange
          default: '{volthaSystemTestsChange}'
          description: 'Download a change for gerrit in the voltha-system-tests repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: volthaHelmChartsChange
          default: '{volthaHelmChartsChange}'
          description: 'Download a change for gerrit in the voltha-helm-charts repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: olts
          default: '{olts}'
          description: 'How many BBSim instances to run'

      - string:
          name: registry
          default: '{registry}'
          description: 'Which registry to use (amazon vs menlo)'

      - string:
          name: logLevel
          default: '{logLevel}'
          description: 'Log level for all the components'

      - bool:
          name: withMonitoring
          default: '{withMonitoring}'
          description: 'Option to install Prometheus'

      - string:
          name: timeout
          default: '{timeout}'
          description: 'Timeout of pipeline job [minutes]'

    project-type: pipeline
    concurrent: true

    pipeline-scm:
      scm:
        - git:
            url: https://gerrit.lfbroadband.org/ci-management
            branches:
              - origin/{pipeline-branch}
      script-path: jjb/pipeline/{pipeline-script}

    triggers:
      # patchset jobs will set this to "0 0 29 2 *" (feb 29th, it's once every 4 years)
      - timed: |
                 TZ=America/Los_Angeles
                 {time-trigger}
      # periodic jobs will set this to vv7CBoQQYYonvaN8xcru (hopefully no-one will comment with that)
      - gerrit:
          server-name: '{gerrit-server-name}'
          silent-start: false
          successful-message: "PASSED openonu-go test"
          failure-message: "FAILED openonu-go test"
          unstable-message: "UNSTABLE openonu-go test"
          trigger-on:
            - comment-added-contains-event:
                comment-contains-value: '.*{trigger-comment}.*'
          projects:
            - project-compare-type: REG_EXP
              project-pattern: '^(voltha-go|voltha-openolt-adapter|voltha-openonu-adapter-go|ofagent-go|voltha-onos|bbsim)$'
              branches:
                - branch-compare-type: REG_EXP
                  branch-pattern: '{all-branches-regexp}'

- job-template:
    id: 'voltha-patch-test'
    name: 'verify_{project}_sanity-test{name-extension}'
    #build-node: 'ubuntu18.04-basebuild-4c-8g'
    build-node: 'ubuntu18.04-basebuild-8c-15g'
    pipeline-script: 'voltha/bbsim-tests.groovy'
    pipeline-branch: 'master'
    override-branch: '$GERRIT_BRANCH'
    sandbox: true
    build-timeout: 20
    timeout: 50
    olts: 1
    registry:  mirror.registry.opennetworking.org
    logLevel: 'INFO'
    volthaSystemTestsChange: ''
    volthaHelmChartsChange: ''
    extraHelmFlags: ''
    enableMacLearning: false
    withMonitoring: false
    robot-args: ''
    branch-regexp: '{all-branches-regexp}'
    testTargets: |
      - target: sanity-kind-att
        workflow: att
        flags: ""
        teardown: true
        logging: true
      - target: sanity-kind-dt
        workflow: dt
        flags: ""
        teardown: true
        logging: true
      - target: sanity-kind-tt
        workflow: tt
        flags: ""
        teardown: true
        logging: true

    description: |
      <!-- Managed by Jenkins Job Builder -->
      Created by {id} job-template from ci-management/jjb/voltha-e2e.yaml  <br /><br />
      E2E Validation for Voltha 2.X

    properties:
      - onf-infra-volthadevs-permissions
      - 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: '{build-node}'
          description: 'Name of the Jenkins node to run the job on'

      - string:
          name: gerritProject
          default: '$GERRIT_PROJECT'
          description: 'Name of the Gerrit project'

      - string:
          name: gerritRefspec
          default: '$GERRIT_REFSPEC'
          description: 'PatchSet REFSPEC in Gerrit, example value: "refs/changes/79/18779/13"'

      - string:
          name: extraHelmFlags
          default: '{extraHelmFlags}'
          description: 'Helm flags to pass to every helm command'

      # applicable for voltha-2.9 (excluding) onwards
      - bool:
          name: enableMacLearning
          default: '{enableMacLearning}'
          description: "Deploy and test with ONOS Mac-Learning app"

      - string:
          name: extraRobotArgs
          default: '{robot-args}'
          description: 'Arguments to pass to robot'

      - string:
          name: volthaSystemTestsChange
          default: '{volthaSystemTestsChange}'
          description: 'Download a change for gerrit in the voltha-system-tests repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: volthaHelmChartsChange
          default: '{volthaHelmChartsChange}'
          description: 'Download a change for gerrit in the voltha-helm-charts repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: branch
          default: '{override-branch}'
          description: 'Name of the branch to use'

      # test configuration
      # this is a parameter to drive the test execution, VOLTHA is redeployed each time with
      # the provided configuration and then the make target is invoked,
      # example value (has to be valid YAML):
      # testTargets: |
      #   - target: 1t1gem-openonu-go-adapter-test
      #     workflow: att
      #     flags: ""
      #     teardown: true
      #     logging: true
      - text:
          name: testTargets
          default: '{testTargets}'
          description: 'Test configuration, see the ci-management job definition for more info'

      - string:
          name: timeout
          default: '{timeout}'
          description: 'Timeout of pipeline job [minutes]'

      - string:
          name: olts
          default: '{olts}'
          description: 'How many BBSim instances to run'

      - string:
          name: registry
          default: '{registry}'
          description: 'Which registry to use (amazon vs menlo)'

      - bool:
          name: withMonitoring
          default: '{withMonitoring}'
          description: 'Option to install Prometheus'

      - string:
          name: logLevel
          default: '{logLevel}'
          description: 'Log level for all the components'

    project-type: pipeline
    concurrent: true

    pipeline-scm:
      scm:
        - git:
            url: https://gerrit.lfbroadband.org/ci-management
            branches:
              - origin/{pipeline-branch}
      script-path: jjb/pipeline/{pipeline-script}

    triggers:
      - gerrit:
          server-name: '{gerrit-server-name}'
          dependency-jobs: '{dependency-jobs}'
          silent-start: true
          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: '^{project}$'
              branches:
                - branch-compare-type: REG_EXP
                  branch-pattern: '{branch-regexp}'
              file-paths:
                - compare-type: REG_EXP
                  pattern: '{all-files-regexp}'

- job-template:
    id: 'voltha-make-test'
    name: '{name}'
    #build-node: 'ubuntu18.04-basebuild-4c-8g'
    build-node: 'ubuntu18.04-basebuild-8c-15g'
    pipeline-script: 'voltha/bbsim-tests.groovy'
    pipeline-branch: 'master'
    override-branch: '$GERRIT_BRANCH'
    sandbox: true
    build-timeout: 20
    timeout: 50
    olts: 1
    registry:  mirror.registry.opennetworking.org
    logLevel: 'INFO'
    test-project: 'voltha-go'
    volthaSystemTestsChange: ''
    volthaHelmChartsChange: ''
    extraHelmFlags: ''
    enableMacLearning: false
    withMonitoring: false
    robot-args: ''
    branch-regexp: '{all-branches-regexp}'
    testTargets: |
      - target: sanity-kind-att
        workflow: att
        flags: ""
        teardown: true
        logging: true
      - target: sanity-kind-dt
        workflow: dt
        flags: ""
        teardown: true
        logging: true
      - target: sanity-kind-tt
        workflow: tt
        flags: ""
        teardown: true
        logging: true

    description: |
      <!-- Managed by Jenkins Job Builder -->
      Created by {id} job-template from ci-management/jjb/voltha-e2e.yaml  <br /><br />
      E2E Validation for Voltha 2.X

    properties:
      - onf-infra-volthadevs-permissions
      - 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: '{build-node}'
          description: 'Name of the Jenkins node to run the job on'

      - string:
          name: gerritProject
          default: '{test-project}'
          description: 'Name of the Gerrit project'

      - string:
          name: gerritRefspec
          default: 'refs/heads/master'
          description: 'PatchSet REFSPEC in Gerrit, example value: "refs/changes/79/18779/13"'

      - string:
          name: extraHelmFlags
          default: '{extraHelmFlags}'
          description: 'Helm flags to pass to every helm command'

      # applicable for voltha-2.9 (excluding) onwards
      - bool:
          name: enableMacLearning
          default: '{enableMacLearning}'
          description: "Deploy and test with ONOS Mac-Learning app"

      - string:
          name: extraRobotArgs
          default: '{robot-args}'
          description: 'Arguments to pass to robot'

      - string:
          name: volthaSystemTestsChange
          default: '{volthaSystemTestsChange}'
          description: 'Download a change for gerrit in the voltha-system-tests repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: volthaHelmChartsChange
          default: '{volthaHelmChartsChange}'
          description: 'Download a change for gerrit in the voltha-helm-charts repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: branch
          default: '{override-branch}'
          description: 'Name of the branch to use'

      # test configuration
      # this is a parameter to drive the test execution, VOLTHA is redeployed each time with
      # the provided configuration and then the make target is invoked,
      # example value (has to be valid YAML):
      # testTargets: |
      #   - target: 1t1gem-openonu-go-adapter-test
      #     workflow: att
      #     flags: ""
      #     teardown: true
      #     logging: true
      - text:
          name: testTargets
          default: '{testTargets}'
          description: 'Test configuration, see the ci-management job definition for more info'

      - string:
          name: timeout
          default: '{timeout}'
          description: 'Timeout of pipeline job [minutes]'

      - string:
          name: olts
          default: '{olts}'
          description: 'How many BBSim instances to run'

      - string:
          name: registry
          default: '{registry}'
          description: 'Which registry to use (amazon vs menlo)'

      - bool:
          name: withMonitoring
          default: '{withMonitoring}'
          description: 'Option to install Prometheus'

      - string:
          name: logLevel
          default: '{logLevel}'
          description: 'Log level for all the components'

    project-type: pipeline
    concurrent: true

    pipeline-scm:
      scm:
        - git:
            url: https://gerrit.lfbroadband.org/ci-management
            branches:
              - origin/{pipeline-branch}
      script-path: jjb/pipeline/{pipeline-script}

    triggers:
      - gerrit:
          server-name: '{gerrit-server-name}'
          dependency-jobs: '{dependency-jobs}'
          silent-start: true
          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: '^{project}$'
              branches:
                - branch-compare-type: REG_EXP
                  branch-pattern: '{branch-regexp}'
              file-paths:
                - compare-type: REG_EXP
                  pattern: '{all-files-regexp}'

# POD Per Patchset Pipeline Jobs
# to use these parameters in a job: `<<: *voltha-physical-patchset-parameters`
- _voltha-physical-patchset-parameters: &voltha-physical-patchset-parameters
    name: voltha-physical-patchset-parameters
    parameters:
      - string:
          name: buildNode
          default: '{build-node}'
          description: 'Pod management node'

      - string:
          name: branch
          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: gerritRefspec
          default: '$GERRIT_REFSPEC'
          description: 'RefSpec number in Gerrit'

      - string:
          name: gerritComment
          default: '$GERRIT_EVENT_COMMENT_TEXT'
          description: 'RefSpec number in Gerrit'

      - string:
          name: cordRepoUrl
          default: '{gerrit-server-url}'
          description: 'The URL of the CORD Project repository'

      - string:
          name: configBaseDir
          default: 'pod-configs'
          description: 'The directory inside the POD configs repository'

      - string:
          name: configDeploymentDir
          default: 'deployment-configs'
          description: 'The deployment configs folder'

      - string:
          name: configKubernetesDir
          default: 'kubernetes-configs'
          description: 'The kubernetes config folder'

      - string:
          name: configFileName
          default: '{config-pod}'
          description: 'The config file'

      - string:
          name: podName
          default: '{config-pod}'

      - string:
          name: sadisConfigFile
          default: 'voltha-system-tests/tests/data/{config-pod}-sadis.json'
          description: 'Path of SADIS config to load'

      - string:
          name: oltDebVersionMaster
          default: '{oltDebVersionMaster}'
          description: 'OLT Software version to install for master branch builds'

      - string:
          name: oltDebVersionVoltha23
          default: '{oltDebVersionVoltha23}'
          description: 'OLT Software version to install for voltha-2.3 branch builds'

      - string:
          name: profile
          default: '{profile}'
          description: 'Technology Profile pushed to the ETCD'

      - bool:
          name: reinstallOlt
          default: true
          description: "Re-install OLT software"

      - string:
          name: extraRobotArgs
          default: '{default-test-args}'
          description: 'Arguments to pass to robot'

      - string:
          name: volthaSystemTestsChange
          default: '{volthaSystemTestsChange}'
          description: 'Download a change for gerrit in the voltha-system-tests repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: volthaHelmChartsChange
          default: '{volthaHelmChartsChange}'
          description: 'Download a change for gerrit in the voltha-helm-charts repo, example value: "refs/changes/79/18779/13"'

      - string:
          name: workflow
          default: '{workflow}'
          description: 'Installs and uses the specified work flow on the POD'

      - string:
          name: extraHelmFlags
          default: '{extraHelmFlags}'
          description: 'Helm flags (passed to each helm command)'

- job-template:
    name: '{name}'
    id: verify_physical_voltha_patchset_auto
    description: |
                  <!-- Managed by Jenkins Job Builder -->
                  Automated build on POD {config-pod} using {pipeline-script} <br /><br />
                  Created from job-template {id} from ci-management/jjb/voltha-e2e.yaml <br />
                  Created by Andy Bavier, andy@opennetworking.org <br />
                  Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
    sandbox: true
    pipeline-script: 'voltha/tucson-build-and-test.groovy'
    pipeline-branch: 'master'
    default-test-args: '-i sanityORDeleteOLT -i PowerSwitch -X'
    build-node: 'tucson-pod'
    config-pod: 'tucson-pod'
    profile: 'Default'
    oltDebVersionMaster: 'openolt_asfvolt16-3.7.4-3b190f027136e845c5850a5b1a97897ce2b74ebf-40G-NNI.deb'
    oltDebVersionVoltha23: 'openolt_asfvolt16-3.4.9-e2a9597f3d690fe3a0ea0df244571dfc9e8c2833-40G-NNI.deb'
    volthaSystemTestsChange: ''
    volthaHelmChartsChange: ''
    extraHelmFlags: ''

    properties:
      - onf-infra-volthadevs-permissions
      - cord-infra-properties:
          build-days-to-keep: '{build-days-to-keep}'
          artifact-num-to-keep: '{artifact-num-to-keep}'

    <<: *voltha-physical-patchset-parameters

    project-type: pipeline
    concurrent: true

    pipeline-scm:
      scm:
        - git:
            url: https://gerrit.lfbroadband.org/ci-management
            branches:
              - origin/{pipeline-branch}
      script-path: jjb/pipeline/{pipeline-script}

    triggers:
      - gerrit:
          server-name: '{gerrit-server-name}'
          dependency-jobs: '{dependency-jobs}'
          silent-start: false
          successful-message: "PASSED hardware test"
          failure-message: "FAILED hardware test"
          unstable-message: "UNSTABLE hardware test"
          trigger-on:
            - comment-added-event:
                approval-category: 'Code-Review'
                approval-value: '+2'
          projects:
            - project-compare-type: REG_EXP
              project-pattern: '^(voltha-openolt-adapter|voltha-openonu-adapter|voltha-openonu-adapter-go|voltha-go)$'
              branches:
                - branch-compare-type: REG_EXP
                  branch-pattern: '{branch-pattern}'

- job-template:
    name: '{name}'
    id: verify_physical_voltha_patchset_manual
    description: |
                  <!-- Managed by Jenkins Job Builder -->
                  Automated build on POD {config-pod} using {pipeline-script} <br /><br />
                  Created from job-template {id} from ci-management/jjb/voltha-e2e.yaml <br />
                  Created by Andy Bavier, andy@opennetworking.org <br />
                  Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
    sandbox: true
    build-node: 'tucson-pod'
    config-pod: 'tucson-pod'
    oltDebVersionMaster: 'openolt_asfvolt16-3.7.4-3b190f027136e845c5850a5b1a97897ce2b74ebf-40G-NNI.deb'
    oltDebVersionVoltha23: 'openolt_asfvolt16-3.4.9-e2a9597f3d690fe3a0ea0df244571dfc9e8c2833-40G-NNI.deb'
    pipeline-script: 'voltha/tucson-build-and-test.groovy'
    pipeline-branch: 'master'
    trigger-string: 'hardware test'
    default-test-args: '-i sanityORDeleteOLT -i PowerSwitch -X'
    volthaSystemTestsChange: ''
    volthaHelmChartsChange: ''
    profile: 'Default'
    extraHelmFlags: ''

    properties:
      - onf-infra-volthadevs-permissions
      - cord-infra-properties:
          build-days-to-keep: '{build-days-to-keep}'
          artifact-num-to-keep: '{artifact-num-to-keep}'

    <<: *voltha-physical-patchset-parameters


    project-type: pipeline
    concurrent: true

    pipeline-scm:
      scm:
        - git:
            url: https://gerrit.lfbroadband.org/ci-management
            branches:
              - origin/{pipeline-branch}
      script-path: jjb/pipeline/{pipeline-script}

    triggers:
      - gerrit:
          server-name: '{gerrit-server-name}'
          dependency-jobs: '{dependency-jobs}'
          silent-start: false
          successful-message: "PASSED {trigger-string}"
          failure-message: "FAILED {trigger-string}"
          unstable-message: "UNSTABLE {trigger-string}"
          trigger-on:
            - comment-added-contains-event:
                comment-contains-value: '^{trigger-string}$'
            - comment-added-contains-event:
                comment-contains-value: '^{trigger-string} with delay$'
          projects:
            - project-compare-type: REG_EXP
              project-pattern: '^(voltha-go|voltha-openolt-adapter|voltha-openonu-adapter|voltha-openonu-adapter-go|voltha-api-server|voltha-system-tests|ofagent-py|ofagent-go|voltha-onos|kind-voltha|voltha-helm-charts)$'
              branches:
                - branch-compare-type: REG_EXP
                  branch-pattern: '{branch-pattern}'

# [EOF]
