Add provider-based package dependency recovery #461
Open
smuppand wants to merge 2 commits into
Open
Conversation
Add a package-manager based dependency recovery helper for testkit dependencies. The helper supports apt, rpm/dnf/yum, opkg, and check-only providers, with automatic provider detection based on available package manager tools. Add repo-owned provider configuration and command-to-package mapping files. The package map resolves missing dependency commands to provider-specific package names instead of assuming command names match package names. It also supports TESTNAME-scoped package sets so large feature dependencies, such as sensors packages, are installed only when the corresponding test runs. For apt-based systems, install optional *.sources artifacts from /opt/qcom-testkit/metadata when present and create optional apt auth configuration only when secure target-local secret files exist. This supports internal authenticated repositories, future public repositories, local apt sources, and existing target apt sources without hardcoding repository type. The provider reuses existing network recovery helpers when available, prints package manager diagnostics to stdout, retries package operations, and keeps package upgrade disabled by default. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Update check_dependencies() to optionally recover missing commands through the package provider before marking a test as SKIP. The existing behavior is preserved when package recovery is disabled or when a missing command has no package mapping. In those cases, the test continues to report SKIP for missing dependencies. When recovery is enabled, check_dependencies() sources lib_pkg_provider.sh, resolves the missing command through the command-to-package map, attempts to install the mapped package set using the active package provider, and rechecks PATH before deciding whether to continue or skip. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional package-manager based dependency recovery flow for testkit dependencies.
This change introduces a provider helper that can recover missing commands through the active package manager before a test is marked SKIP. The flow is package-manager based, not distro-profile based, so Yocto images using dnf/rpm are handled through the rpm provider, while apt, opkg, and check-only systems are handled separately.
New files:
The command-to-package map resolves missing dependency commands to provider-specific package names instead of assuming command names match package names. It also supports TESTNAME-scoped package sets, so larger stacks such as sensors packages are installed only when that specific test runs.
For apt systems, optional *.sources files under /opt/qcom-testkit/metadata are installed when present. Optional apt auth is created only when secure target-local secret files exist. This allows the same flow to work with internal authenticated repositories, future public repositories, local apt sources, or already-configured target apt sources.
check_dependencies() now optionally tries package recovery before reporting SKIP. If recovery is disabled, no package mapping exists, no supported package manager exists, or installation fails, the existing SKIP behavior is preserved.
Package upgrade remains disabled by default. Package-manager output is printed to stdout to make CI failures easier to debug.Add an optional package-manager based dependency recovery flow for testkit dependencies.
This change introduces a provider helper that can recover missing commands through the active package manager before a test is marked SKIP. The flow is package-manager based, not distro-profile based, so Yocto images using dnf/rpm are handled through the rpm provider, while apt, opkg, and check-only systems are handled separately.
New files:
The command-to-package map resolves missing dependency commands to provider-specific package names instead of assuming command names match package names. It also supports TESTNAME-scoped package sets, so larger stacks such as sensors packages are installed only when that specific test runs.
For apt systems, optional *.sources files under /opt/qcom-testkit/metadata are installed when present. Optional apt auth is created only when secure target-local secret files exist. This allows the same flow to work with internal authenticated repositories, future public repositories, local apt sources, or already-configured target apt sources.
check_dependencies() now optionally tries package recovery before reporting SKIP. If recovery is disabled, no package mapping exists, no supported package manager exists, or installation fails, the existing SKIP behavior is preserved.
Package upgrade remains disabled by default. Package-manager output is printed to stdout to make CI failures easier to debug.