From patchwork Thu Nov 17 19:52:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9435265 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 6696D6047D for ; Thu, 17 Nov 2016 19:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51FA0296BD for ; Thu, 17 Nov 2016 19:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 450EC296BF; Thu, 17 Nov 2016 19:54:44 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 574EC296BD for ; Thu, 17 Nov 2016 19:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751716AbcKQTym (ORCPT ); Thu, 17 Nov 2016 14:54:42 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:33503 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751359AbcKQTyl (ORCPT ); Thu, 17 Nov 2016 14:54:41 -0500 Received: by mail-pg0-f44.google.com with SMTP id 3so94593598pgd.0 for ; Thu, 17 Nov 2016 11:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=TAy6yUAT717Ykco1dS+QIorOI2oyoKkMgXmjE+cMlYE=; b=FelpvP75N/DWeS07CyJDEkDH2wN3x3MXedCWlSazImJEQ28hK9R6omNTiWbZ+mlRvU aQ7nWxigUBPeOghRyCV+orhpPSn0tsqdU8EvPsT6AV2bfirUZXur7+ufgQPFd/G4HD07 XuyGlEoICAvDgtZfxu/yJac+l6vHxc4fDlU8hBRbre5wAsKiCkyPJBXv/GjsXxaizX+O MO12k3tDcbwhX0gGBXEoJnjx0wK54DduDH1KTpev+8x3IUpaWVtbhXD1IO4ztY7oxCPy PpcrT8vFGLUYruVqAKSd5hBPfQ3rxV43HPUEa3Etm6QtDvY+mJQpoPoliyQFoMLnINm6 ZjVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TAy6yUAT717Ykco1dS+QIorOI2oyoKkMgXmjE+cMlYE=; b=XEpTfOiwuK2tdCpdZdN1loIAOXOjsvcKo6UWx6XQRbfvGml8NbtTer+omFJg5YlQiW xGv0aIDAj40SWjNvmhiSm7Al3cwTS5P4OOuQHbJwWxePKUCrOdKreBGBl2wVyOsh+vsH CZfhHLDvHwsLqJ9j7IzlJGQQKP/vMd8fyb7n4lS5KV0cKlTbJJD/bzRs8Pa5UTDsumJd 7NoXEgGjnEukYVxSLuC/Zv+ngtDkIQ6q84/SarnNjJbbb69ck+HZ3uQHXteD41GV1Di0 ZCjjfFpYTlL6p0CKn9kXKLnnnVIURAF4jdncwBlaKXu2OBJcKna1ZIqk+jN59hK8Qm8f LjmQ== X-Gm-Message-State: ABUngvd6QZ9QGGoymDFKfB88asyDZQDbMmgbDUrogjhpdUUwL0VA8VeKJjYcrFS3EpKXGzL6 X-Received: by 10.99.9.66 with SMTP id 63mr7860640pgj.84.1479412480984; Thu, 17 Nov 2016 11:54:40 -0800 (PST) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.119.30.154]) by smtp.gmail.com with ESMTPSA id t89sm10173683pfe.50.2016.11.17.11.54.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Nov 2016 11:54:39 -0800 (PST) From: Eric Biggers To: Theodore Ts'o Cc: fstests@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers Subject: [PATCH] xfstests-bld: add f2fs support Date: Thu, 17 Nov 2016 11:52:33 -0800 Message-Id: <1479412353-35154-1-git-send-email-ebiggers@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add basic f2fs support to xfstests-bld. I am using this to verify that the encryption tests I am adding to xfstests pass on both ext4 and f2fs. It may be useful to f2fs developers too. For now, only one configuration, "f2fs/default", is offered. For the f2fs tests to work, it's required to build a kernel with f2fs support and build a rootfs with f2fs-tools installed. For testing encryption, f2fs-tools must be v1.5.0 or later. It was necessary to remove the /etc/fstab lines for /dev/vd[b-f] because they interfered with non-ext4 fsck. They are not needed for the tests. Signed-off-by: Eric Biggers --- kvm-xfstests/test-appliance/files/etc/fstab | 5 -- .../test-appliance/files/root/fs/f2fs/cfg/all.list | 1 + .../test-appliance/files/root/fs/f2fs/cfg/default | 4 ++ .../test-appliance/files/root/fs/f2fs/config | 62 ++++++++++++++++++++++ kvm-xfstests/util/parse_cli | 2 +- 5 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/config diff --git a/kvm-xfstests/test-appliance/files/etc/fstab b/kvm-xfstests/test-appliance/files/etc/fstab index 864478b..27fb1df 100644 --- a/kvm-xfstests/test-appliance/files/etc/fstab +++ b/kvm-xfstests/test-appliance/files/etc/fstab @@ -5,9 +5,4 @@ proc /proc proc defaults 0 0 tmpfs /tmp tmpfs mode=1777 0 0 debugfs /sys/kernel/debug debugfs defaults 0 0 /dev/rootfs / ext4 noatime 0 1 -/dev/vdb /vdb ext4 defaults,noauto 0 0 -/dev/vdc /vdc ext4 defaults,noauto 0 0 -/dev/vdd /vdd ext4 defaults,noauto 0 0 -/dev/vde /vde ext4 defaults,noauto 0 0 -/dev/vdf /vdf ext4 defaults,noauto 0 0 /dev/vdg /results ext4 defaults 0 2 diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list @@ -0,0 +1 @@ +default diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default new file mode 100644 index 0000000..616a070 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default @@ -0,0 +1,4 @@ +SIZE=small +export MKFS_OPTIONS="" +export F2FS_MOUNT_OPTIONS="" +TESTNAME="f2fs" diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config new file mode 100644 index 0000000..3cab963 --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config @@ -0,0 +1,62 @@ +# +# Configuration file for f2fs +# + +DEFAULT_MKFS_OPTIONS="" + +function check_filesystem() +{ + local dev="$1" + local ret + + /sbin/fsck.f2fs -f "$dev" + ret="$?" + echo fsck.f2fs exited with status "$ret" + return "$ret" +} + +function format_filesystem() +{ + local dev="$1" + local opts="$2" + + /sbin/mkfs.f2fs -q $opts "$dev" + return $? +} + +function setup_mount_opts() +{ + if test -n "$MNTOPTS" ; then + if test -n "$F2FS_MOUNT_OPTIONS" ; then + F2FS_MOUNT_OPTIONS="$F2FS_MOUNT_OPTIONS,$MNTOPTS" + else + F2FS_MOUNT_OPTIONS="-o $MNTOPTS" + fi + fi +} + +function get_mkfs_opts() +{ + echo "$MKFS_OPTIONS" +} + +function show_mkfs_opts() +{ + echo MKFS_OPTIONS: "$MKFS_OPTIONS" +} + +function show_mount_opts() +{ + echo F2FS_MOUNT_OPTIONS: "$F2FS_MOUNT_OPTIONS" +} + +function test_name_alias() +{ + echo "$1" +} + +function reset_vars() +{ + unset F2FS_MOUNT_OPTIONS + unset MKFS_OPTIONS +} diff --git a/kvm-xfstests/util/parse_cli b/kvm-xfstests/util/parse_cli index ea747be..b42c8ba 100644 --- a/kvm-xfstests/util/parse_cli +++ b/kvm-xfstests/util/parse_cli @@ -59,7 +59,7 @@ print_help () validate_test_name() { case "$1" in - btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*|overlay*) ;; + btrfs*|cifs*|ext4*|f2fs*|generic*|shared*|udf*|xfs*|overlay*) ;; *) echo -e "Invalid test name: $1\n" print_help