gates / gates (push) Successful in 2m3s
The bind handler always read extra_args and the pairing answer always carried it; the Hosts page had no input, so --accept-small-disk could not reach a public-image install. One text input, a validator in the store (CleanApplianceExtraArgs), a 400 for a refused value. Tests TestR1398_* (4), 5 mutations red. Register: R-1035's 4-week read moved to 2026-11-26 (the operator's Search Console read; reason in the row). Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package api
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"gitea.dooplex.hu/admin/felhom-hub/internal/store"
|
|
)
|
|
|
|
// R-1398: the flag the operator puts in the bind form reaches the box in the pairing answer, word for word —
|
|
// the first-boot unit appends exactly this text to the installer's command line (felhom-bootstrap.sh, read -ra).
|
|
func TestR1398_ExtraArgsReachThePairingAnswer(t *testing.T) {
|
|
h, st, _ := newTestHandler(t)
|
|
if err := st.SaveCustomerConfig(&store.CustomerConfig{CustomerID: "acme", APIKey: "k", RetrievalPassword: "pw"}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
token := registerAppliance(t, h, "uuid-X", []string{"bc:24:11:98:10:0e"})
|
|
list, _ := st.ListUnclaimedAppliances()
|
|
if err := st.BindAppliance(list[0].ID, "acme", "appliance", " --accept-small-disk "); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
rr := poll(t, h, token)
|
|
if rr.Code != 200 {
|
|
t.Fatalf("bound poll = %d", rr.Code)
|
|
}
|
|
var creds map[string]string
|
|
if err := json.Unmarshal(rr.Body.Bytes(), &creds); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if creds["extra_args"] != "--accept-small-disk" {
|
|
t.Fatalf("extra_args in the pairing answer = %q, want --accept-small-disk", creds["extra_args"])
|
|
}
|
|
}
|