[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250117131154.0f3d2057@kernel.org>
Date: Fri, 17 Jan 2025 13:11:54 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Peter Seiderer <ps.report@....net>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon
Horman <horms@...nel.org>, Shuah Khan <shuah@...nel.org>, Toke
Høiland-Jørgensen <toke@...hat.com>, Frederic
Weisbecker <frederic@...nel.org>, Artem Chernyshev
<artem.chernyshev@...-soft.ru>, Nam Cao <namcao@...utronix.de>
Subject: Re: [PATCH net-next v1 5/5] selftest: net: add proc_net_pktgen
On Fri, 17 Jan 2025 15:16:13 +0100 Peter Seiderer wrote:
> +FIXTURE_SETUP(proc_net_pktgen) {
> + ssize_t len;
> +
> + self->ctrl_fd = open("/proc/net/pktgen/kpktgend_0", O_RDWR);
> + ASSERT_GE(self->ctrl_fd, 0) TH_LOG("CONFIG_NET_PKTGEN not enabled, module pktgen nod loaded?");
nod -> not?
Please take a look at the instructions here:
https://github.com/linux-netdev/nipa/wiki/How-to-run-netdev-selftests-CI-style
the test currently fails in our CI, you need to add it to
tools/testing/selftests/net/config, and perhaps try to call
modprobe in the test?
> + len = write(self->ctrl_fd, add_loopback_0, sizeof(add_loopback_0));
> + ASSERT_EQ(len, sizeof(add_loopback_0)) TH_LOG("device lo@0 already registered?");
FWIW we prefer to stick to 80 char line width in networking,
but it's not a big deal for a test, up to you.
> + // complete command string without/with trailing '\0'
> + EXPECT_EQ(len, i);
Run this patch thru checkpatch, please. This looks misaligned.
> + }
> + }
> +}
> +#if 0 // needs CONFIG_XFRM
Add it to the config, too, then?
> +TEST_F(proc_net_pktgen, device_command_spi) {
> + ssize_t len;
> +
> + len = write(self->device_fd, device_command_spi_0, sizeof(device_command_spi_0));
> + EXPECT_EQ(len, sizeof(device_command_spi_0));
> +}
> +#endif
Thanks for working on a test!
Powered by blists - more mailing lists