diff --git a/tests/pktact.py b/tests/pktact.py
index 376e02d..1bedd29 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -360,7 +360,7 @@
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_FLOOD
             self.assertTrue(request.actions.add(act), 
-                            "Could not flood port action")
+                            "Could not add flood port action")
             pa_logger.info(request.show())
 
             pa_logger.info("Inserting flow")
@@ -424,7 +424,133 @@
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_FLOOD
             self.assertTrue(request.actions.add(act), 
-                            "Could not flood port action")
+                            "Could not add flood port action")
+            act.port = ofp.OFPP_IN_PORT
+            self.assertTrue(request.actions.add(act), 
+                            "Could not add ingress port for output")
+            pa_logger.info(request.show())
+
+            pa_logger.info("Inserting flow")
+            rv = self.controller.message_send(request)
+            self.assertTrue(rv != -1, "Error installing flow mod")
+            do_barrier(self.controller)
+
+            pa_logger.info("Sending packet to dp port " + str(ingress_port))
+            self.dataplane.send(ingress_port, str(pkt))
+            for egr_idx in range(len(of_ports)):
+                ofport = of_ports[egr_idx]
+                (rcv_port, rcv_pkt, pkt_time) = self.dataplane.poll(
+                    port_number=ofport, timeout=1)
+                self.assertTrue(rcv_pkt is not None, 
+                                "Did not receive packet port " + str(ofport))
+                pa_logger.debug("Packet len " + str(len(rcv_pkt)) + " in on "
+                                + str(rcv_port))
+
+                self.assertEqual(str(pkt), str(rcv_pkt),
+                             'Response packet does not match send packet ' +
+                                 "on port " + str(ofport))
+
+class All(basic.SimpleDataPlane):
+    """
+    Send to OFPP_ALL port
+
+    Generate a packet
+    Generate and install a matching flow
+    Add action to forward to OFPP_ALL
+    Send the packet to ingress dataplane port
+    Verify the packet is received at all other ports
+    """
+    def runTest(self):
+        global pa_port_map
+        of_ports = pa_port_map.keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+
+        pkt = simple_tcp_packet()
+        match = parse.packet_to_flow_match(pkt)
+        match.wildcards &= ~ofp.OFPFW_IN_PORT
+        self.assertTrue(match is not None, 
+                        "Could not generate flow match from pkt")
+        act = action.action_output()
+
+        for idx in range(len(of_ports)):
+            rc = delete_all_flows(self.controller, pa_logger)
+            self.assertEqual(rc, 0, "Failed to delete all flows")
+
+            ingress_port = of_ports[idx]
+            pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
+
+            match.in_port = ingress_port
+
+            request = message.flow_mod()
+            request.match = match
+            request.buffer_id = 0xffffffff
+            act.port = ofp.OFPP_ALL
+            self.assertTrue(request.actions.add(act), 
+                            "Could not add ALL port action")
+            pa_logger.info(request.show())
+
+            pa_logger.info("Inserting flow")
+            rv = self.controller.message_send(request)
+            self.assertTrue(rv != -1, "Error installing flow mod")
+            do_barrier(self.controller)
+
+            pa_logger.info("Sending packet to dp port " + str(ingress_port))
+            self.dataplane.send(ingress_port, str(pkt))
+            for egr_idx in range(len(of_ports)):
+                if egr_idx == idx:
+                    continue
+                ofport = of_ports[egr_idx]
+                (rcv_port, rcv_pkt, pkt_time) = self.dataplane.poll(
+                    port_number=ofport, timeout=1)
+                self.assertTrue(rcv_pkt is not None, 
+                                "Did not receive packet port " + str(ofport))
+                pa_logger.debug("Packet len " + str(len(rcv_pkt)) + " in on "
+                                + str(rcv_port))
+
+                self.assertEqual(str(pkt), str(rcv_pkt),
+                             'Response packet does not match send packet ' +
+                                 "on port " + str(ofport))
+
+class AllPlusIngress(basic.SimpleDataPlane):
+    """
+    Send to OFPP_ALL port and ingress port
+
+    Generate a packet
+    Generate and install a matching flow
+    Add action to forward to OFPP_ALL
+    Add action to forward to ingress port
+    Send the packet to ingress dataplane port
+    Verify the packet is received at all other ports
+    """
+    def runTest(self):
+        global pa_port_map
+        of_ports = pa_port_map.keys()
+        of_ports.sort()
+        self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
+
+        pkt = simple_tcp_packet()
+        match = parse.packet_to_flow_match(pkt)
+        match.wildcards &= ~ofp.OFPFW_IN_PORT
+        self.assertTrue(match is not None, 
+                        "Could not generate flow match from pkt")
+        act = action.action_output()
+
+        for idx in range(len(of_ports)):
+            rc = delete_all_flows(self.controller, pa_logger)
+            self.assertEqual(rc, 0, "Failed to delete all flows")
+
+            ingress_port = of_ports[idx]
+            pa_logger.info("Ingress " + str(ingress_port) + " to all ports")
+
+            match.in_port = ingress_port
+
+            request = message.flow_mod()
+            request.match = match
+            request.buffer_id = 0xffffffff
+            act.port = ofp.OFPP_ALL
+            self.assertTrue(request.actions.add(act), 
+                            "Could not add ALL port action")
             act.port = ofp.OFPP_IN_PORT
             self.assertTrue(request.actions.add(act), 
                             "Could not add ingress port for output")
