Thread (9 messages) flat view 9 messages, 3 authors, 8d ago

Re: [PATCH net v4 3/4] selftests: net: Test UDP length overflow with PMTU discover and big MTU

From: Alice Mikityanska <hidden>
Date: 2026-08-28 20:36:25

On Thu, Aug 27, 2026, at 22:28, Jakub Kicinski wrote:
On Wed, 26 Aug 2026 13:18:18 -0400 Willem de Bruijn wrote:
quoted
quoted
+def check_dmesg_clean(func: str) -> bool:
+    with subprocess.Popen(['dmesg'], stdout=subprocess.PIPE) as dmesg:
+        res = subprocess.run(['grep', '-q', f'WARNING:.*{func}'], stdin=dmesg.stdout, check=False)
+    return res.returncode != 0 and dmesg.returncode == 0
+
+
+@contextmanager  
Interesting approach. In ksft the built-in defer() mechanism may be
preferred. Not sure.
+1 small preference towards defer() if Alice is willing.
It's be more idiomatic for our selftests
No problem, I can switch to defer, thanks for the suggestion.
More importantly ruff check and pylink --disable=R have to be clean
for new tests. The test cases need a docstring explaining what they are
trying to test. The helpers can probably get a _ prefix to mark them
as private and silence the warning.
Got it, will do. I thought it was OK, because all tests I saw didn't
have docstrings.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help