[PATCH v3 16/18] test/power: fix tests without power drivers

Bruce Richardson bruce.richardson at intel.com
Tue Jul 8 15:26:30 CEST 2025


On Tue, Jul 08, 2025 at 02:53:03PM +0200, David Marchand wrote:
> On Tue, Jul 8, 2025 at 2:48 PM Bruce Richardson
> <bruce.richardson at intel.com> wrote:
> >
> > On Tue, Jul 08, 2025 at 02:28:20PM +0200, David Marchand wrote:
> > > In the absence of drivers, skip tests instead of failing.
> > >
> > > Signed-off-by: David Marchand <david.marchand at redhat.com>
> > > ---
> > >  app/test/meson.build | 10 ++++++----
> > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/app/test/meson.build b/app/test/meson.build
> > > index 7d38f51918..79d635b42b 100644
> > > --- a/app/test/meson.build
> > > +++ b/app/test/meson.build
> > > @@ -145,10 +145,12 @@ source_file_deps = {
> > >      'test_pmd_ring.c': ['net_ring', 'ethdev', 'bus_vdev'],
> > >      'test_pmd_ring_perf.c': ['ethdev', 'net_ring', 'bus_vdev'],
> > >      'test_pmu.c': ['pmu'],
> > > -    'test_power.c': ['power'],
> > > -    'test_power_cpufreq.c': ['power'],
> > > -    'test_power_intel_uncore.c': ['power'],
> > > -    'test_power_kvm_vm.c': ['power'],
> > > +    'test_power.c': ['power', 'power_acpi', 'power_kvm_vm', 'power_intel_pstate',
> > > +        'power_amd_pstate', 'power_cppc'],
> >
> > Is this better done at build time or at runtime? Unfortunately we don't
> > have support for "or" operations on dependencies, so if even one driver is
> > missing the whole test file will not be built. I would think it better to
> > look for the drivers at runtime and return TEST_SKIPPED if not present.
> > WDYT?
> 
> I don't understand the intent behind this test, but test_power.c
> requires this list of drivers to be present.
> 
>         /* Perform tests for valid environments.*/
>         const enum power_management_env envs[] = {PM_ENV_ACPI_CPUFREQ,
>                         PM_ENV_KVM_VM,
>                         PM_ENV_PSTATE_CPUFREQ,
>                         PM_ENV_AMD_PSTATE_CPUFREQ,
>                         PM_ENV_CPPC_CPUFREQ};
> 
>         unsigned int i;
>         for (i = 0; i < RTE_DIM(envs); ++i) {
> 
>                 /* Test setting a valid environment */
>                 ret = rte_power_set_env(envs[i]);
> 
> From this, I chose to disable all other unit tests.
> 
Ok, if that's what it needs, so be it.

Acked-by: Bruce Richardson <bruce.richardson at intel.com>



More information about the dev mailing list