automation-tests/pkg/util
Paul Holzinger 0443c5166e
inspect: ignore ENOENT during device lookup
When we walk the /dev tree we need to lookup all device paths. Now in
order to get the major and minor version we have to actually stat each
device. This can again fail of course. There is at least a race between
the readdir at stat call so it must ignore ENOENT errors to avoid
the race condition as this is not a user problem. Second, we should
also not return other errors and just log them instead, returning an
error means stopping the walk and returning early which means inspect
fails with an error which would be bad.

Also there seems to be cases were ENOENT will be returned all the time,
e.g. when a device is forcefully removed. In the reported bug this is
triggered with iSCSI devices.

Because the caller does already lookup the device from the created map
it reports a warning there if the device is missing on the host so it
is not a problem to ignore a error during lookup here.

[NO NEW TESTS NEEDED] Requires special device setup to trigger
consistentlyand we cannot do that in CI.

Fixes https://issues.redhat.com/browse/RHEL-11158

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-04 13:26:21 +02:00
..
camelcase Fix typos 2023-02-11 18:23:24 +01:00
filters.go filters: use new FilterID function from c/common 2023-06-13 17:49:41 +02:00
filters_test.go filters: use new FilterID function from c/common 2023-06-13 17:49:41 +02:00
kube.go play kube: Allow the user to import the contents of a tar file into a volume 2022-10-25 15:11:25 +03:00
mountOpts.go Add support for ramfs as well as tmpfs in volume mounts 2023-08-21 07:14:57 -04:00
mountOpts_linux.go Turn off 'noexec' option by default for named volumes 2020-05-20 16:48:20 -04:00
mountOpts_other.go go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
utils.go uid/gid mapping flags 2023-08-28 20:21:04 +02:00
utils_darwin.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
utils_freebsd.go pkg/util: Add pid information descriptors for FreeBSD 2022-10-17 15:33:04 +01:00
utils_linux.go inspect: ignore ENOENT during device lookup 2023-10-04 13:26:21 +02:00
utils_linux_test.go Match VT device paths to be blocked from mounting exactly 2023-01-28 05:18:40 -05:00
utils_supported.go rootless: make sure we only use a single pause process 2023-04-11 10:57:46 +02:00
utils_test.go uid/gid mapping flags 2023-08-28 20:21:04 +02:00
utils_unsupported.go pkg: Build pkg/util on FreeBSD 2022-08-13 07:53:34 +01:00
utils_windows.go rootless: make sure we only use a single pause process 2023-04-11 10:57:46 +02:00