diff mbox series

[v3,2/3] btrfs-progs: tests: use feature output from "btrfs --version"

Message ID a920ac0e335cdc5998d6dee8d6a017253b3997ca.1721340621.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: btrfs-progs: csum-change enhancement | expand

Commit Message

Qu Wenruo July 18, 2024, 10:10 p.m. UTC
With the new feature matrix output in "btrfs --version" there is no need
to do the config.h hack to determine if we have certain feature.

This would provide a more reliable way to detect features.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/common | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/tests/common b/tests/common
index e996b35af787..4800ef8e77c9 100644
--- a/tests/common
+++ b/tests/common
@@ -12,11 +12,7 @@  _test_config()
 {
 	local feature="$1"
 
-	if [ ! -f "$TOP/include/config.h" ]; then
-		echo "include/config.h not exists"
-		exit 1
-	fi
-	if grep -q "$feature.*1" "${TOP}/include/config.h"; then
+	if "$TOP/btrfs" --version | grep -q "+${feature}"; then
 		return 0
 	fi
 	return 1