DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xueming Li <xuemingl@mellanox.com>
To: Wu Jingjing <jingjing.wu@intel.com>,
	Harry van Haaren <harry.van.haaren@intel.com>
Cc: Xueming Li <xuemingl@mellanox.com>, dev@dpdk.org
Subject: [dpdk-dev] [RFC v1 8/9] test/expect: add expect test scripts
Date: Fri,  8 Dec 2017 16:22:24 +0800	[thread overview]
Message-ID: <20171208082225.44913-9-xuemingl@mellanox.com> (raw)
In-Reply-To: <20171208082225.44913-1-xuemingl@mellanox.com>
In-Reply-To: <20171019140649.26668-2-xuemingl@mellanox.com>

Please enable python module to run thesse scripts
---
 test/expect/init.exp |  28 +++++++++++
 test/expect/rx.exp   | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 162 insertions(+)
 create mode 100644 test/expect/init.exp
 create mode 100644 test/expect/rx.exp

diff --git a/test/expect/init.exp b/test/expect/init.exp
new file mode 100644
index 000000000..475ff39f9
--- /dev/null
+++ b/test/expect/init.exp
@@ -0,0 +1,28 @@
+# scapy vars
+py eth = Ether(src="00:11:22:33:44:55",dst="aa:bb:cc:dd:ee:ff")
+py ethb = Ether(src="00:11:22:33:44:55",dst="ff:ff:ff:ff:ff:ff")
+py ethm = Ether(src="00:11:22:33:44:55",dst="01:02:03:04:05:06")
+py ip = IP(src="4.3.2.1",dst="44.33.22.11")
+py ipc = IP(src="4.3.2.1",dst="44.33.22.11",chksum=1)
+py ip1 = IP(src="4.3.2.1",dst="44.33.22.12")
+py ip2 = IP(src="4.3.2.2",dst="44.33.22.11")
+py ipv6 = IPv6(src="::2",dst="::1")
+py ipv6c = IPv6(src="::2",dst="::1")
+py ipv61 = IPv6(src="::2",dst="::3")
+py ipv62 = IPv6(src="::3",dst="::1")
+py udp = UDP(sport=54321,dport=4789)
+py udpc = UDP(sport=54321,dport=4789,chksum=1)
+py udp1 = UDP(sport=54322,dport=4789)
+py udp2 = UDP(sport=54321,dport=4790)
+py tcp = TCP(sport=54321,dport=4789)
+py tcpc = TCP(sport=54321,dport=4789,chksum=1)
+py tcp1 = TCP(sport=54322,dport=4789)
+py tcp2 = TCP(sport=54321,dport=4790)
+py vxlan = VXLAN(vni=0x12345)
+py l3vxlan = VXLAN(vni=0x12345)
+py gre = GRE()
+py grex = GRE(chksum_present=1,key_present=1,seqnum_present=1,version=1,chksum=0xbad0,key=0x12345678,seqence_number=0x87654321)
+py x4 = eth/ip/udp/vxlan
+py x6 = eth/ipv6/udp/vxlan
+py g4 = eth/ip/gre
+py g6 = eth/ipv6/gre
diff --git a/test/expect/rx.exp b/test/expect/rx.exp
new file mode 100644
index 000000000..a67f016af
--- /dev/null
+++ b/test/expect/rx.exp
@@ -0,0 +1,134 @@
+# sudo build/app/testpmd -l4-8   -m 200 -w 82:0.0,tx_vec_en=0,rx_vec_en=0 -- -i -a --total-num-mbufs=4096 --txq=4 --rxq=4 --nb-cores=4 --forward-mode=pktgen --rss-udp --enable-rx-cksum
+# sudo build/app/testpmd -l4-8   -m 200 -w 82:0.0,tx_vec_en=1,rx_vec_en=1 -- -i -a --total-num-mbufs=4096 --txq=4 --rxq=4 --nb-cores=4 --forward-mode=pktgen --rss-udp --enable-rx-cksum
+
+
+load  test/expect/init.exp
+
+# show loaded CLIs, mute expect summary info
+# set  verbose  0x8040
+
+port config all rss all
+stop
+port stop 0
+port start 0
+start
+expect 0 0 eth/ip/udp 1 1 20 0x0 queue 1
+expect 0 0 eth/ip/udp 1 1 20 0x0 ptype 0x291
+expect 0 0 eth/ip/udp 1 1 20 0x0 ol_flags 0x180
+expect 0 0 eth/ip/udp 1 1 20 0x0 rss 0xf4ff21c5
+expect 0 0 eth/ip1/udp 1 1 20 0x0 rss 0xa1290ec
+expect 0 0 eth/ip2/udp 1 1 20 0x0 rss 0xfe42683
+expect 0 0 eth/ip/udp1 1 1 20 0x0 rss 0x15b5ba8e
+expect 0 0 eth/ip/udp2 1 1 20 0x0 rss 0x6fb4b12a
+
+
+expect 0 0 eth/ip/udpc 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/ip/udpc 1 1 20 0x0 ptype 0x291
+expect 0 0 eth/ipc/udp 1 1 20 0x0 ol_flags 0x100
+expect 0 0 eth/ipc/udp 1 1 20 0x0 ptype 0x291
+expect 0 0 eth/ipc/udpc 1 1 20 0x0 ol_flags 0x0
+expect 0 0 eth/ipc/udpc 1 1 20 0x0 ptype 0x291
+expect 0 0 eth/ip/tcp 1 1 20 0x0 ol_flags 0x180
+expect 0 0 eth/ip/tcp 1 1 20 0x0 ptype 0x191
+expect 0 0 eth/ip/tcp 1 1 20 0x0 queue 1
+expect 0 0 eth/ip/tcp 1 1 20 0x0 rss 0xf4ff21c5
+expect 0 0 eth/ip1/tcp 1 1 20 0x0 rss 0xa1290ec
+expect 0 0 eth/ip2/tcp 1 1 20 0x0 rss 0xfe42683
+expect 0 0 eth/ip/tcp1 1 1 20 0x0 rss 0x15b5ba8e
+expect 0 0 eth/ip/tcp2 1 1 20 0x0 rss 0x6fb4b12a
+
+expect 0 0 eth/ip/tcpc 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/ip/tcpc 1 1 20 0x0 ptype 0x191
+expect 0 0 eth/ipc/tcp 1 1 20 0x0 ol_flags 0x100
+expect 0 0 eth/ipc/tcp 1 1 20 0x0 ptype 0x191
+expect 0 0 eth/ipc/tcpc 1 1 20 0x0 ol_flags 0x0
+expect 0 0 eth/ipc/tcpc 1 1 20 0x0 ptype 0x191
+expect 0 0 eth/ip 1 1 20 0x0 queue 1
+expect 0 0 eth/ip 1 1 20 0x0 ptype 0x691
+expect 0 0 eth/ip 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/ip 1 1 20 0x0 rss 0xe7fd7ed5
+expect 0 0 eth/ip1 1 1 20 0x0 rss 0x1910cffc
+expect 0 0 eth/ip2 1 1 20 0x0 rss 0x1ce67993
+
+expect 0 0 eth/ipc 1 1 20 0x0 ol_flags 0x0
+expect 0 0 eth/ipc 1 1 20 0x0 ptype 0x691
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[0] 1 1 20 0x0 queue 1
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[0] 1 1 20 0x0 ptype 0x391
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[0] 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[0] 1 1 20 0x0 rss 0xe7fd7ed5
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[1] 1 1 20 0x0 queue 1
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[1] 1 1 20 0x0 ptype 0x391
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[1] 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/fragment(ip/udp/("a"*100),64)[1] 1 1 20 0x0 rss 0xe7fd7ed5
+expect 0 0 eth/ipv6/udp 1 1 20 0x0 rss 0x1799a1f0
+expect 0 0 eth/ipv6/udp 1 1 20 0x0 ptype 0x2e1
+expect 0 0 eth/ipv6/udp 1 1 20 0x0 ol_flags 0x180
+expect 0 0 eth/ipv6/udp 1 1 20 0x0 rss 0x1799a1f0
+expect 0 0 eth/ipv61/udp 1 1 20 0x0 rss 0x5616a88c
+expect 0 0 eth/ipv62/udp 1 1 20 0x0 rss 0x2256bd9c
+expect 0 0 eth/ipv6/udp1 1 1 20 0x0 rss 0xc1ca0f8
+expect 0 0 eth/ipv6/udp2 1 1 20 0x0 rss 0x1691b8ef
+
+
+expect 0 0 eth/ipv6/udpc 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/ipv6/tcp 1 1 20 0x0 ol_flags 0x180
+expect 0 0 eth/ipv6/tcp 1 1 20 0x0 ptype 0x1e1
+expect 0 0 eth/ipv6/tcp 1 1 20 0x0 queue 0
+expect 0 0 eth/ipv6/tcp 1 1 20 0x0 rss 0x1799a1f0
+expect 0 0 eth/ipv61/tcp 1 1 20 0x0 rss 0x5616a88c
+expect 0 0 eth/ipv62/tcp 1 1 20 0x0 rss 0x2256bd9c
+expect 0 0 eth/ipv6/tcp1 1 1 20 0x0 rss 0xc1ca0f8
+expect 0 0 eth/ipv6/tcp2 1 1 20 0x0 rss 0x1691b8ef
+
+expect 0 0 eth/ipv6/tcpc 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/ipv6 1 1 20 0x0 queue 3
+expect 0 0 eth/ipv6 1 1 20 0x0 ptype 0x6e1
+expect 0 0 eth/ipv6 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/ipv6 1 1 20 0x0 rss 0x99f99ccf
+expect 0 0 eth/ipv61 1 1 20 0x0 rss 0xd87695b3
+expect 0 0 eth/ipv62 1 1 20 0x0 rss 0xac3680a3
+
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[0] 1 1 20 0x0 queue 3
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[0] 1 1 20 0x0 ptype 0x3e1
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[0] 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[0] 1 1 20 0x0 rss 0x99f99ccf
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[1] 1 1 20 0x0 queue 3
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[1] 1 1 20 0x0 ptype 0x3e1
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[1] 1 1 20 0x0 ol_flags 0x80
+expect 0 0 eth/fragment6(ipv6/IPv6ExtHdrFragment()/udp/("a"*120),64)[1] 1 1 20 0x0 rss 0x99f99ccf
+expect 0 0 eth 1 1 20 0x0 rss 0
+expect 0 0 eth 1 1 20 0x0 ptype 0x1
+expect 0 0 eth 1 1 20 0x0 ol_flags 0x0
+
+
+
+
+
+expect 0 0 ethb/ip/udp 1 1 20 0x0 rss 0xf4ff21c5
+expect 0 0 ethm/ip/udp 1 1 20 0x0 rss 0xf4ff21c5
+
+
+
+
+
+
+
+
+
+
+
+
+port config all rss none
+stop
+port stop 0
+port start 0
+start
+expect 0 0 eth/ip/udp 1 1 20 0x0 rss 0
+expect 0 0 eth/ip/udp 1 1 20 0x0 ol_flags 0x180
+expect 0 0 eth/ip/udp 1 1 20 0x0 ptype 0x291
+expect 0 0 eth/ip/tcp 1 1 20 0x0 rss 0
+expect 0 0 eth/ip 1 1 20 0x0 rss 0
+expect 0 0 eth/ipv6/udp 1 1 20 0x0 rss 0
+expect 0 0 eth/ipv6/tcp 1 1 20 0x0 rss 0
+expect 0 0 eth/ipv6 1 1 20 0x0 rss 0
+
-- 
2.13.3

  parent reply	other threads:[~2017-12-08  8:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 14:06 [dpdk-dev] [RFC PATCH 0/2] using scapy to generate packet templates Xueming Li
2017-10-19 14:06 ` [dpdk-dev] [RFC PATCH 1/2] app/testpmd: add packet template Xueming Li
2017-12-05  4:43   ` [dpdk-dev] [RFC v1 00/11] scapy/python extension Xueming Li
2017-12-05  4:45   ` Xueming Li
2017-12-05  4:48   ` Xueming Li
2017-12-05  4:55   ` Xueming Li
2017-12-05  6:14     ` Xueming(Steven) Li
2017-12-05  5:00   ` Xueming Li
2017-12-05  5:03   ` [dpdk-dev] [RFC v1 00/11] scappy/pythoon extension Xueming Li
2017-12-05  5:04   ` [dpdk-dev] [RFC v1 00/11] scapy/python extension Xueming Li
2017-12-10 23:16     ` Wiles, Keith
2019-01-10 13:06     ` Eelco Chaudron
2019-01-16 13:24       ` Xueming(Steven) Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 0/9] " Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 1/9] lib/cmdline: add echo support in batch loading from file Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 2/9] app/testpmd: support command echo in CLI batch loading Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 3/9] test: update batch loading test Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 4/9] lib/python: add embedded python lib Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 5/9] app/testpmd: add python command Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 6/9] app/testpmd: add pktgen forwarding engine Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 7/9] app/testpmd: add pktgen engine scapy commands Xueming Li
2017-12-08  8:22   ` Xueming Li [this message]
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 9/9] doc/scapy: add scapy how-to guide Xueming Li
2017-10-19 14:06 ` [dpdk-dev] [RFC PATCH 2/2] app/testpmd: add scapy command as pkt template Xueming Li
2017-10-19 15:21 ` [dpdk-dev] [RFC PATCH 0/2] using scapy to generate packet templates Van Haaren, Harry
2017-10-21 16:04   ` Xueming(Steven) Li

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=20171208082225.44913-9-xuemingl@mellanox.com \
    --to=xuemingl@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=jingjing.wu@intel.com \
    /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).