Skip to content

Commit 237adfe

Browse files
committed
Fixed test
1 parent d10337c commit 237adfe

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

msixbundle/tests/integration.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -608,17 +608,18 @@ fn setup_test_certificate(dir: &Path) -> (std::path::PathBuf, std::path::PathBuf
608608
let pfx_path = dir.join("APPX_TEST_ROOT.pfx");
609609
let cer_path = dir.join("APPX_TEST_ROOT.cer");
610610

611+
let script = format!(
612+
r#"
613+
$cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=MSIX Test Root" -KeyUsage DigitalSignature -CertStoreLocation "Cert:\CurrentUser\My" -NotAfter (Get-Date).AddYears(1)
614+
Export-PfxCertificate -Cert $cert -FilePath "{}" -Password (ConvertTo-SecureString -String "test" -Force -AsPlainText)
615+
Export-Certificate -Cert $cert -FilePath "{}"
616+
"#,
617+
pfx_path.display(),
618+
cer_path.display()
619+
);
620+
611621
let status = std::process::Command::new("powershell")
612-
.args([
613-
"-Command",
614-
r#"
615-
$cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=MSIX Test Root" -KeyUsage DigitalSignature -CertStoreLocation "Cert:\CurrentUser\My" -NotAfter (Get-Date).AddYears(1)
616-
Export-PfxCertificate -Cert $cert -FilePath $args[0] -Password (ConvertTo-SecureString -String "test" -Force -AsPlainText)
617-
Export-Certificate -Cert $cert -FilePath $args[1]
618-
"#,
619-
])
620-
.arg(&pfx_path)
621-
.arg(&cer_path)
622+
.args(["-Command", &script])
622623
.status()
623624
.expect("Failed to run PowerShell");
624625

0 commit comments

Comments
 (0)