dstConfig.APIToken = os.Getenv("ARVADOS_API_TOKEN")
dstConfig.APIHostInsecure = matchTrue.MatchString(os.Getenv("ARVADOS_API_HOST_INSECURE"))
- replications = 1
if enforcePermissions {
blobSigningKey = "zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc"
}
// Create two more keep servers to be used as destination
arvadostest.StartKeepWithParams(true, enforcePermissions)
- // load kcDst
+ // load kcDst; set Want_replicas as 1 since that is how many keep servers are created for dst.
kcDst, err = keepclient.MakeKeepClient(&arvDst)
c.Assert(err, Equals, nil)
kcDst.Want_replicas = 1
c.Assert(err.Error(), Equals, "Block not found")
}
+// Test keep-rsync initialization with default replications count
+func (s *ServerRequiredSuite) TestInitializeRsyncDefaultReplicationsCount(c *C) {
+ setupRsync(c, false)
+
+ // Must have got default replications value as 2 from dst discovery document
+ c.Assert(replications, Equals, 2)
+}
+
+// Test keep-rsync initialization with replications count argument
+func (s *ServerRequiredSuite) TestInitializeRsyncReplicationsCount(c *C) {
+ // set replications to 3 to mimic passing input argument
+ replications = 3
+
+ setupRsync(c, false)
+
+ // Since replications value is provided, default is not used
+ c.Assert(replications, Equals, 3)
+}
+
// Put some blocks in Src and some more in Dst
// And copy missing blocks from Src to Dst
func (s *ServerRequiredSuite) TestKeepRsync(c *C) {