test suite reviews and discussions
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: dts@dpdk.org, Akihiko Odaki <akihiko.odaki@daynix.com>
Subject: [PATCH 6/7] framework/packet: Fix tcpdump help parse
Date: Fri, 14 Apr 2023 21:52:54 +0900	[thread overview]
Message-ID: <20230414125255.67812-7-akihiko.odaki@daynix.com> (raw)
In-Reply-To: <20230414125255.67812-1-akihiko.odaki@daynix.com>

tcpdump version 4.99.3 puts several options in one line as follows:
> $ tcpdump --help
> tcpdump version 4.99.3
> libpcap version 1.10.3 (with TPACKET_V3)
> OpenSSL 3.0.5 5 Jul 2022
> Usage: tcpdump [-AbdDefhHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [--count]
>		[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
> 		[ -i interface ] [ --immediate-mode ] [ -j tstamptype ]
> 		[ -M secret ] [ --number ] [ --print ] [ -Q in|out|inout ]
> 		[ -r file ] [ -s snaplen ] [ -T type ] [ --version ]
> 		[ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ]
> 		[ --time-stamp-precision precision ] [ --micro ] [ --nano ]
> 		[ -z postrotate-command ] [ -Z user ] [ expression ]

This change allows to match a substring representing an option.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 framework/packet.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/packet.py b/framework/packet.py
index f56bf178..9603ec7b 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -1099,7 +1099,7 @@ def start_tcpdump(crb, intf, count=0, filters=None, lldp_forbid=True):
     tcpdump_help = tcpdump_session.send_command("tcpdump -h")
 
     for line in tcpdump_help.split("\n"):
-        m = re.match(direct_param, line)
+        m = re.search(direct_param, line)
         if m:
             opt = re.search("-Q", m.group(2))
             if opt:
-- 
2.40.0


  parent reply	other threads:[~2023-04-14 12:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
2023-04-14 12:52 ` [PATCH 1/7] Replace Pcapy with Pcapyplus Akihiko Odaki
2023-04-14 12:52 ` [PATCH 2/7] Update numpy from 1.18.5 to 1.24.2 Akihiko Odaki
2023-04-14 12:52 ` [PATCH 3/7] framework/ssh_pexpect: Remove duplicate regex flags Akihiko Odaki
2023-04-14 12:52 ` [PATCH 4/7] framework: Remove unused variable Akihiko Odaki
2023-04-14 12:52 ` [PATCH 5/7] nics/system_info: Accept memory with unknown speed Akihiko Odaki
2023-04-14 12:52 ` Akihiko Odaki [this message]
2023-04-14 12:52 ` [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods Akihiko Odaki
2023-05-25  2:52   ` lijuan.tu
2023-05-06  7:27 ` [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki

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=20230414125255.67812-7-akihiko.odaki@daynix.com \
    --to=akihiko.odaki@daynix.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).