24 lines
1.0 KiB
Go
24 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/validate"
|
|
)
|
|
|
|
// A directory or an archive that says how it reacts to files it does not know (novox/hq ADR 0422) is a
|
|
// declaration the node-engine takes, so the gate, which judges every machine with the node-engine's own
|
|
// validator, takes it too. Before the pin moved, every catalogue manifest using the words was refused
|
|
// on every machine (issue 1024).
|
|
func TestTheGateTakesADirectoryThatSaysHowItReacts(t *testing.T) {
|
|
decl := fmt.Sprintf(`{"declaration":%d,"resources":[
|
|
{"id":"xorg.config","type":"directory","path":"/home/a/.config/xorg","mode":"0755","owner":"a","unknown":"move-out","knows":["scripts/"]},
|
|
{"id":"p10k.theme","type":"archive","source":"https://example.invalid/a.tar","digest":"sha256:`+
|
|
"0000000000000000000000000000000000000000000000000000000000000000"+
|
|
`","path":"/home/a/.local/share/powerlevel10k","unknown":"move-out"}]}`, validate.Version)
|
|
if problems := validate.Declaration([]byte(decl)); len(problems) != 0 {
|
|
t.Fatalf("refused: %q", problems)
|
|
}
|
|
}
|