diff --git a/erasure-createfile_test.go b/erasure-createfile_test.go index 2feff420e..1e90a4bb9 100644 --- a/erasure-createfile_test.go +++ b/erasure-createfile_test.go @@ -92,7 +92,7 @@ func TestErasureCreateFile(t *testing.T) { // 1 more disk down. 7 disk down in total. Should return quorum error. disks[10] = AppendDiskDown{disks[10].(*posix)} - size, _, err = erasureCreateFile(disks, "testbucket", "testobject4", bytes.NewReader(data), blockSize, dataBlocks, parityBlocks, bitRotAlgo, dataBlocks+1) + _, _, err = erasureCreateFile(disks, "testbucket", "testobject4", bytes.NewReader(data), blockSize, dataBlocks, parityBlocks, bitRotAlgo, dataBlocks+1) if err != errXLWriteQuorum { t.Errorf("erasureCreateFile returned expected errXLWriteQuorum error, got %s", err) } diff --git a/erasure-readfile_test.go b/erasure-readfile_test.go index 994c2798e..fa3c17f09 100644 --- a/erasure-readfile_test.go +++ b/erasure-readfile_test.go @@ -257,7 +257,7 @@ func TestErasureReadFileDiskFail(t *testing.T) { pool := bpool.NewBytePool(chunkSize, len(disks)) buf := &bytes.Buffer{} - size, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) + _, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) if err != nil { t.Error(err) } @@ -270,7 +270,7 @@ func TestErasureReadFileDiskFail(t *testing.T) { disks[5] = ReadDiskDown{disks[5].(*posix)} buf.Reset() - size, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) + _, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) if err != nil { t.Error(err) } @@ -285,7 +285,7 @@ func TestErasureReadFileDiskFail(t *testing.T) { disks[11] = ReadDiskDown{disks[11].(*posix)} buf.Reset() - size, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) + _, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) if err != nil { t.Error(err) } @@ -296,7 +296,7 @@ func TestErasureReadFileDiskFail(t *testing.T) { // 1 more disk down. 7 disks down in total. Read should fail. disks[12] = ReadDiskDown{disks[12].(*posix)} buf.Reset() - size, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) + _, err = erasureReadFile(buf, disks, "testbucket", "testobject", 0, length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) if err != errXLReadQuorum { t.Fatal("expected errXLReadQuorum error") } @@ -361,7 +361,7 @@ func TestErasureReadFileOffsetLength(t *testing.T) { for i, testCase := range testCases { expected := data[testCase.offset:(testCase.offset + testCase.length)] buf := &bytes.Buffer{} - size, err = erasureReadFile(buf, disks, "testbucket", "testobject", testCase.offset, testCase.length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) + _, err = erasureReadFile(buf, disks, "testbucket", "testobject", testCase.offset, testCase.length, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) if err != nil { t.Error(err) continue @@ -429,7 +429,7 @@ func TestErasureReadFileRandomOffsetLength(t *testing.T) { expected := data[offset : offset+readLen] - size, err = erasureReadFile(buf, disks, "testbucket", "testobject", offset, readLen, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) + _, err = erasureReadFile(buf, disks, "testbucket", "testobject", offset, readLen, length, blockSize, dataBlocks, parityBlocks, checkSums, bitRotAlgo, pool) if err != nil { t.Fatal(err, offset, readLen) } diff --git a/erasure-utils_test.go b/erasure-utils_test.go index fdd08ed82..c3121652b 100644 --- a/erasure-utils_test.go +++ b/erasure-utils_test.go @@ -92,6 +92,9 @@ func TestCopyBuffer(t *testing.T) { testFile := "testFile" testContent := []byte("hello, world") err = disk.AppendFile(volume, testFile, testContent) + if err != nil { + t.Fatalf("AppendFile failed: %s", err) + } testCases := []struct { writer io.Writer diff --git a/server_test.go b/server_test.go index cd0e825da..ed100cf5f 100644 --- a/server_test.go +++ b/server_test.go @@ -726,6 +726,9 @@ func (s *TestSuiteCommon) TestPutBucket(c *C) { client := http.Client{} response, err := client.Do(request) + if err != nil { + c.Fatalf("Put bucket Failed: %s", err) + } defer response.Body.Close() }() } diff --git a/signature-v4-utils_test.go b/signature-v4-utils_test.go index 92ac9627c..980aa2f4c 100644 --- a/signature-v4-utils_test.go +++ b/signature-v4-utils_test.go @@ -178,7 +178,7 @@ func TestExtractSignedHeaders(t *testing.T) { // case where the headers doesn't contain the one of the signed header in the signed headers list. signedHeaders = append(signedHeaders, " X-Amz-Credential") // expected to fail with `ErrUnsignedHeaders`. - extractedSignedHeaders, errCode = extractSignedHeaders(signedHeaders, inputHeader) + _, errCode = extractSignedHeaders(signedHeaders, inputHeader) if errCode != ErrUnsignedHeaders { t.Fatalf("Expected the APIErrorCode to %d, but got %d", ErrUnsignedHeaders, errCode) } @@ -186,7 +186,7 @@ func TestExtractSignedHeaders(t *testing.T) { // case where the list of signed headers doesn't contain the host field. signedHeaders = signedHeaders[1:] // expected to fail with `ErrUnsignedHeaders`. - extractedSignedHeaders, errCode = extractSignedHeaders(signedHeaders, inputHeader) + _, errCode = extractSignedHeaders(signedHeaders, inputHeader) if errCode != ErrUnsignedHeaders { t.Fatalf("Expected the APIErrorCode to %d, but got %d", ErrUnsignedHeaders, errCode) } diff --git a/tree-walk_test.go b/tree-walk_test.go index 2dfa7bdba..8c0dbe74f 100644 --- a/tree-walk_test.go +++ b/tree-walk_test.go @@ -336,7 +336,7 @@ func TestListDir(t *testing.T) { t.Error(err) } // None of the disks are available, should get errDiskNotFound. - entries, _, err = listDir(volume, "", "") + _, _, err = listDir(volume, "", "") if err != errDiskNotFound { t.Error("expected errDiskNotFound error.") } diff --git a/xl-v1-object_test.go b/xl-v1-object_test.go index 3a9646107..bf9e0919c 100644 --- a/xl-v1-object_test.go +++ b/xl-v1-object_test.go @@ -91,7 +91,9 @@ func TestXLDeleteObjectBasic(t *testing.T) { // Create object "obj" under bucket "bucket" for Test 7 to pass _, err = xl.PutObject("bucket", "obj", int64(len("abcd")), bytes.NewReader([]byte("abcd")), nil) - + if err != nil { + t.Fatalf("XL Object upload failed: %s", err) + } for i, test := range testCases { actualErr := xl.DeleteObject(test.bucket, test.object) if test.expectedErr != nil && actualErr != test.expectedErr {