pcu hacking

Change-Id: Ia00362e8272f24f2e0f57f50e7cb3bcbec407266
This commit is contained in:
Neels Hofmeyr 2020-08-25 12:07:46 +00:00 committed by Neels Hofmeyr
parent 48b6d6dbd9
commit adbdadf80e
3 changed files with 42 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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/
@ -29,10 +47,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 \
@ -41,6 +62,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