我成功地拥有了一个使用 gMSA 和 Windows 身份验证以及 IIS .Net Framework Web 应用程序的 Windows 2019 容器。我可以从外部访问 Web 应用程序并完美地使用我的 Windows 域凭据进行身份验证。
我们使用 FitNesse 框架创建的测试需要将近 2 小时才能完成。开发人员将测试分为 2 组,并在一半时间内执行测试。决定尝试在多个容器中运行这些测试,以尝试以较小的块运行测试并并行执行,以降低运行时间。
现在出现了我的问题:FitNesse 需要在 Windows 域凭据下启动该进程,以便它可以通过 Web 应用程序的身份验证。通常这不会有问题,但我需要在Windows 容器中执行它。
尝试 1:使用常规域帐户
PS C:\> Start-Process -FilePath 'C:\MStest\vstest.console.exe' `
>> -ArgumentList @('C:\1\SmokeSuite.GenericTest') `
>> -Credential $credential -WorkingDirectory 'C:\' -NoNewWindow -Wait
Start-Process : This command cannot be run due to the error: The security database on the
server does not have a computer account for this workstation trust relationship.
尝试 2:不使用凭据
PS C:\> Start-Process -FilePath 'C:\MStest\vstest.console.exe' `
>> -ArgumentList @('C:\1\SmokeSuite.GenericTest','/InIsolation','/Logger:"trx"','/TestAdapterPath:"C:\1"') `
>> -WorkingDirectory 'C:\' -NoNewWindow -Wait
Microsoft (R) Test Execution Command Line Tool Version 15.7.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Failed SmokeSuite
Error Message:
Test Pages: 74 right, 0 wrong, 331 ignores, 76 exceptions. Assertions: 0 right, 0 wrong, 0 ignores, 713 exceptions. Run time: 21.834 s.
Standard Output Messages:
2021-09-09T22:14:06.0788973+00:00 [FitNesseRun.exe]: Executing java.exe -DCURRENT_DIRECTORY="C:\TestResults\ContainerAdministrator_78E253BCD
F1E 2021-09-09 22_13_59\Out" -jar fitnesse.jar -p 9123 -d "C:\TestResults\ContainerAdministrator_78E253BCDF1E 2021-09-09 22_13_59\Out\Fit" -o
-c "SmokeTests?suite&format=xml&nochunk&includehtml&ptmurl=http%3A%2F%2Flocalhost%2F&browser=chrome"
2021-09-09T22:14:30.5911781+00:00 [FitNesseRun.exe]: Found output, so ignoring exit code 76, error message: root page: fitnesse.wiki.fs.File
SystemPage at C:\TestResults\ContainerAdministrator_78E253BCDF1E 2021-09-09 22_13_59\Out\Fit\FitNesseRoot#latest
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
page factory: fitnesse.html.template.PageFactory
page theme: bootstrap
Executing command: SmokeTests?suite&format=xml&nochunk&includehtml&ptmurl=http%3A%2F%2Flocalhost%2F&browser=chrome
在容器中,我确实安装了 Java、Chrome 和 VSTest 控制台。我知道我即将解决这个问题,但这是一个新的挑战。