if (geteuid() != 0 || have_effective_cap(CAP_SYS_ADMIN) <= 0)
return log_tests_skipped("not running privileged");
- if (detect_container() > 0)
- return log_tests_skipped("Test not supported in a container, requires udev/uevent notifications");
+ if (detect_container() > 0 || running_in_chroot() > 0)
+ return log_tests_skipped("Test not supported in a container/chroot, requires udev/uevent notifications");
assert_se(loop_device_make(fd, O_RDWR, 0, UINT64_MAX, 0, LO_FLAGS_PARTSCAN, LOCK_EX, &loop) >= 0);