[ARVADOS] updated: 78b5bfcb1fa832e4460cfaa41f7815ce1d07a9a4

git at public.curoverse.com git at public.curoverse.com
Wed Apr 23 22:36:25 EDT 2014


Summary of changes:
 services/keep/src/keep/volume_test.go |   37 ++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 16 deletions(-)

       via  78b5bfcb1fa832e4460cfaa41f7815ce1d07a9a4 (commit)
      from  93db9aecb724964a37474104243a6d619b56769f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 78b5bfcb1fa832e4460cfaa41f7815ce1d07a9a4
Author: Tim Pierce <twp at curoverse.com>
Date:   Wed Apr 23 22:35:58 2014 -0400

    Updated UnixVolume unit tests (refs #2620).

diff --git a/services/keep/src/keep/volume_test.go b/services/keep/src/keep/volume_test.go
index 7e3a42e..9248627 100644
--- a/services/keep/src/keep/volume_test.go
+++ b/services/keep/src/keep/volume_test.go
@@ -6,6 +6,7 @@ import (
 	"io/ioutil"
 	"os"
 	"testing"
+	"time"
 )
 
 func TempUnixVolume(t *testing.T) UnixVolume {
@@ -68,22 +69,6 @@ func TestReadNotFound(t *testing.T) {
 	}
 }
 
-func TestReadCorrupt(t *testing.T) {
-	v := TempUnixVolume(t)
-	defer _teardown(v)
-	_store(t, v, TEST_HASH, BAD_BLOCK)
-
-	buf, err := v.Read(TEST_HASH)
-	switch err {
-	case CorruptError:
-		break
-	case nil:
-		t.Errorf("Read should have failed, returned %s", string(buf))
-	default:
-		t.Error(err)
-	}
-}
-
 func TestWrite(t *testing.T) {
 	v := TempUnixVolume(t)
 	defer _teardown(v)
@@ -111,3 +96,23 @@ func TestWriteBadVolume(t *testing.T) {
 		t.Error("Write should have failed")
 	}
 }
+
+func TestIsFull(t *testing.T) {
+	v := TempUnixVolume(t)
+	defer _teardown(v)
+
+	full_path := v.root + "/full"
+	now := fmt.Sprintf("%d", time.Now().Unix())
+	os.Symlink(now, full_path)
+	if !v.IsFull() {
+		t.Errorf("%s: claims not to be full", v)
+	}
+	os.Remove(full_path)
+
+	// Test with an expired /full link.
+	expired := fmt.Sprintf("%d", time.Now().Unix()-3605)
+	os.Symlink(expired, full_path)
+	if v.IsFull() {
+		t.Errorf("%s: should no longer be full", v)
+	}
+}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list