Skip to content

Commit 8d775f5

Browse files
committed
Make version checks in tests more serviceable
1 parent 1a0fa36 commit 8d775f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Microsoft.DotNet.Docker.Tests/ImageScenarioVerifier.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public ImageScenarioVerifier(
3737
_imageData = imageData;
3838
_isWeb = isWeb;
3939
_outputHelper = outputHelper;
40-
_nonRootUserSupported = DockerHelper.IsLinuxContainerModeEnabled && _imageData.Version.Major >= 8;
40+
_nonRootUserSupported = DockerHelper.IsLinuxContainerModeEnabled && _imageData.Version.Major != 6 && _imageData.Version.Major != 7;
4141
}
4242

4343
public async Task Execute()
@@ -59,8 +59,8 @@ public async Task Execute()
5959
// Use `sdk` image to build and run test app
6060
string buildTag = BuildTestAppImage("build", solutionDir, customBuildArgs);
6161
tags.Add(buildTag);
62-
string dotnetRunArgs = _isWeb && _imageData.Version.Major < 8 ? $" --urls http://0.0.0.0:{_imageData.DefaultPort}" : string.Empty;
63-
await RunTestAppImage(buildTag, command: $"dotnet run{dotnetRunArgs}");
62+
string dotnetRunArgs = _isWeb && (_imageData.Version.Major == 6 || _imageData.Version.Major == 7) ? $" --urls http://0.0.0.0:{_imageData.DefaultPort}" : string.Empty;
63+
await RunTestAppImage(buildTag, command: $"dotnet run");
6464
}
6565

6666
// Running a scenario of unit testing within the sdk container is identical between a console app and web app,

0 commit comments

Comments
 (0)