diff --git a/ci.sh b/ci.sh index 8a9498f9..4b3fbd6a 100755 --- a/ci.sh +++ b/ci.sh @@ -5,8 +5,25 @@ set -ex +wait_for_service() { + while [ -z "$(pgrep parsec)" ]; do + sleep 1 + done + + sleep 5 + + # Check that Parsec successfully started and is running + pgrep parsec >/dev/null +} + +pushd /tmp/parsec +./target/debug/parsec -c /tmp/parsec-openssl-provider/tests/configs/test_config.toml & +popd + +wait_for_service + # Build parsec provider shared library -pushd parsec-openssl-provider-shared/ && +pushd parsec-openssl-provider-shared cargo build popd @@ -29,4 +46,4 @@ if [[ $test_string == $provider_load_result ]]; then fi echo "Loaded Provider has unexpected parameters!!!!" -exit 1 \ No newline at end of file +exit 1 diff --git a/tests/configs/test_config.toml b/tests/configs/test_config.toml new file mode 100644 index 00000000..6b26673d --- /dev/null +++ b/tests/configs/test_config.toml @@ -0,0 +1,22 @@ +[core_settings] +allow_root = true +log_level = "error" +log_timestamp = true +log_error_details = true + +[listener] +listener_type = "DomainSocket" +timeout = 200 # in milliseconds +socket_path = "/tmp/parsec.sock" + +[authenticator] +auth_type = "UnixPeerCredentials" + +[[key_manager]] +name = "on-disk-manager" +manager_type = "OnDisk" +store_path = "mappings" + +[[provider]] +provider_type = "MbedCrypto" +key_info_manager = "on-disk-manager" diff --git a/tests/docker_image/parsec-openssl-provider-test.Dockerfile b/tests/docker_image/parsec-openssl-provider-test.Dockerfile index 3e6da33a..feb33492 100644 --- a/tests/docker_image/parsec-openssl-provider-test.Dockerfile +++ b/tests/docker_image/parsec-openssl-provider-test.Dockerfile @@ -28,3 +28,7 @@ ENV PATH="/root/.cargo/bin:/opt/rust/bin:${PATH}" # For running tests Parsec is configured with the socket in /tmp/ ENV PARSEC_SERVICE_ENDPOINT="unix:/tmp/parsec.sock" + +RUN git clone https://github.com/parallaxsecond/parsec.git --branch 1.3.0 \ + && cd parsec \ + && cargo build --features "mbed-crypto-provider"