iproute2/testsuite
Luca Boccassi 85bcb524a2 testsuite: remove gre kmods if the test loads them
The tunnel test leaves behind link devices created by the GRE kernel
modules:

$ ip -br link
...
gre0@NONE    DOWN 0.0.0.0 <NOARP>
gretap0@NONE DOWN 00:00:00:00:00:00 <BROADCAST,MULTICAST>
erspan0@NONE DOWN 00:00:00:00:00:00 <BROADCAST,MULTICAST>
ip6tnl0@NONE DOWN :: <NOARP>
ip6gre0@NONE DOWN 00:00:00:00:

$ lsmod | grep gre
ip6_gre      40960  0
ip6_tunnel   40960  1 ip6_gre
ip_gre       32768  0
ip_tunnel    24576  1 ip_gre
gre          16384  2 ip6_gre,ip_gre

Check beforehand if the gre kernel module is loaded, and if not unload
them all at the end of the test. This should avoid causing problems if
a user is already using GRE for other purposes.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Tested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2018-12-18 09:58:10 -08:00
..
iproute2 SPDX license identifiers 2017-11-24 12:21:35 -08:00
lib testsuite: Prepare for ss tests 2018-08-15 14:25:18 -07:00
tests testsuite: remove gre kmods if the test loads them 2018-12-18 09:58:10 -08:00
tools testsuite: correctly use CC macros for generate_nlmsg 2018-11-09 08:58:55 -08:00
Makefile testsuite: declare dependency between $(TESTS) and generate_nlmsg 2018-12-18 09:58:10 -08:00