aboutsummaryrefslogtreecommitdiffstats
path: root/ttcn3-bts-test/jenkins.sh
blob: 20f9373bd4fdc0c4c80a9208d587df186341415d (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/sh

. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
# NOTE: there is no osmocom-bb-host-latest, hence always use master!
docker_images_require \
	"debian-stretch-build" \
	"osmo-bsc-$IMAGE_SUFFIX" \
	"osmo-bts-$IMAGE_SUFFIX" \
	"osmocom-bb-host-master" \
	"debian-stretch-titan" \
	"ttcn3-bts-test"

start_bsc() {
	echo Starting container with BSC
	docker run	--rm \
			--network $NET_NAME --ip 172.18.9.11 \
			-v $VOL_BASE_DIR/bsc:/data \
			--name ${BUILD_TAG}-bsc -d \
			$REPO_USER/osmo-bsc-$IMAGE_SUFFIX \
			osmo-bsc -c /data/osmo-bsc.cfg
}

start_bts() {
	echo Starting container with BTS
	docker run	--rm \
			--network $NET_NAME --ip 172.18.9.20 \
			-v $VOL_BASE_DIR/bts:/data \
			-v $VOL_BASE_DIR/unix:/data/unix \
			--name ${BUILD_TAG}-bts -d \
			$REPO_USER/osmo-bts-$IMAGE_SUFFIX \
			/usr/local/bin/respawn.sh osmo-bts-trx -c /data/osmo-bts.cfg -i 172.18.9.10
}

start_fake_trx() {
	echo Starting container with fake_trx
	docker run	--rm \
			--network $NET_NAME --ip 172.18.9.21 \
			-v $VOL_BASE_DIR/fake_trx:/data \
			--name ${BUILD_TAG}-fake_trx -d \
			$REPO_USER/osmocom-bb-host-master \
			/tmp/osmocom-bb/src/target/trx_toolkit/fake_trx.py \
				--log-file-name /data/fake_trx.log \
				--log-file-level DEBUG \
				--log-level INFO \
				-R 172.18.9.20 -r 172.18.9.22
}

start_trxcon() {
	echo Starting container with trxcon
	docker run	--rm \
			--network $NET_NAME --ip 172.18.9.22 \
			-v $VOL_BASE_DIR/unix:/data/unix \
			--name ${BUILD_TAG}-trxcon -d \
			$REPO_USER/osmocom-bb-host-master \
			trxcon -i 172.18.9.21 -s /data/unix/osmocom_l2
}

start_testsuite() {
	echo Starting container with BTS testsuite
	docker run	--rm \
			--network $NET_NAME --ip 172.18.9.10 \
			-e "TTCN3_PCAP_PATH=/data" \
			-v $VOL_BASE_DIR/bts-tester:/data \
			-v $VOL_BASE_DIR/unix:/data/unix \
			--name ${BUILD_TAG}-ttcn3-bts-test \
			$REPO_USER/ttcn3-bts-test
}

network_create 172.18.9.0/24

mkdir $VOL_BASE_DIR/bts-tester
mkdir $VOL_BASE_DIR/bts-tester/unix
cp BTS_Tests.cfg $VOL_BASE_DIR/bts-tester/

mkdir $VOL_BASE_DIR/bsc
cp osmo-bsc.cfg $VOL_BASE_DIR/bsc/

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

mkdir $VOL_BASE_DIR/unix

mkdir $VOL_BASE_DIR/fake_trx

start_bsc
start_bts
start_fake_trx
start_trxcon
start_testsuite

echo Stopping containers
docker container kill ${BUILD_TAG}-trxcon
docker container kill ${BUILD_TAG}-fake_trx
docker container kill ${BUILD_TAG}-bts
docker container kill ${BUILD_TAG}-bsc

network_remove
rm -rf $VOL_BASE_DIR/unix
collect_logs