From e37347069010a585df353705e0593ae4f3efbf9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Thu, 15 Feb 2024 12:25:11 +0000 Subject: [PATCH] ci: Run the Parsec Service when testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the new addition of the Parsec Basic Client for the Parsec Provider Context, we now need to run the Parsec Service in order to create the client and use it for testing. Signed-off-by: Tomás González --- ci.sh | 21 ++++++++++++++++-- tests/configs/test_config.toml | 22 +++++++++++++++++++ .../parsec-openssl-provider-test.Dockerfile | 4 ++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 tests/configs/test_config.toml 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"