Add test_helpers (#474)
* Add set_enterprise_attestation in TestEnv * Add test_helpers for Test Unification * Used it in structured fuzzer and enterprise attestation unittests * Restructure test_helpers * Rename setup_enterprise_attestation to enable_
This commit is contained in:
43
src/env/test/customization.rs
vendored
43
src/env/test/customization.rs
vendored
@@ -4,21 +4,34 @@ use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
pub struct TestCustomization {
|
||||
pub default_cred_protect: Option<CredentialProtectionPolicy>,
|
||||
pub default_min_pin_length: u8,
|
||||
pub default_min_pin_length_rp_ids: Vec<String>,
|
||||
pub enforce_always_uv: bool,
|
||||
pub enterprise_attestation_mode: Option<EnterpriseAttestationMode>,
|
||||
pub enterprise_rp_id_list: Vec<String>,
|
||||
pub max_msg_size: usize,
|
||||
pub max_pin_retries: u8,
|
||||
pub use_batch_attestation: bool,
|
||||
pub use_signature_counter: bool,
|
||||
pub max_cred_blob_length: usize,
|
||||
pub max_credential_count_in_list: Option<usize>,
|
||||
pub max_large_blob_array_size: usize,
|
||||
pub max_rp_ids_length: usize,
|
||||
pub max_supported_resident_keys: usize,
|
||||
default_cred_protect: Option<CredentialProtectionPolicy>,
|
||||
default_min_pin_length: u8,
|
||||
default_min_pin_length_rp_ids: Vec<String>,
|
||||
enforce_always_uv: bool,
|
||||
enterprise_attestation_mode: Option<EnterpriseAttestationMode>,
|
||||
enterprise_rp_id_list: Vec<String>,
|
||||
max_msg_size: usize,
|
||||
max_pin_retries: u8,
|
||||
use_batch_attestation: bool,
|
||||
use_signature_counter: bool,
|
||||
max_cred_blob_length: usize,
|
||||
max_credential_count_in_list: Option<usize>,
|
||||
max_large_blob_array_size: usize,
|
||||
max_rp_ids_length: usize,
|
||||
max_supported_resident_keys: usize,
|
||||
}
|
||||
|
||||
impl TestCustomization {
|
||||
pub fn setup_enterprise_attestation(
|
||||
&mut self,
|
||||
mode: Option<EnterpriseAttestationMode>,
|
||||
rp_id_list: Option<Vec<String>>,
|
||||
) {
|
||||
self.enterprise_attestation_mode = mode;
|
||||
if let Some(rp_id_list) = rp_id_list {
|
||||
self.enterprise_rp_id_list = rp_id_list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Customization for TestCustomization {
|
||||
|
||||
Reference in New Issue
Block a user