From patchwork Wed Nov 29 09:16:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10081653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AFE496056F for ; Wed, 29 Nov 2017 09:16:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B117F29739 for ; Wed, 29 Nov 2017 09:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A63532974A; Wed, 29 Nov 2017 09:16:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E5722973A for ; Wed, 29 Nov 2017 09:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753908AbdK2JQf (ORCPT ); Wed, 29 Nov 2017 04:16:35 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:39528 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753537AbdK2JQd (ORCPT ); Wed, 29 Nov 2017 04:16:33 -0500 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Wed, 29 Nov 2017 02:16:18 -0700 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 7/9] btrfs-progs: tests/mkfs: Introduce test case to check if mkfs rootdir can create new file Date: Wed, 29 Nov 2017 17:16:02 +0800 Message-Id: <20171129091604.2194-8-wqu@suse.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171129091604.2194-1-wqu@suse.com> References: <20171129091604.2194-1-wqu@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To test regression 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs"). Signed-off-by: Qu Wenruo --- tests/mkfs-tests/011-rootdir-create-file/test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tests/mkfs-tests/011-rootdir-create-file/test.sh diff --git a/tests/mkfs-tests/011-rootdir-create-file/test.sh b/tests/mkfs-tests/011-rootdir-create-file/test.sh new file mode 100755 index 000000000000..c6f3d74da885 --- /dev/null +++ b/tests/mkfs-tests/011-rootdir-create-file/test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Regression test for mkfs.btrfs --rootdir on non-exist file +# Designed behavior is, it should create a new file if destination doesn't exist +# Regression 460e93f25754 ("btrfs-progs: mkfs: check the status of file at mkfs") + + +source "$TOP/tests/common" + +check_prereq mkfs.btrfs + +tmp=$(mktemp -d --tmpdir btrfs-progs-mkfs.rootdirXXXXXXX) +run_check "$TOP/mkfs.btrfs" -f -r "$TOP/Documentation/" $tmp/new_file + +rm -rf -- "$tmp"