+
+// Write and read back a full size block
+func testPutFullBlock(t *testing.T, factory TestableVolumeFactory) {
+ v := factory(t)
+ defer v.Teardown()
+
+ if !v.Writable() {
+ return
+ }
+
+ wdata := make([]byte, BlockSize)
+ wdata[0] = 'a'
+ wdata[BlockSize-1] = 'z'
+ hash := fmt.Sprintf("%x", md5.Sum(wdata))
+ err := v.Put(hash, wdata)
+ if err != nil {
+ t.Fatal(err)
+ }
+ rdata, err := v.Get(hash)
+ if err != nil {
+ t.Error(err)
+ } else {
+ defer bufs.Put(rdata)
+ }
+ if bytes.Compare(rdata, wdata) != 0 {
+ t.Error("rdata != wdata")
+ }
+}