Skip to content

Commit

Permalink
Attempt to run network tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Sep 3, 2024
1 parent 609893a commit cbc698d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,36 @@ jobs:
run: cargo build --release
- name: run fork tests
run: cd fork-tests && make
test_network:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
options: --privileged
env:
RUST_BACKTRACE: full
RUST_LOG: trace
services:
docker:
image: docker:dind
options: --privileged
ports:
- 2375:2375
steps:
- uses: actions/checkout@v2

- name: install opensc and dependencies
run: apt-get update && apt-get install -y curl opensc openssl gcc xxd jq gnutls-bin make docker.io

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy, llvm-tools-preview
- name: pull docker image
run: docker pull nitrokey/nethsm:testing

- uses: Swatinem/rust-cache@v2
- name: build release
run: cargo build --release
- name: run network tests
run: cargo t --features pkcs11-full-tests -p nethsm_pkcs11 --test basic
8 changes: 6 additions & 2 deletions pkcs11/tests/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pub fn run_tests(
};
let mut test_dropper = TestDropper {
serialize_test,
command_to_kill: Command::new("podman")
command_to_kill: Command::new("docker")
.args([
"run",
"--rm",
Expand All @@ -334,7 +334,11 @@ pub fn run_tests(
..Default::default()
};

sleep(Duration::from_secs(2));
println!("Configuration built, waiting for test instance to be up");

sleep(Duration::from_secs(5));

println!("Attempting provisionning");

provision_post(
&sdk_config,
Expand Down

0 comments on commit cbc698d

Please sign in to comment.