Skip to content

Commit

Permalink
Clean up version checks in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell committed Feb 13, 2023
1 parent 8d775f5 commit c5aae01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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");
}

Expand Down Expand Up @@ -338,7 +338,7 @@ private async Task RunTestAppImage(string image, string user = null, string comm

public static async Task<HttpResponseMessage> GetHttpResponseFromContainerAsync(string containerName, DockerHelper dockerHelper, ITestOutputHelper outputHelper, int containerPort, string pathAndQuery = null, Action<HttpResponseMessage> 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
Expand Down

0 comments on commit c5aae01

Please sign in to comment.