osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40321?usp=email )
Change subject: epdg: initial testenv.cfg
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
setting to draft: works for me with a 6.8.12 kernel, but doesn't seem to work with other kernels yet, looking into it
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40321?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ide2873be7830cc43e7fa09f26b2d504d0563a3c2
Gerrit-Change-Number: 40321
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 16 May 2025 12:26:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40320?usp=email )
Change subject: epdg: TC_concurrent_ues_MTC: rx CMD_ATTACHED without from vc_conn_list[i]
......................................................................
epdg: TC_concurrent_ues_MTC: rx CMD_ATTACHED without from vc_conn_list[i]
This is needed to make the test pass in QEMU. I think this makes it
accept the COORD_CMD_ATTACHED in any order instead of the order the
COORD_CMD_START were sent beforehand.
Increasing the sleep between the COORD_CMD_START also makes the test
pass in QEMU, but that increases the overall test time significantly in
TC_concurrent_ues100.
Change-Id: I4c76d12273a14df562ea906e6c8ddb348d1b0eda
---
M epdg/EPDG_Tests.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/20/40320/1
diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn
index c8db429..9ca9d82 100644
--- a/epdg/EPDG_Tests.ttcn
+++ b/epdg/EPDG_Tests.ttcn
@@ -1272,7 +1272,7 @@
}
for (var integer i := 0; i < num_ues; i := i + 1) {
- COORD.receive(COORD_CMD_ATTACHED) from vc_conn_list[i];
+ COORD.receive(COORD_CMD_ATTACHED);
}
log("All attached!");
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40320?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4c76d12273a14df562ea906e6c8ddb348d1b0eda
Gerrit-Change-Number: 40320
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40319?usp=email )
Change subject: epdg: add sleep to f_TC_hss_initiated_deregister_permanent_termination
......................................................................
epdg: add sleep to f_TC_hss_initiated_deregister_permanent_termination
The test sends PERMANENT_TERMINATION twice to osmo-epdg. If we don't
sleep between them, osmo-epdg is not able to terminate related FSMs
quickly enough between the first and the second termination request when
running in QEMU, which results in osmo-epdg answering with
DIAMETER_SUCESS instead of DIAMETER_ERROR_USER_UNKNOWN for the second
f_DIA_SWx_RT.
Change-Id: I5d7021b6a9800cf1d7588f4a0ef864f5c30cf475
---
M epdg/EPDG_Tests.ttcn
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/19/40319/1
diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn
index b551b67..c8db429 100644
--- a/epdg/EPDG_Tests.ttcn
+++ b/epdg/EPDG_Tests.ttcn
@@ -1192,6 +1192,7 @@
f_initial_attach();
/* Procedure should be performed properly: */
f_DIA_SWx_RT(PERMANENT_TERMINATION, tr_AVP_ResultCode(DIAMETER_SUCCESS));
+ f_sleep(1.0);
/* Subscriber was already removed, it should fail if requested again: */
var DIAMETER_ts29_229_ExperimentalResultcode erc := DIAMETER_ERROR_USER_UNKNOWN;
f_DIA_SWx_RT(PERMANENT_TERMINATION, tr_AVP_ExperimentalResult(vendor_id_3GPP, int2oct(enum2int(erc), 4)),
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40319?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5d7021b6a9800cf1d7588f4a0ef864f5c30cf475
Gerrit-Change-Number: 40319
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40310?usp=email )
Change subject: testenv: no python trace for setup script failures
......................................................................
testenv: no python trace for setup script failures
Do not print a python trace when a setup script fails, usually it is
unrelated and just clutters the output.
Change-Id: Icbec52befa268547906fdbe9b52bdbc9e94722e6
---
M _testenv/testenv/daemons.py
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/10/40310/1
diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py
index da8248e..d4804d0 100644
--- a/_testenv/testenv/daemons.py
+++ b/_testenv/testenv/daemons.py
@@ -75,7 +75,8 @@
if "setup" in section_data:
setup = section_data["setup"]
logging.info(f"Running {section} setup script")
- testenv.cmd.run(setup, cwd=cwd)
+ if testenv.cmd.run(setup, cwd=cwd, check=False).returncode:
+ raise testenv.NoTraceException(f"{section}: setup script failed")
def kill_process_tree(pid, ppids):
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40310?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Icbec52befa268547906fdbe9b52bdbc9e94722e6
Gerrit-Change-Number: 40310
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40312?usp=email )
Change subject: testenv: podman: add missing tree command
......................................................................
testenv: podman: add missing tree command
The tree command is used by the testenv scripts when building QEMU
initrds to quickly show the contents of the initrd before packing it.
Fix for:
+ tree -a /tmp/testenv-ggsn_tests-osmo_ggsn_v4_only-20250509-1151-745e3562-dxt_lu1f/ggsn/_initrd
osmo-ggsn/run.sh: 140: tree: not found
That the build initramfs logic did not abort here is another bug that
gets fixed in a follow-up patch in this series.
Change-Id: I75fcd210db9e5c9364cb98ee09ebf754790aa55f
---
M _testenv/data/podman/Dockerfile
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/40312/1
diff --git a/_testenv/data/podman/Dockerfile b/_testenv/data/podman/Dockerfile
index 9f92206..fb97ee8 100644
--- a/_testenv/data/podman/Dockerfile
+++ b/_testenv/data/podman/Dockerfile
@@ -85,6 +85,7 @@
sqlite3 \
sudo \
tcpdump \
+ tree \
vim \
vsmartcard-vpcd \
wget \
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40312?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I75fcd210db9e5c9364cb98ee09ebf754790aa55f
Gerrit-Change-Number: 40312
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40313?usp=email )
Change subject: testenv: qemu: fix adding kernel modules
......................................................................
testenv: qemu: fix adding kernel modules
Without this patch qemu_initrd_add_file fails to add kernel modules
with "No such file or directory" when running in podman, even though the
files exist:
./testenv.py run ggsn -Dp -c osmo_ggsn_v4_only
…
+ cp -a --parents /lib/modules/6.1.0-34-amd64/kernel/drivers/net/net_failover.ko /tmp/testenv-ggsn_tests-osmo_ggsn_v4_only-20250509-1146-cd82caba-wegi5i98/ggsn/_initrd/usr
cp: 'lib/modules/6.1.0-34-amd64/kernel/drivers/net': No such file or directory
…
When looking at it with strace it became clear that this comes from a
getxattr that fails in the podman filesystem and returns a misleading
error:
getxattr("lib/modules/6.1.0-34-amd64/kernel/drivers/net", "system.posix_acl_access", 0x7ffc012054e0, 132) = -1 ENOENT (No such file or directory)
Fix it by modifying the cp command to not try to preserve any attributes
(they don't matter in the initramfs).
Change-Id: Ic32318da169ee8ebf867937782be5cf8a15f9f2f
---
M _testenv/data/scripts/qemu/qemu_functions.sh
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/40313/1
diff --git a/_testenv/data/scripts/qemu/qemu_functions.sh b/_testenv/data/scripts/qemu/qemu_functions.sh
index e2014a1..9c92a37 100755
--- a/_testenv/data/scripts/qemu/qemu_functions.sh
+++ b/_testenv/data/scripts/qemu/qemu_functions.sh
@@ -8,14 +8,15 @@
# $@: path to files
qemu_initrd_add_file() {
local i
+ local cp="cp --no-dereference --recursive --parents"
for i in "$@"; do
case "$i" in
/bin/*|/sbin/*|/lib/*|/lib64/*)
- cp -a --parents "$i" "$INITRD_DIR"/usr
+ $cp "$i" "$INITRD_DIR"/usr
;;
*)
- cp -a --parents "$i" "$INITRD_DIR"
+ $cp "$i" "$INITRD_DIR"
;;
esac
done
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40313?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic32318da169ee8ebf867937782be5cf8a15f9f2f
Gerrit-Change-Number: 40313
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40314?usp=email )
Change subject: testenv: fix not aborting on build_initrd error
......................................................................
testenv: fix not aborting on build_initrd error
Without this patch the build_initrd function keeps going on errors:
+ cp -a --parents /lib/modules/6.1.0-34-amd64/kernel/drivers/net/net_failover.ko /tmp/testenv-ggsn_tests-osmo_ggsn_v4_only-20250509-1040-a21668df-euc9e2fs/ggsn/_initrd/usr
cp: 'lib/modules/6.1.0-34-amd64/kernel/drivers/net': No such file or directory
+ cp -a --parents /lib/modules/6.1.0-34-amd64/kernel/drivers/net/virtio_net.ko /tmp/testenv-ggsn_tests-osmo_ggsn_v4_only-20250509-1040-a21668df-euc9e2fs/ggsn/_initrd/usr
…
The reason for that is that even though the script runs with set -e, the
-e flag gets ignored between if…then where the build_initrd shell
function gets called:
if ! build_initrd >build_initrd.log 2>&1; then
qemu_initrd_exit_error "build_initrd.log"
fi
Fix it by using a trap instead.
Related: https://unix.stackexchange.com/a/65564
Change-Id: I2870b7e7ba28b2afc72e86b7a3bc389103564c80
---
M _testenv/data/scripts/qemu/qemu_functions.sh
M ggsn_tests/osmo-ggsn/run.sh
2 files changed, 18 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/40314/1
diff --git a/_testenv/data/scripts/qemu/qemu_functions.sh b/_testenv/data/scripts/qemu/qemu_functions.sh
index 9c92a37..46e7273 100755
--- a/_testenv/data/scripts/qemu/qemu_functions.sh
+++ b/_testenv/data/scripts/qemu/qemu_functions.sh
@@ -136,10 +136,12 @@
| gzip -1 > "$INITRD_DIR".gz )
}
+# Trap for qemu_build_initrd_with_log_redirect
+# Building the initrd is quite verbose, therefore put it in a log file
+# and only output its contents on error (see e.g. osmo-ggsn/run.sh)
qemu_initrd_exit_error() {
- # Building the initrd is quite verbose, therefore put it in a log file
- # and only output its contents on error (see e.g. osmo-ggsn/run.sh)
- cat "$1"
+ trap - EXIT INT TERM 0
+ cat "build_initrd.log"
set +x
echo
echo "ERROR: failed to build the initrd!"
@@ -147,6 +149,18 @@
exit 1
}
+# Users of qemu_functions should define a build_initrd function that calls
+# qemu_initrd_init, qemu_initrd_add_* and qemu_initrd_finish. See ggsn's run.sh
+# as example. The function here redirects the very verbose output of building
+# the initrd to a separate log file, and aborts and display the log on error.
+qemu_build_initrd_with_log_redirect() {
+ # Use a trap instead of "if !build_initrd; then ..." logic as "set -e"
+ # gets otherwise: https://unix.stackexchange.com/a/65564
+ trap qemu_initrd_exit_error EXIT INT TERM 0
+ build_initrd >build_initrd.log 2>&1
+ trap - EXIT INT TERM 0
+}
+
qemu_random_mac() {
printf "52:54:"
date "+%c %N" | sha1sum | sed 's/\(.\{2\}\)/\1:/g' | cut -d: -f 1-4
diff --git a/ggsn_tests/osmo-ggsn/run.sh b/ggsn_tests/osmo-ggsn/run.sh
index ae77484..27e633e 100755
--- a/ggsn_tests/osmo-ggsn/run.sh
+++ b/ggsn_tests/osmo-ggsn/run.sh
@@ -32,9 +32,5 @@
}
. qemu_functions.sh
-
-if ! build_initrd >build_initrd.log 2>&1; then
- qemu_initrd_exit_error "build_initrd.log"
-fi
-
+qemu_build_initrd_with_log_redirect
qemu_run
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40314?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2870b7e7ba28b2afc72e86b7a3bc389103564c80
Gerrit-Change-Number: 40314
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40315?usp=email )
Change subject: testenv: qemu: initrd build fail: stop immediately
......................................................................
testenv: qemu: initrd build fail: stop immediately
Let qemu_wait.sh fail immediately when building the initrd has failed,
instead of waiting until it runs into a timeout.
Change-Id: I6de4d1c31385af52ee0fd55378adb10a9e2c2154
---
M _testenv/data/scripts/qemu/qemu_functions.sh
M _testenv/data/scripts/qemu/qemu_wait.sh
2 files changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/40315/1
diff --git a/_testenv/data/scripts/qemu/qemu_functions.sh b/_testenv/data/scripts/qemu/qemu_functions.sh
index 46e7273..a984ff9 100755
--- a/_testenv/data/scripts/qemu/qemu_functions.sh
+++ b/_testenv/data/scripts/qemu/qemu_functions.sh
@@ -146,6 +146,7 @@
echo
echo "ERROR: failed to build the initrd!"
echo
+ touch build_initrd_failed
exit 1
}
diff --git a/_testenv/data/scripts/qemu/qemu_wait.sh b/_testenv/data/scripts/qemu/qemu_wait.sh
index fb45c7e..2d42701 100755
--- a/_testenv/data/scripts/qemu/qemu_wait.sh
+++ b/_testenv/data/scripts/qemu/qemu_wait.sh
@@ -8,6 +8,12 @@
i=0
for i in $(seq 1 600); do
sleep 0.1
+
+ # Check for the marker from qemu_initrd_exit_error
+ if [ -e build_initrd_failed ]; then
+ exit 1
+ fi
+
if grep -q KERNEL_TEST_VM_IS_READY "$LOGFILE"; then
# Wait some more for SUT to become ready
sleep 1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40315?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6de4d1c31385af52ee0fd55378adb10a9e2c2154
Gerrit-Change-Number: 40315
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>