10281: Test default replication=1 for directory volumes.
authorTom Clegg <tom@curoverse.com>
Mon, 17 Oct 2016 12:26:26 +0000 (08:26 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 17 Oct 2016 12:26:26 +0000 (08:26 -0400)
services/keepstore/volume_unix_test.go

index ac0a492f06a46bf790fd8fae0cff07de7dac2000..887247d3c3956e9475edf8437c913b3e1fc922c9 100644 (file)
@@ -101,6 +101,19 @@ func TestUnixVolumeHandlersWithGenericVolumeTests(t *testing.T) {
        })
 }
 
+func TestReplicationDefault1(t *testing.T) {
+       v := &UnixVolume{
+               Root:     "/",
+               ReadOnly: true,
+       }
+       if err := v.Start(); err != nil {
+               t.Error(err)
+       }
+       if got := v.Replication(); got != 1 {
+               t.Errorf("Replication() returned %d, expected 1 if no config given", got)
+       }
+}
+
 func TestGetNotFound(t *testing.T) {
        v := NewTestableUnixVolume(t, false, false)
        defer v.Teardown()