tests: support worker threads
Add support for specifying the worker thread when adding packet stream. Type: feature Change-Id: I8a98b91c211e60cd53e1166f9f51365394ecacfd Signed-off-by: Klement Sekera <ksekera@cisco.com>
This commit is contained in:
committed by
Ole Trøan
parent
9af7e2e87e
commit
4ecbf105a4
@@ -82,6 +82,8 @@ class VppPGInterface(VppInterface):
|
|||||||
"""CLI string to load the injected packets"""
|
"""CLI string to load the injected packets"""
|
||||||
if self._nb_replays is not None:
|
if self._nb_replays is not None:
|
||||||
return "%s limit %d" % (self._input_cli, self._nb_replays)
|
return "%s limit %d" % (self._input_cli, self._nb_replays)
|
||||||
|
if self._worker is not None:
|
||||||
|
return "%s worker %d" % (self._input_cli, self._worker)
|
||||||
return self._input_cli
|
return self._input_cli
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -158,13 +160,14 @@ class VppPGInterface(VppInterface):
|
|||||||
def disable_capture(self):
|
def disable_capture(self):
|
||||||
self.test.vapi.cli("%s disable" % self.capture_cli)
|
self.test.vapi.cli("%s disable" % self.capture_cli)
|
||||||
|
|
||||||
def add_stream(self, pkts, nb_replays=None):
|
def add_stream(self, pkts, nb_replays=None, worker=None):
|
||||||
"""
|
"""
|
||||||
Add a stream of packets to this packet-generator
|
Add a stream of packets to this packet-generator
|
||||||
|
|
||||||
:param pkts: iterable packets
|
:param pkts: iterable packets
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
self._worker = worker
|
||||||
self._nb_replays = nb_replays
|
self._nb_replays = nb_replays
|
||||||
self._rename_previous_capture_file(self.in_path,
|
self._rename_previous_capture_file(self.in_path,
|
||||||
self.in_history_counter,
|
self.in_history_counter,
|
||||||
|
|||||||
Reference in New Issue
Block a user