Skip to content

Commit 2e090a4

Browse files
authored
Merge pull request #65 from hug-dev/document-tests
Add documentation of existing tests
2 parents 23e8872 + d7a7886 commit 2e090a4

File tree

8 files changed

+73
-13
lines changed

8 files changed

+73
-13
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: Build
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v2
1111
- name: Install mdbook
1212
run: cargo install mdbook
1313
- name: Build book
@@ -17,15 +17,24 @@ jobs:
1717
name: Check formatting
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v1
20+
- uses: actions/checkout@v2
2121
- name: Create a Go workspace and install vmdfmt
2222
run: |
2323
mkdir /tmp/go
2424
export GOPATH=/tmp/go
2525
go get github.com/bobertlo/vmd/cmd/vmdfmt
26-
- name: Link Checker
27-
uses: peter-evans/link-checker@v1
2826
- name: Check formatting
2927
run: |
3028
export PATH="$PATH:/tmp/go/bin:$(pwd)/node_modules/.bin"
3129
./ci/check_format.sh
30+
31+
links:
32+
name: Check links
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Link Checker
37+
id: lc
38+
uses: peter-evans/link-checker@v1
39+
- name: Fail if there were link errors
40+
run: exit ${{ steps.lc.outputs.exit_code }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ will check if your files are formatted correctly.
3838

3939
## Contributing
4040

41-
Please check the [**Contribution Guidelines**](https://parallaxsecond.github.io/parsec-book/contributing.html)
41+
Please check the [**Contribution Guidelines**](https://parallaxsecond.github.io/parsec-book/contributing/index.html)
4242
to know more about the contribution process.
4343

4444
## License

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
- [How to build and run Parsec](parsec_service/build_run.md)
5858
- [How to securely install Parsec on Linux](parsec_service/install_parsec_linux.md)
5959
- [Parsec Configuration](parsec_service/configuration.md)
60-
- [How to test Parsec](parsec_service/test.md)
60+
- [How to test Parsec](parsec_service/tests/README.md)
61+
- [List of existing tests](parsec_service/tests/existing_tests.md)
6162
- [Contributing](contributing/README.md)
6263
- [How to add operations to Parsec](contributing/adding_new_operation_how_to.md)
6364

src/contributing/adding_new_operation_how_to.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ At this point, you will now have a safe Rust interface for the PSA operation you
153153

154154
Add the new operation to the correct
155155
[provider](https://github.com/parallaxsecond/parsec/tree/master/src/providers) (in this case, [Mbed
156-
Crypto](https://github.com/parallaxsecond/parsec/tree/master/src/providers/mbed_provider)) as a
157-
`psa_xxx_internal` method. The operation method should take the user inputs, arrange them in a way
156+
Crypto](https://github.com/parallaxsecond/parsec/tree/master/src/providers/mbed_crypto_provider)) as
157+
a `psa_xxx_internal` method. The operation method should take the user inputs, arrange them in a way
158158
that [`psa-crypto`](#psa-crypto) accepts, and provide any extra logic or storage if required (e.g.
159159
an output buffer). The external implementation is to be added to the provider’s
160-
[`mod.rs`](https://github.com/parallaxsecond/parsec/blob/master/src/providers/mbed_provider/mod.rs)
160+
[`mod.rs`](https://github.com/parallaxsecond/parsec/blob/master/src/providers/mbed_crypto_provider/mod.rs)
161161
file, which outputs a trace entry and passes the call back to the internal implementation.
162162

163163
A default implementation is added to

src/parsec_service/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ They cover the following concepts:
2020
and running the service
2121
- [Installation](install_parsec_linux.md) - installing Parsec as a systemd daemon
2222
- [Configuration](configuration.md) - how to configure Parsec
23-
- [Testing](test.md) - details about the kinds of tests we employ and how to set up your environment
23+
- [Testing](tests) - details about the kinds of tests we employ and how to set up your environment
2424
in preparation for running them
2525

2626
*Copyright 2019 Contributors to the Parsec project.*

src/parsec_service/build_run.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ one](https://github.com/parallaxsecond/parsec/blob/master/e2e_tests/provider_cfg
1818
The `mbed-crypto-provider` feature is going to be used as an example in this guide. This can be
1919
replaced by a subset of the features mentioned above, space or comma separated. If you would like to
2020
test the TPM or PKCS check the [related
21-
guides](test.md#testing-the-tpm-provider-using-the-software-tpm).
21+
guides](tests#testing-the-tpm-provider-using-the-software-tpm).
2222

2323
For the `DomainSocket` listener, the socket folder needs to be created:
2424

@@ -51,8 +51,8 @@ via a command-line argument:
5151
cargo run --features mbed-crypto-provider -- --config e2e_tests/provider_cfg/mbed-crypto/config.toml
5252
```````
5353

54-
From another terminal, it is now possible to execute the [end-to-end
55-
tests](test.md#end-to-end-tests) on Parsec!
54+
From another terminal, it is now possible to execute the [end-to-end tests](tests#end-to-end-tests)
55+
on Parsec!
5656

5757
```````
5858
cd e2e_tests
File renamed without changes.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# List of existing tests
2+
3+
## End-to-end testing
4+
5+
These tests are meant to be executed on a running Parsec service and using a Parsec client to
6+
communicate to it. The
7+
[`parsec/e2e_tests`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests) crate contains
8+
a test client based on the Rust client that is used inside the tests written in
9+
[`parsec/e2e_tests/tests`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests).
10+
11+
The end-to-end tests contain tests to be executed: * with a Parsec service containing a single
12+
provider:
13+
[`per_provider`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/per_provider)
14+
tests * with a Parsec service containing all providers:
15+
[`all_providers`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/all_providers)
16+
and [`config`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/config) tests
17+
18+
The
19+
[`parsec/e2e_tests/provider_cfg`](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/provider_cfg)
20+
folder contain the `Dockerfile` and Parsec configuration needed to run Parsec for the corresponding
21+
tests.
22+
23+
| Name | Description |
24+
|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
25+
| [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. |
26+
| [Cross-providers e2e tests](https://github.com/parallaxsecond/parsec/tree/master/e2e_tests/tests/all_providers/cross.rs) | Test that the output of various operations from different providers is accepted by the other providers. |
27+
| [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. |
28+
| [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. Parsec results are also verified with third party software crypto implementations (ring, the rsa crate, etc...). |
29+
| [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. |
30+
| [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. |
31+
32+
## Fuzz testing
33+
34+
| Name | Description |
35+
|---------------------------------------------------------------------------|-------------------------------------------------------------------------------|
36+
| [Fuzz testing](https://github.com/parallaxsecond/parsec/tree/master/fuzz) | Tests sending random requests to the service and waiting it to crash/timeout. |
37+
38+
## Unit testing
39+
40+
| Name | Description |
41+
|-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
42+
| [Direct authenticator tests](https://github.com/parallaxsecond/parsec/blob/master/src/authenticators/direct_authenticator/mod.rs) | Testing the `Authenticate` trait with this authenticator. |
43+
| [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. |
44+
45+
## In dependencies
46+
47+
The dependencies that we maintain in the `parallaxsecond` organisation also contain their own set of
48+
integration and unit tests: `parsec-interface-rs`, `rust-psa-crypto` and `rust-tss-esapi`.
49+
50+
*Copyright 2020 Contributors to the Parsec project.*

0 commit comments

Comments
 (0)