Piattaforme: istanza unica dopo lo spostamento dei dati, avvio sicuro del contenitore, rilascio con prove e immagine, accesso senza reindirizzamenti esterni (pkg-1, pkg-2, pkg-3, pkg-4, pkg-5, pkg-6, websec-2, web-8, websec-3)
Registro di casa 192.168.30.23:3000 (HTTP) nel modello Unraid, in compose e nel rilascio con buildx; profilo seccomp fuori da /dati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
This commit is contained in:
36 files changed
+1683
-152
No files matched your search
@@ -305,4 +305,43 @@ public sealed class DesktopCompositionTests
|
||||
await DesktopTestBed.WaitUntilAsync(() => browser.LastError is not null, TimeSpan.FromSeconds(10), "il tentativo di avviare Edge");
|
||||
Assert.IsFalse(browser.IsAvailable, "the fake msedge.exe does not exist: the browser is retried, nothing else breaks");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Timeout(60_000, CooperativeCancellation = true)]
|
||||
public async Task EveryEdgeFebeStartsIsTiedToFebeSoACrashLeavesNoEdgeHoldingThePort()
|
||||
{
|
||||
if (!OperatingSystem.IsLinux())
|
||||
{
|
||||
Assert.Inconclusive("Il finto msedge.exe di questa prova è uno script di shell.");
|
||||
return;
|
||||
}
|
||||
|
||||
// An «Edge» that starts and closes at once: every start must be tied to Febe before anything else happens, also
|
||||
// the starts that fail and the ones after (pkg-6: an Edge left behind by a crash keeps the port 9222).
|
||||
using var temp = new TempFolder("desktop-edge");
|
||||
var edge = temp.Combine("Edge", "msedge.exe");
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(edge)!);
|
||||
await File.WriteAllTextAsync(edge, "#!/bin/sh\nexit 3\n", TestContext.CancellationToken);
|
||||
File.SetUnixFileMode(edge, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
|
||||
var shell = new FakeDesktopShell { EdgePath = edge, TieSucceeds = false };
|
||||
await using var bed = await DesktopTestBed.StartAsync(["--browser", "edge"], shell, temp, adjust: o => o with { EdgeDebugPort = FreePort() });
|
||||
await DesktopTestBed.WaitUntilAsync(() => !shell.TiedToFebe.IsEmpty, TimeSpan.FromSeconds(20), "Edge legato alla vita di Febe");
|
||||
var browser = (EdgeBrowser)bed.App.Browser!;
|
||||
await DesktopTestBed.WaitUntilAsync(() => browser.LastError is not null, TimeSpan.FromSeconds(20), "il primo avvio di Edge, che si chiude subito");
|
||||
Assert.IsFalse(browser.IsAvailable);
|
||||
await bed.StopAsync();
|
||||
|
||||
// Windows refused: the log says what to do, in Italian.
|
||||
var log = string.Concat(Directory.EnumerateFiles(Path.Combine(bed.Folders.DefaultDataFolder, "registro")).Select(File.ReadAllText));
|
||||
StringAssert.Contains(log, "Windows non ha legato Edge a Febe");
|
||||
}
|
||||
|
||||
private static int FreePort()
|
||||
{
|
||||
var listener = new System.Net.Sockets.TcpListener(IPAddress.Loopback, 0);
|
||||
listener.Start();
|
||||
var port = ((IPEndPoint)listener.LocalEndpoint).Port;
|
||||
listener.Stop();
|
||||
return port;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user