pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/docker-playground/+/37471?usp=email )
Change subject: asterisk: Wait for Asterisk ready before starting testsuite
......................................................................
asterisk: Wait for Asterisk ready before starting testsuite
A recent commit made Asterisk wait for dnsmasq to be ready before
starting it. This means Asterisk takes more time now to be ready itself,
hence we need to delay launching the testsuite until it is ready.
Otherwise, the entire set of tests may be run even before Asterisk gets
to answer on the AMI socket.
Change-Id: I337d57f3eb3e6688dbf3c61d55978da10d84b2cb
---
M ttcn3-asterisk-ims-ue-test/jenkins.sh
M ttcn3-asterisk-ims-ue-test/ttcn3/ttcn3.sh
2 files changed, 28 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/71/37471/1
diff --git a/ttcn3-asterisk-ims-ue-test/jenkins.sh b/ttcn3-asterisk-ims-ue-test/jenkins.sh
index cad25bd..0707cb9 100755
--- a/ttcn3-asterisk-ims-ue-test/jenkins.sh
+++ b/ttcn3-asterisk-ims-ue-test/jenkins.sh
@@ -74,6 +74,7 @@
--ulimit core=-1 \
-e "TTCN3_PCAP_PATH=/data" \
-e "EXTRA_IPADDR=${EXTRA_IPADDR}" \
+ -e "ASTERISK_IPADDR=${ASTERISK_IPADDR}" \
-v "$VOL_BASE_DIR/asterisk-ims-ue-tester-${test_config}:/data" \
--name "${BUILD_TAG}-ttcn3-asterisk-ims-ue-test" \
$DOCKER_ARGS \
@@ -109,17 +110,19 @@
if [ "$i" = "ipv4" ]; then
NETMASK_PREFIX="24"
SUBNET_IP_PREFIX="$SUB4_PREFIX.$SUBNET"
+ ASTERISK_IPADDR="${SUBNET_IP_PREFIX}.${ASTERISK_IP_SUFFIX}"
DNS_IPADDR="${SUBNET_IP_PREFIX}.${DNS_IP_SUFFIX}"
EXTRA_IPADDR="${SUBNET_IP_PREFIX}.${IMSCORE_IP_SUFFIX}/${NETMASK_PREFIX}"
elif [ "$i" = "ipv6" ]; then
NETMASK_PREFIX="64"
SUBNET_IP_PREFIX="$SUB6_PREFIX:$SUBNET"
+ ASTERISK_IPADDR="${SUBNET_IP_PREFIX}::${ASTERISK_IP_SUFFIX}"
DNS_IPADDR="${SUBNET_IP_PREFIX}::${DNS_IP_SUFFIX}"
EXTRA_IPADDR="${SUBNET_IP_PREFIX}::${IMSCORE_IP_SUFFIX}/${NETMASK_PREFIX}"
# Replace IPv4 addresses with IPv6 ones:
REPLACE_V4_TO_V6_EXPR="s,${SUB4_PREFIX}\.${SUBNET}\.,${SUB6_PREFIX}:${SUBNET}::,g"
- REPLACE_V4_TO_V6_PORT_EXPR="s,${SUB4_PREFIX}\.${SUBNET}\.${ASTERISK_IP_SUFFIX}:,[${SUB6_PREFIX}:${SUBNET}::${ASTERISK_IP_SUFFIX}]:,g"
+ REPLACE_V4_TO_V6_PORT_EXPR="s,${SUB4_PREFIX}\.${SUBNET}\.${ASTERISK_IP_SUFFIX}:,[${ASTERISK_IPADDR}]:,g"
sed -i -E -e "${REPLACE_V4_TO_V6_EXPR}" "${VOL_BASE_DIR}/dnsmasq-${i}"/*.conf
sed -i -E -e "s,${SUB4_PREFIX}\.${SUBNET}\.${TTCN3_IP_SUFFIX}/24,${SUB6_PREFIX}:${SUBNET}::${TTCN3_IP_SUFFIX}/${NETMASK_PREFIX},g" "${VOL_BASE_DIR}/asterisk-${i}"/manager.conf
sed -i -E -e "s,${SUB4},${SUB6},g" "${VOL_BASE_DIR}/asterisk-${i}"/*.conf
@@ -130,8 +133,6 @@
start_dnsmasq "$i"
start_asterisk "$i"
- # Leave some time for asterisk to start:
- sleep 5
start_testsuite "$i"
docker_kill_wait "$BUILD_TAG"-asterisk || true
diff --git a/ttcn3-asterisk-ims-ue-test/ttcn3/ttcn3.sh b/ttcn3-asterisk-ims-ue-test/ttcn3/ttcn3.sh
index e1d4fac..a18d93f 100755
--- a/ttcn3-asterisk-ims-ue-test/ttcn3/ttcn3.sh
+++ b/ttcn3-asterisk-ims-ue-test/ttcn3/ttcn3.sh
@@ -13,4 +13,13 @@
# IPv6 addresses may take an extra while to be available ('tentative' state):
while [ -n "$(ip -6 addr show tentative)" ]; do sleep 1; done
+# Wait for Asterisk to be ready, which in turn may be waiting for dnsmasq to be ready...
+for i in $(seq 30); do
+ set -e
+ netcat -z -v "${ASTERISK_IPADDR}" 5038 && break
+ set +e
+ echo "[$i] Asterisk AMI ${ASTERISK_IPADDR} (port 5038) not ready, waiting..."
+ sleep 1
+done
+
ttcn3-docker-run asterisk Asterisk_Tests
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/37471?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I337d57f3eb3e6688dbf3c61d55978da10d84b2cb
Gerrit-Change-Number: 37471
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37470?usp=email )
Change subject: IPAd_Tests: add missing verification of ESipa responses from IPAd
......................................................................
Patch Set 1:
(1 comment)
File ipad/IPAd_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37470/comment/24c6c04c_fb7a…
PS1, Line 450: if (not match(esipa_req, tr_getBoundProfilePackageRequestEsipa)) {
I'd really go for adding this check in a new api, you'll use this several times:
f_esipa_transceive_exp(esipa_res, tr_getBoundProfilePackageRequestEsipa)
We do this kidn of API in several tests iirc.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37470?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0150fe5c98d5a5db9f1931c72ef6e015f74055bd
Gerrit-Change-Number: 37470
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 11 Jul 2024 14:41:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37470?usp=email )
Change subject: IPAd_Tests: add missing verification of ESipa responses from IPAd
......................................................................
IPAd_Tests: add missing verification of ESipa responses from IPAd
Some of the ESipa messages comming from the IPAd are not verified.
Related: SYS#6563
Change-Id: I0150fe5c98d5a5db9f1931c72ef6e015f74055bd
---
M ipad/IPAd_Tests.ttcn
1 file changed, 22 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/70/37470/1
diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn
index 1ede0b3..0cac37e 100644
--- a/ipad/IPAd_Tests.ttcn
+++ b/ipad/IPAd_Tests.ttcn
@@ -447,8 +447,11 @@
esipa_res := valueof(ts_getBoundProfilePackageResponseEsipa);
esipa_req := f_esipa_transceive(esipa_res);
+ if (not match(esipa_req, tr_getBoundProfilePackageRequestEsipa)) {
+ setverdict(fail, "unexpected message from IPAd");
+ }
+
boundProfilePackage := esipa_res.getBoundProfilePackageResponseEsipa.getBoundProfilePackageOkEsipa.boundProfilePackage;
- /* TODO: match response (we do not have a template yet) */
/* initialiseSecureChannelRequest */
f_vpcd_transceive(''O);
@@ -485,7 +488,9 @@
/* Receive ProfileInstallationResult from iPAD->eIM */
esipa_req := f_esipa_transceive_empty_response();
- /* TODO: match response (we do not have a template yet) */
+ if (not match(esipa_req, tr_handleNotificationEsipa_prfleInstRslt)) {
+ setverdict(fail, "unexpected message from IPAd");
+ }
/* Receive RemoveNotificationFromList from iPAD->eUICC */
f_vpcd_transceive(enc_NotificationSentResponse(valueof(ts_notificationSentResponse)));
@@ -658,6 +663,9 @@
/* IPAd will return the data to us */
esipa_res := valueof(ts_provideEimPackageResultResponse_eimAck(eimAcknowledgements := {1,2,3,4}));
esipa_req := f_esipa_transceive(esipa_res);
+ if (not match(esipa_req, tr_provideEimPackageResult_euiccDataResp)) {
+ setverdict(fail, "unexpected message from IPAd");
+ }
/* Wait some time until the the last HTTP response is actually delivered */
f_sleep(2.0);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37470?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0150fe5c98d5a5db9f1931c72ef6e015f74055bd
Gerrit-Change-Number: 37470
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange