// GetBlock tests.
// ========================================
-// Test simple block reads.
+// TestGetBlockOK
+// Test that a simple block read can be executed successfully.
+//
func TestGetBlockOK(t *testing.T) {
defer teardown()
}
}
-// Test block reads when one Keep volume is missing.
+// TestGetBlockOneKeepOK
+// Test that block reads succeed even when the block is found only
+// on one Keep volume.
+//
func TestGetBlockOneKeepOK(t *testing.T) {
defer teardown()
}
}
-// Test block read failure.
-func TestGetBlockFail(t *testing.T) {
+// TestGetBlockMissing
+// GetBlock must return an error when the block is not found.
+//
+func TestGetBlockMissing(t *testing.T) {
defer teardown()
// Create two empty test Keep volumes.
}
}
-// Test reading a corrupt block.
+// TestGetBlockCorrupt
+// GetBlock must return an error when a corrupted block is requested
+// (the contents of the file do not checksum to its hash).
+//
func TestGetBlockCorrupt(t *testing.T) {
defer teardown()
// PutBlock tests
// ========================================
-// Test simple block stores.
-
+// TestPutBlockOK
+// PutBlock can perform a simple block write and returns success.
+//
func TestPutBlockOK(t *testing.T) {
defer teardown()
}
}
-// Test storing a block when only one volume (of many) is not available.
+// TestPutBlockOneVol
+// PutBlock still returns success even when only one of the known
+// volumes is online.
+//
func TestPutBlockOneVol(t *testing.T) {
defer teardown()
}
}
-// Test finding Keep volumes.
+// TestFindKeepVolumes
+// Confirms that FindKeepVolumes finds tmpfs volumes with "/keep"
+// directories at the top level.
+//
func TestFindKeepVolumes(t *testing.T) {
defer teardown()
}
}
-// Test that FindKeepVolumes returns an empty slice when no Keep volumes
-// are present.
+// TestFindKeepVolumesFail
+// When no Keep volumes are present, FindKeepVolumes returns an empty slice.
+//
func TestFindKeepVolumesFail(t *testing.T) {
defer teardown()
}
}
+// ========================================
+// Helper functions for unit tests.
+// ========================================
+
// setup
// Create KeepVolumes for testing.
// Returns a slice of pathnames to temporary Keep volumes.