Skip to content

Commit 0eafbb0

Browse files
authored
Merge pull request #162 from ionut-arm/integr-tests
Add integration test
2 parents 791b061 + f1a0521 commit 0eafbb0

File tree

8 files changed

+252
-110
lines changed

8 files changed

+252
-110
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Build the container
1212
run: docker build -t all-providers e2e_tests/provider_cfg/all
1313
- name: Run the container to execute the test script
14-
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec all-providers /tmp/parsec/tests/ci.sh all
14+
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec all-providers /tmp/parsec/ci.sh all
1515

1616
mbed-crypto-provider:
1717
name: Integration tests using Mbed Crypto provider
@@ -21,7 +21,7 @@ jobs:
2121
- name: Build the container
2222
run: docker build -t mbed-crypto-provider e2e_tests/provider_cfg/mbed-crypto
2323
- name: Run the container to execute the test script
24-
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec mbed-crypto-provider /tmp/parsec/tests/ci.sh mbed-crypto
24+
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec mbed-crypto-provider /tmp/parsec/ci.sh mbed-crypto
2525

2626
pkcs11-provider:
2727
name: Integration tests using PKCS 11 provider
@@ -31,7 +31,7 @@ jobs:
3131
- name: Build the container
3232
run: docker build -t pkcs11-provider e2e_tests/provider_cfg/pkcs11
3333
- name: Run the container to execute the test script
34-
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec pkcs11-provider /tmp/parsec/tests/ci.sh pkcs11
34+
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec pkcs11-provider /tmp/parsec/ci.sh pkcs11
3535

3636
tpm-provider:
3737
name: Integration tests using TPM provider
@@ -41,4 +41,4 @@ jobs:
4141
- name: Build the container
4242
run: docker build -t tpm-provider e2e_tests/provider_cfg/tpm
4343
- name: Run the container to execute the test script
44-
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec tpm-provider /tmp/parsec/tests/ci.sh tpm
44+
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec tpm-provider /tmp/parsec/ci.sh tpm

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ services:
77
jobs:
88
include:
99
- name: "Integration tests using Mbed Crypto provider"
10-
env: DOCKER_IMAGE_NAME=mbed-crypto-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/mbed-crypto SCRIPT="tests/ci.sh mbed-crypto"
10+
env: DOCKER_IMAGE_NAME=mbed-crypto-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/mbed-crypto SCRIPT="ci.sh mbed-crypto"
1111
- name: "Integration tests using PKCS 11 provider"
12-
env: DOCKER_IMAGE_NAME=pkcs11-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/pkcs11 SCRIPT="tests/ci.sh pkcs11"
12+
env: DOCKER_IMAGE_NAME=pkcs11-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/pkcs11 SCRIPT="ci.sh pkcs11"
1313
# PKCS11 tests are failing because of unidentified issues.
1414
# See https://github.com/parallaxsecond/parsec/issues/116
1515
allow_failures:
16-
- env: DOCKER_IMAGE_NAME=mbed-crypto-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/mbed-crypto SCRIPT="tests/ci.sh mbed-crypto"
17-
- env: DOCKER_IMAGE_NAME=pkcs11-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/pkcs11 SCRIPT="tests/ci.sh pkcs11"
16+
- env: DOCKER_IMAGE_NAME=mbed-crypto-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/mbed-crypto SCRIPT="ci.sh mbed-crypto"
17+
- env: DOCKER_IMAGE_NAME=pkcs11-provider DOCKER_IMAGE_PATH=e2e_tests/provider_cfg/pkcs11 SCRIPT="ci.sh pkcs11"
1818
script:
1919
- docker build -t $DOCKER_IMAGE_NAME $DOCKER_IMAGE_PATH
2020
- docker run -v $(pwd):/tmp/parsec -w /tmp/parsec $DOCKER_IMAGE_NAME /tmp/parsec/$SCRIPT

Cargo.lock

Lines changed: 105 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ derivative = "2.1.1"
4040
version = "3.0.0"
4141

4242
[dev-dependencies]
43-
num_cpus = "1.10.1"
44-
picky-asn1-der = "0.2.2"
45-
picky-asn1 = "0.2.1"
46-
serde = { version = "1.0", features = ["derive"] }
47-
sha2 = "0.8.1"
48-
parsec-client = "0.2.0"
49-
parsec-interface = { version = "0.14.0", features = ["testing"] }
43+
ring = "0.16.12"
44+
lazy_static = "1.4.0"
5045

5146
[build-dependencies]
5247
bindgen = "0.50.0"

tests/ci.sh renamed to ci.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ It is meant to be executed inside one of the container
3131
which Dockerfiles are in tests/per_provider/provider_cfg/*/
3232
or tests/all_providers/
3333
34-
Usage: ./tests/ci.sh [--no-cargo-clean] [--no-stress-test] PROVIDER_NAME
34+
Usage: ./ci.sh [--no-cargo-clean] [--no-stress-test] PROVIDER_NAME
3535
where PROVIDER_NAME can be one of:
3636
- mbed-crypto
3737
- pkcs11
@@ -110,12 +110,13 @@ if rustup component list | grep -q clippy; then
110110
cargo clippy --all-targets $FEATURES -- -D clippy::all -D clippy::cargo
111111
fi
112112

113-
echo "Unit tests"
114-
RUST_BACKTRACE=1 cargo test --lib $FEATURES
115-
echo "Doc tests"
116-
RUST_BACKTRACE=1 cargo test --doc $FEATURES
113+
echo "Unit, doc and integration tests"
114+
RUST_BACKTRACE=1 cargo test $FEATURES
117115

118-
echo "Start Parsec for integration tests"
116+
# Removing any mappings left over from integration tests
117+
rm -rf mappings/
118+
119+
echo "Start Parsec for end-to-end tests"
119120
RUST_LOG=info RUST_BACKTRACE=1 cargo run $FEATURES -- --config $CONFIG_PATH &
120121
PARSEC_PID=$!
121122
# Sleep time needed to make sure Parsec is ready before launching the tests.

0 commit comments

Comments
 (0)