open-nomad/command/system_gc_test.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
640 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package command
import (
"testing"
"github.com/hashicorp/nomad/ci"
"github.com/mitchellh/cli"
)
func TestSystemGCCommand_Implements(t *testing.T) {
ci.Parallel(t)
var _ cli.Command = &SystemGCCommand{}
}
func TestSystemGCCommand_Good(t *testing.T) {
ci.Parallel(t)
// Create a server
srv, _, url := testServer(t, true, nil)
defer srv.Shutdown()
2020-10-05 14:07:41 +00:00
ui := cli.NewMockUi()
cmd := &SystemGCCommand{Meta: Meta{Ui: ui}}
if code := cmd.Run([]string{"-address=" + url}); code != 0 {
t.Fatalf("expected exit 0, got: %d; %v", code, ui.ErrorWriter.String())
}
}