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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/sctp/test | 8 ++++++++
 1 file changed, 8 insertions(+)

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;
-- 
2.26.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux