7329: It appears that UnixVolume -> Compare method is falling in infinite loop due...
authorradhika <radhika@curoverse.com>
Thu, 17 Sep 2015 19:03:59 +0000 (15:03 -0400)
committerradhika <radhika@curoverse.com>
Thu, 17 Sep 2015 19:03:59 +0000 (15:03 -0400)
commitc447d4a79f653bbf2c172a0a715d30db896a4a32
treeaff7b5a2e56b24005f4eca32ea07b348229dacf2
parentd1327f9456b561c059c18c76f63391728ce1780d
7329: It appears that UnixVolume -> Compare method is falling in infinite loop due to the fact that EOF is not returned when reading an empty file.
Due to this, PutBlock for an EmptyHash is resulting in infinite loop when an EmptyBlock already exists in Keep.
Added a quick fix in the Compare method for unix volume implementation. We can try to see why EOF is not returned and put in a better fix,
but for the time being this helps with unblocking tests.

Added several tests for empty block. Most importantly, added an keep integration test with UnixVolume so that we have integration tests covering some
of these code paths. More tests are definitely called for in this intergration test for better code coverage.

Also did gofmt and golint updates.
services/keepstore/collision.go
services/keepstore/keepstore.go
services/keepstore/keepstore_integration_unix_volume_test.go [new file with mode: 0644]
services/keepstore/keepstore_test.go
services/keepstore/mock_mutex_for_test.go
services/keepstore/volume_unix.go
services/keepstore/volume_unix_test.go