diff --git a/crates/cargo-wdk/src/actions/build/package_task.rs b/crates/cargo-wdk/src/actions/build/package_task.rs index 7bd2f3299..d6475e0c3 100644 --- a/crates/cargo-wdk/src/actions/build/package_task.rs +++ b/crates/cargo-wdk/src/actions/build/package_task.rs @@ -10,7 +10,7 @@ use std::{ ffi::{CStr, CString}, marker::PhantomData, - ops::RangeFrom, + ops::RangeInclusive, path::{Path, PathBuf}, result::Result, }; @@ -43,9 +43,9 @@ pub enum SignMode { }, } -// FIXME: This range is inclusive of 25798. Update with range end after /sample -// flag is added to InfVerif CLI -const MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE: RangeFrom = 25798..; +// InfVerif in WDK builds in this range is bugged and does not contain the +// /samples flag. +const MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE: RangeInclusive = 25798..=26100; const WDR_TEST_CERT_STORE: &str = "WDRTestCertStore"; const WDR_LOCAL_TEST_CERT: &str = "WDRLocalTestCert"; const STAMPINF_VERSION_ENV_VAR: &str = "STAMPINF_VERSION"; @@ -544,15 +544,19 @@ impl<'a> PackageTask<'a> { fn run_infverif(&self) -> Result<(), PackageTaskError> { let additional_args = if self.sample_class { let wdk_build_number = self.wdk_build.detect_wdk_build_number()?; - if MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE.contains(&wdk_build_number) { - debug!( - "InfVerif in WDK Build {wdk_build_number} is bugged and does not contain the \ - /samples flag." - ); - warn!("InfVerif skipped for samples class. WDK Build: {wdk_build_number}"); - return Ok(()); + match wdk_build_number { + n if MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE.contains(&n) => { + debug!( + "InfVerif in WDK Build {wdk_build_number} is bugged and does not contain \ + the /samples flag." + ); + warn!("InfVerif skipped for samples class. WDK Build: {wdk_build_number}"); + return Ok(()); + } + // Use the `/samples` flag after the range and the `/msft` flag before the range + n if n > *MISSING_SAMPLE_FLAG_WDK_BUILD_NUMBER_RANGE.end() => "/samples", + _ => "/msft", } - "/msft" } else { "" }; diff --git a/crates/cargo-wdk/src/actions/build/tests.rs b/crates/cargo-wdk/src/actions/build/tests.rs index 882ffda26..2aeee353e 100644 --- a/crates/cargo-wdk/src/actions/build/tests.rs +++ b/crates/cargo-wdk/src/actions/build/tests.rs @@ -64,7 +64,7 @@ pub fn given_a_driver_project_when_default_values_are_provided_then_it_builds_su let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_default_package_task_steps(driver_name, "KMDF", target_arch, verify_signature); @@ -99,7 +99,7 @@ pub fn given_a_driver_project_when_profile_is_release_then_it_builds_successfull create_cargo_build_output_json(driver_name, driver_version, &cwd, None, profile); let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_default_package_task_steps(driver_name, "KMDF", target_arch, verify_signature); @@ -140,7 +140,7 @@ pub fn given_a_driver_project_when_target_arch_is_arm64_then_it_builds_successfu let test_build_action = &TestBuildAction::new(cwd.clone(), profile, Some(target_arch), sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_default_package_task_steps(driver_name, "KMDF", target_arch, verify_signature); assert_build_action_run_with_env_is_success( @@ -182,7 +182,7 @@ pub fn given_a_driver_project_when_profile_is_release_and_target_arch_is_arm64_t let test_build_action = &TestBuildAction::new(cwd.clone(), profile, Some(target_arch), sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_default_package_task_steps(driver_name, "KMDF", target_arch, verify_signature); assert_build_action_run_with_env_is_success( @@ -196,7 +196,45 @@ pub fn given_a_driver_project_when_profile_is_release_and_target_arch_is_arm64_t } #[test] -pub fn given_a_driver_project_when_sample_class_is_true_then_it_builds_successfully() { +pub fn given_sample_class_is_true_and_wdk_build_is_above_range_then_infverif_runs_with_samples_flag() + { + // Input CLI args + let cwd = PathBuf::from("C:\\tmp"); + let profile = None; + let target_arch = CpuArchitecture::Amd64; + let verify_signature = false; + let sample_class = true; + + // Driver project data + let driver_type = "KMDF"; + let driver_name = "sample-kmdf"; + let driver_version = "0.0.1"; + let wdk_metadata = get_cargo_metadata_wdk_metadata(driver_type, 1, 33); + let (workspace_member, package) = + get_cargo_metadata_package(&cwd, driver_name, driver_version, Some(&wdk_metadata)); + + let cargo_build_output = + create_cargo_build_output_json(driver_name, driver_version, &cwd, None, profile); + let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) + .set_up_standalone_driver_project((workspace_member, package)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 26101u32) + .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) + .expect_package_task_steps_without_infverif(driver_name, target_arch, verify_signature) + .expect_infverif(driver_name, &cwd, driver_type, Some("/samples"), None) + .expect_detect_wdk_build_number(26101u32); + + assert_build_action_run_with_env_is_success( + &cwd, + profile, + None, + verify_signature, + sample_class, + test_build_action, + ); +} + +#[test] +pub fn given_sample_class_is_true_and_wdk_build_below_range_then_infverif_runs_with_msft_flag() { // Input CLI args let cwd = PathBuf::from("C:\\tmp"); let profile = None; @@ -216,10 +254,47 @@ pub fn given_a_driver_project_when_sample_class_is_true_then_it_builds_successfu create_cargo_build_output_json(driver_name, driver_version, &cwd, None, profile); let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25797u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) - .expect_default_package_task_steps(driver_name, driver_type, target_arch, verify_signature) - .expect_detect_wdk_build_number(25100u32); + .expect_package_task_steps_without_infverif(driver_name, target_arch, verify_signature) + .expect_infverif(driver_name, &cwd, driver_type, Some("/msft"), None) + .expect_detect_wdk_build_number(25797u32); + + assert_build_action_run_with_env_is_success( + &cwd, + profile, + None, + verify_signature, + sample_class, + test_build_action, + ); +} + +#[test] +pub fn given_sample_class_is_true_and_wdk_build_within_range_then_infverif_is_skipped() { + // Input CLI args + let cwd = PathBuf::from("C:\\tmp"); + let profile = None; + let target_arch = CpuArchitecture::Amd64; + let verify_signature = false; + let sample_class = true; + + // Driver project data + let driver_type = "KMDF"; + let driver_name = "sample-kmdf"; + let driver_version = "0.0.1"; + let wdk_metadata = get_cargo_metadata_wdk_metadata(driver_type, 1, 33); + let (workspace_member, package) = + get_cargo_metadata_package(&cwd, driver_name, driver_version, Some(&wdk_metadata)); + + let cargo_build_output = + create_cargo_build_output_json(driver_name, driver_version, &cwd, None, profile); + let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) + .set_up_standalone_driver_project((workspace_member, package)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 26100u32) + .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) + .expect_package_task_steps_without_infverif(driver_name, target_arch, verify_signature) + .expect_detect_wdk_build_number(26100u32); assert_build_action_run_with_env_is_success( &cwd, @@ -252,7 +327,7 @@ pub fn given_a_driver_project_when_verify_signature_is_true_then_it_builds_succe create_cargo_build_output_json(driver_name, driver_version, &cwd, None, profile); let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_default_package_task_steps(driver_name, driver_type, target_arch, verify_signature); @@ -289,7 +364,7 @@ pub fn given_a_driver_project_when_sign_mode_is_off_then_signing_and_verificatio let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .with_sign_mode(SignMode::Off) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_package_task_steps_with_sign_mode_off(driver_name, driver_type, target_arch); @@ -326,7 +401,7 @@ pub fn given_a_driver_project_when_locked_is_set_then_it_is_forwarded_to_cargo_i let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .with_locked(true) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_default_package_task_steps(driver_name, driver_type, target_arch, verify_signature); @@ -392,7 +467,7 @@ pub fn given_a_driver_project_when_self_signed_exists_then_it_should_skip_callin let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -409,7 +484,7 @@ pub fn given_a_driver_project_when_self_signed_exists_then_it_should_skip_callin .expect_copy_self_signed_cert_file_to_package_folder(driver_name, &cwd, true) .expect_signtool_sign_driver_binary_sys_file(driver_name, &cwd, None) .expect_signtool_sign_cat_file(driver_name, &cwd, None) - .expect_infverif(driver_name, &cwd, "KMDF", None) + .expect_infverif(driver_name, &cwd, "KMDF", None, None) .expect_signtool_verify_driver_binary_sys_file(driver_name, &cwd, None) .expect_signtool_verify_cat_file(driver_name, &cwd, None); @@ -446,7 +521,7 @@ pub fn given_a_driver_project_when_final_package_dir_exists_then_it_should_skip_ let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, false) .expect_dir_created(driver_name, &cwd, true) @@ -464,7 +539,7 @@ pub fn given_a_driver_project_when_final_package_dir_exists_then_it_should_skip_ .expect_copy_self_signed_cert_file_to_package_folder(driver_name, &cwd, true) .expect_signtool_sign_driver_binary_sys_file(driver_name, &cwd, None) .expect_signtool_sign_cat_file(driver_name, &cwd, None) - .expect_infverif(driver_name, &cwd, "KMDF", None); + .expect_infverif(driver_name, &cwd, "KMDF", None, None); assert_build_action_run_with_env_is_success( &cwd, @@ -498,7 +573,7 @@ pub fn given_a_driver_project_when_inx_file_do_not_exist_then_package_should_fai let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_inx_file_exists(driver_name, &cwd, false); @@ -547,7 +622,7 @@ pub fn given_a_driver_project_when_copy_of_an_artifact_fails_then_the_package_sh let test_build_action = &TestBuildAction::new(cwd.clone(), profile, Some(target_arch), sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) .expect_rename_driver_binary_dll_to_sys(driver_name, &cwd) @@ -598,7 +673,7 @@ pub fn given_a_driver_project_when_stampinf_command_execution_fails_then_package let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -659,7 +734,7 @@ pub fn given_a_driver_project_when_inf2cat_command_execution_fails_then_package_ let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -721,7 +796,7 @@ pub fn given_a_driver_project_when_certmgr_command_execution_fails_then_package_ let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -732,7 +807,7 @@ pub fn given_a_driver_project_when_certmgr_command_execution_fails_then_package_ .expect_copy_map_file_to_package_folder(driver_name, &cwd, true) .expect_stampinf(driver_name, &cwd, target_arch, None) .expect_inf2cat(driver_name, &cwd, target_arch, None) - .expect_infverif(driver_name, &cwd, driver_type, None) + .expect_infverif(driver_name, &cwd, driver_type, None, None) .expect_self_signed_cert_file_exists(&cwd, false) .expect_certmgr_exists_check(Some(expected_output)); @@ -781,7 +856,7 @@ pub fn given_a_driver_project_when_makecert_command_execution_fails_then_package let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -792,7 +867,7 @@ pub fn given_a_driver_project_when_makecert_command_execution_fails_then_package .expect_copy_map_file_to_package_folder(driver_name, &cwd, true) .expect_stampinf(driver_name, &cwd, target_arch, None) .expect_inf2cat(driver_name, &cwd, target_arch, None) - .expect_infverif(driver_name, &cwd, driver_type, None) + .expect_infverif(driver_name, &cwd, driver_type, None, None) .expect_self_signed_cert_file_exists(&cwd, false) .expect_certmgr_exists_check(None) .expect_makecert(&cwd, Some(expected_output)); @@ -842,7 +917,7 @@ pub fn given_a_driver_project_when_signtool_command_execution_fails_then_package let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -853,7 +928,7 @@ pub fn given_a_driver_project_when_signtool_command_execution_fails_then_package .expect_copy_map_file_to_package_folder(driver_name, &cwd, true) .expect_stampinf(driver_name, &cwd, target_arch, None) .expect_inf2cat(driver_name, &cwd, target_arch, None) - .expect_infverif(driver_name, &cwd, driver_type, None) + .expect_infverif(driver_name, &cwd, driver_type, None, None) .expect_self_signed_cert_file_exists(&cwd, false) .expect_certmgr_exists_check(None) .expect_makecert(&cwd, None) @@ -905,7 +980,7 @@ pub fn given_a_driver_project_when_infverif_command_execution_fails_then_package let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc(&cwd, target_arch, None) .expect_final_package_dir_exists(driver_name, &cwd, true) .expect_inx_file_exists(driver_name, &cwd, true) @@ -916,7 +991,7 @@ pub fn given_a_driver_project_when_infverif_command_execution_fails_then_package .expect_copy_map_file_to_package_folder(driver_name, &cwd, true) .expect_stampinf(driver_name, &cwd, target_arch, None) .expect_inf2cat(driver_name, &cwd, target_arch, None) - .expect_infverif(driver_name, &cwd, driver_type, Some(expected_output)); + .expect_infverif(driver_name, &cwd, driver_type, None, Some(expected_output)); let build_action = initialize_build_action( &cwd, @@ -952,7 +1027,7 @@ pub fn given_a_non_driver_project_when_default_values_are_provided_with_no_wdk_m let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, None); + .expect_default_build_task_steps(driver_name, None, 25100u32); assert_build_action_run_is_success( &cwd, @@ -979,7 +1054,7 @@ pub fn given_a_invalid_driver_project_with_partial_wdk_metadata_when_valid_defau let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_with_custom_toml(&cargo_toml_metadata) - .expect_default_build_task_steps(driver_name, None); + .expect_default_build_task_steps(driver_name, None, 25100u32); let build_action = initialize_build_action( &cwd, @@ -1027,7 +1102,7 @@ pub fn given_a_driver_project_when_target_arch_is_not_provided_and_probing_cargo let test_build_action = &TestBuildAction::new(cwd.clone(), profile, None, sample_class) .set_up_standalone_driver_project((workspace_member, package)) - .expect_default_build_task_steps(driver_name, Some(cargo_build_output)) + .expect_default_build_task_steps(driver_name, Some(cargo_build_output), 25100u32) .expect_probe_target_arch_using_cargo_rustc( &cwd, CpuArchitecture::Amd64, @@ -1245,7 +1320,7 @@ pub fn given_a_workspace_with_multiple_driver_and_non_driver_projects_when_cwd_i .expect_signtool_sign_cat_file(driver_name_1, &workspace_root_dir, None) .expect_signtool_verify_driver_binary_sys_file(driver_name_1, &workspace_root_dir, None) .expect_signtool_verify_cat_file(driver_name_1, &workspace_root_dir, None) - .expect_infverif(driver_name_1, &workspace_root_dir, "KMDF", None); + .expect_infverif(driver_name_1, &workspace_root_dir, "KMDF", None, None); assert_build_action_run_with_env_is_success( &cwd, @@ -1919,9 +1994,10 @@ impl TestBuildAction { self, driver_name: &str, cargo_build_output: Option, + wdk_build_number: u32, ) -> Self { let cwd = self.cwd.clone(); - self.expect_detect_wdk_build_number(25100u32) + self.expect_detect_wdk_build_number(wdk_build_number) .expect_root_manifest_exists(&cwd, true) .expect_cargo_build(driver_name, &cwd, cargo_build_output) } @@ -1932,6 +2008,17 @@ impl TestBuildAction { driver_type: &str, target_arch: CpuArchitecture, verify_signature: bool, + ) -> Self { + let cwd = self.cwd.clone(); + self.expect_package_task_steps_without_infverif(driver_name, target_arch, verify_signature) + .expect_infverif(driver_name, &cwd, driver_type, None, None) + } + + fn expect_package_task_steps_without_infverif( + self, + driver_name: &str, + target_arch: CpuArchitecture, + verify_signature: bool, ) -> Self { let cwd = self.cwd.clone(); let expected_certmgr_output = get_certmgr_success_output(); @@ -1950,8 +2037,7 @@ impl TestBuildAction { .expect_makecert(&cwd, None) .expect_copy_self_signed_cert_file_to_package_folder(driver_name, &cwd, true) .expect_signtool_sign_driver_binary_sys_file(driver_name, &cwd, None) - .expect_signtool_sign_cat_file(driver_name, &cwd, None) - .expect_infverif(driver_name, &cwd, driver_type, None); + .expect_signtool_sign_cat_file(driver_name, &cwd, None); if !verify_signature { return expectations; } @@ -1979,7 +2065,7 @@ impl TestBuildAction { .expect_copy_map_file_to_package_folder(driver_name, &cwd, true) .expect_stampinf(driver_name, &cwd, target_arch, None) .expect_inf2cat(driver_name, &cwd, target_arch, None) - .expect_infverif(driver_name, &cwd, driver_type, None) + .expect_infverif(driver_name, &cwd, driver_type, None, None) } fn expect_default_package_task_steps_for_workspace( @@ -2007,7 +2093,7 @@ impl TestBuildAction { .expect_copy_self_signed_cert_file_to_package_folder(driver_name, &cwd, true) .expect_signtool_sign_driver_binary_sys_file(driver_name, &cwd, None) .expect_signtool_sign_cat_file(driver_name, &cwd, None) - .expect_infverif(driver_name, &cwd, driver_type, None); + .expect_infverif(driver_name, &cwd, driver_type, None, None); if !verify_signature { return expectations; } @@ -2941,6 +3027,7 @@ impl TestBuildAction { driver_name: &str, driver_dir: &Path, driver_type: &str, + expected_sample_flag: Option<&str>, override_output: Option, ) -> Self { let mut expected_infverif_args = vec!["/v".to_string()]; @@ -2949,8 +3036,10 @@ impl TestBuildAction { } else { expected_infverif_args.push("/u".to_string()); } - if self.sample_class { - expected_infverif_args.push("/msft".to_string()); + if self.sample_class + && let Some(sample_flag) = expected_sample_flag + { + expected_infverif_args.push(sample_flag.to_string()); } let expected_infverif_command: &'static str = "infverif"; let expected_driver_name_underscored = driver_name.replace('-', "_");