test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Wang, Yinan" <yinan.wang@intel.com>
To: "Ma, LihongX" <lihongx.ma@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Ma, LihongX" <lihongx.ma@intel.com>
Subject: Re: [dts] [PATCH V1] tests/pvp_virtio_user_multi_queues: update code to	support trex
Date: Tue, 20 Aug 2019 02:37:45 +0000	[thread overview]
Message-ID: <E0CBA5A1980F1F408E1F28F9991B5B1D50EE72FB@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1565804132-8853-1-git-send-email-lihongx.ma@intel.com>

Acked-by: Wang, Yinan <yinan.wang@intel.com>

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong
> Sent: 2019年8月15日 1:36
> To: dts@dpdk.org
> Cc: Ma, LihongX <lihongx.ma@intel.com>
> Subject: [dts] [PATCH V1] tests/pvp_virtio_user_multi_queues: update code to
> support trex
> 
> Signed-off-by: lihong <lihongx.ma@intel.com>
> ---
>  tests/TestSuite_pvp_virtio_user_multi_queues.py | 45
> ++++++++++++++-----------
>  1 file changed, 25 insertions(+), 20 deletions(-)
> 
> diff --git a/tests/TestSuite_pvp_virtio_user_multi_queues.py
> b/tests/TestSuite_pvp_virtio_user_multi_queues.py
> index ebe65ba..ff8a0c4 100644
> --- a/tests/TestSuite_pvp_virtio_user_multi_queues.py
> +++ b/tests/TestSuite_pvp_virtio_user_multi_queues.py
> @@ -42,10 +42,10 @@ import time
>  import re
>  from settings import HEADER_SIZE
>  from test_case import TestCase
> -from etgen import IxiaPacketGenerator
> +from pktgen import PacketGeneratorHelper
> 
> 
> -class TestPVPVirtioMultiQueues(TestCase, IxiaPacketGenerator):
> +class TestPVPVirtioMultiQueues(TestCase):
> 
>      def set_up_all(self):
>          """
> @@ -79,6 +79,13 @@ class TestPVPVirtioMultiQueues(TestCase,
> IxiaPacketGenerator):
>          if 'packet_sizes' in self.get_suite_cfg():
>              self.frame_sizes = self.get_suite_cfg()['packet_sizes']
> 
> +        self.out_path = '/tmp'
> +        out = self.tester.send_expect('ls -d %s' % self.out_path, '# ')
> +        if 'No such file or directory' in out:
> +            self.tester.send_expect('mkdir -p %s' % self.out_path, '# ')
> +        # create an instance to set stream field setting
> +        self.pktgen_helper = PacketGeneratorHelper()
> +
>      def set_up(self):
>          """
>          Run before each test case.
> @@ -92,21 +99,6 @@ class TestPVPVirtioMultiQueues(TestCase,
> IxiaPacketGenerator):
>          self.vhost_user = self.dut.new_session(suite="vhost-user")
>          self.virtio_user = self.dut.new_session(suite="virtio-user")
> 
> -    def ip(self, port, frag, src, proto, tos, dst, chksum, len, options, version, flags,
> ihl, ttl, id):
> -        """
> -        Configure IP protocol.
> -        """
> -        self.add_tcl_cmd("protocol config -name ip")
> -        self.add_tcl_cmd('ip config -sourceIpAddr "%s"' % src)
> -        self.add_tcl_cmd('ip config -destIpAddrMode ipRandom')
> -        self.add_tcl_cmd("ip config -ttl %d" % ttl)
> -        self.add_tcl_cmd("ip config -totalLength %d" % len)
> -        self.add_tcl_cmd("ip config -fragment %d" % frag)
> -        self.add_tcl_cmd("ip config -ipProtocol %d" % proto)
> -        self.add_tcl_cmd("ip config -identifier %d" % id)
> -        self.add_tcl_cmd("stream config -framesize %d" % (len + 18))
> -        self.add_tcl_cmd("ip set %d %d %d" % (self.chasId, port['card'],
> port['port']))
> -
>      def start_vhost_testpmd(self):
>          """
>          start testpmd on vhost
> @@ -166,6 +158,13 @@ class TestPVPVirtioMultiQueues(TestCase,
> IxiaPacketGenerator):
> 
>          self.vhost_user.send_expect("start", "testpmd> ", 60)
> 
> +    def set_fields(self):
> +        """
> +        set ip protocol field behavior
> +        """
> +        fields_config = {'ip':  {'dst': {'action': 'random'}, }, }
> +        return fields_config
> +
>      def send_and_verify(self, case_info):
>          """
>          start to send packets and calculate avg throughput @@ -175,11 +174,17
> @@ class TestPVPVirtioMultiQueues(TestCase, IxiaPacketGenerator):
>              tgen_input = []
>              port = self.tester.get_local_port(self.dut_ports[0])
> 
> self.tester.scapy_append('a=[Ether(dst="%s")/IP(src="0.240.74.101",proto=255)/
> UDP()/("X"*%d)]' % (self.dst_mac, payload_size))
> -            self.tester.scapy_append('wrpcap("multiqueue.pcap", a)')
> +            self.tester.scapy_append('wrpcap("%s/multiqueue.pcap" , a)'
> + % self.out_path)
>              self.tester.scapy_execute()
> 
> -            tgen_input.append((port, port, "multiqueue.pcap"))
> -            _, pps = self.tester.traffic_generator_throughput(tgen_input)
> +            tgen_input.append((port, port, "%s/multiqueue.pcap" %
> + self.out_path))
> +
> +            vm_config = self.set_fields()
> +            self.tester.pktgen.clear_streams()
> +            streams =
> self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, vm_config,
> self.tester.pktgen)
> +            # set traffic option
> +            traffic_opt = {'delay': 5, 'duration': 20}
> +            _, pps =
> + self.tester.pktgen.measure_throughput(stream_ids=streams,
> + options=traffic_opt)
>              Mpps = pps / 1000000.0
>              self.verify(Mpps > 0, "can not receive packets of frame size %d" %
> (frame_size))
>              throughput = Mpps * 100 / \
> --
> 2.7.4


  reply	other threads:[~2019-08-20  2:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 17:35 lihong
2019-08-20  2:37 ` Wang, Yinan [this message]
2019-08-28 10:06 ` Tu, Lijuan

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=E0CBA5A1980F1F408E1F28F9991B5B1D50EE72FB@SHSMSX104.ccr.corp.intel.com \
    --to=yinan.wang@intel.com \
    --cc=dts@dpdk.org \
    --cc=lihongx.ma@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).