init
release-tag / release-image (push) Failing after 1m20s

This commit is contained in:
2026-08-31 17:09:21 +02:00
parent 57e5114b60
commit 45ca18b74e
38 changed files with 6169 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
package nodes
import "testing"
func TestAgentWebSocketURLPreservesQuery(t *testing.T) {
got, err := agentWebSocketURL("https://agent.example/base", "/agent/v1/stacks/demo/terminal?service=web&shell=sh")
if err != nil {
t.Fatal(err)
}
want := "wss://agent.example/base/agent/v1/stacks/demo/terminal?service=web&shell=sh"
if got != want {
t.Fatalf("got %q want %q", got, want)
}
}
func TestValidateBaseURLRejectsQueryFragmentAndCredentials(t *testing.T) {
bad := []string{
"https://user:pass@agent.example",
"https://agent.example?token=oops",
"https://agent.example/#frag",
"ftp://agent.example",
}
for _, u := range bad {
if err := validateBaseURL(u); err == nil {
t.Fatalf("expected %q to be rejected", u)
}
}
if err := validateBaseURL("https://agent.example/base"); err != nil {
t.Fatalf("valid URL rejected: %v", err)
}
}