mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
Merge pull request #299 from ethersphere/test_missing_hash_no_error
cmd/swarm: make sure swarm doesnt crash when requested missing hashes
This commit is contained in:
commit
b1d253c0fb
1 changed files with 12 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ func testCLISwarmUp(toEncrypt bool, t *testing.T) {
|
|||
}
|
||||
|
||||
if res.StatusCode != 200 {
|
||||
t.Fatalf("expected HTTP status %d, got %s", 200, res.Status)
|
||||
t.Fatalf("expected HTTP status 200, got %s", res.Status)
|
||||
}
|
||||
|
||||
reply, err := ioutil.ReadAll(res.Body)
|
||||
|
|
@ -102,4 +102,15 @@ func testCLISwarmUp(toEncrypt bool, t *testing.T) {
|
|||
t.Fatalf("expected HTTP body %q, got %q", data, reply)
|
||||
}
|
||||
}
|
||||
|
||||
// get an non-existent hash from each node
|
||||
for _, node := range cluster.Nodes {
|
||||
res, err := http.Get(node.URL + "/bzz:/1023e8bae0f70be7d7b5f74343088ba408a218254391490c85ae16278e230340")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if res.StatusCode != 404 {
|
||||
t.Fatalf("expected HTTP status 404, got %s", res.Status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue