btrfs-progs: tests: check the result log for critical warnings
Introduce a new function, check_test_results(), for misc/fsck/convert/mkfs test cases. This function is currently to catch warning message for subpage support, but can be later expanded for other usages. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
fc38ae7f48
commit
5c9a753ba0
13
tests/common
13
tests/common
|
@ -832,4 +832,17 @@ init_env()
|
|||
echo " convert: $TEST_ARGS_CONVERT" >> "$RESULTS"
|
||||
fi
|
||||
}
|
||||
|
||||
# Catch critical warning messages in test results
|
||||
check_test_results()
|
||||
{
|
||||
local results="$1"
|
||||
local testname="$2"
|
||||
|
||||
# Check subpage related warning
|
||||
if grep -q "crrosses 64K page boundary" "$results"; then
|
||||
_fail "found subpage related warning for case $testname"
|
||||
fi
|
||||
}
|
||||
|
||||
init_env
|
||||
|
|
|
@ -70,6 +70,7 @@ run_one_test() {
|
|||
fi
|
||||
_fail "test failed for case $testname"
|
||||
fi
|
||||
check_test_results "$RESULTS" "$testname"
|
||||
else
|
||||
_fail "custom test script not found"
|
||||
fi
|
||||
|
|
|
@ -64,6 +64,7 @@ run_one_test() {
|
|||
fi
|
||||
_fail "test failed for case $(basename $testname)"
|
||||
fi
|
||||
check_test_results "$RESULTS" "$testname"
|
||||
else
|
||||
# Type 1
|
||||
check_all_images
|
||||
|
|
|
@ -66,6 +66,7 @@ do
|
|||
fi
|
||||
_fail "test failed for case $(basename $i)"
|
||||
fi
|
||||
check_test_results "$RESULTS" "$(basename $i)"
|
||||
fi
|
||||
cd "$TEST_TOP"
|
||||
done
|
||||
|
|
|
@ -61,6 +61,7 @@ do
|
|||
fi
|
||||
_fail "test failed for case $(basename $i)"
|
||||
fi
|
||||
check_test_results "$RESULTS" "$(basename $i)"
|
||||
fi
|
||||
cd "$TEST_TOP"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue