W21 sharing switched on without a password asks for it and says why it waits; W25 failed off-site run shows the household a sentence built from the classifier, raw text only to log and operator; W28 share restore skips the controller's drop-zone share; unreleased
gates / gates (push) Successful in 1m40s

This commit is contained in:
admin committed 2026-10-21 23:19:07 +02:00
1 parent 28b05d6d68
commit 5776d54901
16 files changed
+330 -7

No files matched your search

@@ -266,3 +266,40 @@ func TestSharesRestoreFlashMessage(t *testing.T) {
// jsonMarshalIndent is a tiny indirection so the test file needs no direct encoding/json import
// beyond this one helper.
func jsonMarshalIndent(v any) ([]byte, error) { return json.MarshalIndent(v, "", " ") }
// W28 (rehearsal 2026-10-20): the share restore said „Nem állítható vissza (a mappa nincs élő adatmeghajtón):
// beolvasas." — „beolvasas" is the controller's own drop-zone share (R-75, System), which lives on the system drive
// and is re-created by the controller while sharing is on. It is skipped without naming it; a household share outside
// every live root is still refused and named.
func TestW28_TheSystemDropZoneIsNotNamedAsRefused(t *testing.T) {
env := newSharesEnv(t, "hdd_1")
dropZone := filepath.Join(env.tmp, "system", "felhom-data", "userdata", "import")
outside := filepath.Join(env.tmp, "kivul", "csaladi")
mf := SharesManifest{
Version: sharesManifestVersion, ServerName: "FELHOM",
Shares: []settings.SMBShare{
{Name: settings.SystemImportShareName, Path: dropZone, System: true, CreatedAt: "2026-07-18T00:00:00Z"},
{Name: "csaladi", Path: outside, Offsite: true, CreatedAt: "2026-07-18T00:00:00Z"},
},
}
seedSharesScratch(t, env, mf, map[string]string{filepath.Join(dropZone, "scan.pdf"): "X"})
var passdbCalls int
wirePlaceSeams(env, &passdbCalls)
res, err := env.m.PlaceSharesRestore(t.Context())
if err != nil {
t.Fatal(err)
}
msg := res.FlashMessage()
if strings.Contains(msg, settings.SystemImportShareName) {
t.Errorf("the household was told about the controller's drop-zone share: %q", msg)
}
if len(res.Refused) != 1 || res.Refused[0] != "csaladi" || !strings.Contains(msg, "csaladi") {
t.Errorf("a household share outside every live root must still be refused and named: %+v %q", res.Refused, msg)
}
if _, sErr := os.Stat(filepath.Join(dropZone, "scan.pdf")); !os.IsNotExist(sErr) {
t.Error("the drop-zone's files were placed — the skip must write nothing")
}
if len(env.sett.GetSMBShares()) != 0 {
t.Errorf("a skipped share must not enter the registry here: %+v", env.sett.GetSMBShares())
}
}