Merge "Move arp route tbl to script and update defailt vnf config files"
[yardstick.git] / yardstick / network_services / vnf_generic / vnf / sample_vnf.py
index 114153d..06f2596 100644 (file)
@@ -615,13 +615,7 @@ class SampleVNFDeployHelper(object):
         self.ssh_helper = ssh_helper
         self.vnfd_helper = vnfd_helper
 
-    DISABLE_DEPLOY = True
-
     def deploy_vnfs(self, app_name):
-        # temp disable for now
-        if self.DISABLE_DEPLOY:
-            return
-
         vnf_bin = self.ssh_helper.join_bin_path(app_name)
         exit_status = self.ssh_helper.execute("which %s" % vnf_bin)[0]
         if not exit_status:
@@ -691,6 +685,7 @@ class SampleVNF(GenericVNF):
 
     VNF_PROMPT = "pipeline>"
     WAIT_TIME = 1
+    WAIT_TIME_FOR_SCRIPT = 10
     APP_NAME = "SampleVNF"
     # we run the VNF interactively, so the ssh command will timeout after this long
 
@@ -788,7 +783,9 @@ class SampleVNF(GenericVNF):
         self.nfvi_context = Context.get_context_from_server(self.scenario_helper.nodes[self.name])
         # self.nfvi_context = None
 
-        self.deploy_helper.deploy_vnfs(self.APP_NAME)
+        # vnf deploy is unsupported, use ansible playbooks
+        if self.scenario_helper.options.get("vnf_deploy", False):
+            self.deploy_helper.deploy_vnfs(self.APP_NAME)
         self.resource_helper.setup()
         self._start_vnf()
 
@@ -815,7 +812,7 @@ class SampleVNF(GenericVNF):
                                        self.APP_NAME)
 
             LOG.info("Waiting for %s VNF to start.. ", self.APP_NAME)
-            time.sleep(1)
+            time.sleep(self.WAIT_TIME_FOR_SCRIPT)
             # Send ENTER to display a new prompt in case the prompt text was corrupted
             # by other VNF output
             self.q_in.put('\r\n')