46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
// -----------------------------------------------------------------------------
|
|
// AuditReplayE2ETests.cs
|
|
// Sprint: SPRINT_4300_0001_0002 (One-Command Audit Replay CLI)
|
|
// Task: REPLAY-028 - E2E test: export -> transfer -> replay offline
|
|
// Description: End-to-end integration tests for audit bundle export and replay.
|
|
// -----------------------------------------------------------------------------
|
|
using System;
|
|
using System.IO;
|
|
using System.Threading;
|
|
|
|
namespace StellaOps.AuditPack.Tests;
|
|
|
|
public sealed partial class AuditReplayE2ETests : IDisposable
|
|
{
|
|
private static int _tempCounter;
|
|
private static readonly DateTimeOffset FixedUtcNow = new(2026, 1, 2, 12, 0, 0, TimeSpan.Zero);
|
|
private const string FixedScanId = "scan-001";
|
|
private const string FixedImageRef = "registry.example.com/app:v1.2.3";
|
|
private const string FixedImageDigest = "sha256:abc123def456789";
|
|
private const string FixedDecision = "pass";
|
|
private const string FixedSbomSerial = "urn:uuid:11111111-1111-1111-1111-111111111111";
|
|
private const string FixedVexId = "https://stellaops.io/vex/00000000-0000-0000-0000-000000000000";
|
|
private readonly string _tempDir;
|
|
private readonly string _exportDir;
|
|
private readonly string _importDir;
|
|
|
|
public AuditReplayE2ETests()
|
|
{
|
|
var suffix = Interlocked.Increment(ref _tempCounter);
|
|
_tempDir = Path.Combine(Path.GetTempPath(), $"e2e-test-{suffix:0000}");
|
|
_exportDir = Path.Combine(_tempDir, "export");
|
|
_importDir = Path.Combine(_tempDir, "import");
|
|
|
|
Directory.CreateDirectory(_exportDir);
|
|
Directory.CreateDirectory(_importDir);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
if (Directory.Exists(_tempDir))
|
|
{
|
|
Directory.Delete(_tempDir, recursive: true);
|
|
}
|
|
}
|
|
}
|