Skip to content

Add provider-based package dependency recovery #461

Open
smuppand wants to merge 2 commits into
qualcomm-linux:mainfrom
smuppand:distro_support
Open

Add provider-based package dependency recovery #461
smuppand wants to merge 2 commits into
qualcomm-linux:mainfrom
smuppand:distro_support

Conversation

@smuppand
Copy link
Copy Markdown
Contributor

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:

  • Runner/config/pkg_provider.conf
  • Runner/config/pkg_command_map.conf
  • Runner/utils/lib_pkg_provider.sh

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:

  • Runner/config/pkg_provider.conf
  • Runner/config/pkg_command_map.conf
  • Runner/utils/lib_pkg_provider.sh

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.

smuppand added 2 commits May 26, 2026 15:10
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>
@smuppand smuppand added the enhancement New feature or request label May 26, 2026
@smuppand smuppand requested a review from maheswaqcom May 26, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant