From c626494e0c687a109e16ee7289a6f215d6a44809 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 9 May 2020 14:04:47 -0700 Subject: [PATCH] cli-tests: add t_not_supported Test that fscrypt fails when the filesystem doesn't support encryption. --- cli-tests/t_not_supported.out | 11 +++++++++++ cli-tests/t_not_supported.sh | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 cli-tests/t_not_supported.out create mode 100755 cli-tests/t_not_supported.sh diff --git a/cli-tests/t_not_supported.out b/cli-tests/t_not_supported.out new file mode 100644 index 0000000..8af840c --- /dev/null +++ b/cli-tests/t_not_supported.out @@ -0,0 +1,11 @@ + +# Mount tmpfs + +# Create fscrypt metadata on tmpfs +Metadata directories created at "MNT/.fscrypt". + +# Try to encrypt a directory on tmpfs +[ERROR] fscrypt encrypt: get encryption policy MNT/dir: + encryption not supported + +Encryption for this type of filesystem is not supported on this kernel version. diff --git a/cli-tests/t_not_supported.sh b/cli-tests/t_not_supported.sh new file mode 100755 index 0000000..53a096a --- /dev/null +++ b/cli-tests/t_not_supported.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Test that fscrypt fails when the filesystem doesn't support encryption. + +cd "$(dirname "$0")" +. common.sh + +_print_header "Mount tmpfs" +umount "$MNT" +mount tmpfs -t tmpfs -o size=128m "$MNT" + +_print_header "Create fscrypt metadata on tmpfs" +fscrypt setup "$MNT" + +_print_header "Try to encrypt a directory on tmpfs" +mkdir "$MNT/dir" +_expect_failure "fscrypt encrypt '$MNT/dir'" -- 2.39.5