Skip to content

Commit

Permalink
Add documentation of existing tests
Browse files Browse the repository at this point in the history
Adds a new page in our book to describe the tests that we have on a
high-level view.

Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
  • Loading branch information
hug-dev committed Sep 16, 2020
1 parent 23e8872 commit 4d076ac
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
- [How to build and run Parsec](parsec_service/build_run.md)
- [How to securely install Parsec on Linux](parsec_service/install_parsec_linux.md)
- [Parsec Configuration](parsec_service/configuration.md)
- [How to test Parsec](parsec_service/test.md)
- [How to test Parsec](parsec_service/tests/README.md)
- [List of existing tests](parsec_service/tests/existing_tests.md)
- [Contributing](contributing/README.md)
- [How to add operations to Parsec](contributing/adding_new_operation_how_to.md)

Expand Down
File renamed without changes.
55 changes: 55 additions & 0 deletions src/parsec_service/tests/existing_tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# List of existing tests

## Integration tests on providers

| Name | Description |
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TPM integration tests](https://github.com/parallaxsecond/parsec/tree/master/tests/providers) | These tests initialize a provider structure and perform operation using the `Provide` trait. A software crypto library, like `ring`, can be used to verify the behaviour. [Example with the TPM provider](https://github.com/parallaxsecond/parsec/blob/master/tests/providers/tpm.rs). |

## End-to-end testing

These tests are meant to be executed on a running Parsec service and using a Parsec client to
communicate to it. The
[`parsec/e2e_tests`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests) crate contains
a test client based on the Rust client that is used inside the tests written in
[`parsec/e2e_tests/tests`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests).

The end-to-end tests contain tests to be executed: * with a Parsec service containing a single
provider:
[`per_provider`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/per_provider)
tests * with a Parsec service containing all providers:
[`all_providers`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/all_providers)
and [`config`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/config) tests

The
[`parsec/e2e_tests/provider_cfg`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/provider_cfg)
folder contain the `Dockerfile` and Parsec configuration needed to run Parsec for the corresponding
tests.

| Name | Description |
|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| [All providers e2e tests](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/all_providers) | End-to-end tests on a service with all providers. Mostly to test core operations. |
| [Configuration e2e tests](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/config) | These check if the behaviour of the service is correct before and after reloading with a different configuration. |
| [Per provider normal tests](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/per_provider/normal_tests) | E2E tests checking most cryptographic operations on a single provider. |
| [Per provider persistence tests](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/per_provider/persistent_before.rs) | E2E tests checking correct behaviour of the service around persistence of keys in the Key Info Manager. |
| [Per provider stress tests](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/per_provider/stress_test.rs) | Stress tests executing a large number of canonical operations at high frequency on a single provider. |

## Fuzz testing

| Name | Description |
|---------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| [Fuzz testing](https://github.com/parallaxsecond/parsec/tree/master/fuzz) | Tests sending random requests to the service and waiting it to crash/timeout. |

## Unit testing

| Name | Description |
|-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| [Direct authenticator tests](https://github.com/parallaxsecond/parsec/blob/master/src/authenticators/direct_authenticator/mod.rs) | Testing the `Authenticate` trait with this authenticator. |
| [On-disk key info manager tests](https://github.com/parallaxsecond/parsec/blob/master/src/key_info_managers/on_disk_manager/mod.rs) | Testing the `ManageKeyInfo` trait with various strings for application and key names. The persistence is tested in the end-to-end tests. |

## In dependencies

The dependencies that we maintain in the `parallaxsecond` organisation also contain their own set of
integration and unit tests: `parsec-interface-rs`, `rust-psa-crypto` and `rust-tss-esapi`.

*Copyright 2020 Contributors to the Parsec project.*

0 comments on commit 4d076ac

Please sign in to comment.