Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for command-line interface #218

Merged
merged 19 commits into from
May 9, 2020
Merged

Add tests for command-line interface #218

merged 19 commits into from
May 9, 2020

Conversation

ebiggers
Copy link
Collaborator

@ebiggers ebiggers commented Apr 27, 2020

Add tests that directly test the fscrypt command-line tool.

See cli-tests/README.md for information about the test framework.

The following test scripts are included:

  • t_change_passphrase
  • t_encrypt_custom
  • t_encrypt_login
  • t_encrypt_raw_key
  • t_encrypt
  • t_lock
  • t_not_enabled
  • t_not_supported
  • t_passphrase_hashing
  • t_setup
  • t_status
  • t_unlock
  • t_v1_policy_fs_keyring
  • t_v1_policy

Unfortunately, we can't actually make Travis CI run these tests yet because they need kernel v5.4 or later, and Travis CI doesn't support an Ubuntu version that has that yet. But for now, they can be run manually using make cli-test.

ebiggers added 19 commits May 9, 2020 14:04
Allow overriding the location of fscrypt.conf by setting the
FSCRYPT_CONF environmental variable.  The CLI tests need this to avoid
touching the real /etc/fscrypt.conf.
Allow overriding the mountpoint where login protectors are stored by
setting the FSCRYPT_ROOT_MNT environmental variable.  The CLI tests need
this to avoid touching the real "/".
Allow setting FSCRYPT_CONSISTENT_OUTPUT=1 in the environment to cause
policies and protectors to sorted by last modification time.  The CLI
tests need this to make the output of 'fscrypt' ordered in a consistent
way with regard to the operations performed.
Add a framework for writing automated tests of the fscrypt command-line
tool.  See cli-tests/README.md for details.
Enforce that all the cli-test scripts pass 'shellcheck'.
Test changing the passphrase of a custom_passphrase protector.
Add general tests for 'fscrypt encrypt'.  For protector-specific tests,
see t_encrypt_custom, t_encrypt_login, and t_encrypt_raw_key.
Test encrypting a directory using a custom_passphrase protector.
Test encrypting a directory using a login (pam_passphrase) protector.
Test encrypting a directory using a raw_key protector.
Test locking a directory.
Test that fscrypt fails when the filesystem doesn't have the encrypt
feature enabled.  Then test enabling it.
Test that fscrypt fails when the filesystem doesn't support encryption.
Test that the passphrase hashing seems to take long enough.
Test 'fscrypt setup'.
Test getting global, filesystem, and unencrypted directory status when
the filesystem is or isn't set up for fscrypt.
Test unlocking a directory.
Test using v1 encryption policies (deprecated).
Test using v1 encryption policies (deprecated) with
use_fs_keyring_for_v1_policies = true.
@ebiggers ebiggers merged commit 338347a into google:master May 9, 2020
@ebiggers ebiggers deleted the cli-tests branch May 9, 2020 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant