swarm/network/stream: add syncing test (#1399)

* swarm/network/stream: remove old syncing test and replace it with two more granular tests, with the first one testing a full sync between two nodes (makes sure that when all subscriptions are established on all bins - all content is replicated from one node to the other), and a second test that adds a bigger amount of nodes to a star network topology, effectively making the pivot node have a depth > 0 to sync just certain content to the connected nodes (due to a star topology this test (always 1 hop) does not check that, for example, specific content is routed across multiple nodes, but assumes content should be only on the most proximate node)

* api, cmd/swarm-smoke, fuse, network, storage: fix data dir leak when using ephemeral filestore, pull test params to be easily adjustable
This commit is contained in:
acud
2019-06-10 10:52:19 +02:00
committed by GitHub
parent ee7ccbdb4d
commit c1126aaa1b
6 changed files with 363 additions and 100 deletions

View File

@ -53,10 +53,11 @@ func testAPI(t *testing.T, f func(*API, *chunk.Tags, bool)) {
}
defer os.RemoveAll(datadir)
tags := chunk.NewTags()
fileStore, err := storage.NewLocalFileStore(datadir, make([]byte, 32), tags)
fileStore, cleanup, err := storage.NewLocalFileStore(datadir, make([]byte, 32), tags)
if err != nil {
return
}
defer cleanup()
api := NewAPI(fileStore, nil, nil, nil, tags)
f(api, tags, v)
}