public void VerifyImagesWithWebApps(ImageDescriptor imageDescriptor) { VerifyImages(imageDescriptor, "webapp", "powershell -command \"dir ./bin/SimpleWebApplication.dll\"", false); }
public void VerifyShell(ImageDescriptor imageDescriptor) { VerifyCommonShell(imageDescriptor, ShellValue_PowerShell); }
public void VerifyImagesWithApps(ImageDescriptor imageDescriptor) { VerifyImages(imageDescriptor, "dotnetapp", "", true); }
public void VerifyEnvironmentVariables(ImageDescriptor imageDescriptor) { VerifyCommonEnvironmentVariables(AspnetImageTests.GetEnvironmentVariables(imageDescriptor), imageDescriptor); }
public void VerifyNgenQueuesAreEmpty(ImageDescriptor imageDescriptor) { VerifyCommmonNgenQueuesAreEmpty(imageDescriptor); }
protected void VerifyCommonEnvironmentVariables(IEnumerable <EnvironmentVariableInfo> variables, ImageDescriptor imageDescriptor) { const char delimiter = '|'; IEnumerable <string> echoParts; string invokeCommand; char delimiterEscape; if (DockerHelper.IsLinuxContainerModeEnabled) { echoParts = variables.Select(envVar => $"${envVar.Name}"); invokeCommand = $"/bin/sh -c"; delimiterEscape = '\\'; } else { echoParts = variables.Select(envVar => $"%{envVar.Name}%"); invokeCommand = $"CMD /S /C"; delimiterEscape = '^'; } string appId = $"envvar-{DateTime.Now.ToFileTime()}"; string combinedValues = ImageTestHelper.DockerHelper.Run( image: ImageTestHelper.GetImage(ImageType, imageDescriptor.Version, imageDescriptor.OsVariant), name: appId, command: $"{invokeCommand} \"echo {String.Join($"{delimiterEscape}{delimiter}", echoParts)}\""); string[] values = combinedValues.Split(delimiter); Assert.Equal(variables.Count(), values.Count()); for (int i = 0; i < values.Count(); i++) { EnvironmentVariableInfo variable = variables.ElementAt(i); string actualValue; // Process unset variables in Windows if (!DockerHelper.IsLinuxContainerModeEnabled && string.Equals(values[i], $"%{variable.Name}%", StringComparison.Ordinal)) { actualValue = string.Empty; } else { actualValue = values[i]; } if (variable.AllowAnyValue) { Assert.NotEmpty(actualValue); } else { Assert.Equal(variable.ExpectedValue, actualValue); } } }
public void VerifyShell(ImageDescriptor imageDescriptor) { VerifyCommonShell(imageDescriptor, ShellValue_Default); }
protected void VerifyCommmonNgenQueuesAreEmpty(ImageDescriptor imageDescriptor) { VerifyNgenQueueIsUpToDate(imageDescriptor, ImageType, @"\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen display"); VerifyNgenQueueIsUpToDate(imageDescriptor, ImageType, @"\Windows\Microsoft.NET\Framework\v4.0.30319\ngen display"); }
public void VerifyWcfImagesWithApps(ImageDescriptor imageDescriptor) { VerifyWcfImages(imageDescriptor); }
public void VerifyAspnetImagesWithApps(ImageDescriptor imageDescriptor) { VerifyAspnetImages(imageDescriptor); }
public static IEnumerable <EnvironmentVariableInfo> GetRuntimeEnvironmentVariableInfos(ImageDescriptor imageDescriptor) { yield return(new EnvironmentVariableInfo("COMPLUS_NGenProtectedProcess_FeatureEnabled", "0")); if ((imageDescriptor.Version == "3.5" || imageDescriptor.Version == "4.8") && imageDescriptor.OsVariant != OsVersion.WSC_LTSC2016 && imageDescriptor.OsVariant != OsVersion.WSC_LTSC2019 && imageDescriptor.OsVariant != OsVersion.WSC_1903) { yield return(new EnvironmentVariableInfo("DOTNET_RUNNING_IN_CONTAINER", "true")); } }
public void VerifyEnvironmentVariables(ImageDescriptor imageDescriptor) { VerifyCommonEnvironmentVariables(GetRuntimeEnvironmentVariableInfos(imageDescriptor), imageDescriptor); }