Skip to content

Commit

Permalink
kbs: replace actix-rt runtime to tokio
Browse files Browse the repository at this point in the history
tokio async runtime provides the same capatibility as actix-rt, it will
be good to use existing crates.

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Jan 22, 2025
1 parent 21253af commit 8d7e167
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion kbs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ attestation-service = { path = "../attestation-service", default-features = fals


[dev-dependencies]
actix-rt = "2.10.0"
kbs-client = { path = "../tools/kbs-client" }
tempfile.workspace = true
rstest.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions kbs/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use serial_test::serial;
use std::io::Write;
use tempfile::{NamedTempFile, TempDir};

const KBS_URL: &str = "http://127.0.0.1:8080";
const KBS_URL: &str = "http://127.0.0.1:8085";
const SECRET_BYTES: &[u8; 8] = b"shhhhhhh";
const SECRET_PATH: &str = "default/test/secret";
const WAIT_TIME: u64 = 3000;
Expand Down Expand Up @@ -104,7 +104,7 @@ impl TestHarness {
timeout: 5,
},
http_server: HttpServerConfig {
sockets: vec!["127.0.0.1:8080".parse()?],
sockets: vec!["127.0.0.1:8085".parse()?],
private_key: None,
certificate: None,
insecure_http: true,
Expand Down Expand Up @@ -136,7 +136,7 @@ impl TestHarness {
let kbs_server = api_server.server()?;
let kbs_handle = kbs_server.handle();

actix_web::rt::spawn(kbs_server);
tokio::spawn(kbs_server);

self.wait().await;
self.set_secret(SECRET_PATH.to_string(), SECRET_BYTES.as_ref().to_vec())
Expand Down Expand Up @@ -207,7 +207,7 @@ impl TestHarness {
#[case::ear_allow_all(TestParameters{attestation_token_type: "Ear".to_string() })]
#[case::simple_allow_all(TestParameters{attestation_token_type: "Simple".to_string() })]
#[serial]
#[actix_rt::test]
#[tokio::test]
async fn integration(#[case] test_parameters: TestParameters) -> Result<()> {
let _ = env_logger::try_init_from_env(env_logger::Env::new().default_filter_or("debug"));

Expand Down

0 comments on commit 8d7e167

Please sign in to comment.