Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	shuah@kernel.org, petrm@nvidia.com,
	linux-kselftest@vger.kernel.org, willemdebruijn.kernel@gmail.com,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 1/6] selftests: drv-net: add stdout to the command failed exception
Date: Mon, 15 Apr 2024 17:45:51 -0700	[thread overview]
Message-ID: <20240416004556.1618804-2-kuba@kernel.org> (raw)
In-Reply-To: <20240416004556.1618804-1-kuba@kernel.org>

ping prints all the info to stdout. To make debug easier capture
stdout in the Exception raised when command unexpectedly fails.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/net/lib/py/utils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py
index f0d425731fd4..19612348c30d 100644
--- a/tools/testing/selftests/net/lib/py/utils.py
+++ b/tools/testing/selftests/net/lib/py/utils.py
@@ -33,7 +33,8 @@ import subprocess
         if self.proc.returncode != 0 and fail:
             if len(stderr) > 0 and stderr[-1] == "\n":
                 stderr = stderr[:-1]
-            raise Exception("Command failed: %s\n%s" % (self.proc.args, stderr))
+            raise Exception("Command failed: %s\nSTDOUT: %s\nSTDERR: %s" %
+                            (self.proc.args, stdout, stderr))
 
 
 def ip(args, json=None, ns=None):
-- 
2.44.0


  reply	other threads:[~2024-04-16  0:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  0:45 [PATCH net-next v2 0/6] selftests: drv-net: support testing with a remote system Jakub Kicinski
2024-04-16  0:45 ` Jakub Kicinski [this message]
2024-04-16  0:45 ` [PATCH net-next v2 2/6] selftests: drv-net: add config for netdevsim Jakub Kicinski
2024-04-16  0:45 ` [PATCH net-next v2 3/6] selftests: drv-net: define endpoint structures Jakub Kicinski
2024-04-16  0:45 ` [PATCH net-next v2 4/6] selftests: drv-net: factor out parsing of the env Jakub Kicinski
2024-04-16  0:45 ` [PATCH net-next v2 5/6] selftests: drv-net: construct environment for running tests which require an endpoint Jakub Kicinski
2024-04-16  0:45 ` [PATCH net-next v2 6/6] selftests: drv-net: add a trivial ping test Jakub Kicinski
2024-04-16 15:07 ` [PATCH net-next v2 0/6] selftests: drv-net: support testing with a remote system Willem de Bruijn
2024-04-16 23:58   ` Jakub Kicinski
2024-04-17  2:00 ` patchwork-bot+netdevbpf

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=20240416004556.1618804-2-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=shuah@kernel.org \
    --cc=willemdebruijn.kernel@gmail.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