test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] [PATCH]tests: Test Script for L2TPv3
@ 2020-02-14  9:43 Varalakshmi
  2020-02-17  8:26 ` Peng, Yuan
  0 siblings, 1 reply; 2+ messages in thread
From: Varalakshmi @ 2020-02-14  9:43 UTC (permalink / raw)
  To: dts; +Cc: Varalakshmi

Automated script for L2TPv3 feature

Signed-off-by: Varalakshmi <varalakshmi.s@intel.com>
---
 tests/TestSuite_DdpL2tpv3.py | 568 +++++++++++++++++++++++++++++++++++
 1 file changed, 568 insertions(+)
 create mode 100644 tests/TestSuite_DdpL2tpv3.py

diff --git a/tests/TestSuite_DdpL2tpv3.py b/tests/TestSuite_DdpL2tpv3.py
new file mode 100644
index 0000000..24b4f3c
--- /dev/null
+++ b/tests/TestSuite_DdpL2tpv3.py
@@ -0,0 +1,568 @@
+#<COPYRIGHT_TAG>
+import time
+import re
+import sys
+import utils
+from test_case import TestCase
+from pmd_output import PmdOutput
+from settings import get_nic_name
+from scapy.all import *
+import random
+
+class TestDdpL2tpv3(TestCase):
+
+    def set_up_all(self):
+        self.dut_ports = self.dut.get_ports(self.nic)
+        profile_file = 'dep/l2tpv3oip-l4.pkg'
+        profile_dst = "/tmp/"
+        self.dut.session.copy_file_to(profile_file, profile_dst)
+        out = self.dut.send_expect("cat config/common_base", "]# ", 10)
+        self.PF_Q_strip = 'CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF'
+        pattern = "(%s=)(\d*)" % self.PF_Q_strip
+        self.PF_QUEUE = self.element_strip(out, pattern)
+        self.used_dut_port = self.dut_ports[0]
+        tester_port = self.tester.get_local_port(self.used_dut_port)
+        self.tester_intf = self.tester.get_interface(tester_port)
+        self.dut_testpmd = PmdOutput(self.dut)
+
+    def set_up(self):
+        self.load_profile()
+
+    def element_strip(self, out, pattern):
+        """
+        Strip and get queue number.
+        """
+        
+        s = re.compile(pattern)
+        res = s.search(out)
+        if res is None:
+            print 'Queue number not in output.'
+            return None
+        else:
+            result = res.group(2)
+            return int(result)
+
+
+    def load_profile(self):
+        """
+        Load profile to update FVL configuration tables, profile will be
+        stored in binary file.
+        """
+        self.dut_testpmd.start_testpmd(
+            "Default", "--pkt-filter-mode=perfect --port-topology=chained \
+            --txq=%s --rxq=%s --disable-rss"
+            % (self.PF_QUEUE, self.PF_QUEUE))
+        self.dut_testpmd.execute_cmd('port stop 0')
+        time.sleep(1)
+        self.dut_testpmd.execute_cmd(
+            'ddp add 0 /tmp/l2tpv3oip-l4.pkg,/tmp/l2tpv3oip-l4.bak')
+        out = self.dut_testpmd.execute_cmd('ddp get list 0')
+        self.verify("Profile number is: 1" in out,
+                    "Failed to load ddp profile!!!")
+        self.dut_testpmd.execute_cmd('port start all')
+
+    def l2tpv3pkts(self, keyword):
+        """
+        Generate L2TPv3oIPv4, L2TPv3oIPv6 and UDP  packets.
+        """
+        pkt = []
+        if keyword is not 'def':
+            if keyword is "l2tpv3oipv4":
+		pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\fe9')")
+            if keyword is "l2tpv3oipv4_dst":
+                pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\xb9')")
+                pkt.append("Ether()/IP(dst=\"88.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv4_src":
+                pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\xa9')")
+                pkt.append("Ether()/IP(src=\"11.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv4_src_dst":
+                pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IP(src=\"55.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"22.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv6":
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xc9')")
+            if keyword is "l2tpv3oipv6_dst":
+                pkt.append("Ether()/IPv6(dst=\"8:7:6:5:4:3:2:1\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"8:7:6:5:4:3:2:1\",nh=115)/Raw('\\x00\\x00\\x03\\xd9')")
+                pkt.append("Ether()/IPv6(dst=\"8888:7:6:5:4:3:2:1\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv6_src":
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"1111:2:3:4:5:6:7:8\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv6_src_dst":
+                pkt.append("Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"2222:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6666:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3_ipv4_ipv6":
+                pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+            if keyword is "l2tpv3oip_v4src_v6src" :
+                pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\xa9')")
+                pkt.append("Ether()/IP(src=\"11.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:3:5:7:9:2:4:6\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:3:5:7:9:2:4:6\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"1111:3:5:7:9:2:4:6\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oip_v4dst_v6dst":
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xb9')")
+                pkt.append("Ether()/IP(dst=\"99.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xd9')")
+                pkt.append("Ether()/IPv6(dst=\"2222:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oip_v4srcdst_v6srcdst":
+                pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IP(src=\"99.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"44.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"1111:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9999:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oip_v4_v6_udp":
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xb9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xd9')")
+                pkt.append("Ether()/IP()/UDP()")
+        return pkt
+
+    def send_and_verify(self,keyword='def'):
+        """
+        Send packets and verify result.
+        """
+        pkt = self.l2tpv3pkts(keyword)
+	qnum=[]
+        for i in range(len(pkt)):
+	    self.tester.scapy_append('sendp([%s], iface="%s")'%(pkt[i], self.tester_intf))
+	    self.tester.scapy_execute()
+	    out = self.dut.get_session_output(timeout=2)
+	    pattern = "port (\d)/queue (\d{1,2}): received (\d) packets"
+	    qnum.append(self.element_strip(out, pattern))
+        return qnum
+
+    def run_fd_test(self, keyword):
+        """
+        Configure Flow director rules.
+        
+        keywords: keywords have IPv4/IPv6 SIP DIP and UDP
+        """
+
+        out=self.dut_testpmd.execute_cmd('start')
+        out=self.dut_testpmd.execute_cmd('set verbose 1')
+	qdef=[]
+        qnum = self.send_and_verify(keyword)
+        for i in range(len(qnum)):
+            self.verify(qnum[i] == 0, "Receive packet from wrong queue!!!")
+        
+	queue = random.randint(1, self.PF_QUEUE - 1)
+        
+        if 'l2tpv3oipv4' is keyword:
+			
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+                
+        if 'l2tpv3oipv4_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4  dst is 8.8.8.8  / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching DIP
+
+
+        if 'l2tpv3oipv4_src' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 1.1.1.1 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching SIP
+
+        if 'l2tpv3oipv4_src_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 5.5.5.5 dst is 2.2.2.2 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching SIP
+	    qdef.append(0) #Default Queue number to check for in case of non matching DIP
+
+        if 'l2tpv3oipv6' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+
+        if 'l2tpv3oipv6_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 dst is 8:7:6:5:4:3:2:1 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching DIP
+
+        if 'l2tpv3oipv6_src' is keyword:
+            out=self.dut_testpmd.execute_cmd('flow create 0 ingress pattern eth / ipv6 src is 1:2:3:4:5:6:7:8 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching SIP
+
+        if 'l2tpv3oipv6_src_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 src is 2:3:4:5:6:7:8:9 dst is 6:5:4:3:2:1:8:9 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching SIP
+	    qdef.append(0)  #Default Queue number to check for in case of non matching DIP
+
+        if 'l2tpv3_ipv4_ipv6' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+
+        if 'l2tpv3oip_v4src_v6src' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 1.3.5.7 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching IPv4 SIP
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 src is 1:3:5:7:9:2:4:6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching IPv6 SIP
+
+        if 'l2tpv3oip_v4dst_v6dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 dst is 9.7.5.3 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv4 DIP
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 dst is 2:4:6:8:1:3:5:7 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching IPv6 DIP
+
+        if 'l2tpv3oip_v4srcdst_v6srcdst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 9.8.7.6 dst is 4.5.6.7 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv4 SIP
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv4 DIP
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 src is 1:2:3:4:5:6:7:8 dst is 9:8:7:6:5:4:3:2 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv6 SIP
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv6 DIP
+
+        if 'l2tpv3oip_v4_v6_udp' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID 
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / udp / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule 
+
+        qnum=self.send_and_verify(keyword)
+        
+
+        for i in range(len(qdef)):
+	    self.verify(qdef[i] == qnum[i], "Receive packet from wrong queue!!!")
+        self.dut_testpmd.execute_cmd("flow flush 0") # Delete all the flow director rules
+         
+    def test_l2tpv3oipv4(self):
+        """
+        L2TPv3 PAY is supported by NVM with profile updated.
+	Default flow director input set is sessionID
+        flow director works to send matched packets to configured queue, 
+        otherwise to queue 0.
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4'
+        self.run_fd_test(keyword)
+        
+    def test_l2tpv3oipv4_src(self):
+        """
+        Flow director input set is sessionID + SIP for pctype 28
+        """
+
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4_src'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv4_dst(self):
+        """
+        Flow director input set is sessionID + DIP for pctype 28
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4_dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv4_src_dst(self):
+        """
+        Flow director input set is sessionID + SIP + DIP for pctype 28
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4_src_dst'
+        self.run_fd_test(keyword)
+    
+    def test_l2tpv3oipv6(self):
+
+        """
+        Flow director input set is sessionID for pctyp 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6'
+        self.run_fd_test(keyword)
+    
+    def test_l2tpv3oipv6_dst(self):
+        """
+        Flow director input set is sessionID +  DIP for pctype 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6_dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv6_src(self):
+        """
+        Flow director input set is sessionID + SIP for pctype 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6_src'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv6_src_dst(self):
+        """
+        Flow director input set is sessionID + SIP + DIP for pctype 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6_src_dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3_ipv4_ipv6(self):
+        """
+        Flow director input set is sessionID for pctype 28 and 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3_ipv4_ipv6'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4src_v6src(self):
+        """
+        Flow director input set is sessionID + SIP for pctype 28 and 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4src_v6src'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4dst_v6dst(self):
+        """
+        Flow director input set is sessionID + DIP for pctype 28 and 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4dst_v6dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4srcdst_v6srcdst(self):
+        """
+        Flow director input set is sessionID + SIP + DIP for pctype 28 and 38 
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4srcdst_v6srcdst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4_v6_udp(self):
+        """
+        Flow director input set is sessionID for pctype 28 and 38 
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4_v6_udp'
+        self.run_fd_test(keyword)
+
+    def tear_down(self):
+        self.dut_testpmd.execute_cmd('stop')
+        out = self.dut_testpmd.execute_cmd('ddp get list 0')
+        if "Profile number is: 0" not in out:
+            self.dut_testpmd.execute_cmd('port stop all')
+            time.sleep(1)
+            self.dut_testpmd.execute_cmd('ddp del 0 /tmp/l2tpv3oip-l4.bak')
+            out = self.dut_testpmd.execute_cmd('ddp get list 0')
+            self.verify("Profile number is: 0" in out,
+                        "Failed to delete ddp profile!!!")
+            self.dut_testpmd.execute_cmd('port start all')
+        self.dut_testpmd.quit()
+
+    def tear_down_all(self):
+        pass
+
+
+
+
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH] [PATCH]tests: Test Script for L2TPv3
  2020-02-14  9:43 [dts] [PATCH] [PATCH]tests: Test Script for L2TPv3 Varalakshmi
@ 2020-02-17  8:26 ` Peng, Yuan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng, Yuan @ 2020-02-17  8:26 UTC (permalink / raw)
  To: S, Varalakshmi, dts; +Cc: S, Varalakshmi

