public void TestCGroupContentWithInvalidData() { if (!File.Exists("/proc/self/cgroup")) { return; //only run in Docker - this check can be improved } var noopLogger = new NoopLogger(); var systemInfoHelper = new TestSystemInfoHelper(noopLogger, "asdf:invalid-dockerid:243543"); var systemInfo = systemInfoHelper.ParseSystemInfo(null); systemInfo.Container.Should().BeNull(); }
public void TestCGroupContent(string cGroupContent, string expectedContainerId) { if (!File.Exists("/proc/self/cgroup")) { return; //only run in Docker - this check can be improved } var noopLogger = new NoopLogger(); var systemInfoHelper = new TestSystemInfoHelper(noopLogger, cGroupContent); var systemInfo = systemInfoHelper.ParseSystemInfo(null); systemInfo.Should().NotBeNull(); systemInfo.Container.Should().NotBeNull(); systemInfo.Container.Id.Should().Be(expectedContainerId); }