aboutsummaryrefslogtreecommitdiffstats
path: root/ttcn3-pcu-test/jenkins.sh
blob: 17d76b575b7a83910ae7376a5f8f22195d3e93d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
docker_images_require \
	"debian-stretch-build" \
	"osmo-pcu-$IMAGE_SUFFIX" \
	"debian-stretch-titan" \
	"ttcn3-pcu-test"

network_create 172.18.13.0/24

mkdir $VOL_BASE_DIR/pcu-tester
mkdir $VOL_BASE_DIR/pcu-tester/unix
cp PCU_Tests.cfg $VOL_BASE_DIR/pcu-tester/

mkdir $VOL_BASE_DIR/pcu
mkdir $VOL_BASE_DIR/pcu/unix
cp osmo-pcu.cfg $VOL_BASE_DIR/pcu/

mkdir $VOL_BASE_DIR/unix

echo Starting container with PCU
docker run	--rm \
		--network $NET_NAME --ip 172.18.13.101 \
		-v $VOL_BASE_DIR/pcu:/data \
		-v $VOL_BASE_DIR/unix:/data/unix \
		--name ${BUILD_TAG}-pcu -d \
		$REPO_USER/osmo-pcu-$IMAGE_SUFFIX \
		/usr/local/bin/respawn.sh osmo-pcu -c /data/osmo-pcu.cfg -i 172.18.13.10

echo Starting container with PCU testsuite
docker run	--rm \
		--network $NET_NAME --ip 172.18.13.10 \
		-e "TTCN3_PCAP_PATH=/data" \
		-v $VOL_BASE_DIR/pcu-tester:/data \
		-v $VOL_BASE_DIR/unix:/data/unix \
		--name ${BUILD_TAG}-ttcn3-pcu-test \
		$REPO_USER/ttcn3-pcu-test

echo Stopping containers
docker container kill ${BUILD_TAG}-pcu

network_remove
rm -rf $VOL_BASE_DIR/unix
collect_logs