hyperkube: add alpha subcommand
This commit is contained in:
@@ -151,6 +151,7 @@ func runFull(t *testing.T, args string, stopCh <-chan struct{}) *result {
|
||||
hk.AddServer(testServer("test1"))
|
||||
hk.AddServer(testServer("test2"))
|
||||
hk.AddServer(testServer("test3"))
|
||||
hk.AddAlphaServer(testServer("testAlpha1"))
|
||||
hk.AddServer(testServerError("test-error"))
|
||||
hk.AddServer(testStopChIgnoringServer("test-stop-ch-ignoring"))
|
||||
hk.AddServer(testStopChRespectingServer("test-stop-ch-respecting"))
|
||||
@@ -236,6 +237,22 @@ func TestServerError(t *testing.T) {
|
||||
assert.EqualError(t, x.err, "server returning error")
|
||||
}
|
||||
|
||||
func TestAlphaRun(t *testing.T) {
|
||||
x := runFull(t, "hyperkube alpha testAlpha1", wait.NeverStop)
|
||||
assert.NoError(t, x.err)
|
||||
}
|
||||
|
||||
func TestAlphaNoArgs(t *testing.T) {
|
||||
x := runFull(t, "hyperkube alpha", wait.NeverStop)
|
||||
assert.EqualError(t, x.err, "no alpha server specified")
|
||||
}
|
||||
|
||||
func TestAlphaBadServer(t *testing.T) {
|
||||
x := runFull(t, "hyperkube alpha bad-server", wait.NeverStop)
|
||||
assert.EqualError(t, x.err, "Server not found: bad-server")
|
||||
assert.Contains(t, x.output, "Usage")
|
||||
}
|
||||
|
||||
func TestStopChIgnoringServer(t *testing.T) {
|
||||
stopCh := make(chan struct{})
|
||||
returnedCh := make(chan struct{})
|
||||
|
Reference in New Issue
Block a user