This test currently creates a block device node for /dev/ram0,
which isn't guaranteed to exist, and can thus cause the test to
fail with:
mkfs.xfs: cannot open $TEST_DIR/proto/blockdev: No such device or address
Instead, create a node for the backing device for $TEST_DIR, which must
exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
$here/src/af_unix "$PROTO_DIR/socket" 2> /dev/null || true
# Block device (requires root)
- mknod "$PROTO_DIR/blockdev" b 1 0 2> /dev/null || true
+ # Uses the device for $TEST_DIR to ensure it always exists.
+ mknod "$PROTO_DIR/blockdev" b $(stat -c '%Hd %Ld' $TEST_DIR) \
+ 2> /dev/null || true
# Character device (requires root)
+ # Uses /dev/null, which should always exist
mknod "$PROTO_DIR/chardev" c 1 3 2> /dev/null || true
}