ttcn3: write Osmocom repository to configs
Write a line like 'Misc_Helpers.mp_osmo_repo := "nightly"' into the TTCN-3 config file (e.g. BSC_Tests.cfg), before starting the testsuite. This allows executing different code paths in the tests based on the repository. Related: OS#5327 Change-Id: Ic06532f7a67e59458652c5cf4c8f6fee8113e703changes/85/26385/2
parent
b7c430dd10
commit
305ce55b74
|
@ -355,6 +355,41 @@ image_suffix_is_master() {
|
|||
esac
|
||||
}
|
||||
|
||||
# Write the Osmocom repository to the TTCN3 config file, so the tests may take
|
||||
# different code paths (OS#5327)
|
||||
# $1: path to TTCN3 config file (e.g. BSC_Tests.cfg)
|
||||
write_mp_osmo_repo() {
|
||||
local repo="nightly"
|
||||
local config="$1"
|
||||
local line
|
||||
|
||||
if ! [ -e "$config" ]; then
|
||||
set +x
|
||||
echo
|
||||
echo "ERROR: TTCN3 config file '$config' not found in $PWD"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$IMAGE_SUFFIX" in
|
||||
latest*)
|
||||
repo="latest"
|
||||
;;
|
||||
20*q*-*) # e.g. 2021q1-centos8
|
||||
repo="$(echo "$IMAGE_SUFFIX" | cut -d- -f 1)" # e.g. 2021q1
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
line="Misc_Helpers.mp_osmo_repo := \"$repo\""
|
||||
|
||||
sed \
|
||||
-i \
|
||||
"s/\[MODULE_PARAMETERS\]/\[MODULE_PARAMETERS\]\n$line/g" \
|
||||
"$config"
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
# non-jenkins execution: assume local user name
|
||||
|
|
|
@ -13,6 +13,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/bsc-tester
|
||||
cp BSC_Tests.cfg $VOL_BASE_DIR/bsc-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bsc-tester/BSC_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/stp
|
||||
cp osmo-stp.cfg $VOL_BASE_DIR/stp/
|
||||
|
|
|
@ -15,6 +15,7 @@ NET_NAME=ttcn3-bsc_sccplite-test
|
|||
|
||||
mkdir $VOL_BASE_DIR/bsc-tester
|
||||
cp sccplite/BSC_Tests.cfg $VOL_BASE_DIR/bsc-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bsc-tester/BSC_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/bsc
|
||||
cp sccplite/osmo-bsc.cfg $VOL_BASE_DIR/bsc/
|
||||
|
|
|
@ -13,6 +13,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/bsc-tester
|
||||
cp BSC_Tests.cfg $VOL_BASE_DIR/bsc-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bsc-tester/BSC_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/stp
|
||||
cp osmo-stp.cfg $VOL_BASE_DIR/stp/
|
||||
|
|
|
@ -11,6 +11,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/bscnat-tester
|
||||
cp BSCNAT_Tests.cfg $VOL_BASE_DIR/bscnat-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bscnat-tester/BSCNAT_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/bscnat
|
||||
cp osmo-bsc-nat.cfg $VOL_BASE_DIR/bscnat/
|
||||
|
|
|
@ -119,12 +119,16 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/bts-tester-generic
|
||||
cp BTS_Tests.cfg $VOL_BASE_DIR/bts-tester-generic/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bts-tester-generic/BTS_Tests.cfg"
|
||||
mkdir $VOL_BASE_DIR/bts-tester-virtphy
|
||||
cp virtphy/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester-virtphy/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bts-tester-virtphy/BTS_Tests.cfg"
|
||||
mkdir $VOL_BASE_DIR/bts-tester-oml
|
||||
cp oml/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester-oml/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bts-tester-oml/BTS_Tests.cfg"
|
||||
mkdir $VOL_BASE_DIR/bts-tester-hopping
|
||||
cp fh/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester-hopping/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/bts-tester-hopping/BTS_Tests.cfg"
|
||||
|
||||
cp $VOL_BASE_DIR/bts-tester-generic/BTS_Tests.cfg \
|
||||
$VOL_BASE_DIR/bts-tester-hopping/BTS_Tests.cfg.inc
|
||||
|
|
|
@ -11,6 +11,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/cbc-tester
|
||||
cp CBC_Tests.cfg $VOL_BASE_DIR/cbc-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/cbc-tester/CBC_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/cbc
|
||||
cp osmo-cbc.cfg $VOL_BASE_DIR/cbc/
|
||||
|
|
|
@ -16,6 +16,7 @@ mkdir $VOL_BASE_DIR/fr-tester
|
|||
chmod a+w $VOL_BASE_DIR/fr-tester
|
||||
|
||||
cp FR_Tests.cfg $VOL_BASE_DIR/fr-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/fr-tester/FR_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/frnet
|
||||
cp FRNET_Tests.cfg $VOL_BASE_DIR/frnet/
|
||||
|
|
|
@ -29,6 +29,7 @@ mkdir $VOL_BASE_DIR/gbproxy-tester
|
|||
# if we don't change permissions, dumpcap fails to write (despite starting it as root!)
|
||||
chmod a+w $VOL_BASE_DIR/gbproxy-tester
|
||||
cp GBProxy_Tests.cfg $VOL_BASE_DIR/gbproxy-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/gbproxy-tester/GBProxy_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/gbproxy
|
||||
cp osmo-gbproxy.cfg $VOL_BASE_DIR/gbproxy/
|
||||
|
|
|
@ -17,6 +17,7 @@ mkdir $VOL_BASE_DIR/gbproxy-tester
|
|||
chmod a+w $VOL_BASE_DIR/gbproxy-tester
|
||||
|
||||
cp GBProxy_Tests.cfg $VOL_BASE_DIR/gbproxy-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/gbproxy-tester/GBProxy_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/gbproxy
|
||||
cp osmo-gbproxy.cfg $VOL_BASE_DIR/gbproxy/
|
||||
|
|
|
@ -19,6 +19,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/ggsn-tester
|
||||
cp GGSN_Tests.cfg $VOL_BASE_DIR/ggsn-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/ggsn-tester/GGSN_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/ggsn
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/hlr-tester
|
||||
cp HLR_Tests.cfg $VOL_BASE_DIR/hlr-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/hlr-tester/HLR_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/hlr
|
||||
cp osmo-hlr.cfg $VOL_BASE_DIR/hlr/
|
||||
|
|
|
@ -11,6 +11,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/hnodeb-tester
|
||||
cp HNB_Tests.cfg $VOL_BASE_DIR/hnodeb-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/hnodeb-tester/HNB_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/hnodeb
|
||||
cp osmo-hnodeb.cfg $VOL_BASE_DIR/hnodeb/
|
||||
|
|
|
@ -11,6 +11,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/mgw-tester
|
||||
cp MGCP_Test.cfg $VOL_BASE_DIR/mgw-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/mgw-tester/MGCP_Test.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/mgw
|
||||
cp osmo-mgw.cfg $VOL_BASE_DIR/mgw/
|
||||
|
|
|
@ -16,6 +16,7 @@ network_create $SUBNET
|
|||
mkdir $VOL_BASE_DIR/msc-tester
|
||||
mkdir $VOL_BASE_DIR/msc-tester/unix
|
||||
cp MSC_Tests.cfg $VOL_BASE_DIR/msc-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/msc-tester/MSC_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/stp
|
||||
cp osmo-stp.cfg $VOL_BASE_DIR/stp/
|
||||
|
|
|
@ -27,6 +27,7 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/ns-tester
|
||||
cp fr/NS_Tests.cfg $VOL_BASE_DIR/ns-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/ns-tester/NS_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/ns
|
||||
cp fr/osmo-ns-dummy.cfg $VOL_BASE_DIR/ns/
|
||||
|
|
|
@ -14,6 +14,7 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/ns-tester
|
||||
cp sgsn-sns/NS_Tests.cfg $VOL_BASE_DIR/ns-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/ns-tester/NS_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/ns
|
||||
cp sgsn-sns/osmo-ns-dummy.cfg $VOL_BASE_DIR/ns/
|
||||
|
|
|
@ -14,6 +14,7 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/ns-tester
|
||||
cp sns/NS_Tests.cfg $VOL_BASE_DIR/ns-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/ns-tester/NS_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/ns
|
||||
cp sns/osmo-ns-dummy.cfg $VOL_BASE_DIR/ns/
|
||||
|
|
|
@ -14,6 +14,7 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/ns-tester
|
||||
cp NS_Tests.cfg $VOL_BASE_DIR/ns-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/ns-tester/NS_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/ns
|
||||
cp osmo-ns-dummy.cfg $VOL_BASE_DIR/ns/
|
||||
|
|
|
@ -11,6 +11,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/pcap-client-tester
|
||||
cp OPCAP_CLIENT_Tests.cfg $VOL_BASE_DIR/pcap-client-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/pcap-client-tester/OPCAP_CLIENT_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/pcap-client
|
||||
cp osmo-pcap-client.cfg $VOL_BASE_DIR/pcap-client/
|
||||
|
|
|
@ -15,6 +15,7 @@ network_create $SUBNET
|
|||
mkdir $VOL_BASE_DIR/pcu-tester
|
||||
mkdir $VOL_BASE_DIR/pcu-tester/unix
|
||||
cp sns/PCU_Tests.cfg $VOL_BASE_DIR/pcu-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/pcu-tester/PCU_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/pcu
|
||||
mkdir $VOL_BASE_DIR/pcu/unix
|
||||
|
|
|
@ -15,6 +15,7 @@ network_create $SUBNET
|
|||
mkdir $VOL_BASE_DIR/pcu-tester
|
||||
mkdir $VOL_BASE_DIR/pcu-tester/unix
|
||||
cp PCU_Tests.cfg $VOL_BASE_DIR/pcu-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/pcu-tester/PCU_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/pcu
|
||||
mkdir $VOL_BASE_DIR/pcu/unix
|
||||
|
|
|
@ -75,6 +75,7 @@ mkdir $VOL_BASE_DIR/client
|
|||
# 1) server test suite
|
||||
start_server
|
||||
cp REMSIM_Tests.cfg $VOL_BASE_DIR/remsim-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/remsim-tester/REMSIM_Tests.cfg"
|
||||
start_testsuite
|
||||
docker container kill ${BUILD_TAG}-server
|
||||
|
||||
|
@ -82,6 +83,7 @@ docker container kill ${BUILD_TAG}-server
|
|||
echo "Changing to bankd configuration"
|
||||
start_bankd
|
||||
cp bankd/REMSIM_Tests.cfg $VOL_BASE_DIR/remsim-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/remsim-tester/REMSIM_Tests.cfg"
|
||||
start_testsuite
|
||||
docker container kill ${BUILD_TAG}-bankd
|
||||
|
||||
|
@ -89,4 +91,5 @@ docker container kill ${BUILD_TAG}-bankd
|
|||
echo "Changing to client configuration"
|
||||
start_client
|
||||
cp client/REMSIM_Tests.cfg $VOL_BASE_DIR/remsim-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/remsim-tester/REMSIM_Tests.cfg"
|
||||
start_testsuite
|
||||
|
|
|
@ -12,6 +12,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/sccp-tester
|
||||
cp SCCP_Tests.cfg $VOL_BASE_DIR/sccp-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/scpp-tester/SCCP_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/sccp
|
||||
cp sccp_demo_user.cfg $VOL_BASE_DIR/sccp/
|
||||
|
|
|
@ -15,6 +15,7 @@ network_create $SUBNET
|
|||
|
||||
mkdir $VOL_BASE_DIR/sgsn-tester
|
||||
cp SGSN_Tests.cfg $VOL_BASE_DIR/sgsn-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/sgsn-tester/SGSN_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/sgsn
|
||||
cp osmo-sgsn.cfg $VOL_BASE_DIR/sgsn/
|
||||
|
|
|
@ -15,6 +15,7 @@ network_create $SUBNET
|
|||
mkdir $VOL_BASE_DIR/sip-tester
|
||||
mkdir $VOL_BASE_DIR/sip-tester/unix
|
||||
cp SIP_Tests.cfg $VOL_BASE_DIR/sip-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/sip-tester/SIP_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/sip
|
||||
mkdir $VOL_BASE_DIR/sip/unix
|
||||
|
|
|
@ -12,6 +12,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/smlc-tester
|
||||
cp SMLC_Tests.cfg $VOL_BASE_DIR/smlc-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/smlc-tester/SMLC_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/stp
|
||||
cp osmo-stp.cfg $VOL_BASE_DIR/stp/
|
||||
|
|
|
@ -11,6 +11,7 @@ set -e
|
|||
|
||||
mkdir $VOL_BASE_DIR/stp-tester
|
||||
cp STP_Tests.cfg $VOL_BASE_DIR/stp-tester/
|
||||
write_mp_osmo_repo "$VOL_BASE_DIR/stp-tester/STP_Tests.cfg"
|
||||
|
||||
mkdir $VOL_BASE_DIR/stp
|
||||
cp osmo-stp.cfg $VOL_BASE_DIR/stp/
|
||||
|
|
Loading…
Reference in New Issue