Replace Probe with Agent across node runtime, Fleet contracts, backend state, API and storage. Report incoming sessions and outgoing link health through each Agent uplink, and retain directed link controls and retry. Update protocol fixtures and end-to-end coverage for the unified model; accept requested cancellation during the Fleet timeout test cleanup.
28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
using Fleet.Core;
|
|
using MoShiro.Backend.Application;
|
|
using MoShiro.Protocol;
|
|
|
|
namespace MoShiro.Backend.Tests;
|
|
|
|
public sealed class NodeRuntimeLogTests
|
|
{
|
|
[Fact]
|
|
public void DiagnosticFieldsSurviveUpload_WhileSecretsAndOversizedFieldsRemainBounded()
|
|
{
|
|
var service = new NodeRuntimeLogService(TimeProvider.System);
|
|
var node = new NodeId("agt_diagnostics");
|
|
Dictionary<string, string> fields = Enumerable.Range(0, 18).ToDictionary(i => "field_" + i, _ => "value");
|
|
fields.Add("api_token", "must-not-survive");
|
|
fields.Add("detail", new string('x', 500));
|
|
fields.Add("overflow", "discard");
|
|
service.Append(node, [new NodeLogRecord(TimeProvider.System.GetUtcNow().ToUnixTimeMilliseconds(), "warn", "handshake failed", fields)], 0);
|
|
|
|
NodeRuntimeLog entry = Assert.Single(service.List(node, 10).Items);
|
|
Assert.Equal(20, entry.Fields.Count);
|
|
Assert.Equal("value", entry.Fields["field_17"]);
|
|
Assert.Equal("[redacted]", entry.Fields["api_token"]);
|
|
Assert.Equal(128, entry.Fields["detail"].Length);
|
|
Assert.False(entry.Fields.ContainsKey("overflow"));
|
|
}
|
|
}
|