diff options
author | Elad <theman@elad.im> | 2019-03-15 13:20:21 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2019-03-15 13:20:21 +0800 |
commit | df488975bd4bc514a01a3157d52dafd0118a4a05 (patch) | |
tree | f0a97a12da5672c12cf143ed3846d978eb24599a /cmd/swarm | |
parent | 91eec1251c06727581063cd7e942ba913d806971 (diff) | |
download | go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.tar go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.tar.gz go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.tar.bz2 go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.tar.lz go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.tar.xz go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.tar.zst go-tangerine-df488975bd4bc514a01a3157d52dafd0118a4a05.zip |
cmd/swarm: dont connect to bootnodes in tests (#19270)
* cmd/swarm: dont connect to bootnodes in tests
* cmd/utils: check for empty string when parsing enode
Diffstat (limited to 'cmd/swarm')
-rw-r--r-- | cmd/swarm/run_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index 4a6a56d9b..9681c8990 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -82,6 +82,18 @@ func TestMain(m *testing.M) { func runSwarm(t *testing.T, args ...string) *cmdtest.TestCmd { tt := cmdtest.NewTestCmd(t, nil) + found := false + for _, v := range args { + if v == "--bootnodes" { + found = true + break + } + } + + if !found { + args = append([]string{"--bootnodes", ""}, args...) + } + // Boot "swarm". This actually runs the test binary but the TestMain // function will prevent any tests from running. tt.Run("swarm-test", args...) @@ -252,6 +264,7 @@ func existingTestNode(t *testing.T, dir string, bzzaccount string) *testNode { // start the node node.Cmd = runSwarm(t, + "--bootnodes", "", "--port", p2pPort, "--nat", "extip:127.0.0.1", "--datadir", dir, @@ -327,6 +340,7 @@ func newTestNode(t *testing.T, dir string) *testNode { // start the node node.Cmd = runSwarm(t, + "--bootnodes", "", "--port", p2pPort, "--nat", "extip:127.0.0.1", "--datadir", dir, |