@@ -248,6 +248,12 @@ static void mock_sysfs_pathinfo(const struct mocked_path *mp)
*/
void mock_pathinfo(int mask, const struct mocked_path *mp)
{
+ if (mp->flags & DEV_HIDDEN) {
+ will_return(__wrap_udev_device_get_sysattr_value, "1");
+ return;
+ } else
+ will_return(__wrap_udev_device_get_sysattr_value, "0");
+
/* filter_property */
will_return(__wrap_udev_device_get_sysname, mp->devnode);
if (mp->flags & BL_BY_PROPERTY) {
@@ -14,7 +14,8 @@ enum {
BL_MASK = BL_BY_DEVNODE|BL_BY_DEVICE|BL_BY_WWID|BL_BY_PROPERTY,
NEED_SELECT_PRIO = (1 << 8),
NEED_FD = (1 << 9),
- USE_GETUID = (1 << 10)
+ USE_GETUID = (1 << 10),
+ DEV_HIDDEN = (1 << 11),
};
struct mocked_path {
The previous patch "libmultipath: pathinfo: skip hidden devices" requires a change in the pathinfo mocking code. Otherwise the hwtable tests will fail. Signed-off-by: Martin Wilck <mwilck@suse.com> --- tests/test-lib.c | 6 ++++++ tests/test-lib.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)