[S] Change in osmo-ttcn3-hacks[master]: testenv: add --install-package
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41215?usp=email ) Change subject: testenv: add --install-package ...................................................................... testenv: add --install-package Add an option to quickly install packages in the container. This is useful when making a new SUT run with osmo-ttcn3-hacks and figuring out which packages need to be installed to make the build pass (without rebuilding the whole container for each missing dependency). It can also be used to quickly install additional debugging tools (strace, valgrind, etc.). A cache for the deb files is already getting mounted inside the container. Change-Id: Ie54817e6c0334a224a612521beb378537c10d39d --- M _testenv/testenv/__init__.py M _testenv/testenv/podman.py 2 files changed, 14 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py index 44259c2..8a3b728 100644 --- a/_testenv/testenv/__init__.py +++ b/_testenv/testenv/__init__.py @@ -210,6 +210,14 @@ action="store_true", help="run an interactive shell before stopping daemons/container", ) + group.add_argument( + "-I", + "--install-package", + dest="install_packages", + action="append", + metavar="PACKAGE", + help="temporarily install a debian package in the container", + ) group = sub_run.add_argument_group("output options") group.add_argument( @@ -272,6 +280,9 @@ if args.kernel == "debian" and not args.podman: raise NoTraceException("--kernel-debian requires --podman") + if args.install_packages and not args.podman: + raise NoTraceException("--install-packages requires --podman") + if args.kernel == "custom" and not os.path.exists(custom_kernel_path): logging.critical( "See _testenv/README.md for more information on downloading a pre-built kernel or building your own kernel." diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py index 678a0c1..2013699 100644 --- a/_testenv/testenv/podman.py +++ b/_testenv/testenv/podman.py @@ -285,6 +285,9 @@ if not os.path.exists(pkgcache): exec_cmd(["apt-get", "-q", "update"]) + if testenv.args.install_packages: + exec_cmd(["apt-get", "install", "-y", "--no-install-recommends"] + testenv.args.install_packages) + def check_titan_version(): version, _ = testenv.testenv_cfg.get_titan_version_first_cfg() -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41215?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: Ie54817e6c0334a224a612521beb378537c10d39d Gerrit-Change-Number: 41215 Gerrit-PatchSet: 3 Gerrit-Owner: osmith <osmith@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de>
participants (1)
-
osmith