Skip to content

Commit 7301ff4

Browse files
authored
Merge pull request #145 from hug-dev/remove-stress-tests-pkcs11
Remove stress test on Travis CI for PKCS 11
2 parents de5f713 + ae8b964 commit 7301ff4

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ jobs:
1010
env:
1111
- DOCKER_IMAGE_NAME=mbed-crypto-provider
1212
- DOCKER_IMAGE_PATH=tests/per_provider/provider_cfg/mbed-crypto
13-
- SCRIPT="tests/ci.sh mbed-crypto"
13+
# Stress test fails on Travis CI, see #116
14+
- SCRIPT="tests/ci.sh --no-stress-test mbed-crypto"
1415
- name: "Integration tests using PKCS 11 provider"
1516
env:
1617
- DOCKER_IMAGE_NAME=pkcs11-provider
1718
- DOCKER_IMAGE_PATH=tests/per_provider/provider_cfg/pkcs11
18-
- SCRIPT="tests/ci.sh pkcs11"
19+
# Stress test fails on Travis CI, see #116
20+
- SCRIPT="tests/ci.sh --no-stress-test pkcs11"
1921
script:
2022
- docker build -t $DOCKER_IMAGE_NAME $DOCKER_IMAGE_PATH
2123
- docker run -v $(pwd):/tmp/parsec -w /tmp/parsec $DOCKER_IMAGE_NAME /tmp/parsec/$SCRIPT

tests/ci.sh

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ It is meant to be executed inside one of the container
4545
which Dockerfiles are in tests/per_provider/provider_cfg/*/
4646
or tests/all_providers/
4747
48-
Usage: ./tests/ci.sh [--no-cargo-clean] PROVIDER_NAME
48+
Usage: ./tests/ci.sh [--no-cargo-clean] [--no-stress-test] PROVIDER_NAME
4949
where PROVIDER_NAME can be one of:
5050
- mbed-crypto
5151
- pkcs11
@@ -62,12 +62,16 @@ error_msg () {
6262

6363
# Parse arguments
6464
NO_CARGO_CLEAN=
65+
NO_STRESS_TEST=
6566
PROVIDER_NAME=
6667
while [ "$#" -gt 0 ]; do
6768
case "$1" in
6869
--no-cargo-clean )
6970
NO_CARGO_CLEAN="True"
7071
;;
72+
--no-stress-test )
73+
NO_STRESS_TEST="True"
74+
;;
7175
mbed-crypto | pkcs11 | tpm | all )
7276
if [ -n "$PROVIDER_NAME" ]; then
7377
error_msg "Only one provider name must be given"
@@ -172,18 +176,20 @@ else
172176
echo "Execute persistent test, after the reload"
173177
RUST_BACKTRACE=1 cargo test $FEATURES persistent_after
174178

175-
echo "Shutdown Parsec"
176-
kill $PARSEC_PID
177-
# Sleep time needed to make sure Parsec is killed.
178-
sleep 2
179-
180-
echo "Start Parsec for stress tests"
181-
# Change the log level for the stress tests because logging is limited on the
182-
# CI servers.
183-
RUST_LOG=error RUST_BACKTRACE=1 cargo run $FEATURES -- --config $CONFIG_PATH &
184-
PARSEC_PID=$!
185-
sleep 5
186-
187-
echo "Execute stress tests"
188-
RUST_BACKTRACE=1 cargo test $FEATURES stress_test
179+
if [ -z "$NO_STRESS_TEST" ]; then
180+
echo "Shutdown Parsec"
181+
kill $PARSEC_PID
182+
# Sleep time needed to make sure Parsec is killed.
183+
sleep 2
184+
185+
echo "Start Parsec for stress tests"
186+
# Change the log level for the stress tests because logging is limited on the
187+
# CI servers.
188+
RUST_LOG=error RUST_BACKTRACE=1 cargo run $FEATURES -- --config $CONFIG_PATH &
189+
PARSEC_PID=$!
190+
sleep 5
191+
192+
echo "Execute stress tests"
193+
RUST_BACKTRACE=1 cargo test $FEATURES stress_test
194+
fi
189195
fi

tests/per_provider/provider_cfg/mbed-crypto/config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ log_timestamp = false
44

55
[listener]
66
listener_type = "DomainSocket"
7-
timeout = 200 # in milliseconds
7+
# The timeout needs to be smaller than the test client timeout (five seconds) as it is testing
8+
# that the service does not hang for very big values of body or authentication length.
9+
timeout = 3000 # in milliseconds
810

911
[[key_manager]]
1012
name = "on-disk-manager"

tests/per_provider/provider_cfg/pkcs11/config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ log_timestamp = false
44

55
[listener]
66
listener_type = "DomainSocket"
7-
timeout = 200 # in milliseconds
7+
# The timeout needs to be smaller than the test client timeout (five seconds) as it is testing
8+
# that the service does not hang for very big values of body or authentication length.
9+
timeout = 3000 # in milliseconds
810

911
[[key_manager]]
1012
name = "on-disk-manager"

tests/per_provider/provider_cfg/tpm/config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ log_timestamp = false
44

55
[listener]
66
listener_type = "DomainSocket"
7-
timeout = 200 # in milliseconds
7+
# The timeout needs to be smaller than the test client timeout (five seconds) as it is testing
8+
# that the service does not hang for very big values of body or authentication length.
9+
timeout = 3000 # in milliseconds
810

911
[[key_manager]]
1012
name = "on-disk-manager"

0 commit comments

Comments
 (0)