Skip to content

Commit

Permalink
Validate ProcessInfo is same (except entrypoint) before and after res…
Browse files Browse the repository at this point in the history
…ume. (#2603)
  • Loading branch information
jander-msft authored Sep 22, 2021
1 parent 38be915 commit 1fee6e8
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ private async Task BasicProcessInfoTestCore(bool useAsync, bool suspend)
DiagnosticsClientApiShim clientShim = new DiagnosticsClientApiShim(new DiagnosticsClient(runner.Pid), useAsync);

// While suspended, the runtime will not provide entrypoint information.
ProcessInfo processInfoBeforeResume = null;
if (suspend)
{
ProcessInfo processInfoBeforeResume = await clientShim.GetProcessInfo();
processInfoBeforeResume = await clientShim.GetProcessInfo();
ValidateProcessInfo(runner.Pid, processInfoBeforeResume);
Assert.True(string.IsNullOrEmpty(processInfoBeforeResume.ManagedEntrypointAssemblyName));

Expand All @@ -70,6 +71,17 @@ private async Task BasicProcessInfoTestCore(bool useAsync, bool suspend)
ProcessInfo processInfo = await GetProcessInfoWithEntrypointAsync(clientShim);
ValidateProcessInfo(runner.Pid, processInfo);
Assert.Equal("Tracee", processInfo.ManagedEntrypointAssemblyName);

// Validate values before resume (except for entrypoint) are the same after resume.
if (suspend)
{
Assert.Equal(processInfoBeforeResume.ProcessId, processInfo.ProcessId);
Assert.Equal(processInfoBeforeResume.RuntimeInstanceCookie, processInfo.RuntimeInstanceCookie);
Assert.Equal(processInfoBeforeResume.CommandLine, processInfo.CommandLine);
Assert.Equal(processInfoBeforeResume.OperatingSystem, processInfo.OperatingSystem);
Assert.Equal(processInfoBeforeResume.ProcessArchitecture, processInfo.ProcessArchitecture);
Assert.Equal(processInfoBeforeResume.ClrProductVersionString, processInfo.ClrProductVersionString);
}
}
finally
{
Expand Down

0 comments on commit 1fee6e8

Please sign in to comment.