diff options
author | Matej Klotton <mklotton@cisco.com> | 2016-11-23 15:27:17 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-11-24 09:32:57 +0000 |
commit | c5bf07fabe46c175890bb5661a85ed076fbf7f2d (patch) | |
tree | 1397692701d694be941eecb61a69ea2ee5f1b408 /test/vpp_pg_interface.py | |
parent | 1cd8f3c98561771c23d04ac825c745b3b1b28735 (diff) |
Remove postinit from make-test interfaces
Change-Id: I1eb0f735c5d025e6096d5760eb01419a1c58530a
Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'test/vpp_pg_interface.py')
-rw-r--r-- | test/vpp_pg_interface.py | 23 |
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: |