From aa9afa0aba767fbf5eb28299723d45f41f9b79df Mon Sep 17 00:00:00 2001
From: Raphael Defosseux <raphael.defosseux@eurecom.fr>
Date: Fri, 27 Sep 2019 16:17:25 +0200
Subject: [PATCH] CI: adding the gNB + NR UE with N300 test in the develop-nr
 CI process!

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
---
 ci-scripts/Jenkinsfile-gitlab       | 21 +++++++++++++++++++-
 ci-scripts/Jenkinsfile-tmp-full-ran | 30 ++++++++++++++++++++++++++---
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab
index 023b8ec1543..2f736c5dbd0 100644
--- a/ci-scripts/Jenkinsfile-gitlab
+++ b/ci-scripts/Jenkinsfile-gitlab
@@ -44,7 +44,7 @@ pipeline {
         disableConcurrentBuilds()
         timestamps()
         gitLabConnection('OAI GitLab')
-        gitlabBuilds(builds: ["Build gNB-USRP", "Build nr-UE-USRP", "Build eNB-USRP", "Build basic-sim", "Build phy-sim", "Build eNB-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13", "Test-Mono-FDD-Band13-X2-HO"])
+        gitlabBuilds(builds: ["Build gNB-USRP", "Build nr-UE-USRP", "Build eNB-USRP", "Build basic-sim", "Build phy-sim", "Build eNB-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13", "Test-Mono-FDD-Band13-X2-HO", "Test-TDD-Band78-gNB-NR-UE"])
         ansiColor('xterm')
     }
 
@@ -615,6 +615,25 @@ pipeline {
                         }
                     }
                 }
+                stage ("Test OAI NR UE - OAI gNB - TDD - Band 78 - N300") {
+                    steps {
+                        script {
+                            triggerSlaveJob ('gNB-nrUE-MONO-TDD-Band78-N300', 'Test-TDD-Band78-gNB-NR-UE')
+                        }
+                    }
+                    post {
+                        always {
+                            script {
+                                finalizeSlaveJob('gNB-nrUE-MONO-TDD-Band78-N300')
+                            }
+                        }
+                        failure {
+                            script {
+                                currentBuild.result = 'FAILURE'
+                            }
+                        }
+                    }
+                }
             }
             post {
                 always {
diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran
index 3e0777b6a72..7211a54bcfc 100644
--- a/ci-scripts/Jenkinsfile-tmp-full-ran
+++ b/ci-scripts/Jenkinsfile-tmp-full-ran
@@ -54,6 +54,10 @@ def eNB_CommitID
 def eNB_AllowMergeRequestProcess = false
 def eNB_TargetBranch
 
+def doEpcLogCollection = true
+
+
+
 pipeline {
     agent {
         label pythonExecutor
@@ -61,7 +65,7 @@ pipeline {
     options {
         disableConcurrentBuilds()
         ansiColor('xterm')
-        lock(extra: [[resource: ciSmartPhoneResource]], resource: ciSmartPhoneResource)
+        lock(extra: [[resource: oaiUEResource]], resource: ciSmartPhoneResource)
     }
 
     stages {
@@ -139,6 +143,11 @@ pipeline {
 
                     if (params.EPC_IPAddress == null) {
                         allParametersPresent = false
+                    } else {
+                        if (params.EPC_IPAddress == "none") {
+                            doEpcLogCollection = false
+                            echo "No EPC collections (ping/iperf/hss/mme/spgw)"
+                        }
                     }
                     if (params.EPC_Type == null) {
                         allParametersPresent = false
@@ -167,8 +176,8 @@ pipeline {
                             sh "git checkout -f ${eNB_CommitID}"
                         }
                     } else {
-                        echo "Some parameters are missing"
-                        sh "./ci-scripts/fail.sh"
+                        currentBuild.result = 'ABORTED'
+                        error('Stopping early because some parameters are missing')
                     }
                 }
             }
@@ -299,6 +308,9 @@ pipeline {
                     }
                 }
                 stage('Log Collection (Ping)') {
+                    when {
+                       expression {doEpcLogCollection}
+                    }
                     steps {
                         withCredentials([
                              [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
@@ -317,6 +329,9 @@ pipeline {
                     }
                 }
                 stage('Log Collection (Iperf)') {
+                    when {
+                       expression {doEpcLogCollection}
+                    }
                     steps {
                         withCredentials([
                              [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
@@ -335,6 +350,9 @@ pipeline {
                     }
                 }
                 stage('Log Collection (SPGW)') {
+                    when {
+                       expression {doEpcLogCollection}
+                    }
                     steps {
                         withCredentials([
                              [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
@@ -353,6 +371,9 @@ pipeline {
                     }
                 }
                 stage('Log Collection (MME)') {
+                    when {
+                       expression {doEpcLogCollection}
+                    }
                     steps {
                         withCredentials([
                              [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
@@ -371,6 +392,9 @@ pipeline {
                     }
                 }
                 stage('Log Collection (HSS)') {
+                    when {
+                       expression {doEpcLogCollection}
+                    }
                     steps {
                         withCredentials([
                              [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
-- 
GitLab