[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240429075158.51b3f8d6@kernel.org>
Date: Mon, 29 Apr 2024 07:51:58 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next 6/6] selftests: drv-net-hw: add test for memory
allocation failures with page pool
On Sat, 27 Apr 2024 09:49:28 -0400 Willem de Bruijn wrote:
> Eventually probably want a more generic fault injection class.
>
> And for both fault injection and background traffic the with object
> construct to ensure cleanup in all cases.
>
> Maybe even the same for ethtool, as ip and ethtool config changes that
> need to be reverted to original state will be common.
Agreed, the nice way of wrapping all that has not revealed itself to me
yet. When we discussed it with Petr a while back he was suggesting
"with", and I was thinking of creating an object with test as the
parent. The with is nicer but here we'd end up doing:
with a():
# some code
with b():
# more code
with c():
# check traffic
which offends my sensibilities.
There are many options, hard to say which one is best without having
a bunch of tests to convert as a litmus test :S So I stuck to "finally"
Powered by blists - more mailing lists