From 5a73d60641e18afcc288b71bad8eb0b071fb5d35 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Thu, 16 Sep 2021 15:58:40 +0300 Subject: [PATCH] [Windows] win2022: enable use of test-signed code (#4098) --- images/win/scripts/Tests/WindowsFeatures.Tests.ps1 | 6 ++++++ images/win/windows2022.json | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 b/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 index d4a811d7..9f0684ba 100644 --- a/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 +++ b/images/win/scripts/Tests/WindowsFeatures.Tests.ps1 @@ -50,3 +50,9 @@ Describe "GDIProcessHandleQuota" { (Get-ItemProperty $regPath32).GDIProcessHandleQuota | Should -BeExactly 20000 } } + +Describe "Test Signed Drivers" -Skip:(-not (Test-IsWin22)) { + It "bcdedit testsigning should be Yes"{ + "$(bcdedit)" | Should -Match "testsigning\s+Yes" + } +} diff --git a/images/win/windows2022.json b/images/win/windows2022.json index 64b8680f..2c92c392 100644 --- a/images/win/windows2022.json +++ b/images/win/windows2022.json @@ -110,6 +110,14 @@ "if (-not ((net localgroup Administrators) -contains '{{user `install_user`}}')) { exit 1 }" ] }, + { + "type": "powershell", + "inline": [ + "bcdedit.exe /set TESTSIGNING ON" + ], + "elevated_user": "{{user `install_user`}}", + "elevated_password": "{{user `install_password`}}" + }, { "type": "powershell", "environment_vars": [ @@ -143,7 +151,7 @@ }, { "type": "windows-restart", - "restart_timeout": "10m" + "restart_timeout": "30m" }, { "type": "powershell",