test, integration: Add cluster primitives to integration framework

This further extends the integration framework to add some simple
primitives for building clusters. More complex primitives and patterns
can be added in the future, but this should serve the general cases.
This commit is contained in:
James Shubin
2018-03-09 19:28:55 -05:00
parent f3b99b3940
commit 62d1fc7ed3
6 changed files with 527 additions and 36 deletions

View File

@@ -63,3 +63,21 @@ file "${root}/mgmt-hello-world" {
t.Errorf("code samples differ")
}
}
func TestParsePort(t *testing.T) {
if port, err := ParsePort("http://127.0.0.1:2379"); err != nil {
t.Errorf("could not determine port: %+v", err)
} else if port != 2379 {
t.Errorf("unexpected port: %d", port)
}
if port, err := ParsePort("http://127.0.0.1:2381"); err != nil {
t.Errorf("could not determine port: %+v", err)
} else if port != 2381 {
t.Errorf("unexpected port: %d", port)
}
if port, err := ParsePort("http://127.0.0.1"); err == nil {
t.Errorf("expected error, got: %d", port)
}
}