test: Campaign LA finish LA2 probe and idle gates

Prove idle play remains passive and live until cancellation, then converges through one truthful status teardown. Keep probe mode string-only so numeric enum aliases cannot expand the pinned v1 contract, and record the Windows/WSL gates.
This commit is contained in:
Erik 2026-08-14 16:49:51 +02:00
parent c601942467
commit 000ea979d5
5 changed files with 243 additions and 38 deletions

View file

@ -237,6 +237,38 @@ public sealed class HeadlessConfigurationLoaderTests
Assert.Null(session.Policy);
}
/// <summary>
/// The pinned v1 contract has one named mode value: <c>"probe"</c>.
/// In particular, the enum's underlying numeric zero must not become an
/// accidental second spelling through an enum converter configured to
/// allow integers.
/// </summary>
[Theory]
[InlineData("\"play\"")]
[InlineData("0")]
public void SessionModeRejectsEveryValueOtherThanTheNamedProbeMode(
string modeJson)
{
using TemporaryConfiguration file = TemporaryConfiguration.Create(
$$"""
{
"version": 1,
"sessions": [
{
"id": "unsupported-mode",
"endpoint": { "host": "127.0.0.1", "port": 9000 },
"account": "account",
"mode": {{modeJson}},
"credential": { "provider": "environment", "reference": "PROBE_PASSWORD" }
}
]
}
""");
Assert.Throws<JsonException>(
() => HeadlessConfigurationLoader.Load(file.Path));
}
[Fact]
public void ProbeSessionDeclaringCharacterFailsLoadNamingTheField()
{