From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Chen, BoX C" <box.c.chen@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Chen, BoX C" <box.c.chen@intel.com>
Subject: Re: [dts] [PATCH V1] tests/ddp_l2tpv3: adapted scapy tool running in python3
Date: Fri, 29 May 2020 08:41:05 +0000 [thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC46A7F@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20200520095129.23037-1-box.c.chen@intel.com>
Applied failed, please rework it.
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of ChenBo
> Sent: Wednesday, May 20, 2020 5:51 PM
> To: dts@dpdk.org
> Cc: Chen, BoX C <box.c.chen@intel.com>
> Subject: [dts] [PATCH V1] tests/ddp_l2tpv3: adapted scapy tool running in
> python3
>
> adapted scapy tool running in python3
>
> Signed-off-by: ChenBo <box.c.chen@intel.com>
> ---
> tests/TestSuite_ddp_l2tpv3.py | 108 +++++++++++++++++-----------------
> 1 file changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/tests/TestSuite_ddp_l2tpv3.py b/tests/TestSuite_ddp_l2tpv3.py
> index 552232b..da734f3 100644
> --- a/tests/TestSuite_ddp_l2tpv3.py
> +++ b/tests/TestSuite_ddp_l2tpv3.py
> @@ -99,78 +99,78 @@ class TestDdpL2tpv3(TestCase):
> 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')")
> + pkt.append("Ether()/IP(proto=115)/Raw(b'\\x00\\x00\\x03\\xe9')")
> +
> + pkt.append("Ether()/IP(proto=115)/Raw(b'\\x00\\x00\\x03\\fe9')")
> if keyword is "l2tpv3oipv4_dst":
> -
> pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\x
> e9')")
> -
> pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\x
> b9')")
> -
> pkt.append("Ether()/IP(dst=\"88.8.8.8\",proto=115)/Raw('\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(dst=\"8.8.8.8\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xb9')")
> +
> + pkt.append("Ether()/IP(dst=\"88.8.8.8\",proto=115)/Raw(b'\\x00\\x00\\x
> + 03\\xe9')")
> if keyword is "l2tpv3oipv4_src":
> -
> pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\x
> e9')")
> -
> pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\x
> a9')")
> -
> pkt.append("Ether()/IP(src=\"11.1.1.1\",proto=115)/Raw('\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(src=\"1.1.1.1\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xa9')")
> +
> + pkt.append("Ether()/IP(src=\"11.1.1.1\",proto=115)/Raw(b'\\x00\\x00\\x
> + 03\\xe9')")
> if keyword is "l2tpv3oipv4_src_dst":
> -
> pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x0
> 0\\x00\\x03\\xe9')")
> -
> pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x0
> 0\\x00\\x03\\xf9')")
> -
> pkt.append("Ether()/IP(src=\"55.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw('\\x
> 00\\x00\\x03\\xe9')")
> -
> pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"22.2.2.2\",proto=115)/Raw('\\x
> 00\\x00\\x03\\xe9')")
> +
> pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw(b'\\x
> 00\\x00\\x03\\xe9')")
> +
> pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw(b'\\x
> 00\\x00\\x03\\xf9')")
> +
> pkt.append("Ether()/IP(src=\"55.5.5.5\",dst=\"2.2.2.2\",proto=115)/Raw(b'\\
> x00\\x00\\x03\\xe9')")
> +
> + pkt.append("Ether()/IP(src=\"5.5.5.5\",dst=\"22.2.2.2\",proto=115)/Raw
> + (b'\\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')")
> + pkt.append("Ether()/IPv6(nh=115)/Raw(b'\\x00\\x00\\x03\\xe9')")
> +
> + pkt.append("Ether()/IPv6(nh=115)/Raw(b'\\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\\x
> 00\\x03\\xe9')")
> +
> pkt.append("Ether()/IPv6(dst=\"8:7:6:5:4:3:2:1\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xe9')")
> +
> pkt.append("Ether()/IPv6(dst=\"8:7:6:5:4:3:2:1\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xd9')")
> +
> + pkt.append("Ether()/IPv6(dst=\"8888:7:6:5:4:3:2:1\",nh=115)/Raw(b'\\x0
> + 0\\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\\x0
> 0\\x03\\xe9')")
> +
> pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xe9')")
> +
> pkt.append("Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xf9')")
> +
> + pkt.append("Ether()/IPv6(src=\"1111:2:3:4:5:6:7:8\",nh=115)/Raw(b'\\x0
> + 0\\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')")
> +
> + "Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/
> + Raw(b'\\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')")
> +
> + "Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=115)/
> + Raw(b'\\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')")
> +
> + "Ether()/IPv6(src=\"2222:3:4:5:6:7:8:9\",dst=\"6:5:4:3:2:1:8:9\",nh=11
> + 5)/Raw(b'\\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')")
> +
> + "Ether()/IPv6(src=\"2:3:4:5:6:7:8:9\",dst=\"6666:5:4:3:2:1:8:9\",nh=11
> + 5)/Raw(b'\\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')")
> + pkt.append("Ether()/IP(proto=115)/Raw(b'\\x00\\x00\\x03\\xe9')")
> + pkt.append("Ether()/IP(proto=115)/Raw(b'\\x00\\x00\\x03\\xf9')")
> + pkt.append("Ether()/IPv6(nh=115)/Raw(b'\\x00\\x00\\x03\\xe9')")
> +
> + pkt.append("Ether()/IPv6(nh=115)/Raw(b'\\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\\x
> e9')")
> -
> pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw('\\x00\\x00\\x03\\x
> a9')")
> -
> 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\\x0
> 0\\x03\\xe9')")
> +
> pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(src=\"1.3.5.7\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xa9')")
> +
> pkt.append("Ether()/IP(src=\"11.3.5.7\",proto=115)/Raw(b'\\x00\\x00\\x03\
> \xe9')")
> +
> pkt.append("Ether()/IPv6(src=\"1:3:5:7:9:2:4:6\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xe9')")
> +
> pkt.append("Ether()/IPv6(src=\"1:3:5:7:9:2:4:6\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xf9')")
> +
> + pkt.append("Ether()/IPv6(src=\"1111:3:5:7:9:2:4:6\",nh=115)/Raw(b'\\x0
> + 0\\x00\\x03\\xe9')")
> if keyword is "l2tpv3oip_v4dst_v6dst":
> -
> pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\x
> e9')")
> -
> pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\x
> b9')")
> -
> 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\\x
> 00\\x03\\xe9')")
> +
> pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xb9')")
> +
> pkt.append("Ether()/IP(dst=\"99.7.5.3\",proto=115)/Raw(b'\\x00\\x00\\x03\
> \xe9')")
> +
> pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xe9')")
> +
> pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xd9')")
> +
> + pkt.append("Ether()/IPv6(dst=\"2222:4:6:8:1:3:5:7\",nh=115)/Raw(b'\\x0
> + 0\\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('\\x0
> 0\\x00\\x03\\xe9')")
> -
> pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x0
> 0\\x00\\x03\\xf9')")
> -
> pkt.append("Ether()/IP(src=\"99.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw('\\x
> 00\\x00\\x03\\xe9')")
> -
> pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"44.5.6.7\",proto=115)/Raw('\\x
> 00\\x00\\x03\\xe9')")
> +
> pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw(b'\\x
> 00\\x00\\x03\\xe9')")
> +
> pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw(b'\\x
> 00\\x00\\x03\\xf9')")
> +
> pkt.append("Ether()/IP(src=\"99.8.7.6\",dst=\"4.5.6.7\",proto=115)/Raw(b'\\
> x00\\x00\\x03\\xe9')")
> +
> + pkt.append("Ether()/IP(src=\"9.8.7.6\",dst=\"44.5.6.7\",proto=115)/Raw
> + (b'\\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')")
> +
> + "Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/
> + Raw(b'\\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')")
> +
> + "Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=115)/
> + Raw(b'\\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')")
> +
> + "Ether()/IPv6(src=\"1111:2:3:4:5:6:7:8\",dst=\"9:8:7:6:5:4:3:2\",nh=11
> + 5)/Raw(b'\\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')")
> +
> + "Ether()/IPv6(src=\"1:2:3:4:5:6:7:8\",dst=\"9999:8:7:6:5:4:3:2\",nh=11
> + 5)/Raw(b'\\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\\x
> e9')")
> -
> pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw('\\x00\\x00\\x03\\x
> b9')")
> -
> 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(dst=\"9.7.5.3\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xe9')")
> +
> pkt.append("Ether()/IP(dst=\"9.7.5.3\",proto=115)/Raw(b'\\x00\\x00\\x03\\
> xb9')")
> +
> pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw(b'\\x00\\x00\
> \x03\\xe9')")
> +
> + pkt.append("Ether()/IPv6(dst=\"2:4:6:8:1:3:5:7\",nh=115)/Raw(b'\\x00\\
> + x00\\x03\\xd9')")
> pkt.append("Ether()/IP()/UDP()")
> return pkt
>
> @@ -209,7 +209,7 @@ class TestDdpL2tpv3(TestCase):
> qdef = []
> qnum = self.send_and_verify(keyword)
> for i in range(len(qnum)):
> - self.verify(qnum[i] == 0, "Receive packet from wrong queue!!!")
> + self.verify(qnum[i] == 0, "Receive packet from wrong
> + queue{}!!!".format(qnum[i]))
>
> queue = random.randint(1, self.PF_QUEUE - 1)
>
> @@ -356,7 +356,7 @@ class TestDdpL2tpv3(TestCase):
>
> qnum = self.send_and_verify(keyword)
> for i in range(len(qdef)):
> - self.verify(qdef[i] == qnum[i], "Receive packet from wrong queue!!!")
> + self.verify(qdef[i] == qnum[i], "Receive packet from wrong
> + queue{}_{}!!!".format(qdef[i],qnum[i]))
> self.dut_testpmd.execute_cmd("flow flush 0") # Delete all the flow
> director rules
>
> def test_l2tpv3oipv4(self):
> --
> 2.17.1
prev parent reply other threads:[~2020-05-29 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 9:51 ChenBo
2020-05-20 9:56 ` Chen, BoX C
2020-05-29 8:41 ` Tu, Lijuan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8CE3E05A3F976642AAB0F4675D0AD20E0BC46A7F@SHSMSX101.ccr.corp.intel.com \
--to=lijuan.tu@intel.com \
--cc=box.c.chen@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).