From 3060f1585871a67aa87d302e97ad01df27b847fc Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Wed, 31 Jan 2024 15:44:03 +0000 Subject: [PATCH] Test: Add basic ci script and test files This patch only adds rudimentary files for the CI and test setup. A comprehensive PR with detailed setup will be added later. Signed-off-by: Gowtham Suresh Kumar --- .gitignore | 5 +++ ci.sh | 9 +++++ .../parsec-provider-test.Dockerfile | 34 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100755 ci.sh create mode 100644 tests/docker_image/parsec-provider-test.Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..30d8b67d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/target +Cargo.lock +.vscode +*/Cargo.lock +*/target diff --git a/ci.sh b/ci.sh new file mode 100755 index 00000000..c0c5f6e6 --- /dev/null +++ b/ci.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Copyright 2023 Contributors to the Parsec project. +# SPDX-License-Identifier: Apache-2.0 + +set -ex + +openssl version +openssl list -providers -provider-path ./target/debug/ -provider libparsec_openssl_provider_shared diff --git a/tests/docker_image/parsec-provider-test.Dockerfile b/tests/docker_image/parsec-provider-test.Dockerfile new file mode 100644 index 00000000..3cd24507 --- /dev/null +++ b/tests/docker_image/parsec-provider-test.Dockerfile @@ -0,0 +1,34 @@ +# Copyright 2023 Contributors to the Parsec project. +# SPDX-License-Identifier: Apache-2.0 +FROM ubuntu:22.04 + +RUN apt-get update && apt-get -y upgrade +RUN apt install -y autoconf-archive libcmocka0 libcmocka-dev procps +RUN apt install -y iproute2 build-essential git pkg-config gcc libtool automake libssl-dev uthash-dev doxygen libjson-c-dev +RUN apt install -y --fix-missing wget python3 cmake clang +RUN apt install -y libini-config-dev libcurl4-openssl-dev curl libgcc1 +RUN apt install -y python3-distutils libclang-11-dev protobuf-compiler python3-pip +RUN apt install -y libgcrypt20-dev uuid-dev +RUN apt install -y libssl-dev git gcc openssl + +# Setup git config +RUN git config --global user.email "some@email.com" +RUN git config --global user.name "Parsec Team" + +WORKDIR /tmp + +# Install Rust toolchain for all users +# This way of installing allows all users to call the same binaries, but non-root +# users cannot modify the toolchains or install new ones. +# See: https://github.com/rust-lang/rustup/issues/1085 +ENV RUSTUP_HOME /opt/rust +ENV CARGO_HOME /opt/rust +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path +ENV PATH="/root/.cargo/bin:/opt/rust/bin:${PATH}" + +# Install the wrappers for the Rust binaries installed earlier +COPY _exec_wrapper /usr/local/bin/ +RUN ls /opt/rust/bin | xargs -n1 -I% ln -s /usr/local/bin/_exec_wrapper /usr/local/bin/$(basename %) + +# For running tests Parsec is configured with the socket in /tmp/ +ENV PARSEC_SERVICE_ENDPOINT="unix:/tmp/parsec.sock"