netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next mlxsw 0/3] selftests: forwarding: Updates to sysctl handling
@ 2018-05-03 10:36 Petr Machata
  2018-05-03 10:36 ` [PATCH net-next mlxsw 1/3] selftests: forwarding: lib: Add sysctl_set(), sysctl_restore() Petr Machata
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Petr Machata @ 2018-05-03 10:36 UTC (permalink / raw)
  To: netdev, linux-kselftest; +Cc: davem, shuah

Some selftests need to adjust sysctl settings. In order to be neutral to
the system that the test is run on, it is a good practice to change back
to the original setting after the test ends. That involves some
boilerplate that can be abstracted away.

In patch #1, introduce two functions, sysctl_set() and sysctl_restore().
The former stores the current value of a given setting, and sets a new
value. The latter restores the setting to the previously-stored value.

In patch #2, use these wrappers in a number of tests.

Additionally in patch #3, fix a problem in mirror_gre_nh.sh, which
neglected to set a sysctl that's crucial for the test to work.

Petr Machata (3):
  selftests: forwarding: lib: Add sysctl_set(), sysctl_restore()
  selftests: forwarding: Use sysctl_set(), sysctl_restore()
  selftests: forwarding: mirror_gre_nh: Unset RP filter

 tools/testing/selftests/net/forwarding/lib.sh      | 28 ++++++++++++++++------
 .../selftests/net/forwarding/mirror_gre_changes.sh |  7 ++----
 .../selftests/net/forwarding/mirror_gre_nh.sh      |  6 +++++
 .../selftests/net/forwarding/router_multipath.sh   | 12 ++++------
 4 files changed, 33 insertions(+), 20 deletions(-)

-- 
2.4.11

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-03 17:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-03 10:36 [PATCH net-next mlxsw 0/3] selftests: forwarding: Updates to sysctl handling Petr Machata
2018-05-03 10:36 ` [PATCH net-next mlxsw 1/3] selftests: forwarding: lib: Add sysctl_set(), sysctl_restore() Petr Machata
2018-05-03 10:37 ` [PATCH net-next mlxsw 2/3] selftests: forwarding: Use " Petr Machata
2018-05-03 10:37 ` [PATCH net-next mlxsw 3/3] selftests: forwarding: mirror_gre_nh: Unset RP filter Petr Machata
2018-05-03 17:37 ` [PATCH net-next mlxsw 0/3] selftests: forwarding: Updates to sysctl handling David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).