mirror of https://github.com/status-im/consul.git
commands: run all tests in parallel (again)
This commit is contained in:
parent
56b24d3d4f
commit
1b026de1db
|
@ -18,6 +18,7 @@ import (
|
|||
|
||||
// TestConfigFail should test command line flags that lead to an immediate error.
|
||||
func TestConfigFail(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dataDir := testutil.TempDir(t, "consul")
|
||||
defer os.RemoveAll(dataDir)
|
||||
|
@ -75,6 +76,7 @@ func TestConfigFail(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestRetryJoin(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed")
|
||||
a := agent.NewTestAgent(t.Name(), "")
|
||||
defer a.Shutdown()
|
||||
|
@ -123,6 +125,7 @@ func TestRetryJoin(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestRetryJoinFail(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed")
|
||||
cfg := agent.TestConfig()
|
||||
tmpDir := testutil.TempDir(t, "consul")
|
||||
|
@ -148,6 +151,7 @@ func TestRetryJoinFail(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestRetryJoinWanFail(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed")
|
||||
cfg := agent.TestConfig()
|
||||
tmpDir := testutil.TempDir(t, "consul")
|
||||
|
@ -174,6 +178,7 @@ func TestRetryJoinWanFail(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestProtectDataDir(t *testing.T) {
|
||||
t.Parallel()
|
||||
dir := testutil.TempDir(t, "consul")
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
|
@ -208,6 +213,7 @@ func TestProtectDataDir(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestBadDataDirPermissions(t *testing.T) {
|
||||
t.Parallel()
|
||||
dir := testutil.TempDir(t, "consul")
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestCatalogCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestCatalogListDatacentersCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCatalogListDatacentersCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -50,6 +52,7 @@ func TestCatalogListDatacentersCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCatalogListDatacentersCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestCatalogListNodesCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCatalogListNodesCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -28,6 +30,7 @@ func TestCatalogListNodesCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCatalogListNodesCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -10,12 +10,14 @@ import (
|
|||
)
|
||||
|
||||
func TestCatalogListServicesCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCatalogListServicesCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -29,6 +31,7 @@ func TestCatalogListServicesCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCatalogListServicesCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestEventCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEventCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a1 := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a1.Shutdown()
|
||||
|
||||
|
|
|
@ -12,12 +12,14 @@ import (
|
|||
)
|
||||
|
||||
func TestExecCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil, nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestExecCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
@ -38,6 +40,7 @@ func TestExecCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_NoShell(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
@ -58,6 +61,7 @@ func TestExecCommand_NoShell(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_CrossDC(t *testing.T) {
|
||||
t.Parallel()
|
||||
a1 := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
@ -99,6 +103,7 @@ func TestExecCommand_CrossDC(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_Validate(t *testing.T) {
|
||||
t.Parallel()
|
||||
conf := &rExecConf{}
|
||||
err := conf.validate()
|
||||
if err != nil {
|
||||
|
@ -134,6 +139,7 @@ func TestExecCommand_Validate(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_Sessions(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
@ -172,6 +178,7 @@ func TestExecCommand_Sessions(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_Sessions_Foreign(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
@ -221,6 +228,7 @@ func TestExecCommand_Sessions_Foreign(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_UploadDestroy(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
@ -275,6 +283,7 @@ func TestExecCommand_UploadDestroy(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecCommand_StreamResults(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
disable_remote_exec = false
|
||||
`)
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
)
|
||||
|
||||
func TestConfigUtil_Values(t *testing.T) {
|
||||
t.Parallel()
|
||||
type config struct {
|
||||
B BoolValue `mapstructure:"bool"`
|
||||
D DurationValue `mapstructure:"duration"`
|
||||
|
@ -101,6 +102,7 @@ func TestConfigUtil_Values(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestConfigUtil_Visit(t *testing.T) {
|
||||
t.Parallel()
|
||||
var trail []string
|
||||
visitor := func(path string) error {
|
||||
trail = append(trail, path)
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestFlagMapValueSet(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
t.Run("missing =", func(t *testing.T) {
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func TestAppendSliceValue_implements(t *testing.T) {
|
||||
t.Parallel()
|
||||
var raw interface{}
|
||||
raw = new(AppendSliceValue)
|
||||
if _, ok := raw.(flag.Value); !ok {
|
||||
|
@ -15,6 +16,7 @@ func TestAppendSliceValue_implements(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAppendSliceValueSet(t *testing.T) {
|
||||
t.Parallel()
|
||||
sv := new(AppendSliceValue)
|
||||
err := sv.Set("foo")
|
||||
if err != nil {
|
||||
|
|
|
@ -11,12 +11,14 @@ import (
|
|||
)
|
||||
|
||||
func TestForceLeaveCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestForceLeaveCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a1 := agent.NewTestAgent(t.Name(), ``)
|
||||
a2 := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a1.Shutdown()
|
||||
|
@ -55,6 +57,7 @@ func TestForceLeaveCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestForceLeaveCommand_noAddrs(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
args := []string{"-http-addr=foo"}
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestInfoCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestInfoCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a1 := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a1.Shutdown()
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestJoinCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestJoinCommandJoin_lan(t *testing.T) {
|
||||
t.Parallel()
|
||||
a1 := agent.NewTestAgent(t.Name(), ``)
|
||||
a2 := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a1.Shutdown()
|
||||
|
@ -38,6 +40,7 @@ func TestJoinCommandJoin_lan(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestJoinCommand_wan(t *testing.T) {
|
||||
t.Parallel()
|
||||
a1 := agent.NewTestAgent(t.Name(), ``)
|
||||
a2 := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a1.Shutdown()
|
||||
|
@ -62,6 +65,7 @@ func TestJoinCommand_wan(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestJoinCommand_noAddrs(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
cmd := New(ui)
|
||||
args := []string{"-http-addr=foo"}
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKeygenCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKeygenCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
cmd := New(ui)
|
||||
code := cmd.Run(nil)
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKeyringCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKeyringCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
key1 := "HS5lJ+XuTlYKWaeGYyG+/A=="
|
||||
key2 := "kZyFABeAmc64UMTrm9XuKA=="
|
||||
|
||||
|
@ -65,6 +67,7 @@ func TestKeyringCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKeyringCommand_help(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
code := c.Run(nil)
|
||||
|
@ -79,6 +82,7 @@ func TestKeyringCommand_help(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKeyringCommand_failedConnection(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
args := []string{"-list", "-http-addr=127.0.0.1:0"}
|
||||
|
@ -92,6 +96,7 @@ func TestKeyringCommand_failedConnection(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKeyringCommand_invalidRelayFactor(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
|
|
@ -11,12 +11,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKVDeleteCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKVDeleteCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -69,6 +71,7 @@ func TestKVDeleteCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVDeleteCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -105,6 +108,7 @@ func TestKVDeleteCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVDeleteCommand_Recurse(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -148,6 +152,7 @@ func TestKVDeleteCommand_Recurse(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVDeleteCommand_CAS(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -13,12 +13,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKVExportCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKVExportCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -11,12 +11,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKVGetCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKVGetCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -56,6 +58,7 @@ func TestKVGetCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -89,6 +92,7 @@ func TestKVGetCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_Missing(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -107,6 +111,7 @@ func TestKVGetCommand_Missing(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_Empty(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -135,6 +140,7 @@ func TestKVGetCommand_Empty(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_Detailed(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -178,6 +184,7 @@ func TestKVGetCommand_Detailed(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_Keys(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -212,6 +219,7 @@ func TestKVGetCommand_Keys(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_Recurse(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -251,6 +259,7 @@ func TestKVGetCommand_Recurse(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_RecurseBase64(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -291,6 +300,7 @@ func TestKVGetCommand_RecurseBase64(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVGetCommand_DetailedBase64(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKVImportCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKVImportCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestKVCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -16,12 +16,14 @@ import (
|
|||
)
|
||||
|
||||
func TestKVPutCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestKVPutCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -74,6 +76,7 @@ func TestKVPutCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -102,6 +105,7 @@ func TestKVPutCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_EmptyDataQuoted(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -130,6 +134,7 @@ func TestKVPutCommand_EmptyDataQuoted(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_Base64(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -166,6 +171,7 @@ func TestKVPutCommand_Base64(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_File(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -200,6 +206,7 @@ func TestKVPutCommand_File(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_FileNoExist(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -219,6 +226,7 @@ func TestKVPutCommand_FileNoExist(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_Stdin(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -255,6 +263,7 @@ func TestKVPutCommand_Stdin(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_NegativeVal(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -283,6 +292,7 @@ func TestKVPutCommand_NegativeVal(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_Flags(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
@ -312,6 +322,7 @@ func TestKVPutCommand_Flags(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestKVPutCommand_CAS(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestLeaveCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLeaveCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -33,6 +35,7 @@ func TestLeaveCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLeaveCommand_FailOnNonFlagArgs(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -26,18 +26,21 @@ func argFail(t *testing.T, args []string, expected string) {
|
|||
}
|
||||
|
||||
func TestLockCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLockCommand_BadArgs(t *testing.T) {
|
||||
t.Parallel()
|
||||
argFail(t, []string{"-try=blah", "test/prefix", "date"}, "invalid duration")
|
||||
argFail(t, []string{"-try=-10s", "test/prefix", "date"}, "Timeout must be positive")
|
||||
argFail(t, []string{"-monitor-retry=-5", "test/prefix", "date"}, "must be >= 0")
|
||||
}
|
||||
|
||||
func TestLockCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -60,6 +63,7 @@ func TestLockCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_NoShell(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -82,6 +86,7 @@ func TestLockCommand_NoShell(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_TryLock(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -113,6 +118,7 @@ func TestLockCommand_TryLock(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_TrySemaphore(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -144,6 +150,7 @@ func TestLockCommand_TrySemaphore(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_MonitorRetry_Lock_Default(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -176,6 +183,7 @@ func TestLockCommand_MonitorRetry_Lock_Default(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_MonitorRetry_Semaphore_Default(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -208,6 +216,7 @@ func TestLockCommand_MonitorRetry_Semaphore_Default(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_MonitorRetry_Lock_Arg(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -240,6 +249,7 @@ func TestLockCommand_MonitorRetry_Lock_Arg(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_MonitorRetry_Semaphore_Arg(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -272,6 +282,7 @@ func TestLockCommand_MonitorRetry_Semaphore_Arg(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLockCommand_ChildExitCode(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -10,12 +10,14 @@ import (
|
|||
)
|
||||
|
||||
func TestMaintCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaintCommand_ConflictingArgs(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
c.flags.SetOutput(ui.ErrorWriter)
|
||||
|
@ -38,6 +40,7 @@ func TestMaintCommand_ConflictingArgs(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMaintCommand_NoArgs(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -86,6 +89,7 @@ func TestMaintCommand_NoArgs(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMaintCommand_EnableNodeMaintenance(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -109,6 +113,7 @@ func TestMaintCommand_EnableNodeMaintenance(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMaintCommand_DisableNodeMaintenance(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -131,6 +136,7 @@ func TestMaintCommand_DisableNodeMaintenance(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMaintCommand_EnableServiceMaintenance(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -164,6 +170,7 @@ func TestMaintCommand_EnableServiceMaintenance(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMaintCommand_DisableServiceMaintenance(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -196,6 +203,7 @@ func TestMaintCommand_DisableServiceMaintenance(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMaintCommand_ServiceMaintenance_NoService(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -10,12 +10,14 @@ import (
|
|||
)
|
||||
|
||||
func TestMembersCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMembersCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -47,6 +49,7 @@ func TestMembersCommand(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMembersCommand_WAN(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -67,6 +70,7 @@ func TestMembersCommand_WAN(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMembersCommand_statusFilter(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
@ -90,6 +94,7 @@ func TestMembersCommand_statusFilter(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMembersCommand_statusFilter_failed(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorAutopilotGetConfigCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOperatorAutopilotGetConfigCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorAutopilotCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -11,12 +11,14 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorAutopilotSetConfigCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOperatorAutopilotSetConfigCommmand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -10,12 +10,14 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorRaftListPeersCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOperatorRaftListPeersCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorRaftCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorRaftRemovePeerCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestOperatorRaftRemovePeerCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestReloadCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestReloadCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -13,12 +13,14 @@ import (
|
|||
)
|
||||
|
||||
func TestRTTCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRTTCommand_BadArgs(t *testing.T) {
|
||||
t.Parallel()
|
||||
tests := []struct {
|
||||
args []string
|
||||
}{
|
||||
|
@ -41,6 +43,7 @@ func TestRTTCommand_BadArgs(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestRTTCommand_LAN(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), `
|
||||
consul = {
|
||||
coordinate = {
|
||||
|
@ -148,6 +151,7 @@ func TestRTTCommand_LAN(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestRTTCommand_WAN(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
|
@ -13,12 +13,14 @@ import (
|
|||
)
|
||||
|
||||
func TestSnapshotInpectCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshotInspectCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -58,6 +60,7 @@ func TestSnapshotInspectCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSnapshotInspectCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -13,12 +13,14 @@ import (
|
|||
)
|
||||
|
||||
func TestSnapshotRestoreCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSnapshotRestoreCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
ui := cli.NewMockUi()
|
||||
c := New(ui)
|
||||
|
||||
|
@ -58,6 +60,7 @@ func TestSnapshotRestoreCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSnapshotRestoreCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -12,11 +12,13 @@ import (
|
|||
)
|
||||
|
||||
func TestSnapshotSaveCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
func TestSnapshotSaveCommand_Validation(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
cases := map[string]struct {
|
||||
args []string
|
||||
|
@ -57,6 +59,7 @@ func TestSnapshotSaveCommand_Validation(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSnapshotSaveCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
client := a.Client()
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func TestSnapshotCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -12,12 +12,14 @@ import (
|
|||
)
|
||||
|
||||
func TestValidateCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateCommand_FailOnEmptyFile(t *testing.T) {
|
||||
t.Parallel()
|
||||
tmpFile := testutil.TempFile(t, "consul")
|
||||
defer os.RemoveAll(tmpFile.Name())
|
||||
|
||||
|
@ -30,6 +32,7 @@ func TestValidateCommand_FailOnEmptyFile(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestValidateCommand_SucceedOnMinimalConfigFile(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := testutil.TempDir(t, "consul")
|
||||
defer os.RemoveAll(td)
|
||||
|
||||
|
@ -48,6 +51,7 @@ func TestValidateCommand_SucceedOnMinimalConfigFile(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestValidateCommand_SucceedOnMinimalConfigDir(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := testutil.TempDir(t, "consul")
|
||||
defer os.RemoveAll(td)
|
||||
|
||||
|
@ -65,6 +69,7 @@ func TestValidateCommand_SucceedOnMinimalConfigDir(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestValidateCommand_Quiet(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := testutil.TempDir(t, "consul")
|
||||
defer os.RemoveAll(td)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func TestVersionCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi(), "").Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
|
|
|
@ -9,12 +9,14 @@ import (
|
|||
)
|
||||
|
||||
func TestWatchCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New(cli.NewMockUi(), nil).Help(), '\t') {
|
||||
t.Fatal("help has tabs")
|
||||
}
|
||||
}
|
||||
|
||||
func TestWatchCommand(t *testing.T) {
|
||||
t.Parallel()
|
||||
a := agent.NewTestAgent(t.Name(), ``)
|
||||
defer a.Shutdown()
|
||||
|
||||
|
|
Loading…
Reference in New Issue