Testing a small http-client on Linux using no_std & embedded reqwless.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update xtask validate to support HTTPS RNG backends

rektide 7982c4d2 7af9c682

+74 -1
+2
xtask/src/validate/axes/mod.rs
··· 1 1 pub mod dns; 2 2 pub mod platform; 3 + pub mod rng; 3 4 4 5 pub use dns::DnsFeature; 5 6 pub use platform::PlatformFeature; 7 + pub use rng::RngFeature;
+40
xtask/src/validate/axes/rng.rs
··· 1 + use crate::validate::case::{build_check_case, build_run_case, CaseSpec, Expectation}; 2 + 3 + #[derive(Clone, Copy)] 4 + pub enum RngFeature { 5 + Dummy, 6 + DevUrandom, 7 + Getrandom, 8 + } 9 + 10 + impl RngFeature { 11 + pub fn flag(self) -> &'static str { 12 + match self { 13 + Self::Dummy => "rng-dummy", 14 + Self::DevUrandom => "rng-dev-urandom", 15 + Self::Getrandom => "rng-getrandom", 16 + } 17 + } 18 + 19 + fn build_features(self) -> [&'static str; 4] { 20 + [ 21 + "backend-posix-libc", 22 + "dns-getaddrinfo", 23 + "https", 24 + self.flag(), 25 + ] 26 + } 27 + 28 + pub fn check_case(self) -> CaseSpec { 29 + build_check_case(&self.build_features(), true) 30 + } 31 + 32 + pub fn run_case(self) -> CaseSpec { 33 + build_run_case( 34 + &self.build_features(), 35 + true, 36 + crate::validate::case::HTTPS_EXAMPLE_URL, 37 + Expectation::Success, 38 + ) 39 + } 40 + }
+1
xtask/src/validate/case.rs
··· 1 1 pub const HTTP_EXAMPLE_URL: &str = "http://example.com"; 2 + pub const HTTPS_EXAMPLE_URL: &str = "https://example.com"; 2 3 pub const DNS_IP_ONLY_REJECT_NEEDLE: &str = "dns-ip-only mode accepts literal IP hosts only"; 3 4 4 5 #[derive(Clone, Copy)]
+31 -1
xtask/src/validate/task.rs
··· 1 - use crate::validate::axes::{DnsFeature, PlatformFeature}; 1 + use crate::validate::axes::{DnsFeature, PlatformFeature, RngFeature}; 2 2 use crate::validate::case::{ 3 3 default_check_case, default_run_example_case, https_check_case, CaseAxis, CaseSpec, Scenario, 4 4 }; ··· 29 29 RunRustixHttpExample, 30 30 #[value(help = "run rustix backend in IP-only mode against hostname and confirm rejection")] 31 31 RunRustixIpOnlyReject, 32 + #[value(help = "check HTTPS with dummy RNG backend")] 33 + CheckHttpsRngDummy, 34 + #[value(help = "check HTTPS with dev-urandom RNG backend")] 35 + CheckHttpsRngDevUrandom, 36 + #[value(help = "check HTTPS with getrandom RNG backend")] 37 + CheckHttpsRngGetrandom, 38 + #[value(help = "run HTTPS download with dummy RNG backend")] 39 + RunHttpsRngDummy, 40 + #[value(help = "run HTTPS download with dev-urandom RNG backend")] 41 + RunHttpsRngDevUrandom, 42 + #[value(help = "run HTTPS download with getrandom RNG backend")] 43 + RunHttpsRngGetrandom, 32 44 } 33 45 34 46 impl ValidateTask { ··· 40 52 Self::CheckIpOnly, 41 53 Self::CheckRustix, 42 54 Self::CheckRustixIpOnly, 55 + Self::CheckHttpsRngDummy, 56 + Self::CheckHttpsRngDevUrandom, 57 + Self::CheckHttpsRngGetrandom, 43 58 Self::RunHttpExample, 44 59 Self::RunRustixHttpExample, 45 60 Self::RunIpOnlyReject, 46 61 Self::RunRustixIpOnlyReject, 62 + Self::RunHttpsRngDummy, 63 + Self::RunHttpsRngDevUrandom, 64 + Self::RunHttpsRngGetrandom, 47 65 ]), 48 66 Self::Build => Some(&[ 49 67 Self::Check, ··· 51 69 Self::CheckIpOnly, 52 70 Self::CheckRustix, 53 71 Self::CheckRustixIpOnly, 72 + Self::CheckHttpsRngDummy, 73 + Self::CheckHttpsRngDevUrandom, 74 + Self::CheckHttpsRngGetrandom, 54 75 ]), 55 76 Self::Runtime => Some(&[ 56 77 Self::RunHttpExample, 57 78 Self::RunRustixHttpExample, 58 79 Self::RunIpOnlyReject, 59 80 Self::RunRustixIpOnlyReject, 81 + Self::RunHttpsRngDummy, 82 + Self::RunHttpsRngDevUrandom, 83 + Self::RunHttpsRngGetrandom, 60 84 ]), 61 85 _ => None, 62 86 } ··· 85 109 Self::RunRustixIpOnlyReject => { 86 110 DnsFeature::IpOnly.case(Scenario::RejectHostname, Some(PlatformFeature::Rustix)) 87 111 } 112 + Self::CheckHttpsRngDummy => Some(RngFeature::Dummy.check_case()), 113 + Self::CheckHttpsRngDevUrandom => Some(RngFeature::DevUrandom.check_case()), 114 + Self::CheckHttpsRngGetrandom => Some(RngFeature::Getrandom.check_case()), 115 + Self::RunHttpsRngDummy => Some(RngFeature::Dummy.run_case()), 116 + Self::RunHttpsRngDevUrandom => Some(RngFeature::DevUrandom.run_case()), 117 + Self::RunHttpsRngGetrandom => Some(RngFeature::Getrandom.run_case()), 88 118 Self::All | Self::Build | Self::Runtime => None, 89 119 } 90 120 }