]> git.proxmox.com Git - mirror_iproute2.git/commit
testsuite: remove gre kmods if the test loads them
authorLuca Boccassi <bluca@debian.org>
Sun, 16 Dec 2018 20:55:40 +0000 (20:55 +0000)
committerStephen Hemminger <sthemmin@microsoft.com>
Tue, 18 Dec 2018 17:58:10 +0000 (09:58 -0800)
commit85bcb524a2e38940a18fb934fd1e8d37c6496074
treee00fad06679e99f3b75e242430509dd5f3270197
parenteaed928b649d83ebc26849b8f144978d15284da4
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>
testsuite/tests/ip/tunnel/add_tunnel.t