aboutsummaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/framework.py b/test/framework.py
index b10592cf1e7..8dbc18fda4f 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -1,7 +1,5 @@
#!/usr/bin/env python
-from abc import *
-import os
import subprocess
import unittest
import tempfile
@@ -13,6 +11,7 @@ from threading import Thread
from inspect import getdoc
from hook import StepHook, PollHook
from vpp_pg_interface import VppPGInterface
+from vpp_lo_interface import VppLoInterface
from vpp_papi_provider import VppPapiProvider
from scapy.packet import Raw
from log import *
@@ -330,6 +329,22 @@ class VppTestCase(unittest.TestCase):
cls.pg_interfaces = result
return result
+ @classmethod
+ def create_loopback_interfaces(cls, interfaces):
+ """
+ Create loopback interfaces
+
+ :param interfaces: iterable indexes of the interfaces
+
+ """
+ result = []
+ for i in interfaces:
+ intf = VppLoInterface(cls, i)
+ setattr(cls, intf.name, intf)
+ result.append(intf)
+ cls.lo_interfaces = result
+ return result
+
@staticmethod
def extend_packet(packet, size):
"""