aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_pg_interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/vpp_pg_interface.py')
-rw-r--r--test/vpp_pg_interface.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py
index 381dc1dad21..81a0fba984c 100644
--- a/test/vpp_pg_interface.py
+++ b/test/vpp_pg_interface.py
@@ -58,9 +58,16 @@ class VppPGInterface(VppInterface):
self._out_history_counter += 1
return v
- def post_init_setup(self):
- """ Perform post-init setup for super class and add our own setup """
- super(VppPGInterface, self).post_init_setup()
+ def __init__(self, test, pg_index):
+ """ Create VPP packet-generator interface """
+ r = test.vapi.pg_create_interface(pg_index)
+ self._sw_if_index = r.sw_if_index
+
+ super(VppPGInterface, self).__init__(test)
+
+ self._in_history_counter = 0
+ self._out_history_counter = 0
+ self._pg_index = pg_index
self._out_file = "pg%u_out.pcap" % self.pg_index
self._out_path = self.test.tempdir + "/" + self._out_file
self._in_file = "pg%u_in.pcap" % self.pg_index
@@ -71,16 +78,6 @@ class VppPGInterface(VppInterface):
self._input_cli = "packet-generator new pcap %s source pg%u name %s" % (
self.in_path, self.pg_index, self.cap_name)
- def __init__(self, test, pg_index):
- """ Create VPP packet-generator interface """
- self._in_history_counter = 0
- self._out_history_counter = 0
- self._pg_index = pg_index
- self._test = test
- r = self.test.vapi.pg_create_interface(self.pg_index)
- self._sw_if_index = r.sw_if_index
- self.post_init_setup()
-
def enable_capture(self):
""" Enable capture on this packet-generator interface"""
try: