From patchwork Mon Apr 17 21:33:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9684559 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 E4B29600F6 for ; Mon, 17 Apr 2017 21:34:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3937212BE for ; Mon, 17 Apr 2017 21:34:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C791428236; Mon, 17 Apr 2017 21:34:21 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 4DC57212BE for ; Mon, 17 Apr 2017 21:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753523AbdDQVeT (ORCPT ); Mon, 17 Apr 2017 17:34:19 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:32917 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753250AbdDQVeS (ORCPT ); Mon, 17 Apr 2017 17:34:18 -0400 Received: by mail-pf0-f194.google.com with SMTP id c198so27153539pfc.0 for ; Mon, 17 Apr 2017 14:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JmFRx3ChfDGiaEBs/x7cbWet+0k+i4cspbQZIlPnXqw=; b=SHM9fnzvAlaJzrZ6XeCEcXARJmEWAtOWtEouv3Ud+MYEAoOZ0BMTyrkataMKt0T6Pt C1B44FTcn81v7waKH9aLIyqXhUhQKspBl8xmbXvssK9Tx4XVKwP0XYrUD2I71kuKTw6n 38g7y9IL0EJbzMQ7ApJSbS+4xzp358xegIOz3ET6hhhS+1FRr6CSQ5GKWPhbG4aH29RK Ew1hfMlnYZZhlvfMskr2sjlbrWWLkS0RquFLMDfS2SN6dgBkyhrogb2YKgg+39+ojiPW fhh8jrbi6omrcYudyph1YCJCMkWMCq22Jn0IfLUERH8XJzl/XCj7JUN7YUtW7sZSiJR+ RhkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JmFRx3ChfDGiaEBs/x7cbWet+0k+i4cspbQZIlPnXqw=; b=MOJw2FkgLOx7R5ApHmxS/NcntsL5Xcb6QRG96qocqWMXcuGDdcDXAU+gcc/uiUl6hx bIR752iYIThlWKBIqTpBlMletYjFNEBsJ9Yb0BoW/CbEDRG7s198gLq43zmuFUszVEEe 33x0/STmaHJg56i4zetB8o0Is4CzfJ5T4C9gwBQ27bOqzbrbfXGaK77JyIAcqY93YUPV dyH/BKIfCJmSmXXxuT4M7FEVJZlAgPt54O7bSNk74DasNflJgMmPTvMTCvPLkZ2V1K33 Y5bQD1kjbuyfYqdQbDv23pHNlrIKOJlt3XUo1uZXHZRPlyoDqbMhWHdxQluAaguPUA5v NxxQ== X-Gm-Message-State: AN3rC/6F0UkvdVOzHVhT7JQ3EYljScRLutjaWKXRT2Ub9lPlSjqhLj0z TCvQ56hRlqdJkA== X-Received: by 10.99.107.72 with SMTP id g69mr14493385pgc.149.1492464857429; Mon, 17 Apr 2017 14:34:17 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.131]) by smtp.gmail.com with ESMTPSA id r73sm6869012pfa.65.2017.04.17.14.34.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Apr 2017 14:34:16 -0700 (PDT) From: Eric Biggers To: Theodore Ts'o Cc: fstests@vger.kernel.org, Eric Biggers Subject: [PATCH 1/3] xfstests-bld: use a separate default config file for each test runner Date: Mon, 17 Apr 2017 14:33:25 -0700 Message-Id: <20170417213327.36520-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.12.2.762.g0e3151a226-goog Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers Instead of mixing together the default configuration for kvm-xfstests, gce-xfstests, and android-xfstests in a single file "config", split it into separate files for each test runner, along with a config.common (named "xfstests-common" if overridden in ~/.config/). This will allow setting defaults for variables such as ROOT_FS, NR_CPU, and MEM that may be meaningful for more than one test runner but should have different default values. It also more closely matches how the configs in ~/.config/ work. For now keep sourcing kvm-xfstests/config.custom if present, but suggest that the user move their settings into ~/.config/ where they aren't all mixed together for all test runners. Also keep supporting per-account configs for gce-xfstests, though really one could instead just make their ~/.config/gce-xfstests enable different settings based on their active account (it is a shell script after all). Signed-off-by: Eric Biggers --- Documentation/kvm-quickstart.md | 8 ++++---- Documentation/kvm-xfstests.md | 9 ++++----- config | 4 +++- kvm-xfstests/config.android | 6 ++++++ kvm-xfstests/config.common | 7 +++++++ kvm-xfstests/config.gce | 15 +++++++++++++++ kvm-xfstests/{config => config.kvm} | 35 ++++------------------------------- kvm-xfstests/util/get-config | 22 +++++++++++++++++----- 8 files changed, 60 insertions(+), 46 deletions(-) create mode 100644 kvm-xfstests/config.android create mode 100644 kvm-xfstests/config.common create mode 100644 kvm-xfstests/config.gce rename kvm-xfstests/{config => config.kvm} (54%) diff --git a/Documentation/kvm-quickstart.md b/Documentation/kvm-quickstart.md index c18a39e..8dcdc90 100644 --- a/Documentation/kvm-quickstart.md +++ b/Documentation/kvm-quickstart.md @@ -22,10 +22,10 @@ kernel-configs directory; pick one whose version number is close to the kernel version you wish to build. -4. In the fstests/kvm-xfstests directory, take a look at the "config" - file and either edit that file in place, or (this is preferred) - put override values in ~/.config/kvm-xfstests or config.custom. - The most common values you will likely need to override is the +4. In the fstests/kvm-xfstests/ directory, take a look at the + "config.kvm" file and either edit that file in place, or (this is + preferred) put override values in ~/.config/kvm-xfstests. The + most common values you will likely need to override are the location of the compiled kernel and the preferred timezone if you wish the log files to display times in your local timezone. diff --git a/Documentation/kvm-xfstests.md b/Documentation/kvm-xfstests.md index c480e4a..72f3aae 100644 --- a/Documentation/kvm-xfstests.md +++ b/Documentation/kvm-xfstests.md @@ -39,11 +39,10 @@ Please see the relevant documentation files for more details. ## Setup and configuration The configuration file for kvm-xfstests is found in the kvm-xfstests -directory and is named config. You can edit this file directly, but -the better thing to do is to place override values in -~/.config/kvm-xfstests or in kvm-xfstests/config.custom. Please look -at the kvm-xfstests/config file to see the shell variables you can -set. +directory and is named config.kvm. You can edit this file directly, +but the better thing to do is to place override values in +~/.config/kvm-xfstests. Please look at the kvm-xfstests/config.kvm +file to see the shell variables you can set. Perhaps the most important configuration variable to set is KERNEL. This should point at the default location for the kernel that qemu diff --git a/config b/config index af0f21e..f28bf9f 100644 --- a/config +++ b/config @@ -1,4 +1,6 @@ -# Configuration file for xfstests-bld +# +# Configuration file for building xfstests and root filesystem images +# XFSTESTS_GIT=git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git XFSPROGS_GIT=git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git diff --git a/kvm-xfstests/config.android b/kvm-xfstests/config.android new file mode 100644 index 0000000..4b668f8 --- /dev/null +++ b/kvm-xfstests/config.android @@ -0,0 +1,6 @@ +# +# Default configuration for android-xfstests +# +# Variables set here may be overridden in ~/.config/android-xfstests +# + diff --git a/kvm-xfstests/config.common b/kvm-xfstests/config.common new file mode 100644 index 0000000..12cae0a --- /dev/null +++ b/kvm-xfstests/config.common @@ -0,0 +1,7 @@ +# +# Default configuration for all test runners (kvm-xfstests, gce-xfstests, etc.) +# +# Variables set here may be overridden in ~/.config/xfstests-common +# + +PRIMARY_FSTYPE="ext4" diff --git a/kvm-xfstests/config.gce b/kvm-xfstests/config.gce new file mode 100644 index 0000000..96b64f8 --- /dev/null +++ b/kvm-xfstests/config.gce @@ -0,0 +1,15 @@ +# +# Default configuration for gce-xfstests +# +# Variables set here may be overridden in ~/.config/gce-xfstests +# + +# +# GS_BUCKET=gs_bucket.thunk.org +# GCE_PROJECT=tytso-xfstests-project +# GCE_ZONE=us-central1-c +# GCE_KERNEL=/u1/ext4-64/arch/x86/boot/bzImage + +# List of firewall rules to create. By default the gce-xfstests web interface +# is made available to everyone over the public Internet. +GCE_FIREWALL_RULES=("allow-http --allow tcp:80 --target-tags http-server") diff --git a/kvm-xfstests/config b/kvm-xfstests/config.kvm similarity index 54% rename from kvm-xfstests/config rename to kvm-xfstests/config.kvm index 994dcd3..43df96a 100644 --- a/kvm-xfstests/config +++ b/kvm-xfstests/config.kvm @@ -1,27 +1,12 @@ # -# Customize these, or put new values in: +# Default configuration for kvm-xfstests # -# ~/.config/kvm-xfstests -# or -# ~/.config/gce-xfstests -# or -# ~/.config/android-xfstests -# -# ... to affect specific commands only; -# -# or in config.custom to affect all commands. +# Variables set here may be overridden in ~/.config/kvm-xfstests # -############################################################################### -# Common configuration -# -PRIMARY_FSTYPE="ext4" # all commands -NR_CPU=2 # kvm-xfstests and gce-xfstests -MEM=2048 # kvm-xfstests and gce-xfstests +NR_CPU=2 +MEM=2048 -############################################################################### -# KVM configuration -# #QEMU=/usr/local/bin/qemu-system-x86_64 QEMU=/usr/bin/kvm KERNEL=$HOME/linux @@ -55,15 +40,3 @@ MONITOR="-monitor telnet:localhost:7498,server,nowait" # interception entirely. CONSOLE=" -serial mon:stdio" #CONSOLE=" -chardev stdio,id=console,signal=off -serial chardev:console" - -############################################################################### -# GCE configuration -# -# GS_BUCKET=gs_bucket.thunk.org -# GCE_PROJECT=tytso-xfstests-project -# GCE_ZONE=us-central1-c -# GCE_KERNEL=/u1/ext4-64/arch/x86/boot/bzImage - -# List of firewall rules to create. By default the gce-xfstests web interface -# is made available to everyone over the public Internet. -GCE_FIREWALL_RULES=("allow-http --allow tcp:80 --target-tags http-server") diff --git a/kvm-xfstests/util/get-config b/kvm-xfstests/util/get-config index b1ffc8f..f37d8c1 100644 --- a/kvm-xfstests/util/get-config +++ b/kvm-xfstests/util/get-config @@ -12,12 +12,16 @@ # # . "$DIR/util/get-config" -. $DIR/config +# Source the default configs +. $DIR/config.common +. $DIR/config.${XFSTESTS_FLAVOR} -# Source the user-provided config if present (e.g. ~/.config/kvm-xfstests) +# Source custom configs in ~/.config/ if present +[ -f "$HOME/.config/xfstests-common" ] && . "$HOME/.config/xfstests-common" [ -f "$HOME/.config/${XFSTESTS_FLAVOR}-xfstests" ] && \ . "$HOME/.config/${XFSTESTS_FLAVOR}-xfstests" +# For gce-xfstests, source the config for the active account if present if test "$XFSTESTS_FLAVOR" = "gce" -a -z "$GCE_ACCOUNT" -a \ -n "$(ls $DIR/config-* 2> /dev/null)" then @@ -32,11 +36,19 @@ then fi if test -n "$GCE_ACCOUNT" -a -f "$DIR/config-$GCE_ACCOUNT" ; then - . "$DIR/config-$GCE_ACCOUNT" + . "$DIR/config-$GCE_ACCOUNT" elif test -f $DIR/config.custom ; then - . $DIR/config.custom +# Else, source kvm-xfstests/config.custom if present (deprecated) + echo -e 1>&2 "Warning: use of kvm-xfstests/config.custom is deprecated." \ + "Move your settings\n into ~/.config/kvm-xfstests," \ + "~/.config/gce-xfstests,\n ~/.config/android-xfstests," \ + "and/or ~/.config/xfstests-common" + . $DIR/config.custom fi +# Source $KVM_CONFIG if present (deprecated) if test -n "$KVM_CONFIG" -a -f "$KVM_CONFIG"; then - . $KVM_CONFIG + echo -e 1>&2 "Warning: use of \$KVM_CONFIG is deprecated." \ + "Move your settings into\n ~/.config/kvm-xfstests" + . $KVM_CONFIG fi