aboutsummaryrefslogtreecommitdiff
path: root/tests/atf_python/sys/net/vnet.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/atf_python/sys/net/vnet.py')
-rw-r--r--tests/atf_python/sys/net/vnet.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py
index c96eb5d671fc..f75a3eaa693e 100644
--- a/tests/atf_python/sys/net/vnet.py
+++ b/tests/atf_python/sys/net/vnet.py
@@ -283,14 +283,15 @@ class VnetFactory(object):
time.sleep(0.1)
return not_matched
- def create_vnet(self, vnet_alias: str, ifaces: List[VnetInterface]):
+ def create_vnet(self, vnet_alias: str, ifaces: List[VnetInterface], opts: List[str]):
vnet_name = "pytest:{}".format(convert_test_name(self.topology_id))
if self._vnets:
# add number to distinguish jails
vnet_name = "{}_{}".format(vnet_name, len(self._vnets) + 1)
iface_cmds = " ".join(["vnet.interface={}".format(i.name) for i in ifaces])
- cmd = "/usr/sbin/jail -i -c name={} persist vnet {}".format(
- vnet_name, iface_cmds
+ opt_cmds = " ".join(["{}".format(i) for i in opts])
+ cmd = "/usr/sbin/jail -i -c name={} persist vnet {} {}".format(
+ vnet_name, iface_cmds, opt_cmds
)
jid = 0
try:
@@ -421,7 +422,10 @@ class VnetTestTemplate(BaseTest):
idx = len(iface_map[iface_alias].vnet_aliases)
iface_map[iface_alias].vnet_aliases.append(obj_name)
vnet_ifaces.append(iface_map[iface_alias].ifaces[idx])
- vnet = vnet_factory.create_vnet(obj_name, vnet_ifaces)
+ opts = []
+ if "opts" in obj_data:
+ opts = obj_data["opts"]
+ vnet = vnet_factory.create_vnet(obj_name, vnet_ifaces, opts)
vnet_map[obj_name] = vnet
# Allow reference to VNETs as attributes
setattr(self, obj_name, vnet)