From patchwork Wed Sep 25 13:37:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 11160695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 835CD924 for ; Wed, 25 Sep 2019 13:37:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61E4821D7E for ; Wed, 25 Sep 2019 13:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406646AbfIYNhr (ORCPT ); Wed, 25 Sep 2019 09:37:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:35680 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2406639AbfIYNhq (ORCPT ); Wed, 25 Sep 2019 09:37:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 18829B644; Wed, 25 Sep 2019 13:37:44 +0000 (UTC) From: Johannes Thumshirn To: David Sterba Cc: Nikolay Borisov , Linux BTRFS Mailinglist , Johannes Thumshirn Subject: [RFC PATCH v5 7/7] btrfs-progs: add test override for mkfs to use different checksums Date: Wed, 25 Sep 2019 15:37:28 +0200 Message-Id: <20190925133728.18027-8-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190925133728.18027-1-jthumshirn@suse.de> References: <20190925133728.18027-1-jthumshirn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Similar to check's test overrides add an override for mkfs tests so we can specify different mkfs flags. Signed-off-by: Johannes Thumshirn --- tests/common | 10 ++++++++-- tests/mkfs-tests/001-basic-profiles/test.sh | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/common b/tests/common index 75e5540155cc..5148820bef58 100644 --- a/tests/common +++ b/tests/common @@ -473,16 +473,22 @@ prepare_test_dev() # $1-$n: optional, default is -f run_check_mkfs_test_dev() { + MKFS_ARGS="$@" + setup_root_helper # check accidental files/devices passed - for opt in "$@"; do + for opt in "$MKFS_ARGS"; do if [ -f "$opt" -o -b "$opt" ]; then _fail "ERROR: unexpected option for run_check_mkfs_test_dev: device" fi done - run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$@" "$TEST_DEV" + if [ "$TEST_ENABLE_OVERRIDE" = 'true' ]; then + MKFS_ARGS="$TEST_ARGS_MKFS $MKFS_ARGS" + fi + + run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$MKFS_ARGS" "$TEST_DEV" } run_check_mount_test_dev() diff --git a/tests/mkfs-tests/001-basic-profiles/test.sh b/tests/mkfs-tests/001-basic-profiles/test.sh index 6e295274119d..e0110c722555 100755 --- a/tests/mkfs-tests/001-basic-profiles/test.sh +++ b/tests/mkfs-tests/001-basic-profiles/test.sh @@ -21,7 +21,13 @@ test_get_info() } test_do_mkfs() { - run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$@" + MKFS_ARGS="$@" + + if [ "$TEST_ENABLE_OVERRIDE" = 'true' ]; then + MKFS_ARGS="$TEST_ARGS_MKFS $MKFS_ARGS" + fi + + run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$MKFS_ARGS" } test_mkfs_single()