Re: [PATCH nf-next 01/19] selftest: netfilter: use /proc for pid checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, May 3, 2023 at 9:47 PM Florian Westphal <fw@xxxxxxxxx> wrote:
>
> Boris Sukholitko <boris.sukholitko@xxxxxxxxxxxx> wrote:
> > Some ps commands (e.g. busybox derived) have no -p option. Use /proc for
> > pid existence check.
> >
> > Signed-off-by: Boris Sukholitko <boris.sukholitko@xxxxxxxxxxxx>
> > ---
> >  tools/testing/selftests/netfilter/nft_flowtable.sh | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh
> > index 7060bae04ec8..4d8bc51b7a7b 100755
> > --- a/tools/testing/selftests/netfilter/nft_flowtable.sh
> > +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh
> > @@ -288,11 +288,11 @@ test_tcp_forwarding_ip()
> >
> >       sleep 3
> >
> > -     if ps -p $lpid > /dev/null;then
> > +     if test -d /proc/"$lpid"/; then
> >               kill $lpid
>
> I'd shorten both to
>
> kill $lpid 2>/dev/null

I don't like the kill here because it may fail silently should we run
with "set -e" in the future.

I took the liberty to leave the test as is in v2.

Thanks,
Boris.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux