osmith has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email )
Change subject: ttcn3-bts-test: add env var to not run all configs
......................................................................
ttcn3-bts-test: add env var to not run all configs
Make it possible to e.g. run only one of the generic/oml/hopping
configurations.
I made a version of this patch a few weeks ago for testing OS#6375,
and I'm submitting it now so I can add multiple configurations for
ttcn3-ggsn-test in the next patch with the same logic.
Change-Id: I1dce5e6aa4b5d67f9f8c96ced611ab2875c353c8
---
M README.md
M jenkins-common.sh
M ttcn3-bts-test/jenkins.sh
3 files changed, 144 insertions(+), 45 deletions(-)
Approvals:
osmith: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/README.md b/README.md
index 436fdd0..4c6c40a 100644
--- a/README.md
+++ b/README.md
@@ -28,15 +28,29 @@
containers (see "caching" below)
* `DOCKER_ARGS`: pass extra arguments to docker, e.g. to mount local sources
for building as done in osmo-dev.git/ttcn3/ttcn3.sh
+* `TEST_CONFIGS`: for tests that can run with multiple config sets (e.g.
+ `ttcn3-bts-test`), run only some of them. See `TEST_CONFIGS_ALL` in the
+ `jenkins.sh` for possible values.
### Run only one test
+Run only `TC_gsup_sai` in `ttcn3-hlr-test`:
+
```
$ cd ttcn3-hlr-test
$ export DOCKER_ARGS="-e TEST_NAME=TC_gsup_sai"
$ ./jenkins.sh
```
+Run only `TC_est_dchan` in `ttcn3-bts-test`, with the `generic` configuration:
+
+```
+$ cd ttcn3-bts-test
+$ export DOCKER_ARGS="-e TEST_NAME=TC_est_dchan"
+$ export TEST_CONFIGS="generic"
+$ ./jenkins.sh
+```
+
### Using nightly packages from a different date
Pick a date from [here](https://downloads.osmocom.org/obs-mirror/) and use it:
diff --git a/jenkins-common.sh b/jenkins-common.sh
index 7978749..59224a0 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -569,6 +569,43 @@
"$config"
}
+# Output the name of the test config and check if it is enabled. Use this
+# function in jenkins.sh, after setting TEST_CONFIGS_ALL, e.g.:
+# TEST_CONFIGS_ALL="generic oml hopping"
+# The user can then set TEST_CONFIGS to only run one of the test
+# configurations.
+# $1: one of TEST_CONFIGS_ALL, e.g. "classic"
+test_config_enabled() {
+ local config="$1"
+ local i
+ local valid=0
+
+ for i in $TEST_CONFIGS_ALL; do
+ if [ "$config" = "$i" ]; then
+ valid=1
+ break
+ fi
+ done
+
+ if [ "$valid" != "1" ]; then
+ set +x
+ echo "ERROR: config name '$config' is not one of '$TEST_CONFIGS_ALL'"
+ exit 1
+ fi
+
+ if [ -z "$TEST_CONFIGS" ]; then
+ return 0
+ fi
+
+ for i in $TEST_CONFIGS; do
+ if [ "$config" = "$i" ]; then
+ return 0
+ fi
+ done
+
+ return 1
+}
+
set -x
# non-jenkins execution: assume local user name
diff --git a/ttcn3-bts-test/jenkins.sh b/ttcn3-bts-test/jenkins.sh
index f932b4a..0e9fd3e 100755
--- a/ttcn3-bts-test/jenkins.sh
+++ b/ttcn3-bts-test/jenkins.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+TEST_CONFIGS_ALL="generic virtphy oml hopping"
+TEST_CONFIGS="${TEST_CONFIGS:-"generic oml hopping"}"
. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
@@ -13,12 +15,14 @@
set -e
clean_up() {
- # append ':hopping' to the classnames,
- # e.g. "classname='BTS_Tests'" => "classname='BTS_Tests:hopping'"
- # e.g. "classname='BTS_Tests_SMSCB'" => "classname='BTS_Tests_SMSCB:hopping'"
- # so the hopping test cases would not interfere with non-hopping ones in Jenkins
- sed -i "s/classname='\([^']\+\)'/classname='\1:hopping'/g" \
- $VOL_BASE_DIR/bts-tester-hopping/junit-xml-hopping-*.log
+ if test_config_enabled "hopping"; then
+ # append ':hopping' to the classnames,
+ # e.g. "classname='BTS_Tests'" => "classname='BTS_Tests:hopping'"
+ # e.g. "classname='BTS_Tests_SMSCB'" => "classname='BTS_Tests_SMSCB:hopping'"
+ # so the hopping test cases would not interfere with non-hopping ones in Jenkins
+ sed -i "s/classname='\([^']\+\)'/classname='\1:hopping'/g" \
+ $VOL_BASE_DIR/bts-tester-hopping/junit-xml-hopping-*.log
+ fi
}
start_bsc() {
@@ -167,49 +171,77 @@
mkdir $VOL_BASE_DIR/virtphy
# 1) classic test suite with BSC for OML and trxcon+fake_trx
-network_replace_subnet_in_configs
-start_bsc
-start_bts trx 1
-start_fake_trx
-start_trxcon
-start_testsuite generic
+if test_config_enabled "generic"; then
+ network_replace_subnet_in_configs
+
+ start_bsc
+ start_bts trx 1
+ start_fake_trx
+ start_trxcon
+
+ start_testsuite generic
+
+ docker_kill_wait ${BUILD_TAG}-trxcon
+ docker_kill_wait ${BUILD_TAG}-fake_trx
+ docker_kill_wait ${BUILD_TAG}-bts
+ docker_kill_wait ${BUILD_TAG}-bsc
+fi
# 2) some GPRS tests require virt_phy
-echo "Changing to virtphy configuration"
-# switch from osmo-bts-trx + trxcon + faketrx to virtphy + osmo-bts-virtual
-docker_kill_wait ${BUILD_TAG}-trxcon
-docker_kill_wait ${BUILD_TAG}-fake_trx
-docker_kill_wait ${BUILD_TAG}-bts
-cp virtphy/osmo-bts.gen.cfg $VOL_BASE_DIR/bts/
-network_replace_subnet_in_configs
-# FIXME: multicast to/from a docker bridge network is currently not possible.
-# See https://github.com/moby/libnetwork/issues/2397.
-echo "XXX: not running the virtphy configuration"
-#start_bts virtual 0
-#start_virtphy
-# ... and execute the testsuite again with different cfg
-#start_testsuite virtphy
+if test_config_enabled "virtphy"; then
+ # FIXME: multicast to/from a docker bridge network is currently not possible.
+ # See https://github.com/moby/libnetwork/issues/2397.
+ set +x
+ echo "ERROR: not running the virtphy configuration"
+ exit 1
+
+ cp virtphy/osmo-bts.gen.cfg $VOL_BASE_DIR/bts/
+ network_replace_subnet_in_configs
+
+ start_bsc
+ start_bts virtual 0
+ start_virtphy
+
+ start_testsuite virtphy
+
+ docker_kill_wait ${BUILD_TAG}-virtphy
+ docker_kill_wait ${BUILD_TAG}-bts
+ docker_kill_wait ${BUILD_TAG}-bsc
+fi
# 3) OML tests require us to run without BSC
-docker_kill_wait ${BUILD_TAG}-bsc
-# switch back from virtphy + osmo-bts-virtual to osmo-bts-trx
-#docker_kill_wait ${BUILD_TAG}-virtphy
-#docker_kill_wait ${BUILD_TAG}-bts
+if test_config_enabled "oml"; then
+ cp oml/osmo-bts.gen.cfg $VOL_BASE_DIR/bts/
+ network_replace_subnet_in_configs
-cp oml/osmo-bts.gen.cfg $VOL_BASE_DIR/bts/
-network_replace_subnet_in_configs
-start_bts trx 1
-start_fake_trx
-start_trxcon
-# ... and execute the testsuite again with different cfg
-start_testsuite oml
+ start_bsc
+ start_bts trx 1
+ start_fake_trx
+ start_trxcon
+
+ start_testsuite oml
+
+ docker_kill_wait ${BUILD_TAG}-trxcon
+ docker_kill_wait ${BUILD_TAG}-fake_trx
+ docker_kill_wait ${BUILD_TAG}-bts
+ docker_kill_wait ${BUILD_TAG}-bsc
+fi
# 4) Frequency hopping tests require different configuration files
-cp fh/osmo-bsc.gen.cfg $VOL_BASE_DIR/bsc/
-cp generic/osmo-bts.gen.cfg $VOL_BASE_DIR/bts/
-# restart the BSC/BTS and run the testsuite again
-docker_kill_wait ${BUILD_TAG}-bts
-network_replace_subnet_in_configs
-start_bsc
-start_bts trx 1
-start_testsuite hopping
+if test_config_enabled "hopping"; then
+ cp fh/osmo-bsc.gen.cfg $VOL_BASE_DIR/bsc/
+ cp generic/osmo-bts.gen.cfg $VOL_BASE_DIR/bts/
+ network_replace_subnet_in_configs
+
+ start_bsc
+ start_bts trx 1
+ start_fake_trx
+ start_trxcon
+
+ start_testsuite hopping
+
+ docker_kill_wait ${BUILD_TAG}-trxcon
+ docker_kill_wait ${BUILD_TAG}-fake_trx
+ docker_kill_wait ${BUILD_TAG}-bsc
+ docker_kill_wait ${BUILD_TAG}-bts
+fi
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I1dce5e6aa4b5d67f9f8c96ced611ab2875c353c8
Gerrit-Change-Number: 36389
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: laforge, pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/36392?usp=email )
Change subject: ttcn3-ggsn-test: run with multiple configurations
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> Or if you want, the other way around, but I mean having another dir level: […]
done
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36392?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Ia2fe0c3ed4ccf06e72fd258d085e4a79cecd5f26
Gerrit-Change-Number: 36392
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Mar 2024 11:24:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email )
Change subject: ttcn3-bts-test: add env var to not run all configs
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I1dce5e6aa4b5d67f9f8c96ced611ab2875c353c8
Gerrit-Change-Number: 36389
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 25 Mar 2024 11:23:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email )
Change subject: ttcn3-bts-test: add env var to not run all configs
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
File ttcn3-bts-test/jenkins.sh:
https://gerrit.osmocom.org/c/docker-playground/+/36389/comment/4f2d6e36_f6d…
PS1, Line 174: if test_config_enabled "generic"; then
> imho it would become clearer if you put each of this in a function.
done in follow-up patch: https://gerrit.osmocom.org/c/docker-playground/+/36443/1
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I1dce5e6aa4b5d67f9f8c96ced611ab2875c353c8
Gerrit-Change-Number: 36389
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Mar 2024 11:23:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/docker-playground/+/36390?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: ttcn3-ggsn-test/jenkins: add functions for start ggsn/testsuite
......................................................................
ttcn3-ggsn-test/jenkins: add functions for start ggsn/testsuite
Prepare to run start_ggsn and start_testsuite multiple times with
different configurations in a follow-up patch.
Related: OS#6096
Change-Id: I0754b0df5f1b0b162732c3db0797f65676553ab0
---
M ttcn3-ggsn-test/jenkins.sh
1 file changed, 78 insertions(+), 59 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/90/36390/2
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36390?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I0754b0df5f1b0b162732c3db0797f65676553ab0
Gerrit-Change-Number: 36390
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, osmith.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/docker-playground/+/36392?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified+1 by Jenkins Builder, Verified+1 by osmith
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(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/92/36392/2
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36392?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: Ia2fe0c3ed4ccf06e72fd258d085e4a79cecd5f26
Gerrit-Change-Number: 36392
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, osmith, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review+1 by pespin, Verified+1 by Jenkins Builder
Change subject: ttcn3-bts-test: add env var to not run all configs
......................................................................
ttcn3-bts-test: add env var to not run all configs
Make it possible to e.g. run only one of the generic/oml/hopping
configurations.
I made a version of this patch a few weeks ago for testing OS#6375,
and I'm submitting it now so I can add multiple configurations for
ttcn3-ggsn-test in the next patch with the same logic.
Change-Id: I1dce5e6aa4b5d67f9f8c96ced611ab2875c353c8
---
M README.md
M jenkins-common.sh
M ttcn3-bts-test/jenkins.sh
3 files changed, 144 insertions(+), 45 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/89/36389/2
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36389?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I1dce5e6aa4b5d67f9f8c96ced611ab2875c353c8
Gerrit-Change-Number: 36389
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset