Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/powerpc/papr_vpd: Check devfd before get_system_loc_code()

Calling get_system_loc_code before checking devfd and errno fails the test
when the device is not available, the expected behaviour is a SKIP.

Change the order of 'SKIP_IF_MSG' to correctly SKIP when the /dev/
papr-vpd device is not available.

Test output before:
Test FAILED on line 271

Test output after:
[SKIP] Test skipped on line 266: /dev/papr-vpd not present

Signed-off-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240131130859.14968-1-rnsastry@linux.ibm.com

authored by

R Nageswara Sastry and committed by
Michael Ellerman
f0969627 aad98efd

+2 -2
+2 -2
tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c
··· 263 263 off_t size; 264 264 int fd; 265 265 266 - SKIP_IF_MSG(get_system_loc_code(&lc), 267 - "Cannot determine system location code"); 268 266 SKIP_IF_MSG(devfd < 0 && errno == ENOENT, 269 267 DEVPATH " not present"); 268 + SKIP_IF_MSG(get_system_loc_code(&lc), 269 + "Cannot determine system location code"); 270 270 271 271 FAIL_IF(devfd < 0); 272 272