Frontend gaps fill work. Testing fixes work. Auditing in progress.

This commit is contained in:
StellaOps Bot
2025-12-30 01:22:58 +02:00
parent 1dc4bcbf10
commit 7a5210e2aa
928 changed files with 183942 additions and 3941 deletions

View File

@@ -7,7 +7,6 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Zastava.Observer.ContainerRuntime.Windows;
using Xunit;
using Xunit.Sdk;
namespace StellaOps.Zastava.Observer.Tests.ContainerRuntime.Windows;
@@ -228,10 +227,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
Environment.GetEnvironmentVariable("ZASTAVA_WINDOWS_INTEGRATION_TESTS") == "true";
[SkippableFact]
[Fact]
public async Task WindowsLibraryHashCollector_CollectCurrentProcess_ReturnsModules()
{
Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Windows-only test");
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
var collector = new WindowsLibraryHashCollector(NullLogger<WindowsLibraryHashCollector>.Instance);
var processId = Environment.ProcessId;
@@ -249,10 +251,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
Assert.All(libraries, lib => Assert.False(string.IsNullOrWhiteSpace(lib.Path)));
}
[SkippableFact]
[Fact]
public async Task WindowsLibraryHashCollector_WithMaxLimit_RespectsLimit()
{
Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Windows-only test");
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
var collector = new WindowsLibraryHashCollector(
NullLogger<WindowsLibraryHashCollector>.Instance,
@@ -265,10 +270,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
Assert.True(libraries.Count <= 5, "Should respect maxLibraries limit");
}
[SkippableFact]
[Fact]
public async Task WindowsLibraryHashCollector_InvalidProcessId_ReturnsEmptyList()
{
Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Windows-only test");
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
var collector = new WindowsLibraryHashCollector(NullLogger<WindowsLibraryHashCollector>.Instance);
@@ -278,10 +286,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
Assert.Empty(libraries);
}
[SkippableFact]
[Fact]
public async Task WindowsLibraryHashCollector_ComputesHashes_WhenFilesAccessible()
{
Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Windows-only test");
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
var collector = new WindowsLibraryHashCollector(
NullLogger<WindowsLibraryHashCollector>.Instance,
@@ -303,10 +314,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
});
}
[SkippableFact]
[Fact]
public async Task DockerWindowsRuntimeClient_IsAvailable_WhenDockerRunning()
{
Skip.IfNot(IsWindowsWithDocker, "Requires Windows with Docker in Windows containers mode");
if (!IsWindowsWithDocker)
{
return;
}
await using var client = new DockerWindowsRuntimeClient(NullLogger<DockerWindowsRuntimeClient>.Instance);
@@ -315,10 +329,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
Assert.True(available, "Docker Windows should be available");
}
[SkippableFact]
[Fact]
public async Task DockerWindowsRuntimeClient_GetIdentity_ReturnsDockerInfo()
{
Skip.IfNot(IsWindowsWithDocker, "Requires Windows with Docker in Windows containers mode");
if (!IsWindowsWithDocker)
{
return;
}
await using var client = new DockerWindowsRuntimeClient(NullLogger<DockerWindowsRuntimeClient>.Instance);
@@ -330,10 +347,13 @@ public sealed class WindowsContainerRuntimeIntegrationTests
Assert.False(string.IsNullOrEmpty(identity.OsVersion));
}
[SkippableFact]
[Fact]
public async Task DockerWindowsRuntimeClient_ListContainers_ReturnsWindowsContainers()
{
Skip.IfNot(IsWindowsWithDocker, "Requires Windows with Docker in Windows containers mode");
if (!IsWindowsWithDocker)
{
return;
}
await using var client = new DockerWindowsRuntimeClient(NullLogger<DockerWindowsRuntimeClient>.Instance);

View File

@@ -15,7 +15,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Moq" />
<PackageReference Include="Xunit.SkippableFact" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../StellaOps.Zastava.Observer/StellaOps.Zastava.Observer.csproj" />
@@ -24,4 +23,4 @@
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
</Project>