From c5aae01f35e3648160ad08156e21db7b3ad4d017 Mon Sep 17 00:00:00 2001 From: Logan Bussell Date: Mon, 13 Feb 2023 08:17:17 -0800 Subject: [PATCH] Clean up version checks in tests --- .../Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs b/tests/Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs index 55ebe92b0a..9c2c9a1479 100644 --- a/tests/Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs +++ b/tests/Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs @@ -37,7 +37,7 @@ public ImageScenarioVerifier( _imageData = imageData; _isWeb = isWeb; _outputHelper = outputHelper; - _nonRootUserSupported = DockerHelper.IsLinuxContainerModeEnabled && _imageData.Version.Major != 6 && _imageData.Version.Major != 7; + _nonRootUserSupported = DockerHelper.IsLinuxContainerModeEnabled && _imageData.Version.Major >= 7; } public async Task Execute() @@ -59,7 +59,7 @@ public async Task Execute() // Use `sdk` image to build and run test app string buildTag = BuildTestAppImage("build", solutionDir, customBuildArgs); tags.Add(buildTag); - string dotnetRunArgs = _isWeb && (_imageData.Version.Major == 6 || _imageData.Version.Major == 7) ? $" --urls http://0.0.0.0:{_imageData.DefaultPort}" : string.Empty; + string dotnetRunArgs = _isWeb && _imageData.Version.Major <= 7 ? $" --urls http://0.0.0.0:{_imageData.DefaultPort}" : string.Empty; await RunTestAppImage(buildTag, command: $"dotnet run"); } @@ -338,7 +338,7 @@ private async Task RunTestAppImage(string image, string user = null, string comm public static async Task GetHttpResponseFromContainerAsync(string containerName, DockerHelper dockerHelper, ITestOutputHelper outputHelper, int containerPort, string pathAndQuery = null, Action validateCallback = null, AuthenticationHeaderValue authorizationHeader = null) { - int retries = 30; + int retries = 32; // Can't use localhost when running inside containers or Windows. string url = !Config.IsRunningInContainer && DockerHelper.IsLinuxContainerModeEnabled