aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-09-21 17:05:58 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-04-16 13:38:24 +0000
commitae0e341be9bc113e2de13df861b541a591ef4a62 (patch)
tree204ae662e66aa2e00df83aa5770da3a5812870cf
parentd99e94e81d0c94ef4972280c92bcdeac7f970ef3 (diff)
ttcn3-smlc-test: manual invocation
-rw-r--r--ttcn3-smlc-test/Dockerfile3
-rw-r--r--ttcn3-smlc-test/Makefile.within-docker-img14
-rwxr-xr-xttcn3-smlc-test/jenkins.sh32
3 files changed, 46 insertions, 3 deletions
diff --git a/ttcn3-smlc-test/Dockerfile b/ttcn3-smlc-test/Dockerfile
index 5d27ceb..e377ce0 100644
--- a/ttcn3-smlc-test/Dockerfile
+++ b/ttcn3-smlc-test/Dockerfile
@@ -9,5 +9,6 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" smlc
VOLUME /data
COPY SMLC_Tests.cfg /data/SMLC_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run smlc SMLC_Tests
+CMD cd / && make test
diff --git a/ttcn3-smlc-test/Makefile.within-docker-img b/ttcn3-smlc-test/Makefile.within-docker-img
new file mode 100644
index 0000000..03d24be
--- /dev/null
+++ b/ttcn3-smlc-test/Makefile.within-docker-img
@@ -0,0 +1,14 @@
+.PHONY: compile test log
+
+default: compile test
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks smlc/compile
+ $(MAKE) -C /osmo-ttcn3-hacks smlc -j
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/smlc/SMLC_Tests; \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh SMLC_Tests --rm; \
+ exit $$exit_code
diff --git a/ttcn3-smlc-test/jenkins.sh b/ttcn3-smlc-test/jenkins.sh
index f16536f..9fbcd1d 100755
--- a/ttcn3-smlc-test/jenkins.sh
+++ b/ttcn3-smlc-test/jenkins.sh
@@ -7,9 +7,31 @@ docker_images_require \
"osmo-smlc-$IMAGE_SUFFIX" \
"ttcn3-smlc-test"
+<<<<<<< HEAD
set_clean_up_trap
set -e
+||||||| parent of 6105d7c (ttcn3-smlc-test: manual invocation)
+=======
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_SMLC_VOLUMES=""
+ADD_SMLC_ARGS=""
+
+if [ "x$1" = "x-h" ]; then
+ ADD_TTCN_RUN_OPTS="-ti"
+ ADD_TTCN_RUN_CMD="bash"
+ if [ -d "$2" ]; then
+ ADD_TTCN_VOLUMES="$ADD_TTCN_VOLUMES -v $2:/osmo-ttcn3-hacks"
+ fi
+ if [ -d "$3" ]; then
+ ADD_SMLC_RUN_CMD="sleep 9999999"
+ ADD_SMLC_VOLUMES="$ADD_SMLC_VOLUMES -v $3:/src"
+ fi
+fi
+
+>>>>>>> 6105d7c (ttcn3-smlc-test: manual invocation)
mkdir $VOL_BASE_DIR/smlc-tester
cp SMLC_Tests.cfg $VOL_BASE_DIR/smlc-tester/
@@ -37,9 +59,12 @@ docker run --rm \
$(docker_network_params $SUBNET 20) \
--ulimit core=-1 \
-v $VOL_BASE_DIR/smlc:/data \
+ $ADD_SMLC_VOLUMES \
--name ${BUILD_TAG}-smlc -d \
$DOCKER_ARGS \
- $REPO_USER/osmo-smlc-$IMAGE_SUFFIX
+ $ADD_SMLC_ARGS \
+ $REPO_USER/osmo-smlc-$IMAGE_SUFFIX \
+ $ADD_SMLC_RUN_CMD
echo Starting container with SMLC testsuite
docker run --rm \
@@ -47,6 +72,9 @@ docker run --rm \
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/smlc-tester:/data \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-smlc-test \
+ $ADD_TTCN_RUN_OPTS \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-smlc-test
+ $REPO_USER/ttcn3-smlc-test \
+ $ADD_TTCN_RUN_CMD