X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9a2bed0f3878e1332f800987292f9ec4316bd9a7..62817f027167fbe5fc5b66bbdc04261da16fe3ef:/tools/keep-rsync/keep-rsync_test.go diff --git a/tools/keep-rsync/keep-rsync_test.go b/tools/keep-rsync/keep-rsync_test.go index 60bc90acff..e728890388 100644 --- a/tools/keep-rsync/keep-rsync_test.go +++ b/tools/keep-rsync/keep-rsync_test.go @@ -4,6 +4,7 @@ import ( "crypto/md5" "fmt" "io/ioutil" + "log" "os" "strings" "testing" @@ -327,7 +328,8 @@ func (s *ServerRequiredSuite) TestErrorDuringRsync_FakeSrcKeepservers(c *C) { setupRsync(c, false, 1) err := performKeepRsync(kcSrc, kcDst, "", "") - c.Check(strings.HasSuffix(err.Error(), "no such host"), Equals, true) + log.Printf("Err = %v", err) + c.Check(strings.Contains(err.Error(), "no such host"), Equals, true) } // Setup rsync using dstKeepServicesJSON with fake keepservers. @@ -338,7 +340,8 @@ func (s *ServerRequiredSuite) TestErrorDuringRsync_FakeDstKeepservers(c *C) { setupRsync(c, false, 1) err := performKeepRsync(kcSrc, kcDst, "", "") - c.Check(strings.HasSuffix(err.Error(), "no such host"), Equals, true) + log.Printf("Err = %v", err) + c.Check(strings.Contains(err.Error(), "no such host"), Equals, true) } // Test rsync with signature error during Get from src. @@ -366,7 +369,7 @@ func (s *ServerRequiredSuite) TestErrorDuringRsync_ErrorPuttingBlockInDst(c *C) kcDst.Want_replicas = 2 err := performKeepRsync(kcSrc, kcDst, blobSigningKey, "") - c.Check(strings.HasSuffix(err.Error(), "Could not write sufficient replicas"), Equals, true) + c.Check(strings.Contains(err.Error(), "Could not write sufficient replicas"), Equals, true) } // Test loadConfig func @@ -410,7 +413,7 @@ func (s *ServerNotRequiredSuite) TestLoadConfig_MissingSrcConfig(c *C) { // Test loadConfig func - error reading config func (s *ServerNotRequiredSuite) TestLoadConfig_ErrorLoadingSrcConfig(c *C) { _, _, err := loadConfig("no-such-config-file") - c.Assert(strings.HasSuffix(err.Error(), "no such file or directory"), Equals, true) + c.Assert(strings.Contains(err.Error(), "no such file or directory"), Equals, true) } func setupConfigFile(c *C, name string) *os.File {