<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/drivers/net/lib/py/env.py, branch linux-6.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-01-09T03:36:46Z</updated>
<entry>
<title>selftests: drv-net: test drivers sleeping in ndo_get_stats64</title>
<updated>2025-01-09T03:36:46Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2025-01-07T02:29:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31eae6d995870211348345521e4865c2816478f5'/>
<id>urn:sha1:31eae6d995870211348345521e4865c2816478f5</id>
<content type='text'>
Most of our tests use rtnetlink to read device stats, so they
don't expose the drivers much to paths in which device stats
are read under RCU. Add tests which hammer profcs reads to
make sure drivers:
 - don't sleep while reporting stats,
 - can handle parallel reads,
 - can handle device going down while reading.

Set ifname on the env class in NetDrvEnv, we already do that
in NetDrvEpEnv.

  KTAP version 1
  1..7
  ok 1 stats.check_pause
  ok 2 stats.check_fec
  ok 3 stats.pkt_byte_sum
  ok 4 stats.qstat_by_ifindex
  ok 5 stats.check_down
  ok 6 stats.procfs_hammer
  # completed up/down cycles: 6
  ok 7 stats.procfs_downup_hammer
  # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0

Reviewed-by: Petr Machata &lt;petrm@nvidia.com&gt;
Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://patch.msgid.link/20250107022932.2087744-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net: assume stats refresh is 0 if no ethtool -c support</title>
<updated>2024-12-23T18:12:20Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-12-20T00:31:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f288c7a1ba268a9ed58a7971142a98a1e41a3c73'/>
<id>urn:sha1:f288c7a1ba268a9ed58a7971142a98a1e41a3c73</id>
<content type='text'>
Tests using HW stats wait for them to stabilize, using data from
ethtool -c as the delay. Not all drivers implement ethtool -c
so handle the errors gracefully.

Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://patch.msgid.link/20241220003116.1458863-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: net: ksft: support marking tests as disruptive</title>
<updated>2024-08-02T23:09:27Z</updated>
<author>
<name>Stanislav Fomichev</name>
</author>
<published>2024-08-02T00:03:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f879306834818ebd1722a4372079610cdd466fec'/>
<id>urn:sha1:f879306834818ebd1722a4372079610cdd466fec</id>
<content type='text'>
Add new @ksft_disruptive decorator to mark the tests that might
be disruptive to the system. Depending on how well the previous
test works in the CI we might want to disable disruptive tests
by default and only let the developers run them manually.

KSFT framework runs disruptive tests by default. DISRUPTIVE=False
environment (or config file) can be used to disable these tests.
ksft_setup should be called by the test cases that want to use
new decorator (ksft_setup is only called via NetDrvEnv/NetDrvEpEnv for now).

In the future we can add similar decorators to, for example, avoid
running slow tests all the time. And/or have some option to run
only 'fast' tests for some sort of smoke test scenario.

  $ DISRUPTIVE=False ./stats.py
  KTAP version 1
  1..5
  ok 1 stats.check_pause
  ok 2 stats.check_fec
  ok 3 stats.pkt_byte_sum
  ok 4 stats.qstat_by_ifindex
  ok 5 stats.check_down # SKIP marked as disruptive
  # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:1 error:0

v3:
- parse yes and properly treat non-zero nums as true (Petr)

v2:
- convert from cli argument to env variable (Jakub)

Signed-off-by: Stanislav Fomichev &lt;sdf@fomichev.me&gt;
Link: https://patch.msgid.link/20240802000309.2368-2-sdf@fomichev.me
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net: add helper to wait for HW stats to sync</title>
<updated>2024-06-27T02:06:03Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-06-26T01:24:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af8e51644a70f612974a6e767fa7d896d3c23f88'/>
<id>urn:sha1:af8e51644a70f612974a6e767fa7d896d3c23f88</id>
<content type='text'>
Some devices DMA stats to the host periodically. Add a helper
which can wait for that to happen, based on frequency reported
by the driver in ethtool.

