Waiting for adapters to register with core before starting scale test

Change-Id: I24d456e22f92153815249bc778c6843de36cde71
diff --git a/jjb/pipeline/voltha-scale-measurements.groovy b/jjb/pipeline/voltha-scale-measurements.groovy
index 87b8656..ab81eed 100644
--- a/jjb/pipeline/voltha-scale-measurements.groovy
+++ b/jjb/pipeline/voltha-scale-measurements.groovy
@@ -84,6 +84,23 @@
           '''
       }
     }
+    stage('wait for adapters to be registered') {
+      steps{
+        waitUntil {
+          script {
+            openolt_res = sh returnStdout: true, script: """
+            voltctl adapter list | grep openolt | wc -l
+            """
+
+            openonu_res = sh returnStdout: true, script: """
+            voltctl adapter list | grep brcm_openomci_onu | wc -l
+            """
+
+            return openolt_res.toInteger() == 1 && openonu_res.toInteger() == 1
+          }
+        }
+      }
+    }
     stage('MIB-template') {
       steps {
         sh '''
@@ -214,4 +231,4 @@
       }
     }
   }
-}
\ No newline at end of file
+}