aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-08-25 12:07:46 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-04-16 13:38:24 +0000
commit9f08ee13e976bba1e20899708b07d3dd2d498ed3 (patch)
tree39cb61874d4084b63b15df89af0e421477397784
parenta593894c0eb1134b8995be510d1f18635dca1490 (diff)
pcu hacking
-rw-r--r--ttcn3-pcu-test/Dockerfile3
-rw-r--r--ttcn3-pcu-test/Makefile.within-docker-img14
-rwxr-xr-xttcn3-pcu-test/jenkins.sh28
3 files changed, 42 insertions, 3 deletions
diff --git a/ttcn3-pcu-test/Dockerfile b/ttcn3-pcu-test/Dockerfile
index e42bca1..0ab2c06 100644
--- a/ttcn3-pcu-test/Dockerfile
+++ b/ttcn3-pcu-test/Dockerfile
@@ -9,5 +9,6 @@ RUN ttcn3-docker-prepare "$OSMO_TTCN3_BRANCH" pcu
VOLUME /data
COPY PCU_Tests.cfg /data/PCU_Tests.cfg
+COPY Makefile.within-docker-img /Makefile
-CMD ttcn3-docker-run pcu PCU_Tests
+CMD cd / && make test
diff --git a/ttcn3-pcu-test/Makefile.within-docker-img b/ttcn3-pcu-test/Makefile.within-docker-img
new file mode 100644
index 0000000..0469c96
--- /dev/null
+++ b/ttcn3-pcu-test/Makefile.within-docker-img
@@ -0,0 +1,14 @@
+.PHONY: compile test log
+
+default: compile test
+
+compile:
+ $(MAKE) -C /osmo-ttcn3-hacks pcu/compile
+ $(MAKE) -C /osmo-ttcn3-hacks pcu -j
+
+test:
+ cd /data && \
+ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/pcu/PCU_Tests; \
+ exit_code=$$?; \
+ /osmo-ttcn3-hacks/log_merge.sh PCU_Tests --rm; \
+ exit $$exit_code
diff --git a/ttcn3-pcu-test/jenkins.sh b/ttcn3-pcu-test/jenkins.sh
index c597e0e..98e6363 100755
--- a/ttcn3-pcu-test/jenkins.sh
+++ b/ttcn3-pcu-test/jenkins.sh
@@ -12,6 +12,24 @@ set -e
SUBNET=13
network_create $SUBNET
+ADD_TTCN_RUN_OPTS=""
+ADD_TTCN_RUN_CMD=""
+ADD_TTCN_VOLUMES=""
+ADD_PCU_VOLUMES=""
+ADD_PCU_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_PCU_RUN_CMD="sleep 9999999"
+ ADD_PCU_VOLUMES="$ADD_PCU_VOLUMES -v $3:/src"
+ fi
+fi
+
mkdir $VOL_BASE_DIR/pcu-tester
mkdir $VOL_BASE_DIR/pcu-tester/unix
cp PCU_Tests.cfg $VOL_BASE_DIR/pcu-tester/
@@ -33,10 +51,13 @@ docker run --rm \
--ulimit core=-1 \
-v $VOL_BASE_DIR/pcu:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_PCU_VOLUMES \
--name ${BUILD_TAG}-pcu -d \
$DOCKER_ARGS \
$REPO_USER/osmo-pcu-$IMAGE_SUFFIX \
- /bin/sh -c "/usr/local/bin/respawn.sh osmo-pcu -c /data/osmo-pcu.cfg -i 172.18.13.10 >>/data/osmo-pcu.log 2>&1"
+ $ADD_PCU_RUN_CMD
+
+ #/bin/sh -c "/usr/local/bin/respawn.sh osmo-pcu -c /data/osmo-pcu.cfg -i 172.18.13.10 >>/data/osmo-pcu.log 2>&1"
echo Starting container with PCU testsuite
docker run --rm \
@@ -45,6 +66,9 @@ docker run --rm \
-e "TTCN3_PCAP_PATH=/data" \
-v $VOL_BASE_DIR/pcu-tester:/data \
-v $VOL_BASE_DIR/unix:/data/unix \
+ $ADD_TTCN_VOLUMES \
--name ${BUILD_TAG}-ttcn3-pcu-test \
$DOCKER_ARGS \
- $REPO_USER/ttcn3-pcu-test
+ $ADD_TTCN_RUN_OPTS \
+ $REPO_USER/ttcn3-pcu-test \
+ $ADD_TTCN_RUN_CMD