osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40948?usp=email )
Change subject: testenv: enable_binary_repo: configure apt pin
......................................................................
testenv: enable_binary_repo: configure apt pin
Add an apt-pin to ensure packages from the Osmocom repositories get
preferred over Debian's packages. I just ran into this with osmo-mgw,
where we have 1.4.0 in osmocom:latest and Debian 13 has 1.14.0+dfsg1-2,
which counts as higher version. This results in the wrong package being
selected, and also in an error later on when trying to install related
debug packages from our repository:
The following packages have unmet dependencies:
osmo-mgw-dbgsym : Depends: osmo-mgw (= 1.14.0) but 1.14.0+dfsg1-2 is to be installed
Change-Id: I3a45de277bbd5299c8b840680b56b52a8731caa4
---
M _testenv/testenv/podman.py
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index bc45b3a..678a0c1 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -301,16 +301,23 @@
def enable_binary_repo():
+ # Add the binary repository
config = "deb [signed-by=/obs.key]"
config += " https://downloads.osmocom.org/packages/"
config += testenv.args.binary_repo.replace(":", ":/")
config += "/"
config += testenv.distros_repodirs[distro]
config += "/ ./"
-
path = "/etc/apt/sources.list.d/osmocom.list"
-
exec_cmd(["sh", "-c", f"echo {shlex.quote(config)} > {path}"])
+
+ # Add an apt-pin to prefer its packages
+ config = "Package: *\n"
+ config += 'Pin: origin "downloads.osmocom.org"\n'
+ config += "Pin-Priority: 1100\n"
+ path = "/etc/apt/preferences.d/osmocom-apt-pin"
+ exec_cmd(["sh", "-c", f"echo {shlex.quote(config)} > {path}"])
+
exec_cmd(["apt-get", "-q", "update"])
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40948?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3a45de277bbd5299c8b840680b56b52a8731caa4
Gerrit-Change-Number: 40948
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40942?usp=email )
Change subject: testenv: init podman: add --distro arg
......................................................................
testenv: init podman: add --distro arg
Allow building the podman image for another distribution. This was
mostly implemented already, but due to the missing --distro argument for
"./testenv.py init podman" it could not be used yet.
Change-Id: Iff59b5d403e88046a3f98438394e1e02a36e7c0a
---
M _testenv/testenv/__init__.py
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 3de7f0c..49f6368 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -69,6 +69,12 @@
action="store_true",
help="build image even if it is up-to-date",
)
+ sub_podman.add_argument(
+ "-d",
+ "--distro",
+ default=distro_default,
+ help=f"distribution for podman (default: {distro_default})",
+ )
sub_run = sub.add_parser("run", help="build components and run a testsuite")
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40942?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iff59b5d403e88046a3f98438394e1e02a36e7c0a
Gerrit-Change-Number: 40942
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40945?usp=email )
Change subject: testenv: check for --distro without --podman
......................................................................
testenv: check for --distro without --podman
The --distro option only makes sense with --podman, complain if it is
used without --podman.
Change-Id: I1b7b26320c65d498a1e812f85f0b98eda95be783
---
M _testenv/testenv/__init__.py
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 49f6368..3a92ff0 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -187,7 +187,7 @@
group.add_argument(
"-d",
"--distro",
- default=distro_default,
+ default=None, # override in set_args_defaults
help=f"distribution for podman (default: {distro_default})",
)
group.add_argument(
@@ -249,6 +249,9 @@
if args.binary_repo and not args.podman:
raise NoTraceException("--binary-repo requires --podman")
+ if args.distro and not args.podman:
+ raise NoTraceException("--distro requires --podman")
+
if args.kernel == "debian" and not args.podman:
raise NoTraceException("--kernel-debian requires --podman")
@@ -263,9 +266,17 @@
raise NoTraceException(f"testsuite dir not found: {testsuite_dir}")
+def set_args_defaults():
+ """Some defaults are set later, e.g. after verifying that --distro is not
+ being used without --podman."""
+ if args.distro is None:
+ args.distro = distro_default
+
+
def init_args():
parse_args()
verify_args_run()
+ set_args_defaults()
class ColorFormatter(logging.Formatter):
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40945?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I1b7b26320c65d498a1e812f85f0b98eda95be783
Gerrit-Change-Number: 40945
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40946?usp=email )
Change subject: testenv: check value of --distro early
......................................................................
testenv: check value of --distro early
Make sure that the value for --distro is supported early on, instead of
only checking it if --binary-repo is set while trying to add the binary
repository.
Change-Id: I37493f26d71e70a19f4a19b3bbda972c03c84905
---
M _testenv/testenv/__init__.py
M _testenv/testenv/podman.py
2 files changed, 10 insertions(+), 7 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 3a92ff0..f0d6629 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -21,6 +21,12 @@
log_prefix = "[testenv]"
+# Mapping of supported distros (docker/podman image names) and repository dirs
+# from the binary repository
+distros_repodirs = {
+ "debian:bookworm": "Debian_12",
+}
+
def resolve_testsuite_name_alias(name):
mapping = {
@@ -252,6 +258,9 @@
if args.distro and not args.podman:
raise NoTraceException("--distro requires --podman")
+ if args.distro and args.distro not in distros_repodirs:
+ raise NoTraceException(f"--distro must be one of {', '.join(distros_repodirs)}")
+
if args.kernel == "debian" and not args.podman:
raise NoTraceException("--kernel-debian requires --podman")
diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py
index 8ce6766..bc45b3a 100644
--- a/_testenv/testenv/podman.py
+++ b/_testenv/testenv/podman.py
@@ -300,18 +300,12 @@
sys.exit(1)
-def distro_to_repo_dir(distro):
- if distro == "debian:bookworm":
- return "Debian_12"
- raise RuntimeError(f"Can't translate distro {distro} to repo_dir!")
-
-
def enable_binary_repo():
config = "deb [signed-by=/obs.key]"
config += " https://downloads.osmocom.org/packages/"
config += testenv.args.binary_repo.replace(":", ":/")
config += "/"
- config += distro_to_repo_dir(distro)
+ config += testenv.distros_repodirs[distro]
config += "/ ./"
path = "/etc/apt/sources.list.d/osmocom.list"
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40946?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I37493f26d71e70a19f4a19b3bbda972c03c84905
Gerrit-Change-Number: 40946
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>