sln build fix (again), tests fixes, audit work and doctors work

This commit is contained in:
master
2026-01-12 22:15:51 +02:00
parent 9873f80830
commit 9330c64349
812 changed files with 48051 additions and 3891 deletions

View File

@@ -1,7 +1,7 @@
# AuditPack Tests (Libraries) Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Auth Security Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Canonicalization Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps Configuration Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Cryptography KMS Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Offline Verification Plugin Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Cryptography Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Delta Verdict Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -0,0 +1,157 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Doctor.Models;
using StellaOps.Doctor.Plugins;
using StellaOps.Doctor.Plugins.AI;
using Xunit;
namespace StellaOps.Doctor.Plugins.AI.Tests;
[Trait("Category", "Unit")]
public class AIPluginTests
{
[Fact]
public void PluginId_ReturnsExpectedValue()
{
var plugin = new AIPlugin();
Assert.Equal("stellaops.doctor.ai", plugin.PluginId);
}
[Fact]
public void DisplayName_ReturnsExpectedValue()
{
var plugin = new AIPlugin();
Assert.Equal("AI / LLM", plugin.DisplayName);
}
[Fact]
public void Category_ReturnsAI()
{
var plugin = new AIPlugin();
Assert.Equal(DoctorCategory.AI, plugin.Category);
}
[Fact]
public void Version_ReturnsValidVersion()
{
var plugin = new AIPlugin();
Assert.NotNull(plugin.Version);
Assert.True(plugin.Version >= new Version(1, 0, 0));
}
[Fact]
public void MinEngineVersion_ReturnsValidVersion()
{
var plugin = new AIPlugin();
Assert.NotNull(plugin.MinEngineVersion);
Assert.True(plugin.MinEngineVersion >= new Version(1, 0, 0));
}
[Fact]
public void IsAvailable_ReturnsTrue()
{
var plugin = new AIPlugin();
var services = new ServiceCollection().BuildServiceProvider();
Assert.True(plugin.IsAvailable(services));
}
[Fact]
public void GetChecks_ReturnsFiveChecks()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Equal(5, checks.Count);
}
[Fact]
public void GetChecks_ContainsLlmProviderConfigurationCheck()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.ai.llm.config");
}
[Fact]
public void GetChecks_ContainsClaudeProviderCheck()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.ai.provider.claude");
}
[Fact]
public void GetChecks_ContainsOpenAiProviderCheck()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.ai.provider.openai");
}
[Fact]
public void GetChecks_ContainsOllamaProviderCheck()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.ai.provider.ollama");
}
[Fact]
public void GetChecks_ContainsLocalInferenceCheck()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.ai.provider.local");
}
[Fact]
public async Task InitializeAsync_CompletesSuccessfully()
{
var plugin = new AIPlugin();
var context = CreateTestContext();
await plugin.InitializeAsync(context, CancellationToken.None);
// Should complete without throwing
}
private static DoctorPluginContext CreateTestContext(IConfiguration? configuration = null)
{
var services = new ServiceCollection().BuildServiceProvider();
configuration ??= new ConfigurationBuilder().Build();
return new DoctorPluginContext
{
Services = services,
Configuration = configuration,
TimeProvider = TimeProvider.System,
Logger = NullLogger.Instance,
EnvironmentName = "Test",
PluginConfig = configuration.GetSection("Doctor:Plugins:AI")
};
}
}

View File

