Merge "Fixing voltha-patch-test for the kind-voltha repo"
diff --git a/jjb/pipeline/voltha-bbsim-tests.groovy b/jjb/pipeline/voltha-bbsim-tests.groovy
index cbf9e81..3d91c7b 100644
--- a/jjb/pipeline/voltha-bbsim-tests.groovy
+++ b/jjb/pipeline/voltha-bbsim-tests.groovy
@@ -70,7 +70,14 @@
         ])
       }
     }
+    // If the repo under test is not kind-voltha
+    // then download it and checkout the patch
     stage('Download Patch') {
+      when {
+        expression {
+          return "${gerritProject}" != 'kind-voltha';
+        }
+      }
       steps {
         checkout([
           $class: 'GitSCM',
@@ -93,6 +100,21 @@
           """
       }
     }
+    // If the repo under test is kind-voltha we don't need to download it again,
+    // as we already have it, simply checkout the patch
+    stage('Checkout kind-voltha patch') {
+      when {
+        expression {
+          return "${gerritProject}" == 'kind-voltha';
+        }
+      }
+      steps {
+        sh """
+        cd $WORKSPACE/kind-voltha
+        git fetch https://gerrit.opencord.org/kind-voltha ${gerritRefspec} && git checkout FETCH_HEAD
+        """
+      }
+    }
     stage('Create K8s Cluster') {
       steps {
         sh """