Re: [PATCH v2] sefltests: net: Add on/off checks for network interface non fixed features

From: Abhinav Jain
Date: Fri Jun 14 2024 - 07:37:08 EST


On Thu, 13 Jun 2024 18:49:38 -0700, Jakub Kicinski wrote:
> You do off then on, so you assume the feature was on to begin with.
> Not all features will be on. You gotta change the order based on
> the initial state so that the feature goes back to what it was.

Thanks for sharing feedback, I have sent a patch v3 addressing this.
I save the initial state of the feature and set it back after I toggle it.

> Because I'm guessing the VM does not have any interface to test.
>
> Before we extend the test could you please make the test automatically
> add a veth or netdevsim device if there is no testable device on the
> system? Make sure you remove it before exiting.
>
> You can look at tests in tools/testing/selftests/drivers/net/netdevsim
> for inspiration and library scripts which can be reused.

I did the same, I have added a veth pair in case if the network device
in the positional argument is not there. If it's there and just a bad
device name though, I am printing an error. Let me know if I should use
the veth pair in those cases as well for testing.

I have sent patch v3 here, please review:
https://lore.kernel.org/all/20240614113240.41550-1-jain.abhinav177@xxxxxxxxx/

-Abhinav