osmith has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/36392?usp=email )
Change subject: ttcn3-ggsn-test: run with multiple configurations ......................................................................
ttcn3-ggsn-test: run with multiple configurations
The kernel ttcn3-ggsn-tests have been failing since the osmo-ggsn config for kernel-gtp has been adjusted for v4v6 instead of v4 only.
This new configuration caused a regression with: * linux kernel without Pablo's GTP IPv6 patches * latest stable release of osmo-ggsn, which does not support IPv6
As the kernel patches aren't merged yet, this caused all tests to fail.
Avoid this by running the ttcn3-ggsn-test with multiple configurations: * v4_only: one APN with v4 * v6_only: one APN with v6 * v4v6_only: one APN with v4v6 * all: multiple APNs with all of the above
With this change, the tests running in the v4_only configuration will pass again with the stable versions of osmo-ggsn, libgtpnl and kernel. And with new versions, most test in the other configurations will pass too.
As discussed with Harald, this does not only split up the configuration for osmo-ggsn with kernel gtp-u, but also with the userspace implementation. The "all" config currently only works with the userspace gtp implementation (OS#6106).
Related: OS#6096 Depends: osmo-ttcn3-hacks I6d94a8b18200fbb2119406827b74b83e912e3ecc Fixes: e24442f9 ("ttcn3-ggsn-test: kernel-gtp: add ipv6") Change-Id: Ia2fe0c3ed4ccf06e72fd258d085e4a79cecd5f26 --- M ttcn3-ggsn-test/Dockerfile M ttcn3-ggsn-test/jenkins.sh C ttcn3-ggsn-test/osmo-ggsn-kernel/v4_only/osmo-ggsn.cfg R ttcn3-ggsn-test/osmo-ggsn-kernel/v4v6_only/osmo-ggsn.cfg C ttcn3-ggsn-test/osmo-ggsn-kernel/v6_only/osmo-ggsn.cfg R ttcn3-ggsn-test/osmo-ggsn/all/osmo-ggsn.cfg C ttcn3-ggsn-test/osmo-ggsn/v4_only/osmo-ggsn.cfg C ttcn3-ggsn-test/osmo-ggsn/v4v6_only/osmo-ggsn.cfg A ttcn3-ggsn-test/osmo-ggsn/v6_only/osmo-ggsn.cfg R ttcn3-ggsn-test/ttcn3/all/GGSN_Tests.cfg C ttcn3-ggsn-test/ttcn3/v4_only/GGSN_Tests.cfg C ttcn3-ggsn-test/ttcn3/v4v6_only/GGSN_Tests.cfg C ttcn3-ggsn-test/ttcn3/v6_only/GGSN_Tests.cfg 13 files changed, 170 insertions(+), 71 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved
diff --git a/ttcn3-ggsn-test/Dockerfile b/ttcn3-ggsn-test/Dockerfile index 137a4cd..e1da704 100644 --- a/ttcn3-ggsn-test/Dockerfile +++ b/ttcn3-ggsn-test/Dockerfile @@ -8,6 +8,6 @@
VOLUME /data
-COPY ttcn3/GGSN_Tests.cfg /data/GGSN_Tests.cfg +COPY ttcn3/all/GGSN_Tests.cfg /data/GGSN_Tests.cfg
CMD ttcn3-docker-run ggsn_tests GGSN_Tests diff --git a/ttcn3-ggsn-test/jenkins.sh b/ttcn3-ggsn-test/jenkins.sh index 3f1eaf3..f9e7a47 100755 --- a/ttcn3-ggsn-test/jenkins.sh +++ b/ttcn3-ggsn-test/jenkins.sh @@ -1,5 +1,12 @@ #!/bin/sh -# Environment variables: see "Kernel test" section in README.md +# Environment variables: see README.md +# Possible test configurations: +# * v4_only: one APN with v4 +# * v6_only: one APN with v6 +# * v4v6_only: one APN with v4v6 +# * all: multiple APNs with all of the above +TEST_CONFIGS_ALL="all v4_only v6_only v4v6_only" +TEST_CONFIGS="${TEST_CONFIGS:-$TEST_CONFIGS_ALL}" . ../jenkins-common.sh
KERNEL_TEST="${KERNEL_TEST:-0}" @@ -11,20 +18,41 @@ set_clean_up_trap set -e
+clean_up() { + local i + local log + + # Add a suffix to the class names in the junit-xml log + for i in $TEST_CONFIGS; do + if [ "$i" = "all" ]; then + continue + fi + + for log in "$VOL_BASE_DIR"/ggsn-tester-"$i"/junit-xml-*.log; do + if ! [ -e "$log" ]; then + continue + fi + sed -i "s/classname='([^']+)'/classname='\1_$i'/g" "$log" + done + done +} + # Start container with ggsn in background start_ggsn() { + local test_config="$1" + GGSN_CMD="osmo-ggsn -c /data/osmo-ggsn.cfg" GGSN_DOCKER_ARGS="" if [ "$KERNEL_TEST" = "1" ]; then - cp osmo-ggsn-kernel/initrd-ggsn.sh $VOL_BASE_DIR/ggsn/ + cp osmo-ggsn-kernel/initrd-ggsn.sh $VOL_BASE_DIR/ggsn-"$test_config"/ network_replace_subnet_in_configs
kernel_test_prepare \ "defconfig" \ "osmo-ggsn-kernel/fragment.config" \ - "$VOL_BASE_DIR/ggsn/initrd-ggsn.sh" \ + "$VOL_BASE_DIR/ggsn-$test_config/initrd-ggsn.sh" \ "$REPO_USER/osmo-ggsn-$IMAGE_SUFFIX" \ - -v $VOL_BASE_DIR/ggsn:/data + -v $VOL_BASE_DIR/ggsn-"$test_config":/data
GGSN_CMD="/kernel-test/run-qemu.sh" GGSN_DOCKER_ARGS=" @@ -46,23 +74,25 @@ --device /dev/net/tun:/dev/net/tun \ --sysctl net.ipv6.conf.all.disable_ipv6=0 \ --ulimit core=-1 \ - -v $VOL_BASE_DIR/ggsn:/data \ + -v $VOL_BASE_DIR/ggsn-"$test_config":/data \ --name ${BUILD_TAG}-ggsn -d \ $DOCKER_ARGS \ $GGSN_DOCKER_ARGS \ $REPO_USER/osmo-ggsn-$IMAGE_SUFFIX \ /bin/sh -c "$GGSN_CMD >/data/osmo-ggsn.log 2>&1"
- kernel_test_wait_for_vm "$VOL_BASE_DIR/ggsn/osmo-ggsn.log" + kernel_test_wait_for_vm "$VOL_BASE_DIR/ggsn-$test_config/osmo-ggsn.log" }
# Start docker container with testsuite in foreground start_testsuite() { + local test_config="$1" + docker run --rm \ --sysctl net.ipv6.conf.all.disable_ipv6=0 \ $(docker_network_params $SUBNET 202) \ --ulimit core=-1 \ - -v $VOL_BASE_DIR/ggsn-tester:/data \ + -v $VOL_BASE_DIR/ggsn-tester-"$test_config":/data \ -e "TTCN3_PCAP_PATH=/data" \ -e "OSMO_SUT_HOST=$OSMO_SUT_HOST" \ -e "OSMO_SUT_PORT=4260" \ @@ -71,12 +101,6 @@ $REPO_USER/ttcn3-ggsn-test }
-mkdir $VOL_BASE_DIR/ggsn-tester -cp ttcn3/GGSN_Tests.cfg $VOL_BASE_DIR/ggsn-tester/ -write_mp_osmo_repo "$VOL_BASE_DIR/ggsn-tester/GGSN_Tests.cfg" - -mkdir $VOL_BASE_DIR/ggsn - network_create
if [ "$KERNEL_TEST" = 1 ]; then @@ -85,8 +109,28 @@ CONFIGS_DIR="osmo-ggsn" fi
-cp "$CONFIGS_DIR"/osmo-ggsn.cfg $VOL_BASE_DIR/ggsn/osmo-ggsn.cfg -network_replace_subnet_in_configs +for i in $TEST_CONFIGS_ALL; do + if ! test_config_enabled "$i"; then + continue + fi
-start_ggsn -start_testsuite + # OS#6106: Currently it is not possible to configure multiple APNs with + # gtpu-mode kernel-gtp in OsmoGGSN, because it cannot share the GTP-U + # bind socket between tunnels. + if [ "$i" = "all" ] && [ "$KERNEL_TEST" = "1" ]; then + continue + fi + + mkdir $VOL_BASE_DIR/ggsn-tester-"$i" + cp ttcn3/"$i"/GGSN_Tests.cfg $VOL_BASE_DIR/ggsn-tester-"$i"/GGSN_Tests.cfg + write_mp_osmo_repo "$VOL_BASE_DIR/ggsn-tester-$i/GGSN_Tests.cfg" + + mkdir $VOL_BASE_DIR/ggsn-"$i" + cp "$CONFIGS_DIR"/"$i"/osmo-ggsn.cfg "$VOL_BASE_DIR"/ggsn-"$i"/osmo-ggsn.cfg + network_replace_subnet_in_configs + + start_ggsn "$i" + start_testsuite "$i" + + docker_kill_wait "$BUILD_TAG"-ggsn +done diff --git a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn-kernel/v4_only/osmo-ggsn.cfg similarity index 63% copy from ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg copy to ttcn3-ggsn-test/osmo-ggsn-kernel/v4_only/osmo-ggsn.cfg index afa36d6..d8b67a2 100644 --- a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg +++ b/ttcn3-ggsn-test/osmo-ggsn-kernel/v4_only/osmo-ggsn.cfg @@ -25,23 +25,14 @@ ggsn ggsn0 gtp state-dir /tmp gtp bind-ip 172.18.3.201 - # OS#6106: Currently it is not possible to configure multiple APNs with - # gtpu-mode kernel-gtp in OsmoGGSN, because it cannot share the GTP-U bind - # socket between tunnels. apn internet gtpu-mode kernel-gtp - tun-device tun46 - type-support v4v6 + tun-device tun4 + type-support v4 ip prefix dynamic 176.16.16.0/20 ip dns 0 172.18.3.201 ip dns 1 8.8.8.8 ip ifconfig 176.16.16.0/20 - ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 - ipv6 dns 0 fd02:db8:3::201 - ipv6 dns 1 2001:4860:4860::8844 - ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 no shutdown -# apn inet6 -# apn inet46 default-apn internet no shutdown ggsn diff --git a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn-kernel/v4v6_only/osmo-ggsn.cfg similarity index 77% rename from ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg rename to ttcn3-ggsn-test/osmo-ggsn-kernel/v4v6_only/osmo-ggsn.cfg index afa36d6..c3f32f7 100644 --- a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg +++ b/ttcn3-ggsn-test/osmo-ggsn-kernel/v4v6_only/osmo-ggsn.cfg @@ -25,10 +25,7 @@ ggsn ggsn0 gtp state-dir /tmp gtp bind-ip 172.18.3.201 - # OS#6106: Currently it is not possible to configure multiple APNs with - # gtpu-mode kernel-gtp in OsmoGGSN, because it cannot share the GTP-U bind - # socket between tunnels. - apn internet + apn inet46 gtpu-mode kernel-gtp tun-device tun46 type-support v4v6 @@ -41,7 +38,5 @@ ipv6 dns 1 2001:4860:4860::8844 ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 no shutdown -# apn inet6 -# apn inet46 - default-apn internet + default-apn inet46 no shutdown ggsn diff --git a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn-kernel/v6_only/osmo-ggsn.cfg similarity index 64% copy from ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg copy to ttcn3-ggsn-test/osmo-ggsn-kernel/v6_only/osmo-ggsn.cfg index afa36d6..9de035f 100644 --- a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg +++ b/ttcn3-ggsn-test/osmo-ggsn-kernel/v6_only/osmo-ggsn.cfg @@ -25,23 +25,14 @@ ggsn ggsn0 gtp state-dir /tmp gtp bind-ip 172.18.3.201 - # OS#6106: Currently it is not possible to configure multiple APNs with - # gtpu-mode kernel-gtp in OsmoGGSN, because it cannot share the GTP-U bind - # socket between tunnels. - apn internet + apn inet6 gtpu-mode kernel-gtp - tun-device tun46 - type-support v4v6 - ip prefix dynamic 176.16.16.0/20 - ip dns 0 172.18.3.201 - ip dns 1 8.8.8.8 - ip ifconfig 176.16.16.0/20 + tun-device tun6 + type-support v6 ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 ipv6 dns 0 fd02:db8:3::201 ipv6 dns 1 2001:4860:4860::8844 ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 no shutdown -# apn inet6 -# apn inet46 - default-apn internet + default-apn inet6 no shutdown ggsn diff --git a/ttcn3-ggsn-test/osmo-ggsn/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn/all/osmo-ggsn.cfg similarity index 100% rename from ttcn3-ggsn-test/osmo-ggsn/osmo-ggsn.cfg rename to ttcn3-ggsn-test/osmo-ggsn/all/osmo-ggsn.cfg diff --git a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn/v4_only/osmo-ggsn.cfg similarity index 60% copy from ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg copy to ttcn3-ggsn-test/osmo-ggsn/v4_only/osmo-ggsn.cfg index afa36d6..7a94b59 100644 --- a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg +++ b/ttcn3-ggsn-test/osmo-ggsn/v4_only/osmo-ggsn.cfg @@ -25,23 +25,17 @@ ggsn ggsn0 gtp state-dir /tmp gtp bind-ip 172.18.3.201 - # OS#6106: Currently it is not possible to configure multiple APNs with - # gtpu-mode kernel-gtp in OsmoGGSN, because it cannot share the GTP-U bind - # socket between tunnels. + timer gtp T3 1 + timer gtp T1003 2 + timer gtp X3 2 apn internet - gtpu-mode kernel-gtp - tun-device tun46 - type-support v4v6 + gtpu-mode tun + tun-device tun4 + type-support v4 ip prefix dynamic 176.16.16.0/20 ip dns 0 172.18.3.201 ip dns 1 8.8.8.8 ip ifconfig 176.16.16.0/20 - ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 - ipv6 dns 0 fd02:db8:3::201 - ipv6 dns 1 2001:4860:4860::8844 - ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 no shutdown -# apn inet6 -# apn inet46 default-apn internet no shutdown ggsn diff --git a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn/v4v6_only/osmo-ggsn.cfg similarity index 69% copy from ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg copy to ttcn3-ggsn-test/osmo-ggsn/v4v6_only/osmo-ggsn.cfg index afa36d6..f63b0d5 100644 --- a/ttcn3-ggsn-test/osmo-ggsn-kernel/osmo-ggsn.cfg +++ b/ttcn3-ggsn-test/osmo-ggsn/v4v6_only/osmo-ggsn.cfg @@ -25,23 +25,21 @@ ggsn ggsn0 gtp state-dir /tmp gtp bind-ip 172.18.3.201 - # OS#6106: Currently it is not possible to configure multiple APNs with - # gtpu-mode kernel-gtp in OsmoGGSN, because it cannot share the GTP-U bind - # socket between tunnels. - apn internet - gtpu-mode kernel-gtp + timer gtp T3 1 + timer gtp T1003 2 + timer gtp X3 2 + apn inet46 + gtpu-mode tun tun-device tun46 type-support v4v6 - ip prefix dynamic 176.16.16.0/20 + ip prefix dynamic 176.16.32.0/20 ip dns 0 172.18.3.201 ip dns 1 8.8.8.8 - ip ifconfig 176.16.16.0/20 + ip ifconfig 176.16.32.0/20 ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 ipv6 dns 0 fd02:db8:3::201 ipv6 dns 1 2001:4860:4860::8844 ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 no shutdown -# apn inet6 -# apn inet46 - default-apn internet + default-apn inet46 no shutdown ggsn diff --git a/ttcn3-ggsn-test/osmo-ggsn/v6_only/osmo-ggsn.cfg b/ttcn3-ggsn-test/osmo-ggsn/v6_only/osmo-ggsn.cfg new file mode 100644 index 0000000..bca3f57 --- /dev/null +++ b/ttcn3-ggsn-test/osmo-ggsn/v6_only/osmo-ggsn.cfg @@ -0,0 +1,41 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +log gsmtap 172.18.3.202 + logging level set-all debug + logging filter all 1 +! +log stderr + logging filter all 1 + logging color 1 + logging print level 1 + logging print category 1 + logging print category-hex 0 + logging print file basename last + logging print extended-timestamp 1 + logging level set-all info +! +stats interval 5 +! +line vty + no login + bind 0.0.0.0 +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 172.18.3.201 + timer gtp T3 1 + timer gtp T1003 2 + timer gtp X3 2 + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 fd02:db8:3::201 + ipv6 dns 1 2001:4860:4860::8844 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + default-apn inet6 + no shutdown ggsn diff --git a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg b/ttcn3-ggsn-test/ttcn3/all/GGSN_Tests.cfg similarity index 94% rename from ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg rename to ttcn3-ggsn-test/ttcn3/all/GGSN_Tests.cfg index cb548b3..f715d9f 100644 --- a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg +++ b/ttcn3-ggsn-test/ttcn3/all/GGSN_Tests.cfg @@ -24,5 +24,7 @@ # local N3-REQUESTS counter: GGSN_Tests.mp_n3_requests := 2
+GGSN_Tests.m_ggsn_conf := GGSN_CONF_ALL + [EXECUTE] GGSN_Tests.control diff --git a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg b/ttcn3-ggsn-test/ttcn3/v4_only/GGSN_Tests.cfg similarity index 93% copy from ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg copy to ttcn3-ggsn-test/ttcn3/v4_only/GGSN_Tests.cfg index cb548b3..fc21c72 100644 --- a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg +++ b/ttcn3-ggsn-test/ttcn3/v4_only/GGSN_Tests.cfg @@ -24,5 +24,7 @@ # local N3-REQUESTS counter: GGSN_Tests.mp_n3_requests := 2
+GGSN_Tests.m_ggsn_conf := GGSN_CONF_V4_ONLY + [EXECUTE] GGSN_Tests.control diff --git a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg b/ttcn3-ggsn-test/ttcn3/v4v6_only/GGSN_Tests.cfg similarity index 93% copy from ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg copy to ttcn3-ggsn-test/ttcn3/v4v6_only/GGSN_Tests.cfg index cb548b3..c2c8b4a 100644 --- a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg +++ b/ttcn3-ggsn-test/ttcn3/v4v6_only/GGSN_Tests.cfg @@ -24,5 +24,7 @@ # local N3-REQUESTS counter: GGSN_Tests.mp_n3_requests := 2
+GGSN_Tests.m_ggsn_conf := GGSN_CONF_V4V6_ONLY + [EXECUTE] GGSN_Tests.control diff --git a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg b/ttcn3-ggsn-test/ttcn3/v6_only/GGSN_Tests.cfg similarity index 93% copy from ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg copy to ttcn3-ggsn-test/ttcn3/v6_only/GGSN_Tests.cfg index cb548b3..7666438 100644 --- a/ttcn3-ggsn-test/ttcn3/GGSN_Tests.cfg +++ b/ttcn3-ggsn-test/ttcn3/v6_only/GGSN_Tests.cfg @@ -24,5 +24,7 @@ # local N3-REQUESTS counter: GGSN_Tests.mp_n3_requests := 2
+GGSN_Tests.m_ggsn_conf := GGSN_CONF_V6_ONLY + [EXECUTE] GGSN_Tests.control