aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2023-10-13 11:26:35 +0200
committerosmith <osmith@sysmocom.de>2023-10-16 08:52:37 +0000
commitba1385fe60755099caff591adadf66bce27946a8 (patch)
tree203c34fcf83f211c599363607d920ee7ba8304a7
parent0b97785ceb0d9c01f397255732a37c29673076dc (diff)
common/ttcn3-docker-run.sh: add TEST_NAME env var
Make it possible to run only one test by setting an environment variable. Change-Id: I1f45a05e089b429918096fcd64f7c02033d5a9dd
-rw-r--r--README.md10
-rwxr-xr-xcommon/ttcn3-docker-run.sh16
2 files changed, 25 insertions, 1 deletions
diff --git a/README.md b/README.md
index 6f05417..436fdd0 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,16 @@ Environment variables:
Osmocom project. Defaults to `master`.
* `NO_DOCKER_IMAGE_BUILD`: when set to `1`, it won't try to update the
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
+
+### Run only one test
+
+```
+$ cd ttcn3-hlr-test
+$ export DOCKER_ARGS="-e TEST_NAME=TC_gsup_sai"
+$ ./jenkins.sh
+```
### Using nightly packages from a different date
diff --git a/common/ttcn3-docker-run.sh b/common/ttcn3-docker-run.sh
index 26e291c..c8c871e 100755
--- a/common/ttcn3-docker-run.sh
+++ b/common/ttcn3-docker-run.sh
@@ -33,7 +33,21 @@ fi
cd /data
-/osmo-ttcn3-hacks/start-testsuite.sh "/osmo-ttcn3-hacks/$SUBDIR/$SUITE"
+# Use TEST_NAME to only run one test instead of all. Set it like this:
+# $ cd ttcn3-hlr-test
+# $ export DOCKER_ARGS="-e TEST_NAME=TC_gsup_sai"
+# $ ./jenkins.sh
+
+EXTRA_ARGS=""
+if [ -n "$TEST_NAME" ]; then
+ EXTRA_ARGS="$SUITE.$TEST_NAME"
+fi
+
+/osmo-ttcn3-hacks/start-testsuite.sh \
+ "/osmo-ttcn3-hacks/$SUBDIR/$SUITE" \
+ "$SUITE.cfg" \
+ $EXTRA_ARGS
+
exit_code=$?
/osmo-ttcn3-hacks/log_merge.sh "$SUITE" --rm