test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: dliu <dliu@iol.unh.edu>, "dts@dpdk.org" <dts@dpdk.org>
Cc: Owen Hilyard <ohilyard@iol.unh.edu>
Subject: Re: [dts] [PATCH] Strip prompt by default in send_expect
Date: Wed, 9 Jun 2021 07:22:30 +0000	[thread overview]
Message-ID: <88fd4d65d5044044b55e9d400c025410@intel.com> (raw)
In-Reply-To: <20210415140933.23185-1-dliu@iol.unh.edu>


> -----Original Message-----
> From: dliu <dliu@iol.unh.edu>
> Sent: 2021年4月15日 22:10
> To: dts@dpdk.org
> Cc: Tu, Lijuan <lijuan.tu@intel.com>; Owen Hilyard <ohilyard@iol.unh.edu>
> Subject: [PATCH] Strip prompt by default in send_expect
> 
> From: Owen Hilyard <ohilyard@iol.unh.edu>
> 
> During investigation of timeout exceptions during performance testing, the
> community lab found that trailing whitespace in run commands was the cause of
> some of the timeouts. This patch makes the Crb version of send_expect strip
> whitespace from the expected string by default. It is possible to disable this
> behavior should it be needed, but we expect that the majority of use-cases are
> matching non-whitespace characters.
> 
> Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>

Applied again.
Some impacted cases are fixed by http://patchwork.dpdk.org/project/dts/patch/20210603092151.1847-1-leweix.yang@intel.com/

> ---
>  framework/crb.py | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/crb.py b/framework/crb.py index e7c1cc1c..3964e213
> 100644
> --- a/framework/crb.py
> +++ b/framework/crb.py
> @@ -79,12 +79,19 @@ class Crb(object):
>              self.alt_session = None
> 
>      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> -                    alt_session=False, verify=False):
> +                    alt_session=False, verify=False, trim_whitespace=True):
>          """
>          Send commands to crb and return string before expected string. If
>          there's no expected string found before timeout, TimeoutException will
>          be raised.
> +
> +        By default, it will trim the whitespace from the expected string. This
> +        behavior can be turned off via the trim_whitespace argument.
>          """
> +
> +        if trim_whitespace:
> +            expected = expected.strip()
> +
>          # sometimes there will be no alt_session like VM dut
>          if alt_session and self.alt_session:
>              return self.alt_session.session.send_expect(cmds, expected,
> --
> 2.27.0


  parent reply	other threads:[~2021-06-09  7:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 14:09 dliu
2021-04-19 14:01 ` Owen Hilyard
2021-06-09  7:22 ` Tu, Lijuan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-15 14:03 dliu

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=88fd4d65d5044044b55e9d400c025410@intel.com \
    --to=lijuan.tu@intel.com \
    --cc=dliu@iol.unh.edu \
    --cc=dts@dpdk.org \
    --cc=ohilyard@iol.unh.edu \
    /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).