tests/qemu: pass MS_PROTO to gtp-tunnel delete
The MS protocol needs to be passed to gtp-tunnel delete, instead of the
SGSN_GGSN_PROTO.
Fix for:
+ gtp-tunnel add gtp_sgsn v1 200 100 172.99.0.1 fd00::2
…
+ gtp-tunnel delete gtp_sgsn v1 200 ip6
genl_socket_talk: No such file or directory
Change-Id: Ib6b011520fe41855b87ed0e2f6f8a6af3d0b2400
diff --git a/tests/qemu/00_test_functions.sh b/tests/qemu/00_test_functions.sh
index c4813ab..5839363 100644
--- a/tests/qemu/00_test_functions.sh
+++ b/tests/qemu/00_test_functions.sh
@@ -8,6 +8,7 @@
# MS - SGSN -gtp- GGSN - WEBSERVER
tunnel_start() {
+ test -n "$MS_PROTO"
test -n "$MS"
test -n "$MS_PREFLEN"
test -n "$SGSN_GGSN_PROTO"
@@ -67,9 +68,9 @@
ip link del veth_sgsn
ip route del "$WEBSERVER"/"$MS_PREFLEN" dev gtp_sgsn
- gtp-tunnel delete gtp_sgsn v1 200 "$SGSN_GGSN_PROTO"
+ gtp-tunnel delete gtp_sgsn v1 200 "$MS_PROTO"
gtp-link del gtp_sgsn
- ggsn_side gtp-tunnel delete gtp_ggsn v1 100 "$SGSN_GGSN_PROTO"
+ ggsn_side gtp-tunnel delete gtp_ggsn v1 100 "$MS_PROTO"
ggsn_side gtp-link del gtp_ggsn
ip netns del ggsn_side
}
diff --git a/tests/qemu/01_ms_ip4_sgsn_ip4.sh b/tests/qemu/01_ms_ip4_sgsn_ip4.sh
index 42e2842..4789483 100644
--- a/tests/qemu/01_ms_ip4_sgsn_ip4.sh
+++ b/tests/qemu/01_ms_ip4_sgsn_ip4.sh
@@ -1,6 +1,7 @@
#!/bin/sh -ex
. /tests/00_test_functions.sh
+MS_PROTO="ip"
MS="172.99.0.1"
MS_PREFLEN="32"
SGSN_GGSN_PROTO="ip"
diff --git a/tests/qemu/02_ms_ip4_sgsn_ip6.sh b/tests/qemu/02_ms_ip4_sgsn_ip6.sh
index b5858ab..2a489cd 100644
--- a/tests/qemu/02_ms_ip4_sgsn_ip6.sh
+++ b/tests/qemu/02_ms_ip4_sgsn_ip6.sh
@@ -1,6 +1,7 @@
#!/bin/sh -ex
. /tests/00_test_functions.sh
+MS_PROTO="ip"
MS="172.99.0.1"
MS_PREFLEN="32"
SGSN_GGSN_PROTO="ip6"
diff --git a/tests/qemu/03_ms_ip6_sgsn_ip4.sh b/tests/qemu/03_ms_ip6_sgsn_ip4.sh
index 12793b0..f873faf 100644
--- a/tests/qemu/03_ms_ip6_sgsn_ip4.sh
+++ b/tests/qemu/03_ms_ip6_sgsn_ip4.sh
@@ -1,6 +1,7 @@
#!/bin/sh -ex
. /tests/00_test_functions.sh
+MS_PROTO="ip6"
MS="fd00::"
MS_PREFLEN="64"
SGSN_GGSN_PROTO="ip"
diff --git a/tests/qemu/04_ms_ip6_sgsn_ip6.sh b/tests/qemu/04_ms_ip6_sgsn_ip6.sh
index 6c2f13f..483a9d7 100644
--- a/tests/qemu/04_ms_ip6_sgsn_ip6.sh
+++ b/tests/qemu/04_ms_ip6_sgsn_ip6.sh
@@ -1,6 +1,7 @@
#!/bin/sh -ex
. /tests/00_test_functions.sh
+MS_PROTO="ip6"
MS="fc00::"
MS_PREFLEN="64"
SGSN_GGSN_PROTO="ip6"