public async Task GetsLogs() { var containerName = "lcldkr-logs-test"; var client = new DockerClient(); try { client.RunOrReplace( "hello-world", tag: null, args: new RunArguments { Name = containerName }); await client.WaitForLogEntryAsync(containerName, "Hello from Docker!", TimeSpan.FromSeconds(30)); var logString = client.Logs(containerName); Assert.Contains("Hello from Docker!", logString); } finally { client.StopAndRemoveContainer(containerName); } }
public async Task Waits_for_log_entry() { var client = new DockerClient(); var containerName = "lcldkr-log-test"; client.RunOrReplace("hello-world", containerName); await client.WaitForLogEntryAsync(containerName, "Hello from Docker!", TimeSpan.FromSeconds(30)); client.StopAndRemoveContainer(containerName); }