2016-12-22 11:06:56 +01:00
|
|
|
from vpp_object import VppObject
|
2016-11-04 11:11:44 +01:00
|
|
|
from vpp_interface import VppInterface
|
|
|
|
|
|
|
|
|
2016-12-22 11:06:56 +01:00
|
|
|
class VppLoInterface(VppInterface, VppObject):
|
2016-11-11 11:38:55 +01:00
|
|
|
"""VPP loopback interface."""
|
2016-11-04 11:11:44 +01:00
|
|
|
|
2018-06-24 22:49:33 +02:00
|
|
|
def __init__(self, test):
|
2016-11-04 11:11:44 +01:00
|
|
|
""" Create VPP loopback interface """
|
2018-06-22 22:33:41 +02:00
|
|
|
super(VppLoInterface, self).__init__(test)
|
2018-06-24 22:49:33 +02:00
|
|
|
self.add_vpp_config()
|
2016-12-22 11:06:56 +01:00
|
|
|
|
|
|
|
def add_vpp_config(self):
|
|
|
|
r = self.test.vapi.create_loopback()
|
2018-06-24 22:49:33 +02:00
|
|
|
self.set_sw_if_index(r.sw_if_index)
|
2016-12-22 11:06:56 +01:00
|
|
|
|
|
|
|
def remove_vpp_config(self):
|
|
|
|
self.test.vapi.delete_loopback(self.sw_if_index)
|
|
|
|
|
|
|
|
def object_id(self):
|
|
|
|
return "loopback-%d" % self._sw_if_index
|