osmith has uploaded this change for review.

View Change

ns: use osmo-dev to build osmo-ns-dummy

Depends: osmo-ci I1eada70c6c27dca13fe69728007d6bcfa8ef02da
Change-Id: I32b83957a90b30cca18d02e187984648bd69a891
---
D _testenv/data/scripts/build_osmo_ns_dummy.sh
M _testenv/testenv/podman_install.py
M ns/run_osmo_ns_dummy.sh
M ns/testenv_sgsn_sns.cfg
M ns/testenv_sns.cfg
M ns/testenv_udp.cfg
6 files changed, 5 insertions(+), 48 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/77/43777/1
diff --git a/_testenv/data/scripts/build_osmo_ns_dummy.sh b/_testenv/data/scripts/build_osmo_ns_dummy.sh
deleted file mode 100755
index 12a6a43..0000000
--- a/_testenv/data/scripts/build_osmo_ns_dummy.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh -ex
-# Script used by testenv/podman_install:from_source_osmo_ns_dummy() to build
-# osmo-ns-dummy in libosmocore from git when running with "--binary-repo". This
-# is needed, because osmo-ns-dummy is not packaged.
-MAKE="make -j$1"
-
-$MAKE -C include/osmocom/core all
-$MAKE -C src/core libosmocore.la
-$MAKE -C src/vty libosmovty.la
-$MAKE -C src/isdn libosmoisdn.la
-$MAKE -C src/gsm libosmogsm.la
-$MAKE -C src/gb libosmogb.la
-$MAKE -C src/ctrl libosmoctrl.la
-$MAKE -C utils osmo-ns-dummy
diff --git a/_testenv/testenv/podman_install.py b/_testenv/testenv/podman_install.py
index c761a41..3aff51e 100644
--- a/_testenv/testenv/podman_install.py
+++ b/_testenv/testenv/podman_install.py
@@ -146,32 +146,7 @@
show_commit(project, git_dir_project)


-def from_source_osmo_ns_dummy():
- libosmocore_dir = os.path.join(git_dir, "libosmocore")
- osmo_ns_dummy_path = os.path.join(libosmocore_dir, "utils/osmo-ns-dummy")
-
- clone_project("libosmocore")
- if not os.path.exists(osmo_ns_dummy_path):
- logging.info("Building osmo-ns-dummy")
- testenv.cmd.run(["autoreconf", "-fi"], cwd=libosmocore_dir)
-
- configure_cmd = ["./configure"]
- if testenv.args.binary_repo.endswith(":asan"):
- configure_cmd += ["--enable-sanitize"]
- testenv.cmd.run(configure_cmd, cwd=libosmocore_dir)
-
- testenv.cmd.run(
- [os.path.join(testenv.data_dir, "scripts/build_osmo_ns_dummy.sh"), str(jobs)], cwd=libosmocore_dir
- )
-
- testenv.cmd.run(["ln", "-s", osmo_ns_dummy_path, "/usr/local/bin/osmo-ns-dummy"])
-
-
def from_source(cfg, cfg_name, section):
- program = cfg[section]["program"].split(" ", 1)[0]
- if program == "run_osmo_ns_dummy.sh":
- return from_source_osmo_ns_dummy()
-
logging.error(f"Can't install {section}! Fix this by either:")
logging.error(f"* Adding package= to [{section}] in {cfg_name}")
logging.error(" (if it can be installed from binary packages)")
diff --git a/ns/run_osmo_ns_dummy.sh b/ns/run_osmo_ns_dummy.sh
index 5a8cc05..7e84e13 100755
--- a/ns/run_osmo_ns_dummy.sh
+++ b/ns/run_osmo_ns_dummy.sh
@@ -1,11 +1,4 @@
#!/bin/sh -ex

-if [ -n "$OSMO_DEV_MAKE_DIR" ]; then
- # Using osmo-dev: either with or without --podman
- exec "$OSMO_DEV_MAKE_DIR"/libosmocore/utils/osmo-ns-dummy "$@"
-fi
-
-# Using binary packages: as osmo-ns-dummy is not packaged it gets built by
-# testenv/podman_install.py:from_source_osmo_ns_dummy() and symlinked to
-# /usr/local/bin.
-exec osmo-ns-dummy "$@"
+# osmo-ns-dummy is always built with osmo-dev, even if using --binary-packages
+exec "$OSMO_DEV_MAKE_DIR"/libosmocore/utils/osmo-ns-dummy "$@"
diff --git a/ns/testenv_sgsn_sns.cfg b/ns/testenv_sgsn_sns.cfg
index 8037d78..f499720 100644
--- a/ns/testenv_sgsn_sns.cfg
+++ b/ns/testenv_sgsn_sns.cfg
@@ -5,5 +5,6 @@
[osmo-ns-dummy]
program=run_osmo_ns_dummy.sh -p 4240 -c osmo-ns.sgsn.sns.cfg
make=libosmocore
+package=no
copy=osmo-ns.sgsn.sns.cfg
vty_port=4240
diff --git a/ns/testenv_sns.cfg b/ns/testenv_sns.cfg
index c19dfba..c691c79 100644
--- a/ns/testenv_sns.cfg
+++ b/ns/testenv_sns.cfg
@@ -5,5 +5,6 @@
[osmo-ns-dummy]
program=run_osmo_ns_dummy.sh -p 4240 -c osmo-ns.sns.cfg
make=libosmocore
+package=no
copy=osmo-ns.sns.cfg
vty_port=4240
diff --git a/ns/testenv_udp.cfg b/ns/testenv_udp.cfg
index 7d6e82b..c00c2f8 100644
--- a/ns/testenv_udp.cfg
+++ b/ns/testenv_udp.cfg
@@ -5,5 +5,6 @@
[osmo-ns-dummy]
program=run_osmo_ns_dummy.sh -p 4240 -c osmo-ns.udp.cfg
make=libosmocore
+package=no
copy=osmo-ns.udp.cfg
vty_port=4240

To view, visit change 43777. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I32b83957a90b30cca18d02e187984648bd69a891
Gerrit-Change-Number: 43777
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>