From: Allison Henderson <achender@kernel.org>
To: netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com,
kuba@kernel.org, horms@kernel.org, linux-rdma@vger.kernel.org,
achender@kernel.org, linux-kselftest@vger.kernel.org,
shuah@kernel.org
Subject: [PATCH net-next v2 3/7] selftests: rds: Fix more pylint errors
Date: Tue, 28 Apr 2026 15:27:12 -0700 [thread overview]
Message-ID: <20260428222716.2960871-4-achender@kernel.org> (raw)
In-Reply-To: <20260428222716.2960871-1-achender@kernel.org>
This patch fixes a few pylint errors in test.py. Remove unused exception
variables from except blocks, and disable warnings for imports that cannot
appear at the start of the module. Also disable warnings for the
tcpdump processes. The suggestion to use a with block does not apply
here since the process needs to outlive the parent to collect the dumps.
Lastly add the module docstring at the top of the module.
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/test.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/rds/test.py b/tools/testing/selftests/net/rds/test.py
index 93e23e8b256c..4b6ffbb3a81c 100755
--- a/tools/testing/selftests/net/rds/test.py
+++ b/tools/testing/selftests/net/rds/test.py
@@ -1,5 +1,8 @@
#! /usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+"""
+This module provides functional testing for the net/rds component.
+"""
import argparse
import ctypes
@@ -17,7 +20,8 @@ import shutil
# Allow utils module to be imported from different directory
this_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(this_dir, "../"))
-from lib.py.utils import ip
+# pylint: disable-next=wrong-import-position,import-error,no-name-in-module
+from lib.py.utils import ip # noqa: E402
libc = ctypes.cdll.LoadLibrary('libc.so.6')
setns = libc.setns
@@ -129,6 +133,7 @@ tcpdump_procs = []
for net in [NET0, NET1]:
pcap = logdir+'/'+net+'.pcap'
fd, pcap_tmp = tempfile.mkstemp(suffix=".pcap", prefix=f"{net}-", dir="/tmp")
+ # pylint: disable-next=consider-using-with
p = subprocess.Popen(
['ip', 'netns', 'exec', net,
'/usr/sbin/tcpdump', '-i', 'any', '-w', pcap_tmp])
@@ -192,7 +197,7 @@ while nr_send < NUM_PACKETS:
send_hashes.setdefault((sender.fileno(), receiver.fileno()),
hashlib.sha256()).update(f'<{send_data}>'.encode('utf-8'))
nr_send = nr_send + 1
- except BlockingIOError as e:
+ except BlockingIOError:
break
except OSError as e:
if e.errno in [errno.ENOBUFS, errno.ECONNRESET, errno.EPIPE]:
@@ -214,7 +219,7 @@ while nr_send < NUM_PACKETS:
receiver.fileno()), hashlib.sha256()).update(
f'<{recv_data}>'.encode('utf-8'))
nr_recv = nr_recv + 1
- except BlockingIOError as e:
+ except BlockingIOError:
break
# exercise net/rds/tcp.c:rds_tcp_sysctl_reset()
--
2.25.1
next prev parent reply other threads:[~2026-04-28 22:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 22:27 [PATCH net-next v2 0/7] selftests: rds: Log collection, TAP compliance and cleanups Allison Henderson
2026-04-28 22:27 ` [PATCH net-next v2 1/7] selftests: rds: Increase selftest timeout Allison Henderson
2026-04-28 22:27 ` [PATCH net-next v2 2/7] selftests: rds: Update USAGE string for run.sh Allison Henderson
2026-04-28 22:27 ` Allison Henderson [this message]
2026-04-28 22:27 ` [PATCH net-next v2 4/7] selftests: rds: Add timeout flag to run.sh Allison Henderson
2026-04-28 22:27 ` [PATCH net-next v2 5/7] selftests: rds: Fix gcov and pcap collection Allison Henderson
2026-04-30 2:42 ` Jakub Kicinski
2026-04-30 2:48 ` Jakub Kicinski
2026-05-02 5:43 ` Allison Henderson
2026-05-02 16:38 ` Jakub Kicinski
2026-05-03 20:49 ` Allison Henderson
2026-04-28 22:27 ` [PATCH net-next v2 6/7] selftests: rds: Collect pcaps on timeout Allison Henderson
2026-04-30 2:42 ` Jakub Kicinski
2026-05-02 5:41 ` Allison Henderson
2026-04-28 22:27 ` [PATCH net-next v2 7/7] selftests: rds: Make rds selftests TAP compliant Allison Henderson
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=20260428222716.2960871-4-achender@kernel.org \
--to=achender@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.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