diff --git a/tests/bsn_ipmask.py b/tests/bsn_ipmask.py
index cc2e893..4d325f6 100644
--- a/tests/bsn_ipmask.py
+++ b/tests/bsn_ipmask.py
@@ -92,6 +92,10 @@
         return x[5]
 
     def runTest(self):
+        self.assertFalse(required_wildcards(self) & ofp.OFPFW_NW_DST_ALL,
+                         "IP dst must be wildcarded")
+        self.assertFalse(required_wildcards(self) & ofp.OFPFW_NW_SRC_ALL,
+                         "IP src must be wildcarded")
         for index in range(0, 64):
             mask = self.bsn_get_ip_mask(index)
             im_logger.info("Index %d mask is %s" %
diff --git a/tests/caps.py b/tests/caps.py
index 4657baa..7c187cc 100644
--- a/tests/caps.py
+++ b/tests/caps.py
@@ -63,7 +63,7 @@
     obj.assertEqual(rv, 0, "Failed to delete all flows")
 
     pkt = simple_tcp_packet()
-    match = parse.packet_to_flow_match(pkt)
+    match = packet_to_flow_match(self, pkt)
     obj.assertTrue(match is not None, "Could not generate flow match from pkt")
     for port in of_ports:
         break;
diff --git a/tests/flow_expire.py b/tests/flow_expire.py
index 1d05b6b..ab5b68a 100644
--- a/tests/flow_expire.py
+++ b/tests/flow_expire.py
@@ -68,7 +68,7 @@
         self.assertEqual(rc, 0, "Failed to delete all flows")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
diff --git a/tests/flow_query.py b/tests/flow_query.py
index 7c04928..6044758 100644
--- a/tests/flow_query.py
+++ b/tests/flow_query.py
@@ -723,8 +723,8 @@
         return self
 
     # Randomize flow cfg
-    def rand(self, fi, valid_wildcards, valid_actions, valid_ports, valid_queues):
-        wildcards_force = test_param_get(fq_config, "wildcards_force", 0)
+    def rand(self, fi, wildcards_force, valid_wildcards, valid_actions, valid_ports,
+             valid_queues):
         if wildcards_force != 0:
             fq_logger.info("Wildcards forced:")
             fq_logger.info(wildcards_to_str(wildcards_force))
@@ -1186,7 +1186,7 @@
     def count(self):
         return len(self.dict)
 
-    def rand(self, sw, fi, num_flows):
+    def rand(self, wildcards_force, sw, fi, num_flows):
         self.clear()
         i = 0
         tbl = 0
@@ -1194,6 +1194,7 @@
         while i < num_flows:
             fc = Flow_Cfg()
             fc.rand(fi, \
+                    wildcards_force, \
                     sw.tbl_stats.stats[tbl].wildcards, \
                     sw.sw_features.actions, \
                     sw.valid_ports, \
@@ -1211,27 +1212,6 @@
                 j = 0
 
 
-error_msgs   = []
-removed_msgs = []
-
-def error_handler(self, msg, rawmsg):
-    fq_logger.info("Got an ERROR message, type=%d, code=%d" \
-                    % (msg.type, msg.code) \
-                    )
-    fq_logger.info("Message header:")
-    fq_logger.info(msg.header.show())
-    global error_msgs
-    error_msgs.append(msg)
-    pass
-
-def removed_handler(self, msg, rawmsg):
-    fq_logger.info("Got a REMOVED message")
-    fq_logger.info("Message header:")
-    fq_logger.info(msg.header.show())
-    global removed_msgs
-    removed_msgs.append(msg)
-    pass
-
 class Switch:
     # Members:
     # controller   - switch's test controller
@@ -1251,14 +1231,30 @@
         self.tbl_stats    = None
         self.flow_stats   = None
         self.flow_tbl     = Flow_Tbl()
+        self.error_msgs   = []
+        self.removed_msgs = []
+
+    def error_handler(self, controller, msg, rawmsg):
+        fq_logger.info("Got an ERROR message, type=%d, code=%d" \
+                          % (msg.type, msg.code) \
+                          )
+        fq_logger.info("Message header:")
+        fq_logger.info(msg.header.show())
+        self.error_msgs.append(msg)
+
+    def removed_handler(self, controller, msg, rawmsg):
+        fq_logger.info("Got a REMOVED message")
+        fq_logger.info("Message header:")
+        fq_logger.info(msg.header.show())
+        self.removed_msgs.append(msg)
 
     def controller_set(self, controller):
         self.controller = controller
         # Register error message handler
-        global error_msgs
-        error_msgs = []
-        controller.register(ofp.OFPT_ERROR, error_handler)
-        controller.register(ofp.OFPT_FLOW_REMOVED, removed_handler)
+        self.error_msgs = []
+        self.removed_msgs = []
+        controller.register(ofp.OFPT_ERROR, self.error_handler)
+        controller.register(ofp.OFPT_FLOW_REMOVED, self.removed_handler)
 
     def features_get(self):
         # Get switch features
@@ -1437,9 +1433,8 @@
 
     def errors_verify(self, num_exp, type = 0, code = 0):
         result = True
-        global error_msgs
         fq_logger.info("Expecting %d error messages" % (num_exp))
-        num_got = len(error_msgs)
+        num_got = len(self.error_msgs)
         fq_logger.info("Got %d error messages" % (num_got))
         if num_got != num_exp:
             fq_logger.error("Incorrect number of error messages received")
@@ -1451,7 +1446,7 @@
                             % (type, code) \
                             )
             f = False
-            for e in error_msgs:
+            for e in self.error_msgs:
                 if e.type == type and e.code == code:
                     fq_logger.info("Got it")
                     f = True
@@ -1465,9 +1460,8 @@
 
     def removed_verify(self, num_exp):
         result = True
-        global removed_msgs
         fq_logger.info("Expecting %d removed messages" % (num_exp))
-        num_got = len(removed_msgs)
+        num_got = len(self.removed_msgs)
         fq_logger.info("Got %d removed messages" % (num_got))
         if num_got != num_exp:
             fq_logger.error("Incorrect number of removed messages received")
@@ -1642,7 +1636,7 @@
         # Create a flow table
 
         ft = Flow_Tbl()
-        ft.rand(sw, fi, num_flows)
+        ft.rand(required_wildcards(self), sw, fi, num_flows)
 
         # Send flow table to switch
 
@@ -1735,6 +1729,7 @@
         while True:
             fc = Flow_Cfg()
             fc.rand(fi, \
+                    required_wildcards(self), \
                     sw.tbl_stats.stats[0].wildcards, \
                     sw.sw_features.actions, \
                     sw.valid_ports, \
@@ -1852,7 +1847,7 @@
         # Create a flow table, to switch's capacity
 
         ft = Flow_Tbl()
-        ft.rand(sw, fi, num_flows)
+        ft.rand(required_wildcards(self), sw, fi, num_flows)
 
         # Send flow table to switch
 
@@ -1879,6 +1874,7 @@
         while True:
             fc = Flow_Cfg()
             fc.rand(fi, \
+                    required_wildcards(self), \
                     sw.tbl_stats.stats[0].wildcards, \
                     sw.sw_features.actions, \
                     sw.valid_ports, \
@@ -1973,6 +1969,7 @@
 
         fc = Flow_Cfg()
         fc.rand(fi, \
+                required_wildcards(self), \
                 sw.tbl_stats.stats[0].wildcards, \
                 sw.sw_features.actions, \
                 sw.valid_ports, \
@@ -2093,6 +2090,7 @@
         fc = Flow_Cfg()
         while True:
             fc.rand(fi, \
+                    required_wildcards(self), \
                     sw.tbl_stats.stats[0].wildcards, \
                     sw.sw_features.actions, \
                     sw.valid_ports, \
@@ -2216,6 +2214,7 @@
 
         fc = Flow_Cfg()
         fc.rand(fi, \
+                required_wildcards(self), \
                 sw.tbl_stats.stats[0].wildcards, \
                 sw.sw_features.actions, \
                 sw.valid_ports, \
@@ -2340,7 +2339,7 @@
         # Dream up some flows
 
         ft = Flow_Tbl()
-        ft.rand(sw, fi, num_flows)
+        ft.rand(required_wildcards(self), sw, fi, num_flows)
 
         # Send flow table to switch
 
@@ -2487,6 +2486,7 @@
 
         fc = Flow_Cfg()
         fc.rand(fi, \
+                required_wildcards(self), \
                 sw.tbl_stats.stats[0].wildcards, \
                 sw.sw_features.actions, \
                 sw.valid_ports, \
@@ -2577,6 +2577,7 @@
 
         fc = Flow_Cfg()
         fc.rand(fi, \
+                required_wildcards(self), \
                 sw.tbl_stats.stats[0].wildcards, \
                 sw.sw_features.actions, \
                 sw.valid_ports, \
@@ -2688,6 +2689,7 @@
 
         fc = Flow_Cfg()
         fc.rand(fi, \
+                required_wildcards(self), \
                 sw.tbl_stats.stats[0].wildcards, \
                 sw.sw_features.actions, \
                 sw.valid_ports, \
@@ -2809,7 +2811,7 @@
         # Dream up some flows
 
         ft = Flow_Tbl()
-        ft.rand(sw, fi, num_flows)
+        ft.rand(required_wildcards(self), sw, fi, num_flows)
 
         # Send flow table to switch
 
@@ -2962,6 +2964,7 @@
 
         fc = Flow_Cfg()
         fc.rand(fi, \
+                required_wildcards(self), \
                 sw.tbl_stats.stats[0].wildcards, \
                 sw.sw_features.actions, \
                 sw.valid_ports, \
diff --git a/tests/flow_stats.py b/tests/flow_stats.py
index 4e115aa..9c7170e 100644
--- a/tests/flow_stats.py
+++ b/tests/flow_stats.py
@@ -145,7 +145,7 @@
 
         # build packet
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -185,7 +185,7 @@
         self.verifyStats(match, ofp.OFPP_NONE, test_timeout, num_sends)
         self.verifyStats(match, egress_port, test_timeout, num_sends)
         for wc in WILDCARD_VALUES:
-            match.wildcards = wc
+            match.wildcards = required_wildcards(self) | wc
             self.verifyStats(match, egress_port, test_timeout, num_sends)
 
 
@@ -203,7 +203,7 @@
     """
 
     def buildFlowModMsg(self, pkt, ingress_port, egress_port):
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -308,10 +308,10 @@
         for i in range(0,num_pkt2s):
             sendPacket(self, pkt2, ingress_port, egress_port2, test_timeout)
             
-        match1 = parse.packet_to_flow_match(pkt1)
+        match1 = packet_to_flow_match(self, pkt1)
         fs_logger.info("Verifying flow1's " + str(num_pkt1s) + " packets")
         self.verifyStats(match1, ofp.OFPP_NONE, test_timeout, num_pkt1s)
-        match2 = parse.packet_to_flow_match(pkt2)
+        match2 = packet_to_flow_match(self, pkt2)
         fs_logger.info("Verifying flow2's " + str(num_pkt2s) + " packets")
         self.verifyStats(match2, ofp.OFPP_NONE, test_timeout, num_pkt2s)
         match1.wildcards |= ofp.OFPFW_DL_SRC
@@ -333,7 +333,7 @@
     """
 
     def buildFlowModMsg(self, pkt, ingress_port, egress_port):
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -425,7 +425,7 @@
             sendPacket(self, pkt2, ingress_port, egress_port2, test_timeout)
             
         # loop on flow stats request until timeout
-        match = parse.packet_to_flow_match(pkt1)
+        match = packet_to_flow_match(self, pkt1)
         match.wildcards |= ofp.OFPFW_DL_SRC
         self.verifyAggFlowStats(match, ofp.OFPP_NONE, test_timeout, 
                                 2, num_pkt1s+num_pkt2s)
diff --git a/tests/load.py b/tests/load.py
index d168a17..7b18252 100644
--- a/tests/load.py
+++ b/tests/load.py
@@ -87,7 +87,7 @@
         self.controller.pkt_in_filter_limit = 10
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         match.in_port = lb_port
         act = action.action_output()
diff --git a/tests/pktact.py b/tests/pktact.py
index 14e540c..b53f13b 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -133,7 +133,7 @@
             pkt = simple_icmp_packet()
         else:
             pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -203,7 +203,7 @@
             pkt = simple_icmp_packet()
         else:
             pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None,
                         "Could not generate flow match from pkt")
@@ -274,7 +274,7 @@
             pkt = simple_icmp_packet()
         else:
             pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -398,7 +398,7 @@
             pkt = simple_icmp_packet()
         else:
             pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -533,7 +533,7 @@
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -593,7 +593,7 @@
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -648,7 +648,7 @@
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -699,7 +699,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -748,7 +748,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -798,7 +798,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -847,7 +847,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -899,7 +899,7 @@
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -1068,8 +1068,9 @@
 
 
 
-    def installFlow(self, prio, inp, egp, 
+    def installFlow(self, prio, inp, egp,
                     wildcards=ofp.OFPFW_DL_SRC):
+        wildcards |= required_wildcards(self)
         request = flow_msg_create(self, self.pkt, ing_port=inp, 
                                   wildcards=wildcards,
                                   egr_ports=egp)
@@ -1214,6 +1215,7 @@
     def runTest(self):
         vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
         for wc in WILDCARD_VALUES:
+            wc |= required_wildcards(self)
             if wc & ofp.OFPFW_DL_VLAN:
                 # Set nonzero VLAN id to avoid sending priority-tagged packet
                 dl_vlan = vid
@@ -1229,6 +1231,7 @@
     def runTest(self):
         vid = test_param_get(self.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,
                             max_test=10)
 
@@ -1246,6 +1249,7 @@
     def runTest(self):
         vid = test_param_get(self.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:
                 # Set nonzero VLAN id to avoid sending priority-tagged packet
                 dl_vlan = vid
@@ -1261,6 +1265,7 @@
     def runTest(self):
         vid = test_param_get(self.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,
                             dl_vlan=vid)
 
@@ -1388,7 +1393,8 @@
                                        dl_vlan_enable=True, dl_vlan=old_vid)
         exp_pkt = simple_tcp_packet(pktlen=len_w_vid, dl_vlan_enable=True,
                                     dl_vlan=new_vid)
-        wildcards=ofp.OFPFW_DL_VLAN|ofp.OFPFW_DL_VLAN_PCP
+        wildcards = (required_wildcards(self) | ofp.OFPFW_DL_VLAN |
+                     ofp.OFPFW_DL_VLAN_PCP)
         vid_act = action.action_set_vlan_vid()
         vid_act.vlan_vid = new_vid
         request = flow_msg_create(self, untagged_pkt, ing_port=ing_port, 
@@ -1465,10 +1471,12 @@
         pkt = simple_tcp_packet(pktlen=len_w_vid, dl_vlan_enable=True, 
                                 dl_vlan=old_vid)
         exp_pkt = simple_tcp_packet(pktlen=len_untagged)
+        wildcards = (required_wildcards(self) | ofp.OFPFW_DL_VLAN |
+                     ofp.OFPFW_DL_VLAN_PCP)
         vid_act = action.action_strip_vlan()
 
         flow_match_test(self, pa_port_map, 
-                        wildcards=ofp.OFPFW_DL_VLAN|ofp.OFPFW_DL_VLAN_PCP,
+                        wildcards=wildcards,
                         pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act])
 
@@ -1723,13 +1731,14 @@
         flows.append([])
         flows.append([])
     
-        wildcards = ofp.OFPFW_DL_SRC | ofp.OFPFW_DL_DST
+        wildcards = (required_wildcards(self) | ofp.OFPFW_DL_SRC |
+                     ofp.OFPFW_DL_DST)
         # Create up the flows in an array
         for toggle in range(2):
             for f_idx in range(flow_count):
                 pkt = simple_tcp_packet(tcp_sport=f_idx)
                 msg = message.flow_mod()
-                match = parse.packet_to_flow_match(pkt)
+                match = packet_to_flow_match(self, pkt)
                 match.in_port = of_ports[2]
                 match.wildcards = wildcards
                 msg.match = match
diff --git a/tests/port_stats.py b/tests/port_stats.py
index 087e725..0964774 100644
--- a/tests/port_stats.py
+++ b/tests/port_stats.py
@@ -165,7 +165,7 @@
 
         # build packet
         pkt = simple_tcp_packet()
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
@@ -218,7 +218,7 @@
     """
 
     def buildFlowModMsg(self, pkt, ingress_port, egress_port):
-        match = parse.packet_to_flow_match(pkt)
+        match = packet_to_flow_match(self, pkt)
         match.wildcards &= ~ofp.OFPFW_IN_PORT
         self.assertTrue(match is not None, 
                         "Could not generate flow match from pkt")
diff --git a/tests/testutils.py b/tests/testutils.py
index daa8ce1..b9e69d4 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -66,6 +66,14 @@
                          0, ofp.OFPPC_NO_FLOOD, logger)
     self.assertEqual(rv, 0, "Failed to reset port config")
 
+def required_wildcards(parent):
+    w = test_param_get(parent.config, 'required_wildcards', default='default')
+    if w == 'l3-l4':
+        return (ofp.OFPFW_NW_SRC_ALL | ofp.OFPFW_NW_DST_ALL | ofp.OFPFW_NW_TOS
+                | ofp.OFPFW_NW_PROTO | ofp.OFPFW_TP_SRC | ofp.OFPFW_TP_DST)
+    else:
+        return 0
+
 def simple_tcp_packet(pktlen=100, 
                       dl_dst='00:01:02:03:04:05',
                       dl_src='00:06:07:08:09:0a',
@@ -421,7 +429,12 @@
                                str(response.byte_count) + " != " + 
                                str(byte_count))
 
-def flow_msg_create(parent, pkt, ing_port=None, action_list=None, wildcards=0,
+def packet_to_flow_match(parent, packet):
+    match = parse.packet_to_flow_match(packet)
+    match.wildcards |= required_wildcards(parent)
+    return match
+
+def flow_msg_create(parent, pkt, ing_port=None, action_list=None, wildcards=None,
                egr_ports=None, egr_queue=None, check_expire=False, in_band=False):
     """
     Create a flow message
@@ -434,6 +447,8 @@
     """
     match = parse.packet_to_flow_match(pkt)
     parent.assertTrue(match is not None, "Flow match from pkt failed")
+    if wildcards is None:
+        wildcards = required_wildcards(parent)
     if in_band:
         wildcards &= ~ofp.OFPFW_IN_PORT
     match.wildcards = wildcards
@@ -503,7 +518,7 @@
     parent.assertTrue(rv != -1, "Error installing flow mod")
     parent.assertEqual(do_barrier(parent.controller), 0, "Barrier failed")
 
-def flow_match_test_port_pair(parent, ing_port, egr_ports, wildcards=0, 
+def flow_match_test_port_pair(parent, ing_port, egr_ports, wildcards=None,
                               dl_vlan=-1, pkt=None, exp_pkt=None,
                               action_list=None, check_expire=False):
     """
@@ -514,6 +529,8 @@
     See flow_match_test for parameter descriptions
     """
 
+    if wildcards is None:
+        wildcards = required_wildcards(parent)
     parent.logger.info("Pkt match test: " + str(ing_port) + " to " + 
                        str(egr_ports))
     parent.logger.debug("  WC: " + hex(wildcards) + " vlan: " + str(dl_vlan) +
@@ -563,7 +580,7 @@
     parent.logger.debug("Could not generate enough egress ports for test")
     return []
     
-def flow_match_test(parent, port_map, wildcards=0, dl_vlan=-1, pkt=None, 
+def flow_match_test(parent, port_map, wildcards=None, dl_vlan=-1, pkt=None, 
                     exp_pkt=None, action_list=None, check_expire=False, 
                     max_test=0, egr_count=1, ing_port=False):
     """
@@ -580,6 +597,8 @@
     @param check_expire Check for flow expiration message
     @param egr_count Number of egress ports; -1 means get from config w/ dflt 2
     """
+    if wildcards is None:
+        wildcards = required_wildcards(parent)
     of_ports = port_map.keys()
     of_ports.sort()
     parent.assertTrue(len(of_ports) > 1, "Not enough ports for test")
