osmith submitted this change.

View Change

Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve
testenv: fix running configs with omitted package=

The ns and sccp testsuites have test components in their testenv.cfg
without a package= line (osmo-ns-dummy and sccp_demo_user). These are
built from source against the -dev packages of the currently used binary
repository with testenv.podman_install.from_source().

Fix regressions from recent patches that broke this in two places:

1. testenv.daemons.start() always tried to access "packages" without
checking if it exists in the section first.

2. testenv.osmo_dev.get_targets() was treating a missing packages= line
the same as packages=no (which means building with osmo-dev instead
of testenv.podman_install.from_source()). Add the logic to not add
the make target to ret if there is no package= line. While at it,
rewrite the long if conditions to make the function easier to
understand.

Fixes: cf009ae7 ("testenv: run osmo-dev logic for --binary-repo too")
Fixes: 6cbec87b ("testenv: build package=no components with osmo-dev")
Change-Id: Id5920aacba832a1f43d87d09a9e133d95384e635
---
M _testenv/testenv/daemons.py
M _testenv/testenv/osmo_dev.py
2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py
index 0c402e9..e6085b6 100644
--- a/_testenv/testenv/daemons.py
+++ b/_testenv/testenv/daemons.py
@@ -60,7 +60,7 @@
env["LIBOSMO_IO_BACKEND"] = "IO_URING"

envtype = "osmo_dev"
- if testenv.args.binary_repo and section_data["package"] != "no":
+ if testenv.args.binary_repo and section_data.get("package") != "no":
envtype = "binary_repo"

if testenv.args.podman:
diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py
index edbe1b2..d2f9229 100644
--- a/_testenv/testenv/osmo_dev.py
+++ b/_testenv/testenv/osmo_dev.py
@@ -58,10 +58,24 @@
# Gets built with testenv.testsuite.build()
continue

- if "make" in section_data and section_data["make"] != "no" and section_data["make"] not in ret:
- if testenv.args.binary_repo and section_data.get("package", "no") != "no":
+ if "make" not in section_data or section_data["make"] == "no":
+ # No osmo-dev make target listed in testenv.cfg
+ continue
+
+ if section_data["make"] in ret:
+ # Already decided that this target will be built while parsing a
+ # previous section
+ continue
+
+ if testenv.args.binary_repo:
+ if "package" not in section_data:
+ # Gets built with testenv.podman_install.from_source()
continue
- ret += [section_data["make"]]
+ if section_data["package"] != "no":
+ # Gets installed from a debian package
+ continue
+
+ ret += [section_data["make"]]

return ret


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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id5920aacba832a1f43d87d09a9e133d95384e635
Gerrit-Change-Number: 43795
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>