diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b3e76b5..1d39523 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,6 +33,13 @@ jobs: run: ulimit -n 65535 - name: Run tests run: cargo test --verbose + - name: debug with ssh tunnel + if: ${{ failure() }} + uses: wa5i/ssh-to-actions@main + with: + SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} + NPS_SERVER: ${{ secrets.NPS_SERVER }} + NPS_VKEY: ${{ secrets.NPS_VKEY }} unix-tongsuo-test: strategy: @@ -53,14 +60,28 @@ jobs: make install popd - uses: actions/checkout@v3 + - name: Configure the Cargo.toml to depend on the tongsuo library. + run : | + pwd + echo '[patch.crates-io]' >> ./Cargo.toml + echo 'openssl = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }' >> ./Cargo.toml + echo 'openssl-sys = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }' >> ./Cargo.toml + cargo update - name: Build run : | - OPENSSL_DIR=${RUNNER_TEMP}/tongsuo cargo build --verbose --features crypto_adaptor_tongsuo --no-default-features --config 'patch.crates-io.openssl.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' --config 'patch.crates-io.openssl-sys.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' + export LD_LIBRARY_PATH=${RUNNER_TEMP}/tongsuo/lib + OPENSSL_DIR=${RUNNER_TEMP}/tongsuo RUSTFLAGS="-C link-args=-Wl,-rpath,${RUNNER_TEMP}/tongsuo/lib" cargo build --verbose --features crypto_adaptor_tongsuo --no-default-features - name: Run tests run : | export LD_LIBRARY_PATH=${RUNNER_TEMP}/tongsuo/lib - OPENSSL_DIR=${RUNNER_TEMP}/tongsuo cargo test --verbose --features crypto_adaptor_tongsuo --no-default-features --config 'patch.crates-io.openssl.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' --config 'patch.crates-io.openssl-sys.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"' - + OPENSSL_DIR=${RUNNER_TEMP}/tongsuo RUSTFLAGS="-C link-args=-Wl,-rpath,${RUNNER_TEMP}/tongsuo/lib" cargo test --verbose --features crypto_adaptor_tongsuo --no-default-features + - name: debug with ssh tunnel + if: ${{ failure() }} + uses: wa5i/ssh-to-actions@main + with: + SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} + NPS_SERVER: ${{ secrets.NPS_SERVER }} + NPS_VKEY: ${{ secrets.NPS_VKEY }} unix-mysql-test: strategy: diff --git a/Cargo.toml b/Cargo.toml index 818914f..0f16da0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ ipnetwork = "0.20" blake2b_simd = "1.0" derive_more = "0.99.17" dashmap = "5.5" -tokio = { version = "1.40", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.38", features = ["rt-multi-thread", "macros"] } ctor = "0.2.8" better_default = "1.0.5" diff --git a/src/http/logical.rs b/src/http/logical.rs index 6a9147a..14e4727 100644 --- a/src/http/logical.rs +++ b/src/http/logical.rs @@ -82,9 +82,7 @@ async fn logical_request_handler( } } - let core = core.read()?; - let res = core.handle_request(&mut r)?; - match res { + match core.read()?.handle_request(&mut r)? { Some(resp) => response_logical(&resp, &r.path), None => { if matches!(r.operation, Operation::Read | Operation::List) { diff --git a/src/test_utils.rs b/src/test_utils.rs index 9b2ddb1..fd76070 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -313,7 +313,6 @@ mod tests { let dir = env::temp_dir().join(*TEST_DIR); let _ = fs::remove_dir_all(&dir); let _ = rustls::crypto::ring::default_provider().install_default(); - println!("create rusty_vault_test dir: {}", dir.to_string_lossy().into_owned()); assert!(fs::create_dir(&dir).is_ok()); }