2018-03-01 14:05:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ../jenkins-common.sh
|
2018-10-16 09:15:42 +00:00
|
|
|
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
|
|
|
|
# NOTE: there is no osmocom-bb-host-latest, hence always use master!
|
|
|
|
docker_images_require \
|
|
|
|
"osmo-bsc-$IMAGE_SUFFIX" \
|
|
|
|
"osmo-bts-$IMAGE_SUFFIX" \
|
|
|
|
"osmocom-bb-host-master" \
|
|
|
|
"ttcn3-bts-test"
|
2018-03-01 14:05:15 +00:00
|
|
|
|
2019-05-29 17:13:16 +00:00
|
|
|
start_bsc() {
|
|
|
|
echo Starting container with BSC
|
|
|
|
docker run --rm \
|
|
|
|
--network $NET_NAME --ip 172.18.9.11 \
|
2020-06-20 18:48:20 +00:00
|
|
|
--ulimit core=-1 \
|
2019-05-29 17:13:16 +00:00
|
|
|
-v $VOL_BASE_DIR/bsc:/data \
|
|
|
|
--name ${BUILD_TAG}-bsc -d \
|
2020-03-18 14:37:59 +00:00
|
|
|
$DOCKER_ARGS \
|
2019-05-29 17:13:16 +00:00
|
|
|
$REPO_USER/osmo-bsc-$IMAGE_SUFFIX \
|
2019-11-13 15:15:44 +00:00
|
|
|
/bin/sh -c "osmo-bsc -c /data/osmo-bsc.cfg >>/data/osmo-bsc.log 2>&1"
|
2019-05-29 17:13:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
start_bts() {
|
2019-05-29 17:28:21 +00:00
|
|
|
local variant
|
|
|
|
variant="$1"
|
2019-05-29 17:13:16 +00:00
|
|
|
echo Starting container with BTS
|
2019-05-29 17:28:21 +00:00
|
|
|
if [ -z "$variant" ]; then
|
|
|
|
echo ERROR: You have to specify a BTS variant
|
|
|
|
exit 23
|
|
|
|
fi
|
2019-05-29 17:13:16 +00:00
|
|
|
docker run --rm \
|
|
|
|
--network $NET_NAME --ip 172.18.9.20 \
|
2020-06-20 18:48:20 +00:00
|
|
|
--ulimit core=-1 \
|
2019-05-29 17:13:16 +00:00
|
|
|
-v $VOL_BASE_DIR/bts:/data \
|
|
|
|
-v $VOL_BASE_DIR/unix:/data/unix \
|
|
|
|
--name ${BUILD_TAG}-bts -d \
|
2020-03-18 14:37:59 +00:00
|
|
|
$DOCKER_ARGS \
|
2019-05-29 17:13:16 +00:00
|
|
|
$REPO_USER/osmo-bts-$IMAGE_SUFFIX \
|
2019-11-13 15:15:44 +00:00
|
|
|
/bin/sh -c "/usr/local/bin/respawn.sh osmo-bts-$variant -c /data/osmo-bts.cfg -i 172.18.9.10 >>/data/osmo-bts.log 2>&1"
|
2019-05-29 17:13:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
start_fake_trx() {
|
|
|
|
echo Starting container with fake_trx
|
|
|
|
docker run --rm \
|
|
|
|
--network $NET_NAME --ip 172.18.9.21 \
|
2020-06-20 18:48:20 +00:00
|
|
|
--ulimit core=-1 \
|
2019-05-29 17:13:16 +00:00
|
|
|
-v $VOL_BASE_DIR/fake_trx:/data \
|
|
|
|
--name ${BUILD_TAG}-fake_trx -d \
|
2020-03-18 14:37:59 +00:00
|
|
|
$DOCKER_ARGS \
|
2019-05-29 17:13:16 +00:00
|
|
|
$REPO_USER/osmocom-bb-host-master \
|
2020-06-03 13:46:52 +00:00
|
|
|
/bin/sh -c "/tmp/osmocom-bb/src/target/trx_toolkit/fake_trx.py \
|
2019-05-29 17:13:16 +00:00
|
|
|
--log-file-name /data/fake_trx.log \
|
|
|
|
--log-file-level DEBUG \
|
2020-04-08 21:48:08 +00:00
|
|
|
--log-file-time \
|
2019-05-29 17:13:16 +00:00
|
|
|
--log-level INFO \
|
2020-05-17 18:17:42 +00:00
|
|
|
-R 172.18.9.20 -r 172.18.9.22 \
|
|
|
|
--trx TRX1@172.18.9.20:5700/1 \
|
|
|
|
--trx TRX2@172.18.9.20:5700/2 \
|
2020-06-03 13:46:52 +00:00
|
|
|
--trx TRX3@172.18.9.20:5700/3 >>/data/fake_trx.out 2>&1"
|
2019-05-29 17:13:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
start_trxcon() {
|
|
|
|
echo Starting container with trxcon
|
|
|
|
docker run --rm \
|
|
|
|
--network $NET_NAME --ip 172.18.9.22 \
|
2020-06-20 18:48:20 +00:00
|
|
|
--ulimit core=-1 \
|
2019-12-04 13:11:38 +00:00
|
|
|
-v $VOL_BASE_DIR/trxcon:/data \
|
2019-05-29 17:13:16 +00:00
|
|
|
-v $VOL_BASE_DIR/unix:/data/unix \
|
|
|
|
--name ${BUILD_TAG}-trxcon -d \
|
2020-03-18 14:37:59 +00:00
|
|
|
$DOCKER_ARGS \
|
2019-05-29 17:13:16 +00:00
|
|
|
$REPO_USER/osmocom-bb-host-master \
|
2019-11-13 15:15:44 +00:00
|
|
|
/bin/sh -c "trxcon -i 172.18.9.21 -s /data/unix/osmocom_l2 >>/data/trxcon.log 2>&1"
|
2019-05-29 17:13:16 +00:00
|
|
|
}
|
|
|
|
|
2019-05-29 17:28:21 +00:00
|
|
|
start_virtphy() {
|
|
|
|
echo Starting container with virtphy
|
|
|
|
docker run --rm \
|
|
|
|
--network $NET_NAME --ip 172.18.9.22 \
|
2020-06-20 18:48:20 +00:00
|
|
|
--ulimit core=-1 \
|
2020-06-07 12:12:00 +00:00
|
|
|
-v $VOL_BASE_DIR/virtphy:/data \
|
2019-05-29 17:28:21 +00:00
|
|
|
-v $VOL_BASE_DIR/unix:/data/unix \
|
|
|
|
--name ${BUILD_TAG}-virtphy -d \
|
2020-03-18 14:37:59 +00:00
|
|
|
$DOCKER_ARGS \
|
2019-05-29 17:28:21 +00:00
|
|
|
$REPO_USER/osmocom-bb-host-master \
|
2019-11-13 15:15:44 +00:00
|
|
|
/bin/sh -c "virtphy -s /data/unix/osmocom_l2 >>/data/virtphy.log 2>&1"
|
2019-05-29 17:28:21 +00:00
|
|
|
}
|
|
|
|
|
2019-05-29 17:13:16 +00:00
|
|
|
start_testsuite() {
|
|
|
|
echo Starting container with BTS testsuite
|
|
|
|
docker run --rm \
|
|
|
|
--network $NET_NAME --ip 172.18.9.10 \
|
2020-06-20 18:48:20 +00:00
|
|
|
--ulimit core=-1 \
|
2019-05-29 17:13:16 +00:00
|
|
|
-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 \
|
2020-03-18 14:37:59 +00:00
|
|
|
$DOCKER_ARGS \
|
2019-05-29 17:13:16 +00:00
|
|
|
$REPO_USER/ttcn3-bts-test
|
|
|
|
}
|
|
|
|
|
2018-03-01 14:05:15 +00:00
|
|
|
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/
|
|
|
|
|
2020-06-09 13:51:47 +00:00
|
|
|
# Work around for a bug in osmo-bts when all transceivers use IPAC_PROTO_RSL_TRX0.
|
|
|
|
# Enables patching of IPA stream ID. TODO: remove as soon as we make a new release.
|
|
|
|
if [ "$IMAGE_SUFFIX" = "latest" ]; then
|
|
|
|
sed "s/RSL_Emulation.mp_rslem_patch_ipa_cid := false/RSL_Emulation.mp_rslem_patch_ipa_cid := true/g" -i \
|
|
|
|
"$VOL_BASE_DIR/bts-tester/BTS_Tests.cfg"
|
|
|
|
fi
|
|
|
|
|
2018-03-01 14:05:15 +00:00
|
|
|
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
|
|
|
|
|
2018-10-22 17:24:32 +00:00
|
|
|
mkdir $VOL_BASE_DIR/fake_trx
|
2019-12-09 10:50:28 +00:00
|
|
|
mkdir $VOL_BASE_DIR/trxcon
|
2020-06-07 12:12:00 +00:00
|
|
|
mkdir $VOL_BASE_DIR/virtphy
|
2018-10-22 17:24:32 +00:00
|
|
|
|
2019-05-29 17:28:21 +00:00
|
|
|
# 1) classic test suite with BSC for OML and trxcon+fake_trx
|
2019-05-29 17:13:16 +00:00
|
|
|
start_bsc
|
2019-05-29 17:28:21 +00:00
|
|
|
start_bts trx
|
2019-05-29 17:13:16 +00:00
|
|
|
start_fake_trx
|
|
|
|
start_trxcon
|
|
|
|
start_testsuite
|
2018-03-01 14:05:15 +00:00
|
|
|
|
2019-05-29 17:28:21 +00:00
|
|
|
# 2) some GPRS tests require virt_phy
|
|
|
|
echo "Changing to virtphy configuration"
|
|
|
|
# switch from osmo-bts-trx + trxcon + faketrx to virtphy + osmo-bts-virtual
|
2018-03-01 14:05:15 +00:00
|
|
|
docker container kill ${BUILD_TAG}-trxcon
|
|
|
|
docker container kill ${BUILD_TAG}-fake_trx
|
|
|
|
docker container kill ${BUILD_TAG}-bts
|
2019-05-29 17:28:21 +00:00
|
|
|
cp virtphy/osmo-bts.cfg $VOL_BASE_DIR/bts/
|
|
|
|
start_bts virtual
|
|
|
|
start_virtphy
|
|
|
|
# ... and execute the testsuite again with different cfg
|
|
|
|
cp virtphy/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester/
|
2019-05-29 19:04:51 +00:00
|
|
|
#start_testsuite
|
2019-05-29 17:28:21 +00:00
|
|
|
|
2019-05-29 19:04:51 +00:00
|
|
|
# 3) OML tests require us to run without BSC
|
|
|
|
docker container kill ${BUILD_TAG}-bsc
|
|
|
|
# switch back from virtphy + osmo-bts-virtual to osmo-bts-trx
|
|
|
|
docker container kill ${BUILD_TAG}-virtphy
|
|
|
|
docker container kill ${BUILD_TAG}-bts
|
|
|
|
cp oml/osmo-bts.cfg $VOL_BASE_DIR/bts/
|
|
|
|
start_bts trx
|
|
|
|
start_fake_trx
|
|
|
|
start_trxcon
|
|
|
|
# ... and execute the testsuite again with different cfg
|
|
|
|
cp oml/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester/
|
|
|
|
start_testsuite
|
2019-05-29 17:28:21 +00:00
|
|
|
|
|
|
|
echo Stopping containers
|
2019-05-29 19:04:51 +00:00
|
|
|
docker container kill ${BUILD_TAG}-trxcon
|
|
|
|
docker container kill ${BUILD_TAG}-fake_trx
|
2019-05-29 17:28:21 +00:00
|
|
|
docker container kill ${BUILD_TAG}-bts
|
2019-05-29 19:04:51 +00:00
|
|
|
|
2018-03-01 14:05:15 +00:00
|
|
|
|
|
|
|
network_remove
|
|
|
|
rm -rf $VOL_BASE_DIR/unix
|
2018-04-09 13:28:25 +00:00
|
|
|
collect_logs
|