@@ -0,0 +1,126 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Doctor.Models;
using StellaOps.Doctor.Plugins;
using StellaOps.Doctor.Plugins.AI.Checks;
using Xunit;
namespace StellaOps.Doctor.Plugins.AI.Tests.Checks;
[Trait("Category", "Unit")]
public class LlmProviderConfigurationCheckTests
{
[Fact]
public void CheckId_ReturnsExpectedValue()
{
var check = new LlmProviderConfigurationCheck();
Assert.Equal("check.ai.llm.config", check.CheckId);
}
[Fact]
public void Name_ReturnsExpectedValue()
{
var check = new LlmProviderConfigurationCheck();
Assert.Equal("LLM Configuration", check.Name);
}
[Fact]
public void DefaultSeverity_IsInfo()
{
var check = new LlmProviderConfigurationCheck();
Assert.Equal(DoctorSeverity.Info, check.DefaultSeverity);
}
[Fact]
public void Tags_ContainsAi()
{
var check = new LlmProviderConfigurationCheck();
Assert.Contains("ai", check.Tags);
}
[Fact]
public void Tags_ContainsLlm()
{
var check = new LlmProviderConfigurationCheck();
Assert.Contains("llm", check.Tags);
}
[Fact]
public void CanRun_ReturnsTrue()
{
var check = new LlmProviderConfigurationCheck();
var context = CreateTestContext();
Assert.True(check.CanRun(context));
}
[Fact]
public async Task RunAsync_WhenAiDisabled_ReturnsInfoResult()
{
var check = new LlmProviderConfigurationCheck();
var config = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["AdvisoryAI:Enabled"] = "false"
})
.Build();
var context = CreateTestContext(config);
var result = await check.RunAsync(context, CancellationToken.None);
Assert.NotNull(result);
Assert.Equal(DoctorSeverity.Info, result.Severity);
}
[Fact]
public async Task RunAsync_WhenNoProvidersConfigured_ReturnsInfoResult()
{
var check = new LlmProviderConfigurationCheck();
var context = CreateTestContext();
var result = await check.RunAsync(context, CancellationToken.None);
Assert.NotNull(result);
Assert.Equal(DoctorSeverity.Info, result.Severity);
}
[Fact]
public async Task RunAsync_WhenClaudeConfigured_ReturnsPassResult()
{
var check = new LlmProviderConfigurationCheck();
var config = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["AdvisoryAI:LlmProviders:Claude:ApiKey"] = "test-api-key"
})
.Build();
var context = CreateTestContext(config);
var result = await check.RunAsync(context, CancellationToken.None);
Assert.NotNull(result);
Assert.Equal(DoctorSeverity.Pass, result.Severity);
}
private static DoctorPluginContext CreateTestContext(IConfiguration? configuration = null)
{
var services = new ServiceCollection().BuildServiceProvider();
configuration ??= new ConfigurationBuilder().Build();
return new DoctorPluginContext
{
Services = services,
Configuration = configuration,
TimeProvider = TimeProvider.System,
Logger = NullLogger.Instance,
EnvironmentName = "Test",
PluginConfig = configuration.GetSection("Doctor:Plugins:AI")
};
}
}

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.AI\StellaOps.Doctor.Plugins.AI.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Core\StellaOps.Doctor.Plugins.Core.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,84 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Doctor.Models;
using StellaOps.Doctor.Plugins;
using StellaOps.Doctor.Plugins.Cryptography.Checks;
using Xunit;
namespace StellaOps.Doctor.Plugins.Cryptography.Tests.Checks;
[Trait("Category", "Unit")]
public class CryptoProviderAvailabilityCheckTests
{
[Fact]
public void CheckId_ReturnsExpectedValue()
{
var check = new CryptoProviderAvailabilityCheck();
Assert.Equal("check.crypto.provider", check.CheckId);
}
[Fact]
public void Name_ReturnsExpectedValue()
{
var check = new CryptoProviderAvailabilityCheck();
Assert.Equal("Crypto Provider Availability", check.Name);
}
[Fact]
public void DefaultSeverity_IsWarn()
{
var check = new CryptoProviderAvailabilityCheck();
Assert.Equal(DoctorSeverity.Warn, check.DefaultSeverity);
}
[Fact]
public void Tags_ContainsCryptography()
{
var check = new CryptoProviderAvailabilityCheck();
Assert.Contains("cryptography", check.Tags);
}
[Fact]
public void CanRun_ReturnsTrue()
{
var check = new CryptoProviderAvailabilityCheck();
var context = CreateTestContext();
Assert.True(check.CanRun(context));
}
[Fact]
public async Task RunAsync_ReturnsPassResult_WhenProvidersAvailable()
{
var check = new CryptoProviderAvailabilityCheck();
var context = CreateTestContext();
var result = await check.RunAsync(context, CancellationToken.None);
Assert.NotNull(result);
Assert.Equal("check.crypto.provider", result.CheckId);
// Should pass because ECDSA, RSA, AES are typically available
Assert.Equal(DoctorSeverity.Pass, result.Severity);
}
private static DoctorPluginContext CreateTestContext(IConfiguration? configuration = null)
{
var services = new ServiceCollection().BuildServiceProvider();
configuration ??= new ConfigurationBuilder().Build();
return new DoctorPluginContext
{
Services = services,
Configuration = configuration,
TimeProvider = TimeProvider.System,
Logger = NullLogger.Instance,
EnvironmentName = "Test",
PluginConfig = configuration.GetSection("Doctor:Plugins:Cryptography")
};
}
}

