test-appliance: fix specifying f2fs mount options in config file
PATCH 1/2 test-appliance: fix specifying f2fs mount options in config file
From: Eric Biggers <[email protected]>
setup_mount_opts() is supposed to prepend "-o " to the mount options, but it failed to do so in the case where mount options are specified in a config file rather than on the command line. Fix it.
--- kvm-xfstests/test-appliance/files/root/fs/f2fs/config | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
kvm-xfstests/test-appliance/files/root/fs/f2fs/config +2 -5
@@ -31,12 +31,9 @@ function format_filesystem() function setup_mount_opts() { if test -n "$MNTOPTS" ; then - if test -n "$F2FS_MOUNT_OPTIONS" ; then - export F2FS_MOUNT_OPTIONS="$F2FS_MOUNT_OPTIONS,$MNTOPTS" - else - export F2FS_MOUNT_OPTIONS="-o $MNTOPTS" - fi + F2FS_MOUNT_OPTIONS+="${F2FS_MOUNT_OPTIONS:+,}$MNTOPTS" fi + export F2FS_MOUNT_OPTIONS="${F2FS_MOUNT_OPTIONS:+-o }$F2FS_MOUNT_OPTIONS" } function get_mkfs_opts()
Signature · 1 line
2.17.0.484.g0c8726318c-goog
PATCH 2/2 test-appliance: add 'encrypt' config for f2fs
From: Eric Biggers <[email protected]>
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.
--- .../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
kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list +1 -0
@@ -1 +1,2 @@ default +encrypt
kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/encrypt new file +5 -0
@@ -0,0 +1,5 @@ +SIZE=small +export MKFS_OPTIONS="-O encrypt" +export F2FS_MOUNT_OPTIONS="test_dummy_encryption" +REQUIRE_FEATURE=encryption +TESTNAME="F2FS encryption"
kvm-xfstests/test-appliance/files/root/fs/f2fs/config +12 -0
@@ -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" }
Signature · 1 line
2.17.0.484.g0c8726318c-goog
Re: [xfstests-bld PATCH 2/2] test-appliance: add 'encrypt' config for f2fs
Quoted 61 lines · Eric Biggers
From: Eric Biggers <[email protected]>
Allow testing f2fs using the
test_dummy_encryptionmount 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 <[email protected]>--- .../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/encryptkvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list +1
-0@@ -1 +1,2 @@ default +encryptkvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/encrypt new file +5
-0@@ -0,0 +1,5 @@ +SIZE=small +export MKFS_OPTIONS="-O encrypt" +export F2FS_MOUNT_OPTIONS="test_dummy_encryption" +REQUIRE_FEATURE=encryption +TESTNAME="F2FS encryption"kvm-xfstests/test-appliance/files/root/fs/f2fs/config +12
-0@@ -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" }Signature · 1 line
2.17.0.484.g0c8726318c-goog
Ping.
Theodore Y. Ts'o
AppliedRe: [xfstests-bld PATCH 2/2] test-appliance: add 'encrypt' config for f2fs
In reply to Eric BiggersQuoted 10 lines · Eric Biggers
From: Eric Biggers <[email protected]>
Allow testing f2fs using the
test_dummy_encryptionmount 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 <[email protected]>
Applied, thanks.
- Ted
Quoted 33 lines · Eric Biggers
From: Eric Biggers <[email protected]>
setup_mount_opts()is supposed to prepend "-o " to the mount options, but it failed to do so in the case where mount options are specified in a config file rather than on the command line. Fix it.Signed-off-by Eric Biggers <[email protected]>--- kvm-xfstests/test-appliance/files/root/fs/f2fs/config | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)kvm-xfstests/test-appliance/files/root/fs/f2fs/config +2
-5@@ -31,12 +31,9 @@ function format_filesystem() function setup_mount_opts() { if test -n "$MNTOPTS" ; then - if test -n "$F2FS_MOUNT_OPTIONS" ; then - export F2FS_MOUNT_OPTIONS="$F2FS_MOUNT_OPTIONS,$MNTOPTS" - else - export F2FS_MOUNT_OPTIONS="-o $MNTOPTS" - fi + F2FS_MOUNT_OPTIONS+="${F2FS_MOUNT_OPTIONS:+,}$MNTOPTS" fi + export F2FS_MOUNT_OPTIONS="${F2FS_MOUNT_OPTIONS:+-o }$F2FS_MOUNT_OPTIONS" } function get_mkfs_opts()Signature · 1 line
2.17.0.484.g0c8726318c-goog
Ping.
Theodore Y. Ts'o
AppliedQuoted 7 lines · Eric Biggers
From: Eric Biggers <[email protected]>
setup_mount_opts()is supposed to prepend "-o " to the mount options, but it failed to do so in the case where mount options are specified in a config file rather than on the command line. Fix it.Signed-off-by Eric Biggers <[email protected]>
Applied, thanks.
- Ted