aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-29 17:13:16 +0000
committerHarald Welte <laforge@gnumonks.org>2019-05-29 21:59:43 +0200
commit70c92ef1c22fad8e8176673178e04a57aea5bb80 (patch)
tree0c8beb09aa59c5525dc4e05fa8b07f5841ece698
parentcbcdf97f921f127d7864274092b56062045a4b36 (diff)
ttcn3-bts-test/jenkins.sh: Move start of containers into shell functions
-rwxr-xr-xttcn3-bts-test/jenkins.sh107
1 files changed, 61 insertions, 46 deletions
diff --git a/ttcn3-bts-test/jenkins.sh b/ttcn3-bts-test/jenkins.sh
index eb96e59..20f9373 100755
--- a/ttcn3-bts-test/jenkins.sh
+++ b/ttcn3-bts-test/jenkins.sh
@@ -11,6 +11,62 @@ docker_images_require \
"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
@@ -28,52 +84,11 @@ mkdir $VOL_BASE_DIR/unix
mkdir $VOL_BASE_DIR/fake_trx
-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
-
-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
-
-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
-
-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
-
-
-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
+start_bsc
+start_bts
+start_fake_trx
+start_trxcon
+start_testsuite
echo Stopping containers
docker container kill ${BUILD_TAG}-trxcon