diff options
author | 2018-04-24 10:35:50 +0100 | |
---|---|---|
committer | 2018-07-05 08:44:05 +0100 | |
commit | 1004f2ac1ea0394afdc2d5a8ca20c8c1a6d2cd93 (patch) | |
tree | f23e01cf001fc80577ae70cd03f1a31befb5bdcd /yardstick/network_services/vnf_generic/vnf/sample_vnf.py | |
parent | 5ca6368e609d9dc8ec19590835d91b36b2d1fa78 (diff) |
Enable traffic generator PID in "NSPerf" scenario setup
Now "NSPerf" scenario will inform about the traffic generator PIDs after
setup process. With this information, IterationIPC runner will be able
to receive the messages sent by those traffic generators and control
the main iteration loop.
The following example, using vFW as VNF and OpenStack as context, makes
use of this new runner implementation:
/samples/vnf_samples/nsut/vfw/
tc_heat_rfc2544_ipv4_1rule_1flow_64B_trex_iterationipc.yaml
JIRA: YARDSTICK-1127
Change-Id: I46b1368bc209680b88ff9fb5c3b9beadf6271ac9
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/network_services/vnf_generic/vnf/sample_vnf.py')
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/sample_vnf.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py index a37f4f72d..bc65380d3 100644 --- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py @@ -918,12 +918,12 @@ class SampleVNFTrafficGen(GenericTrafficGen): LOG.info("%s TG Server is up and running.", self.APP_NAME) return self._tg_process.exitcode - def _traffic_runner(self, traffic_profile, mq_pid): + def _traffic_runner(self, traffic_profile, mq_id): # always drop connections first thing in new processes # so we don't get paramiko errors self.ssh_helper.drop_connection() LOG.info("Starting %s client...", self.APP_NAME) - self._mq_producer = self._setup_mq_producer(mq_pid) + self._mq_producer = self._setup_mq_producer(mq_id) self.resource_helper.run_traffic(traffic_profile, self._mq_producer) def run_traffic(self, traffic_profile): @@ -937,9 +937,9 @@ class SampleVNFTrafficGen(GenericTrafficGen): name = '{}-{}-{}-{}'.format(self.name, self.APP_NAME, traffic_profile.__class__.__name__, os.getpid()) - mq_pid = uuid.uuid1().int - self._traffic_process = Process(name=name, target=self._traffic_runner, - args=(traffic_profile, mq_pid)) + self._traffic_process = Process( + name=name, target=self._traffic_runner, + args=(traffic_profile, uuid.uuid1().int)) self._traffic_process.start() # Wait for traffic process to start while self.resource_helper.client_started.value == 0: @@ -948,8 +948,6 @@ class SampleVNFTrafficGen(GenericTrafficGen): if not self._traffic_process.is_alive(): break - return mq_pid - def collect_kpi(self): # check if the tg processes have exited physical_node = Context.get_physical_node_from_server( |