diff mbox series

[2/2] tests/sctp: set up a GRE tunnel to activate ASCONF tests

Message ID 20201021214453.400811-3-omosnace@redhat.com (mailing list archive)
State Accepted
Delegated to: Ondrej Mosnáček
Headers show
Series Fix ASCONF test and ensure it can be always run | expand

Commit Message

Ondrej Mosnacek Oct. 21, 2020, 9:44 p.m. UTC
Currently, the ASCONF tests will activate only if the test system has
two global IPv4 addresses, otherwise they are just skipped. Most
systems, including the VM in CI, don't fulfill this condition.

As it turns out, this second IPv4 address can be set up very easily by
creating a GRE trunnel interface over loopback. So make the SCTP test
create such interface so that the ASCONF tests can be always run.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 tests/sctp/test | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Richard Haines Oct. 22, 2020, 2:11 p.m. UTC | #1
On Wed, 2020-10-21 at 23:44 +0200, Ondrej Mosnacek wrote:
> Currently, the ASCONF tests will activate only if the test system has
> two global IPv4 addresses, otherwise they are just skipped. Most
> systems, including the VM in CI, don't fulfill this condition.
> 
> As it turns out, this second IPv4 address can be set up very easily
> by
> creating a GRE trunnel interface over loopback. So make the SCTP test
> create such interface so that the ASCONF tests can be always run.
> 
> Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
> ---
>  tests/sctp/test | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

Acked-by: Richard Haines <richard_c_haines@btinternet.com>

> diff --git a/tests/sctp/test b/tests/sctp/test
> index eede42f..1170921 100755
> --- a/tests/sctp/test
> +++ b/tests/sctp/test
> @@ -35,6 +35,12 @@ BEGIN {
>      else {
>          $test_count = 75;
>  
> +        # Set up a GRE tunnel over loopback to ensure we have enough
> addresses
> +        # for the ASCONF tests.
> +        system "ip link add mygre type gretap local 127.0.0.1 remote
> 127.0.0.1";
> +        system "ip addr add 10.123.123.123 dev mygre";
> +        system "ip link set mygre up";
> +
>          # asconf parameter tests require two local non-loopback
> addresses.
>          $ipaddress_list = `ip -o addr show up scope global`;
>          $test_asconf    = 0;
> @@ -909,4 +915,6 @@ if ($test_nft) {
>      system "nft -f $basedir/nftables-flush";
>  }
>  
> +system "ip link del mygre";
> +
>  exit;
Ondrej Mosnacek Oct. 23, 2020, 2:55 p.m. UTC | #2
On Thu, Oct 22, 2020 at 4:11 PM Richard Haines
<richard_c_haines@btinternet.com> wrote:
> On Wed, 2020-10-21 at 23:44 +0200, Ondrej Mosnacek wrote:
> > Currently, the ASCONF tests will activate only if the test system has
> > two global IPv4 addresses, otherwise they are just skipped. Most
> > systems, including the VM in CI, don't fulfill this condition.
> >
> > As it turns out, this second IPv4 address can be set up very easily
> > by
> > creating a GRE trunnel interface over loopback. So make the SCTP test
> > create such interface so that the ASCONF tests can be always run.
> >
> > Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
> > ---
> >  tests/sctp/test | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
>
> Acked-by: Richard Haines <richard_c_haines@btinternet.com>

Thanks! I applied both patches now.

>
> > diff --git a/tests/sctp/test b/tests/sctp/test
> > index eede42f..1170921 100755
> > --- a/tests/sctp/test
> > +++ b/tests/sctp/test
> > @@ -35,6 +35,12 @@ BEGIN {
> >      else {
> >          $test_count = 75;
> >
> > +        # Set up a GRE tunnel over loopback to ensure we have enough
> > addresses
> > +        # for the ASCONF tests.
> > +        system "ip link add mygre type gretap local 127.0.0.1 remote
> > 127.0.0.1";
> > +        system "ip addr add 10.123.123.123 dev mygre";
> > +        system "ip link set mygre up";
> > +
> >          # asconf parameter tests require two local non-loopback
> > addresses.
> >          $ipaddress_list = `ip -o addr show up scope global`;
> >          $test_asconf    = 0;
> > @@ -909,4 +915,6 @@ if ($test_nft) {
> >      system "nft -f $basedir/nftables-flush";
> >  }
> >
> > +system "ip link del mygre";
> > +
> >  exit;
>
diff mbox series

Patch

diff --git a/tests/sctp/test b/tests/sctp/test
index eede42f..1170921 100755
--- a/tests/sctp/test
+++ b/tests/sctp/test
@@ -35,6 +35,12 @@  BEGIN {
     else {
         $test_count = 75;
 
+        # Set up a GRE tunnel over loopback to ensure we have enough addresses
+        # for the ASCONF tests.
+        system "ip link add mygre type gretap local 127.0.0.1 remote 127.0.0.1";
+        system "ip addr add 10.123.123.123 dev mygre";
+        system "ip link set mygre up";
+
         # asconf parameter tests require two local non-loopback addresses.
         $ipaddress_list = `ip -o addr show up scope global`;
         $test_asconf    = 0;
@@ -909,4 +915,6 @@  if ($test_nft) {
     system "nft -f $basedir/nftables-flush";
 }
 
+system "ip link del mygre";
+
 exit;