mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common: new function to get real device path name and basename
If TEST_DEV or SCRATCH_DEV is symlink(mostly a lvm lv), a simple basename is not enough, symlink should be followed. This task is common enough, so introduce new helper functions and replace all readlink calls in ext4/305 generic/009 generic/019 generic/285 generic/312 Signed-off-by: Eryu Guan <eguan@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ _require_scratch
|
||||
# 5G in byte
|
||||
fssize=$((2**30 * 5))
|
||||
required_blocks=$(($fssize / 1024))
|
||||
dev_blocks=$(grep $(basename $(readlink -f $SCRATCH_DEV)) /proc/partitions | $AWK_PROG '{print $3}')
|
||||
dev_blocks=$(grep $(_short_dev $SCRATCH_DEV) /proc/partitions | $AWK_PROG '{print $3}')
|
||||
if [ $required_blocks -gt $dev_blocks ];then
|
||||
_notrun "this test requires \$SCRATCH_DEV has ${fssize}B space"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user