From 3ef69aaafcfe6df03097d9ebdc8e4c7f7516999b Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Fri, 16 Mar 2018 01:55:04 -0700 Subject: Clarify how to run integration tests Also clarifies some other minor points. --- CONTRIBUTING.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'CONTRIBUTING.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff76d59..08775fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ On every pull request, [Travis CI](https://travis-ci.org/google/fscrypt) runs unit tests, integration tests, code formatters, and linters. To pass these checks you should make sure that in your submission: - `make` properly builds `fscrypt` and `pam_fscrypt.so`. -- All tests, including integration tests (see below), should pass. +- All tests, including [integration tests](#running-integration-tests), should pass. - `make format` has been run. - If you made any changes to files ending in `.proto`, the corresponding `.pb.go` files should be regenerated with `make gen`. @@ -92,17 +92,25 @@ The only exceptions to this rule are: Running `make test` will build each package and run the unit tests, but will skip the integration tests. To run the integration tests, you will need a filesystem that supports encryption. If you already have some empty filesystem -at `/foo/bar`, just run: +at `/foo/bar` that supports filesystem encryption, just run: ```bash make test MOUNT=/foo/bar ``` Otherwise, you can use the `make test-setup`/`make test-teardown` commands to -create/destory a test filesystem for running integration tests. Note that these -commands require `sudo` to mount/unmount the test filesystem. The fake -filesystem generated by these commands will automatically be detected by -`make test`, so running `make test-setup` then `make test` will run all the -integration tests. +create/destory a test filesystem for running integration tests. By default, a +filesystem will be created (then destoryed) at `/tmp/fscrypt-mount` (using an +image file at `/tmp/fscrypt-image`). To create/test/destroy a filesystem at a +custom mountpoint `/foo/bar`, run: +```bash +make test-setup MOUNT=/foo/bar +make test MOUNT=/foo/bar +make test-teardown MOUNT=/foo/bar +``` +Running the commands without `MOUNT=/foo/bar` uses the default locations. + +Note that the setup/teardown commands require `sudo` to mount/unmount the +test filesystem. ### Changing dependencies -- cgit v1.2.3