-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(https support ): add test for https support DI
- still WIP Signed-off-by: Sarita Mahajan <sarmahaj@redhat.com>
- Loading branch information
Showing
7 changed files
with
141 additions
and
1 deletion.
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
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,61 @@ | ||
/* | ||
mod common; | ||
use common::{Binary, LogSide, TestContext}; | ||
use std::env; | ||
use std::path::Path; | ||
use std::time::Duration; | ||
use anyhow::{Context, Result}; | ||
const L: LogSide = LogSide::Test; | ||
#[tokio::test] | ||
async fn di_diun_https_test() -> Result<()> { | ||
let mut ctx = TestContext::new().context("Error building test context")?; | ||
let mfg_server = ctx | ||
.start_test_server( | ||
Binary::ManufacturingServer, | ||
|cfg| { | ||
Ok(cfg.prepare_config_file(None, |cfg| { | ||
cfg.insert("rendezvous_port", "1337"); | ||
cfg.insert("diun_key_type", "FileSystem"); | ||
cfg.insert("device_identification_format", "SerialNumber"); | ||
cfg.insert("manufacturing_server_https_cert_path", "/workspaces/fido-device-onboard-rs/integration-tests/tests/test-data/https-test"); | ||
cfg.insert("manufacturing_server_https_key_path", "/workspaces/fido-device-onboard-rs/integration-tests/tests/test-data/https-test"); | ||
// cfg.insert("bind_http", "8085"); | ||
cfg.insert("bind_https", &format!("0.0.0.0:{}","8086")); | ||
Ok(()) | ||
})?) | ||
}, | ||
|_| Ok(()), | ||
) | ||
.context("Error creating manufacturing server")?; | ||
ctx.wait_until_servers_ready() | ||
.await | ||
.context("Error waiting for servers to start")?; | ||
let client_result = ctx | ||
.run_client( | ||
Binary::ManufacturingClient, | ||
Some(&mfg_server), | ||
|cfg| { | ||
cfg.env("DEVICE_CREDENTIAL_FILENAME", "devicecredential.dc") | ||
.env("MANUFACTURING_SERVER_URL", "https://localhost:8086") | ||
.env("DEV_ENVIRONMENT", "1") | ||
.env("DIUN_PUB_KEY_INSECURE", "true"); | ||
Ok(()) | ||
}, | ||
Duration::from_secs(5), | ||
) | ||
.context("Error running manufacturing client")?; | ||
client_result | ||
.expect_success() | ||
.context("Manufacturing client failed")?; | ||
let dc_path = client_result.client_path().join("devicecredential.dc"); | ||
L.l(format!("Device Credential should be in {:?}", dc_path)); | ||
assert!(Path::new(&dc_path).exists()); | ||
Ok(()) | ||
} */ |
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
22 changes: 22 additions & 0 deletions
22
integration-tests/tests/test-data/https-test/manufacturing_server_https_cert.crt
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,22 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDqzCCApMCFDBq5YwvijIjOB6U4yFgJpJwHTsEMA0GCSqGSIb3DQEBCwUAMIGR | ||
MQswCQYDVQQGEwJJRTEPMA0GA1UECAwGR2Fsd2F5MQ8wDQYDVQQHDAZHYWx3YXkx | ||
EDAOBgNVBAoMB1JlZCBIYXQxDDAKBgNVBAsMA1I0RTEcMBoGA1UEAwwTd3d3LmZk | ||
by5leGFtcGxlLmNvbTEiMCAGCSqGSIb3DQEJARYTc2FybWFoYWpAcmVkaGF0LmNv | ||
bTAeFw0yM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 changes: 28 additions & 0 deletions
28
integration-tests/tests/test-data/https-test/manufacturing_server_https_key.key
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,28 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDIihQOM4+A2d0v | ||
OR6LBzQ+4QGqTezEkuofuMXSQusWQXuBJEjab7o9tiNPW8XZnTweCgyNJiiIczOU | ||
E5niI+Xoxmnr4rg2y7hdbdgi22+A6a4/bkvNV2rbaknUQ3lmuBGURn94hqK8m9io | ||
HUWqk9bMuUYdinzWvtuu8CRJWehLAY416IwTtsoPnVu+VNaCIS7UDxVCEO/Jrjq/ | ||
B4Oqeu1B2izuq68u0fw4XW6YaycCzBOQGkAL6bnVjO8tD6x7Ds1t55spJLU0mzlw | ||
Vrcdne6WWI7vg10lvf9a1fhlfjbaFCI1C/XxCpvZk9lbluN92Qrz60EwHDaPO1bD | ||
GJOJmcmXAgMBAAECgf9sNVs/8WPmXUt8Uqdio0ZTkESP8h8424G/Vl05aPm25bXh | ||
p9V5Tlv2Hy7XI3PZBDkDcN0PHjZ7DSLTWzSiC7zI6Y0PgSPOPvBfeZSPaQcqZXkJ | ||
NW8Or4WQmdVT7iv8e21d/ZUQlttQR4HyHXxXDp1wTrdMlnk6rMHGOs4T3anL5ZY9 | ||
juXeva/7ilyETvuGCogx4F8/jMpaG9ypr8HYUCwEtt2pEL1eak5VQ/U1wzoN5mKd | ||
Ke8eIfuE1JLdArFgXL9T3xmEu640JW27p94FTt6gUzutY6H88QvRy0S6A+Umat/A | ||
0sM3T0U3wZso0VI3wpgLScy+aKYz+NE+HWb74hkCgYEA7D3yhQ5iORs1o/ELdfJP | ||
j4pzaqyQ0fTjyXJ0BeCdbyvt6pKyEOVWr6N5tSb1LuoqHNO2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