From patchwork Thu Apr 19 20:50:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10351579 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 42AE960365 for ; Thu, 19 Apr 2018 20:52:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 317B72853A for ; Thu, 19 Apr 2018 20:52:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2604128565; Thu, 19 Apr 2018 20:52:05 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, WEIRD_QUOTING 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 017BB2853A for ; Thu, 19 Apr 2018 20:52:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753411AbeDSUwD (ORCPT ); Thu, 19 Apr 2018 16:52:03 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33209 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbeDSUwC (ORCPT ); Thu, 19 Apr 2018 16:52:02 -0400 Received: by mail-pl0-f67.google.com with SMTP id w12-v6so3953049plp.0 for ; Thu, 19 Apr 2018 13:52:02 -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:in-reply-to:references; bh=RGBzZ/iRXnEaDxqxcNcqG9Ifs5oAXLcRKCzeD9G9m2Q=; b=pjedR55AKP8gc+GAKvWA9X2HsxrHNnVz1rHFgIgGpmJobw0gDLqVmokZwNWezK976n EiwegkMxyIcbnnJ7cQvEwyOZdEZR97WkCGAFYx01Z0mODqB6fENJ2MJu0/LQFxNgy3z1 fxvsuR17sZsFTNElWfkB/GmfsP/g5qm39aO0yengWJS77DSn76HpxadamNBcSGrkL75f nacY7puGavggnH+TK2XqGf/zaf3fNKuS4/gqWRtX5eeGzCkeyEdsVNNgfTiuo7KW5VKk eP4dK6pNCDDnTo4vdVsU3So56sMBS+njeo98rZRO4oXjXCk5JDgQbNeUeaMeCY/9BnaD wC4w== 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:in-reply-to :references; bh=RGBzZ/iRXnEaDxqxcNcqG9Ifs5oAXLcRKCzeD9G9m2Q=; b=maxb+Hs1sbq/Nt+HUhc/NDgE5UUcB01Pfocd0NVyz3QDksTRa5qs9cG2YfjnDAVeQq 4WDMe9Z6uM+Cy2kivwiDXlrmNgf7t1vKeH79zCxmmQHe5uKTrv6C2gN5LCzgNTdn3UoP /MMZAsUx7zEyAxosqqSsXYfY/yOy4C0OssHM/pEdwRLAMOI1SCUgey5cY5vSRe2dW1ff Ob37xwj3tm50wOITBk4U3GrPySC9Bw7Se1uQsyarbZshRjPFwbsNFLrZSMZ5FJfk3our 9zi2zmfVAbPnf1XPNnWcgRJIXZTDQJPOKnn5kpXYh+q4RRT3D5MSoe6hE2rR/m+VVFES gtFA== X-Gm-Message-State: ALQs6tAg0HK4BTruqAaM5HrcjgakiQjziXhET2XX/7kthvbewue7KAQR UBy+HLsxRB3isyuD75uZ4gFxJcSo X-Google-Smtp-Source: AIpwx4+KnC7DUqtOWh4aQsYaBuCkKeftg0mfum0ULnca8rztDqoJZ+hFomJY9KSa0uAZgs2/DAKQng== X-Received: by 2002:a17:902:b105:: with SMTP id q5-v6mr7631066plr.173.1524171122399; Thu, 19 Apr 2018 13:52:02 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([2620:15c:17:3:dc28:5c82:b905:e8a8]) by smtp.gmail.com with ESMTPSA id 4sm1540791pfn.38.2018.04.19.13.52.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 13:52:01 -0700 (PDT) From: Eric Biggers To: Theodore Ts'o Cc: fstests@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers Subject: [xfstests-bld PATCH 2/2] test-appliance: add 'encrypt' config for f2fs Date: Thu, 19 Apr 2018 13:50:20 -0700 Message-Id: <20180419205020.16868-2-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog In-Reply-To: <20180419205020.16868-1-ebiggers3@gmail.com> References: <20180419205020.16868-1-ebiggers3@gmail.com> 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 Allow testing f2fs using the test_dummy_encryption mount option, available with f2fs in kernel 4.17 and later. E.g., gce-xfstests -c f2fs/encrypt -g auto This is the f2fs equivalent of ext4/encrypt. Signed-off-by: Eric Biggers --- .../test-appliance/files/root/fs/f2fs/cfg/all.list | 1 + .../test-appliance/files/root/fs/f2fs/cfg/encrypt | 5 +++++ .../test-appliance/files/root/fs/f2fs/config | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/encrypt 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 index 4ad96d5..bc796ff 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list @@ -1 +1,2 @@ default +encrypt diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/encrypt b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/encrypt new file mode 100644 index 0000000..0e4e8ab --- /dev/null +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/encrypt @@ -0,0 +1,5 @@ +SIZE=small +export MKFS_OPTIONS="-O encrypt" +export F2FS_MOUNT_OPTIONS="test_dummy_encryption" +REQUIRE_FEATURE=encryption +TESTNAME="F2FS encryption" diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config index 94c402b..3857d5d 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config +++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config @@ -33,6 +33,18 @@ function setup_mount_opts() if test -n "$MNTOPTS" ; then F2FS_MOUNT_OPTIONS+="${F2FS_MOUNT_OPTIONS:+,}$MNTOPTS" fi + if echo ",$F2FS_MOUNT_OPTIONS," | grep -q ',test_dummy_encryption,'; then + local mode='\x00\x00\x00\x00' + local raw="$(printf ""\\\\x%02x"" $(seq 0 63))" + if lscpu | grep "Byte Order" | grep -q Little ; then + local size='\x40\x00\x00\x00' + else + local size='\x00\x00\x00\x40' + fi + local key="${mode}${raw}${size}" + keyctl new_session >& /dev/null + echo -n -e "${key}" | keyctl padd logon fscrypt:4242424242424242 @s >& /dev/null + fi export F2FS_MOUNT_OPTIONS="${F2FS_MOUNT_OPTIONS:+-o }$F2FS_MOUNT_OPTIONS" }