Skip to contentSkip to conversation

erofs-utils: tests: fix compression algorithms check

PATCH In review Hongzhen Luo 1 participant 2 messages Oct 10, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 erofs-utils: tests: fix compression algorithms check

When checking with _require_erofs_compression(), the error "xxx is not a block device" occurs. This patch adds "-o loop" to address this issue.

Fixes ace04f5bbc5c ("erofs-utils: tests: add compression algorithms

check for tests")

---
 tests/common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/common/rc +1 -1
index b739089..4fb4674 100644
@@ -157,7 +157,7 @@ _require_erofs_compression()
 	truncate -s 1m $random_dir/test/file > /dev/null 2>&1
 
 	eval "$MKFS_EROFS_PROG $opt $random_dir/tmp.erofs $random_dir/test" >> /dev/null 2>&1
-	_try_mount $random_dir/tmp.erofs $random_dir/mnt || \
+	_try_mount -o loop $random_dir/tmp.erofs $random_dir/mnt || \
 		_notrun "fail to mount filesystem in _require_erofs_compression"
 	_do_unmount $random_dir/mnt
 
Signature · 1 line
2.43.5
#1 lore raw
Quoted 17 lines · Hongzhen Luo

When checking with _require_erofs_compression(), the error "xxx is not a block device" occurs. This patch adds "-o loop" to address this issue.

Fixes ace04f5bbc5c ("erofs-utils: tests: add compression algorithms

check for tests")

---
  tests/common/rc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/common/rc +0 -0
index b739089..4fb4674 100644

tests/common/rc _require_erofs_compression() · line 163

Quoted 8 lines
tests/common/rc +1 -1
@@ -157,7 +157,7 @@ _require_erofs_compression()
  	truncate -s 1m $random_dir/test/file > /dev/null 2>&1
 
  	eval "$MKFS_EROFS_PROG $opt $random_dir/tmp.erofs $random_dir/test" >> /dev/null 2>&1
-	_try_mount $random_dir/tmp.erofs $random_dir/mnt || \
+	_try_mount -o loop $random_dir/tmp.erofs $random_dir/mnt || \
  		_notrun "fail to mount filesystem in _require_erofs_compression"
  	_do_unmount $random_dir/mnt
 

It appears that this fix is not universal (at least for erofsfuse), so please disregard this patch.

===

Thansks,

Hongzhen Luo