Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
resource: remove cores args
[yardstick.git]
/
yardstick
/
network_services
/
vnf_generic
/
vnf
/
sample_vnf.py
diff --git
a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py
index
114153d
..
f0c276a
100644
(file)
--- a/
yardstick/network_services/vnf_generic/vnf/sample_vnf.py
+++ b/
yardstick/network_services/vnf_generic/vnf/sample_vnf.py
@@
-108,13
+108,6
@@
class SetupEnvHelper(object):
self.ssh_helper = ssh_helper
self.scenario_helper = scenario_helper
self.ssh_helper = ssh_helper
self.scenario_helper = scenario_helper
- def _get_ports_gateway(self, name):
- routing_table = self.vnfd_helper.vdu0.get('routing_table', [])
- for route in routing_table:
- if name == route['if']:
- return route['gateway']
- return None
-
def build_config(self):
raise NotImplementedError
def build_config(self):
raise NotImplementedError
@@
-330,7
+323,6
@@
class DpdkVnfSetupEnvHelper(SetupEnvHelper):
else:
self.socket = 1
else:
self.socket = 1
- cores = self._validate_cpu_cfg()
# implicit ordering, presumably by DPDK port num, so pre-sort by port_num
# this won't work because we don't have DPDK port numbers yet
ports = sorted(self.vnfd_helper.interfaces, key=self.vnfd_helper.port_num)
# implicit ordering, presumably by DPDK port num, so pre-sort by port_num
# this won't work because we don't have DPDK port numbers yet
ports = sorted(self.vnfd_helper.interfaces, key=self.vnfd_helper.port_num)
@@
-338,7
+330,7
@@
class DpdkVnfSetupEnvHelper(SetupEnvHelper):
collectd_options = self.get_collectd_options()
plugins = collectd_options.get("plugins", {})
# we must set timeout to be the same as the VNF otherwise KPIs will die before VNF
collectd_options = self.get_collectd_options()
plugins = collectd_options.get("plugins", {})
# we must set timeout to be the same as the VNF otherwise KPIs will die before VNF
- return ResourceProfile(self.vnfd_helper.mgmt_interface, port_names=port_names,
cores=cores,
+ return ResourceProfile(self.vnfd_helper.mgmt_interface, port_names=port_names,
plugins=plugins, interval=collectd_options.get("interval"),
timeout=self.scenario_helper.timeout)
plugins=plugins, interval=collectd_options.get("interval"),
timeout=self.scenario_helper.timeout)
@@
-615,13
+607,7
@@
class SampleVNFDeployHelper(object):
self.ssh_helper = ssh_helper
self.vnfd_helper = vnfd_helper
self.ssh_helper = ssh_helper
self.vnfd_helper = vnfd_helper
- DISABLE_DEPLOY = True
-
def deploy_vnfs(self, app_name):
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:
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
+677,7
@@
class SampleVNF(GenericVNF):
VNF_PROMPT = "pipeline>"
WAIT_TIME = 1
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
APP_NAME = "SampleVNF"
# we run the VNF interactively, so the ssh command will timeout after this long
@@
-788,7
+775,9
@@
class SampleVNF(GenericVNF):
self.nfvi_context = Context.get_context_from_server(self.scenario_helper.nodes[self.name])
# self.nfvi_context = None
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()
self.resource_helper.setup()
self._start_vnf()
@@
-815,7
+804,7
@@
class SampleVNF(GenericVNF):
self.APP_NAME)
LOG.info("Waiting for %s VNF to start.. ", self.APP_NAME)
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')
# Send ENTER to display a new prompt in case the prompt text was corrupted
# by other VNF output
self.q_in.put('\r\n')
@@
-934,8
+923,9
@@
class SampleVNFTrafficGen(GenericTrafficGen):
def instantiate(self, scenario_cfg, context_cfg):
self.scenario_helper.scenario_cfg = scenario_cfg
def instantiate(self, scenario_cfg, context_cfg):
self.scenario_helper.scenario_cfg = scenario_cfg
- self.resource_helper.generate_cfg()
self.resource_helper.setup()
self.resource_helper.setup()
+ # must generate_cfg after DPDK bind because we need port number
+ self.resource_helper.generate_cfg()
LOG.info("Starting %s server...", self.APP_NAME)
name = "{}-{}-{}".format(self.name, self.APP_NAME, os.getpid())
LOG.info("Starting %s server...", self.APP_NAME)
name = "{}-{}-{}".format(self.name, self.APP_NAME, os.getpid())