View File

@@ -0,0 +1,190 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Doctor.Models;
using StellaOps.Doctor.Plugins;
using StellaOps.Doctor.Plugins.Cryptography;
using Xunit;
namespace StellaOps.Doctor.Plugins.Cryptography.Tests;
[Trait("Category", "Unit")]
public class CryptographyPluginTests
{
[Fact]
public void PluginId_ReturnsExpectedValue()
{
var plugin = new CryptographyPlugin();
Assert.Equal("stellaops.doctor.cryptography", plugin.PluginId);
}
[Fact]
public void DisplayName_ReturnsExpectedValue()
{
var plugin = new CryptographyPlugin();
Assert.Equal("Cryptography", plugin.DisplayName);
}
[Fact]
public void Category_ReturnsCryptography()
{
var plugin = new CryptographyPlugin();
Assert.Equal(DoctorCategory.Cryptography, plugin.Category);
}
[Fact]
public void Version_ReturnsValidVersion()
{
var plugin = new CryptographyPlugin();
Assert.NotNull(plugin.Version);
Assert.True(plugin.Version >= new Version(1, 0, 0));
}
[Fact]
public void MinEngineVersion_ReturnsValidVersion()
{
var plugin = new CryptographyPlugin();
Assert.NotNull(plugin.MinEngineVersion);
Assert.True(plugin.MinEngineVersion >= new Version(1, 0, 0));
}
[Fact]
public void IsAvailable_ReturnsTrue()
{
var plugin = new CryptographyPlugin();
var services = new ServiceCollection().BuildServiceProvider();
Assert.True(plugin.IsAvailable(services));
}
[Fact]
public void GetChecks_ReturnsEightChecks()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Equal(8, checks.Count);
}
[Fact]
public void GetChecks_ContainsCryptoProviderAvailabilityCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.provider");
}
[Fact]
public void GetChecks_ContainsFipsComplianceCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.fips");
}
[Fact]
public void GetChecks_ContainsGostProviderCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.gost");
}
[Fact]
public void GetChecks_ContainsSmProviderCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.sm");
}
[Fact]
public void GetChecks_ContainsEidasProviderCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.eidas");
}
[Fact]
public void GetChecks_ContainsHsmConnectivityCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.hsm");
}
[Fact]
public void GetChecks_ContainsCryptoLicenseCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.license");
}
[Fact]
public void GetChecks_ContainsCryptoProCheck()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.crypto.cryptopro");
}
[Fact]
public async Task InitializeAsync_CompletesSuccessfully()
{
var plugin = new CryptographyPlugin();
var context = CreateTestContext();
await plugin.InitializeAsync(context, CancellationToken.None);
// Should complete without throwing
}
private static DoctorPluginContext CreateTestContext(IConfiguration? configuration = null)
{
var services = new ServiceCollection().BuildServiceProvider();
configuration ??= new ConfigurationBuilder().Build();
return new DoctorPluginContext
{
Services = services,
Configuration = configuration,
TimeProvider = TimeProvider.System,
Logger = NullLogger.Instance,
EnvironmentName = "Test",
PluginConfig = configuration.GetSection("Doctor:Plugins:Cryptography")
};
}
}

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Cryptography\StellaOps.Doctor.Plugins.Cryptography.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Database\StellaOps.Doctor.Plugins.Database.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,123 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Doctor.Models;
using StellaOps.Doctor.Plugins;
using StellaOps.Doctor.Plugins.Docker.Checks;
using Xunit;
namespace StellaOps.Doctor.Plugins.Docker.Tests.Checks;
[Trait("Category", "Unit")]
public class DockerSocketCheckTests
{
[Fact]
public void CheckId_ReturnsExpectedValue()
{
var check = new DockerSocketCheck();
Assert.Equal("check.docker.socket", check.CheckId);
}
[Fact]
public void Name_ReturnsExpectedValue()
{
var check = new DockerSocketCheck();
Assert.Equal("Docker Socket", check.Name);
}
[Fact]
public void Description_IsNotEmpty()
{
var check = new DockerSocketCheck();
Assert.False(string.IsNullOrWhiteSpace(check.Description));
}
[Fact]
public void DefaultSeverity_IsFail()
{
var check = new DockerSocketCheck();
Assert.Equal(DoctorSeverity.Fail, check.DefaultSeverity);
}
[Fact]
public void Tags_ContainsDocker()
{
var check = new DockerSocketCheck();
Assert.Contains("docker", check.Tags);
}
[Fact]
public void Tags_ContainsSocket()
{
var check = new DockerSocketCheck();
Assert.Contains("socket", check.Tags);
}
[Fact]
public void EstimatedDuration_IsPositive()
{
var check = new DockerSocketCheck();
Assert.True(check.EstimatedDuration > TimeSpan.Zero);
}
[Fact]
public void CanRun_ReturnsTrue()
{
var check = new DockerSocketCheck();
var context = CreateTestContext();
Assert.True(check.CanRun(context));
}
[Fact]
public async Task RunAsync_ReturnsResult()
{
var check = new DockerSocketCheck();
var context = CreateTestContext();
var result = await check.RunAsync(context, CancellationToken.None);
Assert.NotNull(result);
Assert.Equal("check.docker.socket", result.CheckId);
}
[Fact]
public async Task RunAsync_WithCustomHost_UsesConfiguredHost()
{
var check = new DockerSocketCheck();
var config = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["Docker:Host"] = "unix:///custom/docker.sock"
})
.Build();
var context = CreateTestContext(config);
var result = await check.RunAsync(context, CancellationToken.None);
Assert.NotNull(result);
}
private static DoctorPluginContext CreateTestContext(IConfiguration? configuration = null)
{
var services = new ServiceCollection().BuildServiceProvider();
configuration ??= new ConfigurationBuilder().Build();
return new DoctorPluginContext
{
Services = services,
Configuration = configuration,
TimeProvider = TimeProvider.System,
Logger = NullLogger.Instance,
EnvironmentName = "Test",
PluginConfig = configuration.GetSection("Doctor:Plugins:Docker")
};
}
}