Hi Lakshimi,

There are many similar hard code steps in each test case, like:

  self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')

You'd better put them to a function, the pctype and flowtype can be passing by argument.

You can refer to the TestSuite_ddp_ppp_l2tp.py

There are 3 cases less than test plan:

Test Case : Adding L2TPv3 profile to the port
Test Case : Deleting L2TPv3 profile from the port
Test Case : Adding and deleting Flow Director rules

-----Original Message-----
From: dts <dts-bounces@dpdk.org> On Behalf Of Varalakshmi
Sent: Friday, February 14, 2020 5:43 PM
To: dts@dpdk.org
Cc: S, Varalakshmi <varalakshmi.s@intel.com>
Subject: [dts] [PATCH] [PATCH]tests: Test Script for L2TPv3

Automated script for L2TPv3 feature

Signed-off-by: Varalakshmi <varalakshmi.s@intel.com>
---
 tests/TestSuite_DdpL2tpv3.py | 568 +++++++++++++++++++++++++++++++++++
 1 file changed, 568 insertions(+)
 create mode 100644 tests/TestSuite_DdpL2tpv3.py

diff --git a/tests/TestSuite_DdpL2tpv3.py b/tests/TestSuite_DdpL2tpv3.py new file mode 100644 index 0000000..24b4f3c
--- /dev/null
+++ b/tests/TestSuite_DdpL2tpv3.py
@@ -0,0 +1,568 @@
+#<COPYRIGHT_TAG>
+import time
+import re
+import sys
+import utils
+from test_case import TestCase
+from pmd_output import PmdOutput
+from settings import get_nic_name
+from scapy.all import *
+import random
+
+class TestDdpL2tpv3(TestCase):
+
+    def set_up_all(self):
+        self.dut_ports = self.dut.get_ports(self.nic)
+        profile_file = 'dep/l2tpv3oip-l4.pkg'
+        profile_dst = "/tmp/"
+        self.dut.session.copy_file_to(profile_file, profile_dst)
+        out = self.dut.send_expect("cat config/common_base", "]# ", 10)
+        self.PF_Q_strip = 'CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF'
+        pattern = "(%s=)(\d*)" % self.PF_Q_strip
+        self.PF_QUEUE = self.element_strip(out, pattern)
+        self.used_dut_port = self.dut_ports[0]
+        tester_port = self.tester.get_local_port(self.used_dut_port)
+        self.tester_intf = self.tester.get_interface(tester_port)
+        self.dut_testpmd = PmdOutput(self.dut)
+
+    def set_up(self):
+        self.load_profile()
+
+    def element_strip(self, out, pattern):
+        """
+        Strip and get queue number.
+        """
+        
+        s = re.compile(pattern)
+        res = s.search(out)
+        if res is None:
+            print 'Queue number not in output.'
+            return None
+        else:
+            result = res.group(2)
+            return int(result)
+
+
+    def load_profile(self):
+        """
+        Load profile to update FVL configuration tables, profile will be
+        stored in binary file.
+        """
+        self.dut_testpmd.start_testpmd(
+            "Default", "--pkt-filter-mode=perfect --port-topology=chained \
+            --txq=%s --rxq=%s --disable-rss"
+            % (self.PF_QUEUE, self.PF_QUEUE))
+        self.dut_testpmd.execute_cmd('port stop 0')
+        time.sleep(1)
+        self.dut_testpmd.execute_cmd(
+            'ddp add 0 /tmp/l2tpv3oip-l4.pkg,/tmp/l2tpv3oip-l4.bak')
+        out = self.dut_testpmd.execute_cmd('ddp get list 0')
+        self.verify("Profile number is: 1" in out,
+                    "Failed to load ddp profile!!!")
+        self.dut_testpmd.execute_cmd('port start all')
+
+    def l2tpv3pkts(self, keyword):
+        """
+        Generate L2TPv3oIPv4, L2TPv3oIPv6 and UDP  packets.
+        """
+        pkt = []
+        if keyword is not 'def':
+            if keyword is "l2tpv3oipv4":
+		pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\fe9')")
+            if keyword is "l2tpv3oipv4_dst":
+                pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\xb9')")
+                pkt.append("Ether()/IP(dst=\"88.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv4_src":
+                pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\xa9')")
+                pkt.append("Ether()/IP(src=\"11.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv4_src_dst":
+                pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IP(src=\"55.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"22.2.2.2\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv6":
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xc9')")
+            if keyword is "l2tpv3oipv6_dst":
+                pkt.append("Ether()/IPv6(dst=\"8:7:6:5:4:3:2:1\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"8:7:6:5:4:3:2:1\",nh=115)/Raw('\\x00\\x00\\x03\\xd9')")
+                pkt.append("Ether()/IPv6(dst=\"8888:7:6:5:4:3:2:1\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv6_src":
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"1111:2:3:4:5:6:7:8\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oipv6_src_dst":
+                pkt.append("Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"2222:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6666:5:4:3:2:1:8:9\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3_ipv4_ipv6":
+                pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(proto=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+            if keyword is "l2tpv3oip_v4src_v6src" :
+                pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\xa9')")
+                pkt.append("Ether()/IP(src=\"11.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:3:5:7:9:2:4:6\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:3:5:7:9:2:4:6\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"1111:3:5:7:9:2:4:6\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oip_v4dst_v6dst":
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xb9')")
+                pkt.append("Ether()/IP(dst=\"99.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xd9')")
+                pkt.append("Ether()/IPv6(dst=\"2222:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oip_v4srcdst_v6srcdst":
+                pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IP(src=\"99.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"44.5.6.7\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xf9')")
+                pkt.append("Ether()/IPv6(src=\"1111:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9999:8:7:6:5:4:3:2\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+            if keyword is "l2tpv3oip_v4_v6_udp":
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\xb9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xe9')")
+                pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw('\\x00\\x00\\x03\\xd9')")
+                pkt.append("Ether()/IP()/UDP()")
+        return pkt
+
+    def send_and_verify(self,keyword='def'):
+        """
+        Send packets and verify result.
+        """
+        pkt = self.l2tpv3pkts(keyword)
+	qnum=[]
+        for i in range(len(pkt)):
+	    self.tester.scapy_append('sendp([%s], iface="%s")'%(pkt[i], self.tester_intf))
+	    self.tester.scapy_execute()
+	    out = self.dut.get_session_output(timeout=2)
+	    pattern = "port (\d)/queue (\d{1,2}): received (\d) packets"
+	    qnum.append(self.element_strip(out, pattern))
+        return qnum
+
+    def run_fd_test(self, keyword):
+        """
+        Configure Flow director rules.
+        
+        keywords: keywords have IPv4/IPv6 SIP DIP and UDP
+        """
+
+        out=self.dut_testpmd.execute_cmd('start')
+        out=self.dut_testpmd.execute_cmd('set verbose 1')
+	qdef=[]
+        qnum = self.send_and_verify(keyword)
+        for i in range(len(qnum)):
+            self.verify(qnum[i] == 0, "Receive packet from wrong 
+queue!!!")
+        
+	queue = random.randint(1, self.PF_QUEUE - 1)
+        
+        if 'l2tpv3oipv4' is keyword:
+			
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching sessionID
+                
+        if 'l2tpv3oipv4_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4  dst is 8.8.8.8  / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching DIP
+
+
+        if 'l2tpv3oipv4_src' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 1.1.1.1 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching SIP
+
+        if 'l2tpv3oipv4_src_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 5.5.5.5 dst is 2.2.2.2 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching SIP
+	    qdef.append(0) #Default Queue number to check for in case of non 
+matching DIP
+
+        if 'l2tpv3oipv6' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching sessionID
+
+        if 'l2tpv3oipv6_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 dst is 8:7:6:5:4:3:2:1 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching DIP
+
+        if 'l2tpv3oipv6_src' is keyword:
+            out=self.dut_testpmd.execute_cmd('flow create 0 ingress pattern eth / ipv6 src is 1:2:3:4:5:6:7:8 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching SIP
+
+        if 'l2tpv3oipv6_src_dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 src is 2:3:4:5:6:7:8:9 dst is 6:5:4:3:2:1:8:9 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching SIP
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching DIP
+
+        if 'l2tpv3_ipv4_ipv6' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+	    qdef.append(0)  #Default Queue number to check for in case of non 
+matching sessionID
+
+        if 'l2tpv3oip_v4src_v6src' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 1.3.5.7 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching IPv4 SIP
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 src is 1:3:5:7:9:2:4:6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0) #Default Queue number to check for in case 
+ of non matching IPv6 SIP
+
+        if 'l2tpv3oip_v4dst_v6dst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 dst is 9.7.5.3 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv4 DIP
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 dst is 2:4:6:8:1:3:5:7 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0) #Default Queue number to check for in case 
+ of non matching IPv6 DIP
+
+        if 'l2tpv3oip_v4srcdst_v6srcdst' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 src is 9.8.7.6 dst is 4.5.6.7 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv4 SIP
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv4 DIP
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 src is 1:2:3:4:5:6:7:8 dst is 9:8:7:6:5:4:3:2 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching sessionID
+            qdef.append(0)  #Default Queue number to check for in case of non matching IPv6 SIP
+            qdef.append(0)  #Default Queue number to check for in case 
+ of non matching IPv6 DIP
+
+        if 'l2tpv3oip_v4_v6_udp' is keyword:
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv6 / l2tpv3oip session_id is 1001 / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule for matched sessionID 
+            qdef.append(0) #Default Queue number to check for in case of non matching sessionID
+            queue = random.randint(1, self.PF_QUEUE - 1)
+            out=self.dut_testpmd.execute_cmd( 'flow create 0 ingress pattern eth / ipv4 / udp / end actions queue index {} / end'.format(queue))
+            qdef.append(queue) #Queue Number as configured in the rule
+
+        qnum=self.send_and_verify(keyword)
+        
+
+        for i in range(len(qdef)):
+	    self.verify(qdef[i] == qnum[i], "Receive packet from wrong queue!!!")
+        self.dut_testpmd.execute_cmd("flow flush 0") # Delete all the 
+flow director rules
+         
+    def test_l2tpv3oipv4(self):
+        """
+        L2TPv3 PAY is supported by NVM with profile updated.
+	Default flow director input set is sessionID
+        flow director works to send matched packets to configured queue, 
+        otherwise to queue 0.
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4'
+        self.run_fd_test(keyword)
+        
+    def test_l2tpv3oipv4_src(self):
+        """
+        Flow director input set is sessionID + SIP for pctype 28
+        """
+
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4_src'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv4_dst(self):
+        """
+        Flow director input set is sessionID + DIP for pctype 28
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4_dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv4_src_dst(self):
+        """
+        Flow director input set is sessionID + SIP + DIP for pctype 28
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv4_src_dst'
+        self.run_fd_test(keyword)
+    
+    def test_l2tpv3oipv6(self):
+
+        """
+        Flow director input set is sessionID for pctyp 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6'
+        self.run_fd_test(keyword)
+    
+    def test_l2tpv3oipv6_dst(self):
+        """
+        Flow director input set is sessionID +  DIP for pctype 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6_dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv6_src(self):
+        """
+        Flow director input set is sessionID + SIP for pctype 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6_src'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oipv6_src_dst(self):
+        """
+        Flow director input set is sessionID + SIP + DIP for pctype 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oipv6_src_dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3_ipv4_ipv6(self):
+        """
+        Flow director input set is sessionID for pctype 28 and 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3_ipv4_ipv6'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4src_v6src(self):
+        """
+        Flow director input set is sessionID + SIP for pctype 28 and 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4src_v6src'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4dst_v6dst(self):
+        """
+        Flow director input set is sessionID + DIP for pctype 28 and 38
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4dst_v6dst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4srcdst_v6srcdst(self):
+        """
+        Flow director input set is sessionID + SIP + DIP for pctype 28 and 38 
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 13')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 14')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 15')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 16')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 17')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 18')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 19')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 20')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 21')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 22')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 23')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 24')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 25')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 26')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 27')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 28')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4srcdst_v6srcdst'
+        self.run_fd_test(keyword)
+
+    def test_l2tpv3oip_v4_v6_udp(self):
+        """
+        Flow director input set is sessionID for pctype 28 and 38 
+        """
+        self.dut_testpmd.execute_cmd('port stop 0')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset clear all')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 28 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 44')
+        self.dut_testpmd.execute_cmd('port config 0 pctype 38 fdir_inset set field 45')
+        self.dut_testpmd.execute_cmd('port start 0')
+        self.dut_testpmd.execute_cmd('start')
+        keyword = 'l2tpv3oip_v4_v6_udp'
+        self.run_fd_test(keyword)
+
+    def tear_down(self):
+        self.dut_testpmd.execute_cmd('stop')
+        out = self.dut_testpmd.execute_cmd('ddp get list 0')
+        if "Profile number is: 0" not in out:
+            self.dut_testpmd.execute_cmd('port stop all')
+            time.sleep(1)
+            self.dut_testpmd.execute_cmd('ddp del 0 /tmp/l2tpv3oip-l4.bak')
+            out = self.dut_testpmd.execute_cmd('ddp get list 0')
+            self.verify("Profile number is: 0" in out,
+                        "Failed to delete ddp profile!!!")
+            self.dut_testpmd.execute_cmd('port start all')
+        self.dut_testpmd.quit()
+
+    def tear_down_all(self):
+        pass
+
+
+
+
--
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-17  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  9:43 [dts] [PATCH] [PATCH]tests: Test Script for L2TPv3 Varalakshmi
2020-02-17  8:26 ` Peng, Yuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).