From patchwork Tue May 2 01:01:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 13228403 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 946FFC77B7C for ; Tue, 2 May 2023 01:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232467AbjEBBCQ (ORCPT ); Mon, 1 May 2023 21:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjEBBCP (ORCPT ); Mon, 1 May 2023 21:02:15 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE67C30F6 for ; Mon, 1 May 2023 18:02:09 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 727111F854 for ; Tue, 2 May 2023 01:02:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1682989328; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m40easRD3g+cccI1U1Ub9+cOATt2e81kaIk0ouUp6fY=; b=qVqV2tyFI9WaTus1rj4AZrxMcsIg025CXYADuEsiCQc7j36wVbdPT4jwrK4QQoETe40k+H V0VJ7jQzxLPLLmN1gnq8GTHzJIiqx5g6VrM1P82qHe1sgiKlHWIz5EFCSd2Tu+oY4I2nYy SIDBLGS9A0mlhsMltQHg70Vf8HTU/0k= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BD5D913580 for ; Tue, 2 May 2023 01:02:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kJnYIA9hUGTldQAAMHmgww (envelope-from ) for ; Tue, 02 May 2023 01:02:07 +0000 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 3/3] btrfs-progs: misc-tests: add test case to verify btrfstune --convert-to-free-space-tree option Date: Tue, 2 May 2023 09:01:46 +0800 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The new test case would create a fs without free space tree, then popluate it, convert to free-space-tree feature, and make sure everything is fine. Signed-off-by: Qu Wenruo --- .../057-btrfstune-free-space-tree/test.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/misc-tests/057-btrfstune-free-space-tree/test.sh diff --git a/tests/misc-tests/057-btrfstune-free-space-tree/test.sh b/tests/misc-tests/057-btrfstune-free-space-tree/test.sh new file mode 100755 index 000000000000..c69f99cfbd38 --- /dev/null +++ b/tests/misc-tests/057-btrfstune-free-space-tree/test.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# test btrfstune --convert-to-free-space-tree option + +source "$TEST_TOP/common" || exit +source "$TEST_TOP/common.convert" || exit + +check_prereq mkfs.btrfs +check_prereq btrfstune +check_prereq btrfs + +setup_root_helper +prepare_test_dev + +run_check_mkfs_test_dev -O ^free-space-tree +run_check_mount_test_dev +populate_fs +run_check_umount_test_dev + +run_check $SUDO_HELPER "$TOP/btrfstune" --convert-to-free-space-tree $TEST_DEV + +run_check "$TOP/btrfs" check "$TEST_DEV"