View File

@@ -0,0 +1,157 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
using StellaOps.Doctor.Models;
using StellaOps.Doctor.Plugins;
using StellaOps.Doctor.Plugins.Docker;
using Xunit;
namespace StellaOps.Doctor.Plugins.Docker.Tests;
[Trait("Category", "Unit")]
public class DockerPluginTests
{
[Fact]
public void PluginId_ReturnsExpectedValue()
{
var plugin = new DockerPlugin();
Assert.Equal("stellaops.doctor.docker", plugin.PluginId);
}
[Fact]
public void DisplayName_ReturnsExpectedValue()
{
var plugin = new DockerPlugin();
Assert.Equal("Docker Runtime", plugin.DisplayName);
}
[Fact]
public void Category_ReturnsInfrastructure()
{
var plugin = new DockerPlugin();
Assert.Equal(DoctorCategory.Infrastructure, plugin.Category);
}
[Fact]
public void Version_ReturnsValidVersion()
{
var plugin = new DockerPlugin();
Assert.NotNull(plugin.Version);
Assert.True(plugin.Version >= new Version(1, 0, 0));
}
[Fact]
public void MinEngineVersion_ReturnsValidVersion()
{
var plugin = new DockerPlugin();
Assert.NotNull(plugin.MinEngineVersion);
Assert.True(plugin.MinEngineVersion >= new Version(1, 0, 0));
}
[Fact]
public void IsAvailable_ReturnsTrue()
{
var plugin = new DockerPlugin();
var services = new ServiceCollection().BuildServiceProvider();
Assert.True(plugin.IsAvailable(services));
}
[Fact]
public void GetChecks_ReturnsFiveChecks()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Equal(5, checks.Count);
}
[Fact]
public void GetChecks_ContainsDockerDaemonCheck()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.docker.daemon");
}
[Fact]
public void GetChecks_ContainsDockerSocketCheck()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.docker.socket");
}
[Fact]
public void GetChecks_ContainsDockerApiVersionCheck()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.docker.apiversion");
}
[Fact]
public void GetChecks_ContainsDockerNetworkCheck()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.docker.network");
}
[Fact]
public void GetChecks_ContainsDockerStorageCheck()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
var checks = plugin.GetChecks(context);
Assert.Contains(checks, c => c.CheckId == "check.docker.storage");
}
[Fact]
public async Task InitializeAsync_CompletesSuccessfully()
{
var plugin = new DockerPlugin();
var context = CreateTestContext();
await plugin.InitializeAsync(context, CancellationToken.None);
// Should complete without throwing
}
private static DoctorPluginContext CreateTestContext(IConfiguration? configuration = null)
{
var services = new ServiceCollection().BuildServiceProvider();
configuration ??= new ConfigurationBuilder().Build();
return new DoctorPluginContext
{
Services = services,
Configuration = configuration,
TimeProvider = TimeProvider.System,
Logger = NullLogger.Instance,
EnvironmentName = "Test",
PluginConfig = configuration.GetSection("Doctor:Plugins:Docker")
};
}
}

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Docker\StellaOps.Doctor.Plugins.Docker.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Integration\StellaOps.Doctor.Plugins.Integration.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Observability\StellaOps.Doctor.Plugins.Observability.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.Security\StellaOps.Doctor.Plugins.Security.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Moq" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\StellaOps.Doctor\StellaOps.Doctor.csproj" />
<ProjectReference Include="..\..\StellaOps.Doctor.Plugins.ServiceGraph\StellaOps.Doctor.Plugins.ServiceGraph.csproj" />
<ProjectReference Include="..\..\StellaOps.TestKit\StellaOps.TestKit.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,7 +1,7 @@
# Eventing Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Evidence Persistence Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# Evidence Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -15,7 +15,7 @@ Validate HLC timestamping, serialization, and monotonic behavior across scenario
## Required Reading
- `docs/modules/platform/architecture-overview.md`
- `docs/implplan/permament/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`
- `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`
## Working Agreement
- 1. Avoid hardware-dependent perf assertions in CI by gating as needed.

View File

@@ -1,7 +1,7 @@
# Hybrid Logical Clock Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/permament/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Infrastructure.Postgres.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Metrics.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Microservice.AspNetCore.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Plugin.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Provcache.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Provenance.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.ReachGraph.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Replay.Core.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Replay.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Signals.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Spdx3.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.TestKit.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Testing.Determinism.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.Testing.Manifests.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |

View File

@@ -1,7 +1,7 @@
# StellaOps.VersionComparison.Tests Task Board
This board mirrors active sprint tasks for this module.
Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229_049_BE_csproj_audit_maint_tests.md`.
| Task ID | Status | Notes |
| --- | --- | --- |