Message ID | 20171101013043.19294-4-wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Nov 01, 2017 at 09:30:42AM +0800, Qu Wenruo wrote: > So prepare_test_dev() can be called several times in one test case, to > test different device sizes. > > Signed-off-by: Qu Wenruo <wqu@suse.com> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/tests/common b/tests/common index 977bade201a6..63750dbfeffe 100644 --- a/tests/common +++ b/tests/common @@ -441,8 +441,12 @@ prepare_test_dev() # num[K/M/G/T...] local size="$1" - [[ "$TEST_DEV" ]] && return [[ "$size" ]] || size='2G' + # Still truncate it to new size + if [[ "$TEST_DEV" ]]; then + truncate -s "$size" "$TEST_DEV" + return; + fi echo "\$TEST_DEV not given, use $TOP/test/test.img as fallback" >> \ "$RESULTS"
So prepare_test_dev() can be called several times in one test case, to test different device sizes. Signed-off-by: Qu Wenruo <wqu@suse.com> --- tests/common | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)