vpp/test/vpp_tunnel_interface.py
Paul Vinciguerra 3bce8ebfdf VPP-1508 Python3 abstract classes
Update the syntax to support abstract classes in python 2 and python 3.

Depends on: new style classes -- https://gerrit.fd.io/r/16166

Change-Id: Iad2c1240149f38b3faca1b37ab95d3d210e1daee
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-02-26 11:31:42 +00:00

33 lines
927 B
Python

import abc
import six
from vpp_pg_interface import is_ipv6_misc
from vpp_interface import VppInterface
@six.add_metaclass(abc.ABCMeta)
class VppTunnelInterface(VppInterface):
""" VPP tunnel interface abstraction """
def __init__(self, test, parent_if):
super(VppTunnelInterface, self).__init__(test)
self.parent_if = parent_if
@property
def local_mac(self):
return self.parent_if.local_mac
@property
def remote_mac(self):
return self.parent_if.remote_mac
def enable_capture(self):
return self.parent_if.enable_capture()
def add_stream(self, pkts):
return self.parent_if.add_stream(pkts)
def get_capture(self, expected_count=None, remark=None, timeout=1,
filter_out_fn=is_ipv6_misc):
return self.parent_if.get_capture(expected_count, remark, timeout,
filter_out_fn)