projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '12614-broken-docker' refs #12614
[arvados.git]
/
services
/
keepproxy
/
keepproxy_test.go
diff --git
a/services/keepproxy/keepproxy_test.go
b/services/keepproxy/keepproxy_test.go
index 23bb2bd216c1f1080d246e63a47252564e4d9bf4..a7b608b69c462fd4149f932c16dbabcaddbca6c6 100644
(file)
--- a/
services/keepproxy/keepproxy_test.go
+++ b/
services/keepproxy/keepproxy_test.go
@@
-10,7
+10,6
@@
import (
"errors"
"fmt"
"io/ioutil"
"errors"
"fmt"
"io/ioutil"
- "log"
"math/rand"
"net/http"
"net/http/httptest"
"math/rand"
"net/http"
"net/http/httptest"
@@
-57,7
+56,7
@@
func waitForListener() {
time.Sleep(ms * time.Millisecond)
}
if listener == nil {
time.Sleep(ms * time.Millisecond)
}
if listener == nil {
-
log.Fatalf
("Timed out waiting for listener to start")
+
panic
("Timed out waiting for listener to start")
}
}
}
}
@@
-255,14
+254,14
@@
func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
{
_, _, err := kc.Ask(hash)
c.Check(err, Equals, keepclient.BlockNotFound)
{
_, _, err := kc.Ask(hash)
c.Check(err, Equals, keepclient.BlockNotFound)
-
log.Print
("Finished Ask (expected BlockNotFound)")
+
c.Log
("Finished Ask (expected BlockNotFound)")
}
{
reader, _, _, err := kc.Get(hash)
c.Check(reader, Equals, nil)
c.Check(err, Equals, keepclient.BlockNotFound)
}
{
reader, _, _, err := kc.Get(hash)
c.Check(reader, Equals, nil)
c.Check(err, Equals, keepclient.BlockNotFound)
-
log.Print
("Finished Get (expected BlockNotFound)")
+
c.Log
("Finished Get (expected BlockNotFound)")
}
// Note in bug #5309 among other errors keepproxy would set
}
// Note in bug #5309 among other errors keepproxy would set
@@
-281,14
+280,14
@@
func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
c.Check(hash2, Matches, fmt.Sprintf(`^%s\+3(\+.+)?$`, hash))
c.Check(rep, Equals, 2)
c.Check(err, Equals, nil)
c.Check(hash2, Matches, fmt.Sprintf(`^%s\+3(\+.+)?$`, hash))
c.Check(rep, Equals, 2)
c.Check(err, Equals, nil)
-
log.Print
("Finished PutB (expected success)")
+
c.Log
("Finished PutB (expected success)")
}
{
blocklen, _, err := kc.Ask(hash2)
c.Assert(err, Equals, nil)
c.Check(blocklen, Equals, int64(3))
}
{
blocklen, _, err := kc.Ask(hash2)
c.Assert(err, Equals, nil)
c.Check(blocklen, Equals, int64(3))
-
log.Print
("Finished Ask (expected success)")
+
c.Log
("Finished Ask (expected success)")
}
{
}
{
@@
-297,7
+296,7
@@
func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
all, err := ioutil.ReadAll(reader)
c.Check(all, DeepEquals, []byte("foo"))
c.Check(blocklen, Equals, int64(3))
all, err := ioutil.ReadAll(reader)
c.Check(all, DeepEquals, []byte("foo"))
c.Check(blocklen, Equals, int64(3))
-
log.Print
("Finished Get (expected success)")
+
c.Log
("Finished Get (expected success)")
}
{
}
{
@@
-307,7
+306,7
@@
func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
c.Check(hash2, Matches, `^d41d8cd98f00b204e9800998ecf8427e\+0(\+.+)?$`)
c.Check(rep, Equals, 2)
c.Check(err, Equals, nil)
c.Check(hash2, Matches, `^d41d8cd98f00b204e9800998ecf8427e\+0(\+.+)?$`)
c.Check(rep, Equals, 2)
c.Check(err, Equals, nil)
-
log.Print
("Finished PutB zero block")
+
c.Log
("Finished PutB zero block")
}
{
}
{
@@
-316,7
+315,7
@@
func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
all, err := ioutil.ReadAll(reader)
c.Check(all, DeepEquals, []byte(""))
c.Check(blocklen, Equals, int64(0))
all, err := ioutil.ReadAll(reader)
c.Check(all, DeepEquals, []byte(""))
c.Check(blocklen, Equals, int64(0))
-
log.Print
("Finished Get zero block")
+
c.Log
("Finished Get zero block")
}
}
}
}
@@
-331,7
+330,7
@@
func (s *ServerRequiredSuite) TestPutAskGetForbidden(c *C) {
errNotFound, _ := err.(keepclient.ErrNotFound)
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
errNotFound, _ := err.(keepclient.ErrNotFound)
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
-
log.Print
("Ask 1")
+
c.Log
("Ask 1")
}
{
}
{
@@
-339,7
+338,7
@@
func (s *ServerRequiredSuite) TestPutAskGetForbidden(c *C) {
c.Check(hash2, Equals, "")
c.Check(rep, Equals, 0)
c.Check(err, FitsTypeOf, keepclient.InsufficientReplicasError(errors.New("")))
c.Check(hash2, Equals, "")
c.Check(rep, Equals, 0)
c.Check(err, FitsTypeOf, keepclient.InsufficientReplicasError(errors.New("")))
-
log.Print
("PutB")
+
c.Log
("PutB")
}
{
}
{
@@
-348,7
+347,7
@@
func (s *ServerRequiredSuite) TestPutAskGetForbidden(c *C) {
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
c.Check(blocklen, Equals, int64(0))
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
c.Check(blocklen, Equals, int64(0))
-
log.Print
("Ask 2")
+
c.Log
("Ask 2")
}
{
}
{
@@
-357,7
+356,7
@@
func (s *ServerRequiredSuite) TestPutAskGetForbidden(c *C) {
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
c.Check(blocklen, Equals, int64(0))
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
c.Check(blocklen, Equals, int64(0))
-
log.Print
("Get")
+
c.Log
("Get")
}
}
}
}
@@
-372,7
+371,7
@@
func (s *ServerRequiredSuite) TestGetDisabled(c *C) {
errNotFound, _ := err.(keepclient.ErrNotFound)
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 400"), Equals, true)
errNotFound, _ := err.(keepclient.ErrNotFound)
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 400"), Equals, true)
-
log.Print
("Ask 1")
+
c.Log
("Ask 1")
}
{
}
{
@@
-380,7
+379,7
@@
func (s *ServerRequiredSuite) TestGetDisabled(c *C) {
c.Check(hash2, Matches, fmt.Sprintf(`^%s\+3(\+.+)?$`, hash))
c.Check(rep, Equals, 2)
c.Check(err, Equals, nil)
c.Check(hash2, Matches, fmt.Sprintf(`^%s\+3(\+.+)?$`, hash))
c.Check(rep, Equals, 2)
c.Check(err, Equals, nil)
-
log.Print
("PutB")
+
c.Log
("PutB")
}
{
}
{
@@
-389,7
+388,7
@@
func (s *ServerRequiredSuite) TestGetDisabled(c *C) {
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 400"), Equals, true)
c.Check(blocklen, Equals, int64(0))
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 400"), Equals, true)
c.Check(blocklen, Equals, int64(0))
-
log.Print
("Ask 2")
+
c.Log
("Ask 2")
}
{
}
{
@@
-398,7
+397,7
@@
func (s *ServerRequiredSuite) TestGetDisabled(c *C) {
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 400"), Equals, true)
c.Check(blocklen, Equals, int64(0))
c.Check(errNotFound, NotNil)
c.Assert(strings.Contains(err.Error(), "HTTP 400"), Equals, true)
c.Check(blocklen, Equals, int64(0))
-
log.Print
("Get")
+
c.Log
("Get")
}
}
}
}