-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add a rustls-webpki harness Signed-off-by: William Woodruff <[email protected]> * fix harness name Signed-off-by: William Woodruff <[email protected]> * Makefile, CI wiring Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: William Woodruff <[email protected]>
- Loading branch information
Showing
15 changed files
with
967 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["harness/rust-webpki"] | ||
members = ["harness-support/rust", "harness/rust-webpki", "harness/rust-rustls"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "limbo-harness-support" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
# TODO: Replace with upstream once merged: | ||
# https://github.com/Marwes/schemafy/pull/76 | ||
schemafy = { git = "https://github.com/woodruffw-forks/schemafy", rev = "de28e87" } | ||
serde = { version = "1.0.192", features = ["derive"] } | ||
serde_json = "1.0.108" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
limbo-harness-support | ||
===================== | ||
|
||
Shared behavior between Rust-based Limbo test harnesses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use models::Limbo; | ||
|
||
pub mod models; | ||
|
||
// `cargo run` runs from the workspace root, so this is relative to | ||
// the root. | ||
const LIMBO_JSON: &str = "limbo.json"; | ||
|
||
pub fn load_limbo() -> Limbo { | ||
serde_json::from_str::<Limbo>(&std::fs::read_to_string(LIMBO_JSON).unwrap()).unwrap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
schemafy::schemafy!("../../limbo-schema.json"); | ||
|
||
#[derive(Serialize)] | ||
#[serde(rename_all = "UPPERCASE")] | ||
pub enum ActualResult { | ||
Success, | ||
Failure, | ||
Skipped, | ||
} | ||
|
||
#[derive(Serialize)] | ||
pub struct TestcaseResult { | ||
pub id: String, | ||
pub actual_result: ActualResult, | ||
pub context: Option<String>, | ||
} | ||
|
||
impl TestcaseResult { | ||
pub fn fail(tc: &Testcase, reason: &str) -> Self { | ||
TestcaseResult { | ||
id: tc.id.clone(), | ||
actual_result: ActualResult::Failure, | ||
context: Some(reason.into()), | ||
} | ||
} | ||
|
||
pub fn success(tc: &Testcase) -> Self { | ||
TestcaseResult { | ||
id: tc.id.clone(), | ||
actual_result: ActualResult::Success, | ||
context: None, | ||
} | ||
} | ||
|
||
pub fn skip(tc: &Testcase, reason: &str) -> Self { | ||
TestcaseResult { | ||
id: tc.id.clone(), | ||
actual_result: ActualResult::Skipped, | ||
context: Some(reason.into()), | ||
} | ||
} | ||
} | ||
|
||
#[derive(Serialize)] | ||
pub struct LimboResult { | ||
pub version: u8, | ||
pub harness: String, | ||
pub results: Vec<TestcaseResult>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "rust-rustls-harness" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
limbo-harness-support = { path = "../../harness-support/rust" } | ||
chrono = "0.4.31" | ||
pem = "3.0.2" | ||
serde_json = "1.0.108" | ||
rustls-webpki = { version = "0.101.7", features = ["std"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# `rustls-webpki` test harness for x509-limbo | ||
|
||
This directory contains a basic test harness for running the x509-limbo | ||
testsuite against the Rust [`rustls-webpki` crate]. | ||
|
||
[`webpki` crate]: https://docs.rs/rustls-webpki/latest/rustls-webpki/index.html | ||
|
||
## Building | ||
|
||
Just `cargo build`. |
Oops, something went wrong.