add a global config dictionary
There was no need for each test module to keep a copy for itself. This means we
can also get rid of test_set_init.
diff --git a/tests/pktact.py b/tests/pktact.py
index d22690c..5c1d702 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -7,11 +7,8 @@
namespace as different groups of tests will likely define
similar identifiers.
- The function test_set_init is called with a complete configuration
-dictionary prior to the invocation of any tests from this file.
-
- The switch is actively attempting to contact the controller at the address
-indicated oin oft_config
+The switch is actively attempting to contact the controller at the address
+indicated in config.
"""
@@ -21,6 +18,7 @@
import unittest
+from oftest import config
import oftest.controller as controller
import oftest.cstruct as ofp
import oftest.message as message
@@ -32,12 +30,6 @@
from oftest.testutils import *
-#@var port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-pa_port_map = None
-#@var pa_config Local copy of global configuration data
-pa_config = None
-
WILDCARD_VALUES = [ofp.OFPFW_IN_PORT,
ofp.OFPFW_DL_VLAN | ofp.OFPFW_DL_VLAN_PCP,
ofp.OFPFW_DL_SRC,
@@ -84,21 +76,6 @@
TEST_VID_DEFAULT = 2
-def test_set_init(config):
- """
- Set up function for packet action test classes
-
- @param config The configuration dictionary; see oft
- """
-
- basic.test_set_init(config)
-
- global pa_port_map
- global pa_config
-
- pa_port_map = config["port_map"]
- pa_config = config
-
class DirectPacket(basic.SimpleDataPlane):
"""
Send packet to single egress port
@@ -113,7 +90,7 @@
self.handleFlow()
def handleFlow(self, pkttype='TCP'):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -156,7 +133,7 @@
exp_pkt_arg = None
exp_port = None
- if pa_config["relax"]:
+ if config["relax"]:
exp_pkt_arg = pkt
exp_port = egress_port
@@ -183,7 +160,7 @@
self.handleFlow()
def handleFlow(self, pkttype='TCP'):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 0, "Not enough ports for test")
@@ -254,7 +231,7 @@
return result
def handleFlow(self, pkttype='TCP'):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -319,7 +296,7 @@
exp_pkt_arg = None
exp_port = None
- if pa_config["relax"]:
+ if config["relax"]:
exp_pkt_arg = pkt
exp_port = egress_port
@@ -378,7 +355,7 @@
return result
def handleFlow(self, pkttype='TCP'):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -454,7 +431,7 @@
break
if dataplane.match_exp_pkt(pkt, response.data): # Got match
break
- if not basic_config["relax"]: # Only one attempt to match
+ if not config["relax"]: # Only one attempt to match
break
count += 1
if count > 10: # Too many tries
@@ -516,7 +493,7 @@
Verify the packet is received at the two egress ports
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
@@ -561,7 +538,7 @@
no_ports = set(of_ports).difference(yes_ports)
receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports,
- self, pa_config)
+ self, config)
class DirectMCNonIngress(basic.SimpleDataPlane):
"""
@@ -576,7 +553,7 @@
Does not use the flood action
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
@@ -615,7 +592,7 @@
self.dataplane.send(ingress_port, str(pkt))
yes_ports = set(of_ports).difference([ingress_port])
receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
- self, pa_config)
+ self, config)
class DirectMC(basic.SimpleDataPlane):
@@ -631,7 +608,7 @@
Does not use the flood action
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
@@ -668,7 +645,7 @@
logging.info("Sending packet to dp port " + str(ingress_port))
self.dataplane.send(ingress_port, str(pkt))
- receive_pkt_check(self.dataplane, pkt, of_ports, [], self, pa_config)
+ receive_pkt_check(self.dataplane, pkt, of_ports, [], self, config)
class Flood(basic.SimpleDataPlane):
"""
@@ -681,7 +658,7 @@
Verify the packet is received at all other ports
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -716,7 +693,7 @@
self.dataplane.send(ingress_port, str(pkt))
yes_ports = set(of_ports).difference([ingress_port])
receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
- self, pa_config)
+ self, config)
class FloodPlusIngress(basic.SimpleDataPlane):
"""
@@ -730,7 +707,7 @@
Verify the packet is received at all other ports
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -766,7 +743,7 @@
logging.info("Sending packet to dp port " + str(ingress_port))
self.dataplane.send(ingress_port, str(pkt))
- receive_pkt_check(self.dataplane, pkt, of_ports, [], self, pa_config)
+ receive_pkt_check(self.dataplane, pkt, of_ports, [], self, config)
class All(basic.SimpleDataPlane):
"""
@@ -779,7 +756,7 @@
Verify the packet is received at all other ports
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -814,7 +791,7 @@
self.dataplane.send(ingress_port, str(pkt))
yes_ports = set(of_ports).difference([ingress_port])
receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
- self, pa_config)
+ self, config)
class AllPlusIngress(basic.SimpleDataPlane):
"""
@@ -828,7 +805,7 @@
Verify the packet is received at all other ports
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -864,7 +841,7 @@
logging.info("Sending packet to dp port " + str(ingress_port))
self.dataplane.send(ingress_port, str(pkt))
- receive_pkt_check(self.dataplane, pkt, of_ports, [], self, pa_config)
+ receive_pkt_check(self.dataplane, pkt, of_ports, [], self, config)
class FloodMinusPort(basic.SimpleDataPlane):
"""
@@ -879,7 +856,7 @@
the ingress port and the no_flood port
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
@@ -921,7 +898,7 @@
self.dataplane.send(ingress_port, str(pkt))
no_ports = set([ingress_port, no_flood_port])
yes_ports = set(of_ports).difference(no_ports)
- receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports, self, pa_config)
+ receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports, self, config)
# Turn no flood off again
rv = port_config_set(self.controller, no_flood_port,
@@ -952,7 +929,7 @@
"""
def runTest(self):
- flow_match_test(self, pa_port_map)
+ flow_match_test(self, config["port_map"])
class ExactMatchTagged(BaseMatchCase):
"""
@@ -960,8 +937,8 @@
"""
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
- flow_match_test(self, pa_port_map, dl_vlan=vid)
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
+ flow_match_test(self, config["port_map"], dl_vlan=vid)
class ExactMatchTaggedMany(BaseMatchCase):
"""
@@ -972,10 +949,10 @@
def runTest(self):
for vid in range(2,100,10):
- flow_match_test(self, pa_port_map, dl_vlan=vid, max_test=5)
+ flow_match_test(self, config["port_map"], dl_vlan=vid, max_test=5)
for vid in range(100,4000,389):
- flow_match_test(self, pa_port_map, dl_vlan=vid, max_test=5)
- flow_match_test(self, pa_port_map, dl_vlan=4094, max_test=5)
+ flow_match_test(self, config["port_map"], dl_vlan=vid, max_test=5)
+ flow_match_test(self, config["port_map"], dl_vlan=4094, max_test=5)
class SingleWildcardMatchPriority(BaseMatchCase):
"""
@@ -994,7 +971,7 @@
def runTest(self):
self._Init()
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
# Delete the initial flow table
@@ -1089,7 +1066,7 @@
self._Init()
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
# Install an entry from 0 -> 1 @ prio 1000
@@ -1121,7 +1098,7 @@
self._Init()
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self._ClearTable()
@@ -1156,7 +1133,7 @@
self._Init()
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self._ClearTable()
@@ -1191,7 +1168,7 @@
Verify flow_expiration message is correct when command option is set
"""
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
for wc in WILDCARD_VALUES:
wc |= required_wildcards(self)
if wc & ofp.OFPFW_DL_VLAN:
@@ -1199,7 +1176,7 @@
dl_vlan = vid
else:
dl_vlan = -1
- flow_match_test(self, pa_port_map, wildcards=wc,
+ flow_match_test(self, config["port_map"], wildcards=wc,
dl_vlan=dl_vlan, max_test=10)
class SingleWildcardMatchTagged(BaseMatchCase):
@@ -1207,10 +1184,10 @@
SingleWildcardMatch with tagged packets
"""
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
for wc in WILDCARD_VALUES:
wc |= required_wildcards(self)
- flow_match_test(self, pa_port_map, wildcards=wc, dl_vlan=vid,
+ flow_match_test(self, config["port_map"], wildcards=wc, dl_vlan=vid,
max_test=10)
class AllExceptOneWildcardMatch(BaseMatchCase):
@@ -1225,7 +1202,7 @@
Verify flow_expiration message is correct when command option is set
"""
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
for all_exp_one_wildcard in NO_WILDCARD_VALUES:
all_exp_one_wildcard |= required_wildcards(self)
if all_exp_one_wildcard & ofp.OFPFW_DL_VLAN:
@@ -1233,7 +1210,7 @@
dl_vlan = vid
else:
dl_vlan = -1
- flow_match_test(self, pa_port_map, wildcards=all_exp_one_wildcard,
+ flow_match_test(self, config["port_map"], wildcards=all_exp_one_wildcard,
dl_vlan=dl_vlan)
class AllExceptOneWildcardMatchTagged(BaseMatchCase):
@@ -1241,10 +1218,10 @@
Match one field with tagged packets
"""
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
for all_exp_one_wildcard in NO_WILDCARD_VALUES:
all_exp_one_wildcard |= required_wildcards(self)
- flow_match_test(self, pa_port_map, wildcards=all_exp_one_wildcard,
+ flow_match_test(self, config["port_map"], wildcards=all_exp_one_wildcard,
dl_vlan=vid)
class AllWildcardMatch(BaseMatchCase):
@@ -1259,15 +1236,15 @@
Verify flow_expiration message is correct when command option is set
"""
def runTest(self):
- flow_match_test(self, pa_port_map, wildcards=ofp.OFPFW_ALL)
+ flow_match_test(self, config["port_map"], wildcards=ofp.OFPFW_ALL)
class AllWildcardMatchTagged(BaseMatchCase):
"""
AllWildcardMatch with tagged packets
"""
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
- flow_match_test(self, pa_port_map, wildcards=ofp.OFPFW_ALL,
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
+ flow_match_test(self, config["port_map"], wildcards=ofp.OFPFW_ALL,
dl_vlan=vid)
@@ -1290,7 +1267,7 @@
vid_act = action.action_set_vlan_vid()
vid_act.vlan_vid = new_vid
- flow_match_test(self, pa_port_map, pkt=pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt,
exp_pkt=exp_pkt, action_list=[vid_act])
class PacketOnly(basic.DataPlaneOnly):
@@ -1302,7 +1279,7 @@
def runTest(self):
pkt = simple_tcp_packet()
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
ing_port = of_ports[0]
logging.info("Sending packet to " + str(ing_port))
@@ -1317,9 +1294,9 @@
priority = -1
def runTest(self):
- vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+ vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
pkt = simple_tcp_packet(dl_vlan_enable=True, dl_vlan=vid)
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
ing_port = of_ports[0]
logging.info("Sending packet to " + str(ing_port))
@@ -1347,7 +1324,7 @@
vid_act = action.action_set_vlan_vid()
vid_act.vlan_vid = new_vid
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=[vid_act], ing_port=self.ing_port)
class ModifyVIDToIngress(ModifyVID):
@@ -1372,7 +1349,7 @@
skip_message_emit(self, "ModifyVIDWithTagWildcarded test")
return
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
ing_port = of_ports[0]
egr_ports = of_ports[1]
@@ -1424,7 +1401,7 @@
vid_act = action.action_set_vlan_pcp()
vid_act.vlan_pcp = new_vlan_pcp
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=[vid_act])
class StripVLANTag(BaseMatchCase):
@@ -1445,7 +1422,7 @@
exp_pkt = simple_tcp_packet(pktlen=len)
vid_act = action.action_strip_vlan()
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=[vid_act])
class StripVLANTagWithTagMatchWildcarded(BaseMatchCase):
@@ -1469,7 +1446,7 @@
ofp.OFPFW_DL_VLAN_PCP)
vid_act = action.action_strip_vlan()
- flow_match_test(self, pa_port_map,
+ flow_match_test(self, config["port_map"],
wildcards=wildcards,
pkt=pkt, exp_pkt=exp_pkt,
action_list=[vid_act])
@@ -1483,9 +1460,9 @@
dl_vlan_enable=False
dl_vlan=-1
- if pa_config["test-params"]["vid"]:
+ if config["test-params"]["vid"]:
dl_vlan_enable=True
- dl_vlan = pa_config["test-params"]["vid"]
+ dl_vlan = config["test-params"]["vid"]
# Unpack operator is ** on a dictionary
@@ -1503,7 +1480,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_src'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
class ModifyL2Dst(BaseMatchCase):
@@ -1518,7 +1495,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_dst'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
class ModifyL3Src(BaseMatchCase):
@@ -1533,7 +1510,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_src'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
class ModifyL3Dst(BaseMatchCase):
@@ -1548,7 +1525,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_dst'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
class ModifyL4Src(BaseMatchCase):
@@ -1563,7 +1540,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['tcp_sport'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
class ModifyL4Dst(BaseMatchCase):
@@ -1578,7 +1555,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['tcp_dport'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
class ModifyTOS(BaseMatchCase):
@@ -1593,7 +1570,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_tos'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=-1)
class ModifyL2DstMC(BaseMatchCase):
@@ -1608,7 +1585,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_dst'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=-1)
class ModifyL2DstIngress(BaseMatchCase):
@@ -1623,7 +1600,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_dst'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=0,
ing_port=True)
@@ -1639,7 +1616,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_dst'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=-1,
ing_port=True)
@@ -1655,7 +1632,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_src'],
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=-1)
class ModifyL2SrcDstMC(BaseMatchCase):
@@ -1672,7 +1649,7 @@
mod_fields = ['dl_dst', 'dl_src']
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=mod_fields,
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=-1)
class ModifyL2DstVIDMC(BaseMatchCase):
@@ -1690,7 +1667,7 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self,
start_field_vals={'dl_vlan_enable':True}, mod_fields=mod_fields,
check_test_params=True)
- flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2, egr_count=-1)
class FlowToggle(BaseMatchCase):
@@ -1705,8 +1682,8 @@
(add, modify, delete +/- strict).
"""
def runTest(self):
- flow_count = test_param_get(self.config, 'ft_flow_count', default=20)
- iter_count = test_param_get(self.config, 'ft_iter_count', default=10)
+ flow_count = test_param_get(config, 'ft_flow_count', default=20)
+ iter_count = test_param_get(config, 'ft_iter_count', default=10)
logging.info("Running flow toggle with %d flows, %d iterations" %
(flow_count, iter_count))
@@ -1714,7 +1691,7 @@
acts.append(action.action_output())
acts.append(action.action_output())
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
if len(of_ports) < 3:
self.assertTrue(False, "Too few ports for test")
@@ -1813,7 +1790,7 @@
priority = -1
def runTest(self):
- count = test_param_get(self.config, 'iter_count', default=10)
+ count = test_param_get(config, 'iter_count', default=10)
tests_done = 0
logging.info("Running iteration test " + str(count) + " times")
start = time.time()
@@ -1882,7 +1859,7 @@
TODO test UDP, ARP, ICMP, etc.
"""
def runTest(self):
- of_ports = pa_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
@@ -1930,7 +1907,7 @@
exp_pkt_arg = None
exp_port = None
- if pa_config["relax"]:
+ if config["relax"]:
exp_pkt_arg = pkt
exp_port = egress_port