Integrazione 0.1.1: unione di correzione/prove-su-windows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/decisioni.md
This commit is contained in:
commit
5dc9b4c6ae
7 files changed
+105
-16
No files matched your search
@@ -99,14 +99,23 @@ public sealed class StartupProblemTests
|
||||
[TestMethod]
|
||||
public async Task ADataFolderOnANetworkShareIsRefused()
|
||||
{
|
||||
// A share shows itself differently on the two systems: on Linux as a cifs mount in the mount table (injected
|
||||
// here), on Windows as a UNC path, recognised from its form before anything touches it. The Windows server name
|
||||
// ends in .invalid (RFC 6761): no machine answers to it, and nothing here looks it up.
|
||||
using var temp = new TempFolder("server-problemi");
|
||||
var data = temp.Combine("dati");
|
||||
var windows = OperatingSystem.IsWindows();
|
||||
var data = windows ? @"\\febe-prova.invalid\condivisa\dati" : temp.Combine("dati");
|
||||
var mounts = $"/dev/sda1 / ext4 rw 0 0\n//nas/condivisa {temp.Path} cifs rw 0 0\n";
|
||||
await using var server = await FebeServer.StartAsync(Options(temp), Hooks() with { DataFolderCheck = new DataFolderCheck(() => mounts) });
|
||||
await using var server = await FebeServer.StartAsync(Options(temp) with { DataFolder = data }, Hooks() with { DataFolderCheck = new DataFolderCheck(() => mounts) });
|
||||
var problem = server.Problems.Single();
|
||||
Assert.AreEqual(StartupChecks.DataOnNetwork, problem.Code);
|
||||
StringAssert.Contains(problem.Message, "cifs");
|
||||
Assert.IsFalse(Directory.Exists(Path.Combine(data, "registro")));
|
||||
StringAssert.Contains(problem.Message, windows ? "condivisione di rete" : "cifs");
|
||||
if (!windows)
|
||||
{
|
||||
// Nothing written in the Data folder (on Windows the share does not exist: looking would mean asking the network).
|
||||
Assert.IsFalse(Directory.Exists(Path.Combine(data, "registro")));
|
||||
}
|
||||
|
||||
using var client = Client(server);
|
||||
await AssertHealthAsync(client, HttpStatusCode.ServiceUnavailable, """{"stato":"problema"}""");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user