pktact: add ModifyL4SrcUdp and ModifyL4DstUdp
diff --git a/tests/pktact.py b/tests/pktact.py
index 34654d1..97c5113 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -1546,6 +1546,21 @@
flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
+class ModifyL4SrcUdp(BaseMatchCase):
+ """
+ Modify the source UDP port of a UDP packet
+ """
+ def runTest(self):
+ sup_acts = self.supported_actions
+ if not (sup_acts & 1 << ofp.OFPAT_SET_TP_DST):
+ skip_message_emit(self, "ModifyL4SrcUdp test")
+ return
+
+ (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['udp_sport'],
+ check_test_params=True, tp="udp")
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
+ action_list=acts, max_test=2)
+
class ModifyL4Dst(BaseMatchCase):
"""
Modify the dest TCP port of a TCP packet (TP1)
@@ -1561,6 +1576,21 @@
flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
+class ModifyL4DstUdp(BaseMatchCase):
+ """
+ Modify the dest UDP port of a UDP packet
+ """
+ def runTest(self):
+ sup_acts = self.supported_actions
+ if not (sup_acts & 1 << ofp.OFPAT_SET_TP_DST):
+ skip_message_emit(self, "ModifyL4DstUdp test")
+ return
+
+ (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['udp_dport'],
+ check_test_params=True, tp="udp")
+ flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
+ action_list=acts, max_test=2)
+
class ModifyTOS(BaseMatchCase):
"""
Modify the IP type of service of an IP packet (TP1)