testsuite/mount.tests: fix false positive
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 28 Jun 2018 12:10:00 +0000 (14:10 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 28 Jun 2018 12:10:00 +0000 (14:10 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/loop.c
testsuite/mount.tests

index f0d4296ae9454020b26eea3aec7f39e7b18c07a7..c78535a206d026c5beedb5add0e0dd4e14399cbd 100644 (file)
@@ -106,6 +106,10 @@ int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offse
                return -errno;
        }
 
+//TODO: use LOOP_CTL_GET_FREE instead of trying every loopN in sequence? a-la:
+// fd = open("/dev/loop-control", O_RDWR);
+// loopN = ioctl(fd, LOOP_CTL_GET_FREE);
+//
        /* Find a loop device.  */
        try = *device ? *device : dev;
        /* 1048575 (0xfffff) is a max possible minor number in Linux circa 2010 */
index a0bc50888693bdc9abe83e02d9e95a01bd97aa04..91c2e8b42aa03270842df6b63381e2d6c139968a 100755 (executable)
@@ -10,9 +10,11 @@ test "`id -u`" = 0 || {
        exit 0
 }
 
+# Without MOUNT_LOOP_CREATE, the test will fail if /dev/loopN's do not exist
 if test x"$CONFIG_MKFS_MINIX" != x"y" \
 || test x"$CONFIG_FEATURE_MINIX2" != x"y" \
 || test x"$CONFIG_FEATURE_MOUNT_LOOP" != x"y" \
+|| test x"$CONFIG_FEATURE_MOUNT_LOOP_CREATE" != x"y" \
 || test x"$CONFIG_FEATURE_MOUNT_FLAGS" != x"y" \
 || test x"$CONFIG_FEATURE_DEVFS" = x"y" \
 ; then