aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/upload_test.go
diff options
context:
space:
mode:
authorElad <theman@elad.im>2018-10-09 20:08:40 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-10-09 20:08:40 +0800
commitda290e9707d6b3074b571722bbb557815b03ad48 (patch)
treedbb7a5c62330bc3f9a862f2eacc067c477e16719 /cmd/swarm/upload_test.go
parent0fe9a372b3ff9fd0746c3e271bd0ddddd3412122 (diff)
downloaddexon-da290e9707d6b3074b571722bbb557815b03ad48.tar
dexon-da290e9707d6b3074b571722bbb557815b03ad48.tar.gz
dexon-da290e9707d6b3074b571722bbb557815b03ad48.tar.bz2
dexon-da290e9707d6b3074b571722bbb557815b03ad48.tar.lz
dexon-da290e9707d6b3074b571722bbb557815b03ad48.tar.xz
dexon-da290e9707d6b3074b571722bbb557815b03ad48.tar.zst
dexon-da290e9707d6b3074b571722bbb557815b03ad48.zip
cmd/swarm: speed up tests (#17878)
These minor changes already shaved off around 30s.
Diffstat (limited to 'cmd/swarm/upload_test.go')
-rw-r--r--cmd/swarm/upload_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/swarm/upload_test.go b/cmd/swarm/upload_test.go
index e8161680f..0ac2456a5 100644
--- a/cmd/swarm/upload_test.go
+++ b/cmd/swarm/upload_test.go
@@ -32,6 +32,7 @@ import (
"github.com/ethereum/go-ethereum/log"
swarm "github.com/ethereum/go-ethereum/swarm/api/client"
+ "github.com/ethereum/go-ethereum/swarm/testutil"
"github.com/mattn/go-colorable"
)
@@ -298,8 +299,8 @@ func TestCLISwarmUpDefaultPath(t *testing.T) {
}
func testCLISwarmUpDefaultPath(toEncrypt bool, absDefaultPath bool, t *testing.T) {
- cluster := newTestCluster(t, 1)
- defer cluster.Shutdown()
+ srv := testutil.NewTestSwarmServer(t, serverFunc, nil)
+ defer srv.Close()
tmp, err := ioutil.TempDir("", "swarm-defaultpath-test")
if err != nil {
@@ -323,7 +324,7 @@ func testCLISwarmUpDefaultPath(toEncrypt bool, absDefaultPath bool, t *testing.T
args := []string{
"--bzzapi",
- cluster.Nodes[0].URL,
+ srv.URL,
"--recursive",
"--defaultpath",
defaultPath,
@@ -340,7 +341,7 @@ func testCLISwarmUpDefaultPath(toEncrypt bool, absDefaultPath bool, t *testing.T
up.ExpectExit()
hash := matches[0]
- client := swarm.NewClient(cluster.Nodes[0].URL)
+ client := swarm.NewClient(srv.URL)
m, isEncrypted, err := client.DownloadManifest(hash)
if err != nil {