Skip to content

Commit

Permalink
ci: Run the Parsec Service when testing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tgonzalezorlandoarm committed Feb 15, 2024
1 parent f5a8bf6 commit e373470
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
21 changes: 19 additions & 2 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -29,4 +46,4 @@ if [[ $test_string == $provider_load_result ]]; then
fi

echo "Loaded Provider has unexpected parameters!!!!"
exit 1
exit 1
22 changes: 22 additions & 0 deletions tests/configs/test_config.toml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions tests/docker_image/parsec-openssl-provider-test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit e373470

Please sign in to comment.