All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Luca Boccassi <bluca@debian.org>
Cc: netdev@vger.kernel.org, stephen@networkplumber.org, petr.vorel@gmail.com
Subject: Re: [PATCH iproute2 v2 4/4] testsuite: remove gre kmods if the test loads them
Date: Sun, 16 Dec 2018 21:21:18 +0100	[thread overview]
Message-ID: <20181216202117.GB6090@x230> (raw)
In-Reply-To: <20181216134727.8342-4-bluca@debian.org>

Hi Luca,

Reviewed-by: Petr Vorel <pvorel@suse.cz>
LGTM, but I'd suggest 2 small changes (see bellow).

> +++ b/testsuite/tests/ip/tunnel/add_tunnel.t

>  TUNNEL_NAME="tunnel_test_ip"
I'd put KMODS here:
KMODS="ip6_gre ip6_tunnel ip_gre ip_tunnel gre"

The reason is maintenance of this script - maybe one day there will be other
modules needed to be added, take this list as a configuration (which is usually
in shell scripts in the top).
BTW Maintenance was reason why I didn't like duplicity in modules you had in v1.

> +# unload kernel modules to remove dummy interfaces only if they were not in use beforehand
> +KMODS_REMOVE=
As a side effect, this could be lower case (showing it's not a configuration
variable, but just normal variable).

> +# note that checkbashism reports command -v, but dash supports it and it's POSIX 2008 compliant
> +if command -v lsmod >/dev/null 2>&1 && command -v rmmod >/dev/null 2>&1; then
> +    KMODS="ip6_gre ip6_tunnel ip_gre ip_tunnel gre"
> +    for i in $KMODS; do
> +        lsmod | grep -q "^$i" || KMODS_REMOVE="$KMODS_REMOVE $i";
> +    done
> +fi
> +
>  ts_log "[Testing add/del tunnels]"

>  ts_ip "$0" "Add GRE tunnel over IPv4" tunnel add name $TUNNEL_NAME mode gre local 1.1.1.1 remote 2.2.2.2
> @@ -12,3 +22,6 @@ ts_ip "$0" "Del GRE tunnel over IPv4" tunnel del $TUNNEL_NAME
>  ts_ip "$0" "Add GRE tunnel over IPv6" tunnel add name $TUNNEL_NAME mode ip6gre local dead:beef::1 remote dead:beef::2
>  ts_ip "$0" "Del GRE tunnel over IPv6" tunnel del $TUNNEL_NAME

> +for mod in $KMODS_REMOVE; do
> +    sudo rmmod "$mod"
> +done

Kind regards,
Petr

  reply	other threads:[~2018-12-16 20:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15 15:30 [PATCH iproute2 1/4] Makefile: have check target depend on all Luca Boccassi
2018-12-15 15:30 ` [PATCH iproute2 2/4] testsuite: declare dependency between $(TESTS) and generate_nlmsg Luca Boccassi
2018-12-15 16:22   ` Petr Vorel
2018-12-15 15:30 ` [PATCH iproute2 3/4] tests: delete dummy interface after default route test Luca Boccassi
2018-12-15 16:32   ` Petr Vorel
2018-12-16 13:52     ` Luca Boccassi
2018-12-15 15:33 ` [PATCH iproute2 4/4] testsuite: remove gre kmods if the test loads them Luca Boccassi
2018-12-15 17:37   ` Petr Vorel
2018-12-16 13:52     ` Luca Boccassi
2018-12-15 16:13 ` [PATCH iproute2 1/4] Makefile: have check target depend on all Petr Vorel
2018-12-16 13:47 ` [PATCH iproute2 v2 " Luca Boccassi
2018-12-16 13:47   ` [PATCH iproute2 v2 2/4] testsuite: declare dependency between $(TESTS) and generate_nlmsg Luca Boccassi
2018-12-16 13:47   ` [PATCH iproute2 v2 3/4] testsuite: delete dummy interface after default route test Luca Boccassi
2018-12-16 20:13     ` Petr Vorel
2018-12-16 13:47   ` [PATCH iproute2 v2 4/4] testsuite: remove gre kmods if the test loads them Luca Boccassi
2018-12-16 20:21     ` Petr Vorel [this message]
2018-12-16 20:57       ` Luca Boccassi
2018-12-16 20:55 ` [PATCH iproute2 v3 1/4] Makefile: have check target depend on all Luca Boccassi
2018-12-16 20:55   ` [PATCH iproute2 v3 2/4] testsuite: declare dependency between $(TESTS) and generate_nlmsg Luca Boccassi
2018-12-16 20:55   ` [PATCH iproute2 v3 3/4] testsuite: delete dummy interface after default route test Luca Boccassi
2018-12-16 20:55   ` [PATCH iproute2 v3 4/4] testsuite: remove gre kmods if the test loads them Luca Boccassi
2018-12-16 21:10     ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181216202117.GB6090@x230 \
    --to=pvorel@suse.cz \
    --cc=bluca@debian.org \
    --cc=netdev@vger.kernel.org \
    --cc=petr.vorel@gmail.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.