Reviewed-by: Petr Machata &lt;petrm@nvidia.com&gt;
Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://patch.msgid.link/20240626012456.2326192-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: selftest: add test for netdev netlink queue-get API</title>
<updated>2024-05-09T01:59:47Z</updated>
<author>
<name>David Wei</name>
</author>
<published>2024-05-07T16:32:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1cf2704242180351d156fb48c334b319ae6b0759'/>
<id>urn:sha1:1cf2704242180351d156fb48c334b319ae6b0759</id>
<content type='text'>
Add a selftest for netdev generic netlink. For now there is only a
single test that exercises the `queue-get` API.

The test works with netdevsim by default or with a real device by
setting NETIF.

Add a timeout param to cmd() since ethtool -L can take a long time on
real devices.

Signed-off-by: David Wei &lt;dw@davidwei.uk&gt;
Link: https://lore.kernel.org/r/20240507163228.2066817-3-dw@davidwei.uk
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net-hw: support using Python from net hw tests</title>
<updated>2024-04-30T15:15:31Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-04-29T14:44:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff4b2bfa63bd07cca35f6e704dc5035650595950'/>
<id>urn:sha1:ff4b2bfa63bd07cca35f6e704dc5035650595950</id>
<content type='text'>
We created a separate directory for HW-only tests, recently.
Glue in the Python test library there, Python is a bit annoying
when it comes to using library code located "lower"
in the directory structure.

Reuse the Env class, but let tests require non-nsim setup.

Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://lore.kernel.org/r/20240429144426.743476-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net: validate the environment</title>
<updated>2024-04-26T23:10:26Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-04-25T22:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=340ab206ce5c673aab23d0197d3a0e2bccb86d74'/>
<id>urn:sha1:340ab206ce5c673aab23d0197d3a0e2bccb86d74</id>
<content type='text'>
Throw a slightly more helpful exception when env variables
are partially populated. Prior to this change we'd get
a dictionary key exception somewhere later on.

Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://lore.kernel.org/r/20240425222341.309778-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net: reimplement the config parser</title>
<updated>2024-04-26T23:10:26Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-04-25T22:23:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64ed7d8190611c96744fd2b89afe6aeb3054902b'/>
<id>urn:sha1:64ed7d8190611c96744fd2b89afe6aeb3054902b</id>
<content type='text'>
The shell lexer is not helping much, do very basic parsing
manually.

Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://lore.kernel.org/r/20240425222341.309778-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net: add require_XYZ() helpers for validating env</title>
<updated>2024-04-23T17:13:56Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-04-20T02:52:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1e68a1a4a404e739f93b4e48344f9101b581771'/>
<id>urn:sha1:f1e68a1a4a404e739f93b4e48344f9101b581771</id>
<content type='text'>
Wrap typical checks like whether given command used by the test
is available in helpers.

Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://lore.kernel.org/r/20240420025237.3309296-8-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: drv-net: add a TCP ping test case (and useful helpers)</title>
<updated>2024-04-23T17:13:56Z</updated>
<author>
<name>Jakub Kicinski</name>
</author>
<published>2024-04-20T02:52:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31611cea8f0f45f0b803b010be47a37792ba58a8'/>
<id>urn:sha1:31611cea8f0f45f0b803b010be47a37792ba58a8</id>
<content type='text'>
More complex tests often have to spawn a background process,
like a server which will respond to requests or tcpdump.

Add support for creating such processes using the with keyword:

  with bkg("my-daemon", ..):
     # my-daemon is alive in this block

My initial thought was to add this support to cmd() directly
but it runs the command in the constructor, so by the time
we __enter__ it's too late to make sure we used "background=True".

Second useful helper transplanted from net_helper.sh is
wait_port_listen().

The test itself uses socat, which insists on v6 addresses
being wrapped in [], it's not the only command which requires
this format, so add the wrapped address to env. The hope
is to save test code from checking if address is v6.

Reviewed-by: Willem de Bruijn &lt;willemb@google.com&gt;
Link: https://lore.kernel.org/r/20240420025237.3309296-7-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
