selftests/powerpc: Skip energy_scale_info test on older firmware
authorMichael Ellerman <mpe@ellerman.id.au>
Sun, 19 Jun 2022 23:31:03 +0000 (09:31 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 26 Jun 2022 00:29:43 +0000 (10:29 +1000)
commit4228a996b072d36f3baafb4afdc2d2d66d2cbadf
tree15687434777ac8014f0e92959e9d4ae5d16b0976
parent00bcb550dc60f73d593d2dbb718c4f521c7d7be8
selftests/powerpc: Skip energy_scale_info test on older firmware

Older machines don't have the firmware feature that enables the code
this test is testing. Skip the test if the sysfs directory doesn't
exist. Also use the FAIL_IF() macro to provide more verbose error
reporting if an error is encountered.

Fixes: 57201d657eb7 ("selftest/powerpc: Add PAPR sysfs attributes sniff test")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220619233103.2666171-1-mpe@ellerman.id.au
tools/testing/selftests/powerpc/papr_attributes/attr_test.c