osmith submitted this change.
sccp: testenv: fix run with asan + latest binaries
When running against osmocom:nightly:asan, build sccp_demo_user with
--enable-sanitize. Otherwise this code is not running with asan and
doesn't even start (as the libraries we link against are built with
--enable-sanitize).
When running against osmocom:latest, check out the latest tag instead of
current master.
Fixes: OS#5899
Change-Id: I5307125560694feae9f0978ebd27607a77ed8675
---
M _testenv/testenv/podman_install.py
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/_testenv/testenv/podman_install.py b/_testenv/testenv/podman_install.py
index 2c5ae5a..a27abd8 100644
--- a/_testenv/testenv/podman_install.py
+++ b/_testenv/testenv/podman_install.py
@@ -20,7 +20,12 @@
global sccp_dir
global jobs
- git_dir = os.path.join(testenv.args.cache, "git")
+ # Make the git dir we clone into specific to the repository we build
+ # against. Replace ":" because the libtool scripts fail to escape it when
+ # setting LD_LIBRARY_PATH, leading to "cannot open shared object file"
+ # errors.
+ git_dir = os.path.join(testenv.args.cache, "git", f"build_against_{testenv.args.binary_repo}".replace(":", "_"))
+
sccp_dir = os.path.join(git_dir, "libosmo-sigtran")
jobs = multiprocessing.cpu_count() + 1
@@ -97,6 +102,14 @@
logging.debug("libosmo-sigtran: already cloned")
return
+ branch = "master"
+ if testenv.args.binary_repo.endswith(":latest"):
+ ls_remote = testenv.cmd.run(
+ ["git", "ls-remote", "--tags", "https://gerrit.osmocom.org/libosmo-sigtran"], capture_output=True, text=True
+ )
+ branch = ls_remote.stdout.split("\n")[-2].split("refs/tags/")[1].split("^")[0]
+
+ logging.info(f"libosmo-sigtran: cloning {branch}")
testenv.cmd.run(
[
"git",
@@ -105,6 +118,8 @@
"clone",
"--depth",
"1",
+ "--branch",
+ branch,
"https://gerrit.osmocom.org/libosmo-sigtran",
]
)
@@ -126,7 +141,12 @@
clone_libosmo_sigtran()
logging.info("Building sccp_demo_user")
testenv.cmd.run(["autoreconf", "-fi"], cwd=sccp_dir)
- testenv.cmd.run(["./configure"], cwd=sccp_dir)
+
+ configure_cmd = ["./configure"]
+ if testenv.args.binary_repo.endswith(":asan"):
+ configure_cmd += ["--enable-sanitize"]
+ testenv.cmd.run(configure_cmd, cwd=sccp_dir)
+
testenv.cmd.run(
["make", "-j", f"{jobs}", "libosmo-sigtran.la"],
cwd=os.path.join(sccp_dir, "src"),
To view, visit change 39934. To unsubscribe, or for help writing mail filters, visit settings.