v0.318.0: the internal data place, partitions, an honest whole-box backup offer (R-1084), sys_drive never offered (R-1082)
gates / gates (push) Successful in 46s
gates / gates (push) Successful in 46s
felhom.eu architecture/16 §4-§6 (build B). MinAgent 0.157.0 — the internal place and the partitions appear only when agent >= 0.158.0 reports them. Tests red-proved; four parity fixtures refreshed (only the new lines). Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
@@ -2,8 +2,13 @@ package stacks
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/settings"
|
||||
)
|
||||
|
||||
// D4 (felhom.eu architecture/16-storage-physical-identity.md §5, R-1068): a data-folder or media app on a
|
||||
@@ -45,3 +50,33 @@ func TestD4_FilledPathKeepsItsOwnRefusal(t *testing.T) {
|
||||
t.Fatalf("want ErrPathMissing for a filled, missing path, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// `16` §5 (v0.318.0): on a one-disk box with the internal place registered, a media app installs with NO extra step
|
||||
// and NO sentence — its HDD_PATH lands on the internal place. Companion of TestD4_NoDriveRefusalSpeaksInWords (the
|
||||
// same app, no drive → the refusal).
|
||||
func TestD4_InternalPlaceIsTheMediaAppsDrive(t *testing.T) {
|
||||
m := r553Manager(t, "display_name: Jellyfin\nmedia_library:\n folder: films\ndeploy_fields:\n - env_var: HDD_PATH\n label: Médiatár útvonal\n type: path\n required: true\n")
|
||||
sett, err := settings.Load(filepath.Join(t.TempDir(), "settings.json"), log.New(io.Discard, "", 0))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
belso := filepath.Join(t.TempDir(), "belso")
|
||||
if err := sett.AddStoragePath(settings.StoragePath{Path: belso, IsDefault: true, Schedulable: true, Kind: settings.StorageKindInternal}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
m.settings = sett
|
||||
m.isMountPoint = func(p string) bool { return filepath.Clean(p) == belso }
|
||||
if got := m.defaultMediaDrive(); got != belso {
|
||||
t.Fatalf("the default media drive: want the internal place %q, got %q", belso, got)
|
||||
}
|
||||
// The folder is deliberately NOT created: the deploy then stops at its path check, so no real `docker compose`
|
||||
// can ever start on the machine running this test (tests that reach real docker act on DooPlex, R-650). The
|
||||
// refusal naming the internal place proves HDD_PATH was filled with it — the step the household no longer does.
|
||||
_, err = m.DeployStack(DeployRequest{StackName: "r553app", Values: map[string]string{}})
|
||||
if errors.Is(err, ErrNeedsDrive) {
|
||||
t.Fatalf("a box with the internal place must not be told it needs a drive: %v", err)
|
||||
}
|
||||
if !errors.Is(err, ErrPathMissing) || !strings.Contains(err.Error(), belso) {
|
||||
t.Fatalf("want the media app's HDD_PATH filled with the internal place %q, got %v", belso, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user