linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org,
	kernel-team@meta.com, ebiggers@google.com, anand.jain@oracle.com,
	fdmanana@suse.com, linux-fscrypt@vger.kernel.org,
	fsverity@lists.linux.dev, zlang@kernel.org
Subject: Re: [RFC PATCH v3 9/9] btrfs: test snapshotting encrypted subvol
Date: Tue, 8 Aug 2023 14:46:27 -0400	[thread overview]
Message-ID: <1b838929-f349-559c-5f69-560c635c1d24@dorminy.me> (raw)
In-Reply-To: <400435f749f54e07a23e8e3c67bb717646747cc4.1691530000.git.sweettea-kernel@dorminy.me>



On 8/8/23 13:21, Sweet Tea Dorminy wrote:
> Make sure that snapshots of encrypted data are readable and writeable.
> 
> Test deliberately high-numbered to not conflict.
> 
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> ---
>   tests/btrfs/614     |  76 ++++++++++++++++++++++++++++++
>   tests/btrfs/614.out | 111 ++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 187 insertions(+)
>   create mode 100755 tests/btrfs/614
>   create mode 100644 tests/btrfs/614.out
> 
> diff --git a/tests/btrfs/614 b/tests/btrfs/614
> new file mode 100755
> index 00000000..87dd27f9
> --- /dev/null
> +++ b/tests/btrfs/614
> @@ -0,0 +1,76 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2023 Meta Platforms, Inc.  All Rights Reserved.
> +#
> +# FS QA Test 614
> +#
> +# Try taking a snapshot of an encrypted subvolume. Make sure the snapshot is
> +# still readable. Rewrite part of the subvol with the same data; make sure it's
> +# still readable.
> +#
> +. ./common/preamble
> +_begin_fstest auto encrypt
> +
> +# Import common functions.
> +. ./common/encrypt
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs btrfs
> +
> +_require_test
> +_require_scratch
> +_require_scratch_encryption -v 2
> +_require_command "$KEYCTL_PROG" keyctl
> +
> +_scratch_mkfs_encrypted &>> $seqres.full
> +_scratch_mount
> +
> +udir=$SCRATCH_MNT/reference
> +dir=$SCRATCH_MNT/subvol
> +dir2=$SCRATCH_MNT/subvol2
> +$BTRFS_UTIL_PROG subvolume create $dir >> $seqres.full
> +mkdir $udir
> +
> +_set_encpolicy $dir $TEST_KEY_IDENTIFIER
> +_add_enckey $SCRATCH_MNT "$TEST_RAW_KEY"
> +
> +# get files with lots of extents by using backwards writes.
> +for j in `seq 0 50`; do
> +	for i in `seq 20 -1 1`; do
> +		$XFS_IO_PROG -f -d -c "pwrite $(($i * 4096)) 4096" \
> +		$dir/foo-$j >> $seqres.full | _filter_xfs_io
> +		$XFS_IO_PROG -f -d -c "pwrite $(($i * 4096)) 4096" \
> +		$udir/foo-$j >> $seqres.full | _filter_xfs_io
> +	done
> +done
> +
> +$BTRFS_UTIL_PROG subvolume snapshot $dir $dir2 | _filter_scratch
> +
> +_scratch_remount
> +_add_enckey $SCRATCH_MNT "$TEST_RAW_KEY"
> +sleep 30
Just noticed this sleep, will remove it in the next version.

      reply	other threads:[~2023-08-08 20:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 17:21 [RFC PATCH v3 0/9] fstests: add btrfs encryption testing Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 1/9] common/encrypt: separate data and inode nonces Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 2/9] common/encrypt: add btrfs to get_encryption_*nonce Sweet Tea Dorminy
2023-10-02 11:22   ` Anand Jain
2023-08-08 17:21 ` [RFC PATCH v3 3/9] common/encrypt: add btrfs to get_ciphertext_filename Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 4/9] common/encrypt: enable making a encrypted btrfs filesystem Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 5/9] generic/613: write some actual data for btrfs Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 6/9] tests: adjust generic/429 for extent encryption Sweet Tea Dorminy
2023-10-02 11:20   ` Anand Jain
2023-08-08 17:21 ` [RFC PATCH v3 7/9] common/verity: explicitly don't allow btrfs encryption Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 8/9] btrfs: add simple test of reflink of encrypted data Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 9/9] btrfs: test snapshotting encrypted subvol Sweet Tea Dorminy
2023-08-08 18:46   ` Sweet Tea Dorminy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b838929-f349-559c-5f69-560c635c1d24@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=anand.jain@oracle.com \
    --cc=ebiggers@google.com \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=fsverity@lists.linux.dev \
    --cc=kernel-team@meta.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=zlang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).