Merge "Use latest openolt deb package for multiple tcont type support"
diff --git a/jjb/pipeline/voltha/master/openonu-go-periodic-test-bbsim.groovy b/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
similarity index 75%
rename from jjb/pipeline/voltha/master/openonu-go-periodic-test-bbsim.groovy
rename to jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
index 0001fac..57a6e0e 100644
--- a/jjb/pipeline/voltha/master/openonu-go-periodic-test-bbsim.groovy
+++ b/jjb/pipeline/voltha/master/periodic-bbsim-tests.groovy
@@ -23,7 +23,7 @@
def clusterName = "kind-ci"
-def execute_test(testName, workflow, testTarget, outputDir, testSpecificHelmFlags = "") {
+def execute_test(testTarget, workflow, testSpecificHelmFlags = "") {
def infraNamespace = "default"
def volthaNamespace = "voltha"
def robotLogsDir = "RobotLogs"
@@ -51,7 +51,7 @@
}
// NOTE temporary workaround expose ONOS node ports
- def localHelmFlags = extraHelmFlags + " --set onos-classic.onosSshPort=30115 " +
+ def localHelmFlags = extraHelmFlags + " --set global.log_level=DEBUG --set onos-classic.onosSshPort=30115 " +
" --set onos-classic.onosApiPort=30120 " +
" --set onos-classic.onosOfPort=31653 " +
" --set onos-classic.individualOpenFlowNodePorts=true " + testSpecificHelmFlags
@@ -67,8 +67,8 @@
}
// start logging
sh """
- mkdir -p ${outputDir}
- _TAG=kail-${workflow} kail -n infra -n voltha > ${outputDir}/onos-voltha-combined.log &
+ mkdir -p $WORKSPACE/${testTarget}
+ _TAG=kail-${workflow} kail -n infra -n voltha > $WORKSPACE/${testTarget}/onos-voltha-combined.log &
"""
sh """
JENKINS_NODE_COOKIE="dontKillMe" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"&
@@ -76,13 +76,13 @@
JENKINS_NODE_COOKIE="dontKillMe" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"&
ps aux | grep port-forward
"""
- getPodsInfo("${outputDir}")
+ getPodsInfo("$WORKSPACE/${testTarget}")
}
}
stage('Run test ' + testTarget + ' on ' + workflow + ' workFlow') {
sh """
- mkdir -p $WORKSPACE/${robotLogsDir}/${testName}
- export ROBOT_MISC_ARGS="-d $WORKSPACE/${robotLogsDir}/${testName} "
+ mkdir -p $WORKSPACE/${robotLogsDir}/${testTarget}
+ export ROBOT_MISC_ARGS="-d $WORKSPACE/${robotLogsDir}/${testTarget} "
ROBOT_MISC_ARGS+="-v ONOS_SSH_PORT:30115 -v ONOS_REST_PORT:30120"
export KVSTOREPREFIX=voltha/voltha_voltha
@@ -164,57 +164,21 @@
}
}
}
+ stage('Parse and execute tests') {
+ steps {
+ script {
+ def tests = readYaml text: testTargets
- stage('Run E2E Tests 1t1gem') {
- steps {
- execute_test("1t1gem", "att", makeTarget, "$WORKSPACE/1t1gem")
- }
- }
-
- stage('Run E2E Tests 1t4gem') {
- steps {
- execute_test("1t4gem", "att", make1t4gemTestTarget, "$WORKSPACE/1t4gem")
- }
- }
-
- stage('Run E2E Tests 1t8gem') {
- steps {
- execute_test("1t8gem", "att", make1t8gemTestTarget, "$WORKSPACE/1t8gem")
- }
- }
-
- stage('Run MIB Upload Tests') {
- when { beforeAgent true; expression { return "${olts}" == "1" } }
- steps {
- script {
- def mibUploadHelmFlags = "--set pon=2,onu=2,controlledActivation=only-onu "
- execute_test("mibupload", "att", "mib-upload-templating-openonu-go-adapter-test", "$WORKSPACE/mibupload", mibUploadHelmFlags)
+ for(int i = 0;i<tests.size();i++) {
+ def test = tests[i]
+ def target = test["target"]
+ def workflow = test["workflow"]
+ def flags = test["flags"]
+ println "Executing test ${target} on workflow ${workflow} with extra flags ${flags}"
+ execute_test(target, workflow, flags)
+ }
+ }
}
- }
- }
-
- stage('Reconcile DT workflow') {
- steps {
- script {
- execute_test("ReconcileDT", "dt", makeReconcileDtTestTarget, "$WORKSPACE/ReconcileDT")
- }
- }
- }
-
- stage('Reconcile ATT workflow') {
- steps {
- script {
- execute_test("ReconcileATT", "att", makeReconcileTestTarget, "$WORKSPACE/ReconcileATT")
- }
- }
- }
-
- stage('Reconcile TT workflow') {
- steps {
- script {
- execute_test("ReconcileTT", "tt", makeReconcileTtTestTarget, "$WORKSPACE/ReconcileTT")
- }
- }
}
}
post {
diff --git a/jjb/verify/up4.yaml b/jjb/verify/up4.yaml
index dbb83bd..087b66b 100644
--- a/jjb/verify/up4.yaml
+++ b/jjb/verify/up4.yaml
@@ -73,6 +73,10 @@
- lf-infra-wrappers:
build-timeout: "{build-timeout}"
jenkins-ssh-credential: "{jenkins-ssh-credential}"
+ - credentials-binding:
+ - text:
+ credential-id: codecov-up4
+ variable: CODECOV_TOKEN
- job-template:
id: "up4-postmerge"
@@ -124,3 +128,7 @@
- lf-infra-wrappers:
build-timeout: "{build-timeout}"
jenkins-ssh-credential: "{jenkins-ssh-credential}"
+ - credentials-binding:
+ - text:
+ credential-id: codecov-up4
+ variable: CODECOV_TOKEN
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 325b006..f9625e8 100755
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -73,6 +73,28 @@
name: 'periodic-voltha-openonu-go-test-bbsim'
code-branch: 'master'
time-trigger: "H H/12 * * *"
+ testTargets: |
+ - target: openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: 1t4gem-openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: 1t8gem-openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: mib-upload-templating-openonu-go-adapter-test
+ workflow: att
+ flags: "--set pon=2,onu=2,controlledActivation=only-onu"
+ - target: reconcile-openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: reconcile-openonu-go-adapter-test-dt
+ workflow: dt
+ flags: ""
+ - target: reconcile-openonu-go-adapter-test-tt
+ workflow: tt
+ flags: ""
- 'voltha-periodic-test':
name: 'patchset-voltha-openonu-go-test-bbsim'
@@ -80,6 +102,28 @@
code-branch: '$GERRIT_BRANCH'
gerrit-project: '$GERRIT_PROJECT'
gerritRefspec: '$GERRIT_REFSPEC'
+ testTargets: |
+ - target: openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: 1t4gem-openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: 1t8gem-openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: mib-upload-templating-openonu-go-adapter-test
+ workflow: att
+ flags: "--set pon=2,onu=2,controlledActivation=only-onu"
+ - target: reconcile-openonu-go-adapter-test
+ workflow: att
+ flags: ""
+ - target: reconcile-openonu-go-adapter-test-dt
+ workflow: dt
+ flags: ""
+ - target: reconcile-openonu-go-adapter-test-tt
+ workflow: tt
+ flags: ""
- 'voltha-periodic-test-kind-voltha-based':
name: 'periodic-voltha-openonu-go-test-bbsim-2.7'
@@ -101,12 +145,25 @@
olts: 2
onus: 2
pons: 2
- make-target: openonu-go-adapter-multi-olt-test
- make-target-1t4gemtest: 1t4gem-openonu-go-adapter-multi-olt-test
- make-target-1t8gemtest: 1t8gem-openonu-go-adapter-multi-olt-test
- make-target-reconciletest: reconcile-openonu-go-adapter-multi-olt-test
- make-target-reconciledttest: reconcile-openonu-go-adapter-multi-olt-test-dt
- make-target-reconciletttest: reconcile-openonu-go-adapter-multi-olt-test-tt
+ testTargets: |
+ - target: openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: 1t4gem-openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: 1t8gem-openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: reconcile-openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: reconcile-openonu-go-adapter-multi-olt-test-dt
+ workflow: dt
+ flags: ""
+ - target: reconcile-openonu-go-adapter-multi-olt-test-tt
+ workflow: tt
+ flags: ""
time-trigger: "H H/12 * * *"
- 'voltha-periodic-test':
@@ -115,12 +172,25 @@
code-branch: '$GERRIT_BRANCH'
gerrit-project: '$GERRIT_PROJECT'
gerritRefspec: '$GERRIT_REFSPEC'
- make-target: openonu-go-adapter-multi-olt-test
- make-target-1t4gemtest: 1t4gem-openonu-go-adapter-multi-olt-test
- make-target-1t8gemtest: 1t8gem-openonu-go-adapter-multi-olt-test
- make-target-reconciletest: reconcile-openonu-go-adapter-multi-olt-test
- make-target-reconciledttest: reconcile-openonu-go-adapter-multi-olt-test-dt
- make-target-reconciletttest: reconcile-openonu-go-adapter-multi-olt-test-tt
+ testTargets: |
+ - target: openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: 1t4gem-openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: 1t8gem-openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: reconcile-openonu-go-adapter-multi-olt-test
+ workflow: att
+ flags: ""
+ - target: reconcile-openonu-go-adapter-multi-olt-test-dt
+ workflow: dt
+ flags: ""
+ - target: reconcile-openonu-go-adapter-multi-olt-test-tt
+ workflow: tt
+ flags: ""
olts: 2
onus: 2
pons: 2
@@ -296,12 +366,9 @@
default-test-args: '-i sanityORDeleteOLT -i PowerSwitch -X'
- job-template:
- # as of now this template is only used by the openonu-go periodic test,
- # in order to use for multiple pipelines we should change it so that
- # we can specify a list of make targets and iterate over that
id: 'voltha-periodic-test'
name: '{name}'
- pipeline-script: 'voltha/master/openonu-go-periodic-test-bbsim.groovy'
+ pipeline-script: 'voltha/master/periodic-bbsim-tests.groovy'
build-node: 'ubuntu18.04-basebuild-8c-15g'
test-runs: 1
robot-args: ''
@@ -313,12 +380,7 @@
extraHelmFlags: ''
sandbox: true
olts: 1
- make-target: openonu-go-adapter-test
- make-target-1t4gemtest: 1t4gem-openonu-go-adapter-test
- make-target-1t8gemtest: 1t8gem-openonu-go-adapter-test
- make-target-reconciletest: reconcile-openonu-go-adapter-test
- make-target-reconciledttest: reconcile-openonu-go-adapter-test-dt
- make-target-reconciletttest: reconcile-openonu-go-adapter-test-tt
+
trigger-comment: vv7CBoQQYYonvaN8xcru
time-trigger: 0 0 29 2 *
@@ -346,59 +408,20 @@
- string:
name: extraHelmFlags
default: '--set onu={onus},pon={pons},{extraHelmFlags}'
- description: 'Helm flags to pass to ./voltha up'
+ description: 'Helm flags (passed to each deployment)'
- # TODO is there a better way to manage the test targets?
- # maybe we can use a comma separated list?
- - string:
- name: makeTarget
- default: '{make-target}'
- description: 'Makefile target to invoke during test'
-
- - string:
- name: makeFailtestTarget
- default: '{make-target-failtest}'
- description: 'Makefile target to invoke during failure/based test'
-
- - string:
- name: makeMultiOltTarget
- default: '{make-target-multipleolt}'
- description: 'Makefile target to invoke during multiple olt test'
-
- - string:
- name: makeErrortestTarget
- default: '{make-target-errortest}'
- description: 'Makefile target to invoke during error test'
-
- - string:
- name: makeAlarmtestTarget
- default: '{make-target-alarmtest}'
- description: 'Makefile target to invoke during alarm test'
-
- - string:
- name: make1t4gemTestTarget
- default: '{make-target-1t4gemtest}'
- description: 'Makefile target to invoke during 1t4gem test'
-
- - string:
- name: make1t8gemTestTarget
- default: '{make-target-1t8gemtest}'
- description: 'Makefile target to invoke during 1t8gem test'
-
- - string:
- name: makeReconcileTestTarget
- default: '{make-target-reconciletest}'
- description: 'Makefile target to invoke during reconcile test'
-
- - string:
- name: makeReconcileDtTestTarget
- default: '{make-target-reconciledttest}'
- description: 'Makefile target to invoke during reconcile dt test'
-
- - string:
- name: makeReconcileTtTestTarget
- default: '{make-target-reconciletttest}'
- description: 'Makefile target to invoke during reconcile tt test'
+ # 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: openonu-go-adapter-test
+ # workflow: att
+ # flags: ""
+ - text:
+ name: testTargets
+ default: '{testTargets}'
+ description: 'Test configuration, see the ci-management job definition for more info'
- string:
name: branch
diff --git a/vars/volthaStackDeploy.groovy b/vars/volthaStackDeploy.groovy
index b39c84f..b7e43fc 100644
--- a/vars/volthaStackDeploy.groovy
+++ b/vars/volthaStackDeploy.groovy
@@ -41,13 +41,32 @@
"""
for(int i = 0;i<cfg.bbsimReplica;i++) {
- // TODO differentiate olt_id between different stacks
- sh """
- helm upgrade --install --create-namespace -n ${cfg.volthaNamespace} bbsim${i} onf/bbsim \
- --set olt_id="${cfg.stackId}${i}" \
- -f $WORKSPACE/voltha-helm-charts/examples/${cfg.workflow}-values.yaml \
- ${cfg.extraHelmFlags}
- """
+ // NOTE we don't need to update the tag for DT
+ script {
+ sh """
+ rm -f $WORKSPACE/bbsimCfg${cfg.stackId}${i}.yaml
+ """
+ if (cfg.workflow == "att" || cfg.workflow == "tt") {
+ def startingStag = 900
+ def bbsimCfg = readYaml file: "$WORKSPACE/voltha-helm-charts/examples/${cfg.workflow}-values.yaml"
+ // NOTE we assume that the only service that needs a different s_tag is the first one in the list
+ bbsimCfg["servicesConfig"]["services"][0]["s_tag"] = startingStag + i
+ println "Using BBSim Service config ${bbsimCfg}"
+ writeYaml file: "$WORKSPACE/bbsimCfg${cfg.stackId}${i}.yaml", data: bbsimCfg
+ } else {
+ // NOTE if it's DT just copy the file over
+ sh """
+ cp $WORKSPACE/voltha-helm-charts/examples/${cfg.workflow}-values.yaml $WORKSPACE/bbsimCfg${cfg.stackId}${i}.yaml
+ """
+ }
+ }
+
+ sh """
+ helm upgrade --install --create-namespace -n ${cfg.volthaNamespace} bbsim${i} onf/bbsim \
+ --set olt_id="${cfg.stackId}${i}" \
+ -f $WORKSPACE/bbsimCfg${cfg.stackId}${i}.yaml \
+ ${cfg.extraHelmFlags}
+ """
}
println "Wait for VOLTHA Stack ${cfg.stackName} to start"