diff --git a/Makefile b/Makefile index 4bccce60f..d59ec2e0a 100644 --- a/Makefile +++ b/Makefile @@ -13,36 +13,27 @@ getdeps: checkdeps build-utils: @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/cpu @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/unitconv - -build-crypto: - @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/crypto/md5/ - @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/crypto/sha1/ - @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/crypto/sha256/ - @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/crypto/sha512/ - -build-checksum: - @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/checksum/crc32c + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/split + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/md5/ + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/sha1/ + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/sha256/ + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/sha512/ + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/checksum/crc32c build-os: @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/os/scsi @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/os/sysctl -build-fileutils: build-utils - @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/fileutils/split - -build-storage: build-erasure build-storage-append build-storage-encoded - -build-erasure: +build-storage: @$(MAKE) $(MAKE_OPTIONS) -C pkg/storage/erasure/isal lib @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/storage/erasure - -build-storage-append: @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/storage/appendstorage - -build-storage-encoded: @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/storage/encodedstorage -cover: build-fileutils build-checksum build-os build-storage build-crypto +build-server: + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/server + +cover: build-storage build-os build-server build-utils install: cover @@ -56,5 +47,7 @@ env: @godep go env clean: + @echo "Cleaning up all the generated files" @$(MAKE) $(MAKE_OPTIONS) -C pkg/storage/erasure/isal clean - @rm -v cover.out + @rm -fv pkg/utils/split/TESTPREFIX.* + @rm -fv cover.out diff --git a/pkg/fileutils/split/Makefile b/pkg/fileutils/split/Makefile deleted file mode 100644 index de67111fb..000000000 --- a/pkg/fileutils/split/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -all: build test -.PHONY: all - -build: - @godep go build - -test: build - @godep go test -race -coverprofile=cover.out - -clean: - @rm -fv NEWFILE TESTPREFIX.* cover.out diff --git a/pkg/gateway/gateway.go b/pkg/server/server.go similarity index 99% rename from pkg/gateway/gateway.go rename to pkg/server/server.go index 4fd3c0b22..003b84722 100644 --- a/pkg/gateway/gateway.go +++ b/pkg/server/server.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package gateway +package server import ( "bytes" diff --git a/pkg/gateway/gateway_test.go b/pkg/server/server_test.go similarity index 99% rename from pkg/gateway/gateway_test.go rename to pkg/server/server_test.go index 53f9a918b..8433ed9a3 100644 --- a/pkg/gateway/gateway_test.go +++ b/pkg/server/server_test.go @@ -1,4 +1,4 @@ -package gateway +package server import ( "io/ioutil" diff --git a/pkg/storage/appendstorage/append_storage.go b/pkg/storage/appendstorage/append_storage.go index dbf8542f0..a44ca50fc 100644 --- a/pkg/storage/appendstorage/append_storage.go +++ b/pkg/storage/appendstorage/append_storage.go @@ -27,8 +27,8 @@ import ( "strconv" "strings" - "github.com/minio-io/minio/pkg/checksum/crc32c" "github.com/minio-io/minio/pkg/storage" + "github.com/minio-io/minio/pkg/utils/checksum/crc32c" ) type appendStorage struct { diff --git a/pkg/storage/encodedstorage/encoded_storage.go b/pkg/storage/encodedstorage/encoded_storage.go index c731a415f..8ab304644 100644 --- a/pkg/storage/encodedstorage/encoded_storage.go +++ b/pkg/storage/encodedstorage/encoded_storage.go @@ -29,10 +29,10 @@ import ( "strconv" "strings" - "github.com/minio-io/minio/pkg/fileutils/split" "github.com/minio-io/minio/pkg/storage" "github.com/minio-io/minio/pkg/storage/appendstorage" "github.com/minio-io/minio/pkg/storage/erasure" + "github.com/minio-io/minio/pkg/utils/split" "github.com/spaolacci/murmur3" ) diff --git a/pkg/checksum/crc32c/Makefile b/pkg/utils/checksum/crc32c/Makefile similarity index 100% rename from pkg/checksum/crc32c/Makefile rename to pkg/utils/checksum/crc32c/Makefile diff --git a/pkg/checksum/crc32c/asm.S b/pkg/utils/checksum/crc32c/asm.S similarity index 100% rename from pkg/checksum/crc32c/asm.S rename to pkg/utils/checksum/crc32c/asm.S diff --git a/pkg/checksum/crc32c/crc32c.go b/pkg/utils/checksum/crc32c/crc32c.go similarity index 100% rename from pkg/checksum/crc32c/crc32c.go rename to pkg/utils/checksum/crc32c/crc32c.go diff --git a/pkg/checksum/crc32c/crc32c_amd64.S b/pkg/utils/checksum/crc32c/crc32c_amd64.S similarity index 100% rename from pkg/checksum/crc32c/crc32c_amd64.S rename to pkg/utils/checksum/crc32c/crc32c_amd64.S diff --git a/pkg/checksum/crc32c/crc32c_test.go b/pkg/utils/checksum/crc32c/crc32c_test.go similarity index 100% rename from pkg/checksum/crc32c/crc32c_test.go rename to pkg/utils/checksum/crc32c/crc32c_test.go diff --git a/pkg/checksum/crc32c/doc.go b/pkg/utils/checksum/crc32c/doc.go similarity index 100% rename from pkg/checksum/crc32c/doc.go rename to pkg/utils/checksum/crc32c/doc.go diff --git a/pkg/crypto/md5/md5.go b/pkg/utils/crypto/md5/md5.go similarity index 100% rename from pkg/crypto/md5/md5.go rename to pkg/utils/crypto/md5/md5.go diff --git a/pkg/crypto/md5/md5_test.go b/pkg/utils/crypto/md5/md5_test.go similarity index 100% rename from pkg/crypto/md5/md5_test.go rename to pkg/utils/crypto/md5/md5_test.go diff --git a/pkg/crypto/sha1/TODO b/pkg/utils/crypto/sha1/TODO similarity index 100% rename from pkg/crypto/sha1/TODO rename to pkg/utils/crypto/sha1/TODO diff --git a/pkg/crypto/sha1/asm.S b/pkg/utils/crypto/sha1/asm.S similarity index 100% rename from pkg/crypto/sha1/asm.S rename to pkg/utils/crypto/sha1/asm.S diff --git a/pkg/crypto/sha1/sha1.go b/pkg/utils/crypto/sha1/sha1.go similarity index 100% rename from pkg/crypto/sha1/sha1.go rename to pkg/utils/crypto/sha1/sha1.go diff --git a/pkg/crypto/sha1/sha1_amd64.S b/pkg/utils/crypto/sha1/sha1_amd64.S similarity index 100% rename from pkg/crypto/sha1/sha1_amd64.S rename to pkg/utils/crypto/sha1/sha1_amd64.S diff --git a/pkg/crypto/sha1/sha1_test.go b/pkg/utils/crypto/sha1/sha1_test.go similarity index 100% rename from pkg/crypto/sha1/sha1_test.go rename to pkg/utils/crypto/sha1/sha1_test.go diff --git a/pkg/crypto/sha256/TODO b/pkg/utils/crypto/sha256/TODO similarity index 100% rename from pkg/crypto/sha256/TODO rename to pkg/utils/crypto/sha256/TODO diff --git a/pkg/crypto/sha256/asm.S b/pkg/utils/crypto/sha256/asm.S similarity index 100% rename from pkg/crypto/sha256/asm.S rename to pkg/utils/crypto/sha256/asm.S diff --git a/pkg/crypto/sha256/sha256-avx-asm.S b/pkg/utils/crypto/sha256/sha256-avx-asm.S similarity index 100% rename from pkg/crypto/sha256/sha256-avx-asm.S rename to pkg/utils/crypto/sha256/sha256-avx-asm.S diff --git a/pkg/crypto/sha256/sha256-avx2-asm.S b/pkg/utils/crypto/sha256/sha256-avx2-asm.S similarity index 100% rename from pkg/crypto/sha256/sha256-avx2-asm.S rename to pkg/utils/crypto/sha256/sha256-avx2-asm.S diff --git a/pkg/crypto/sha256/sha256-ssse3-asm.S b/pkg/utils/crypto/sha256/sha256-ssse3-asm.S similarity index 100% rename from pkg/crypto/sha256/sha256-ssse3-asm.S rename to pkg/utils/crypto/sha256/sha256-ssse3-asm.S diff --git a/pkg/crypto/sha256/sha256.go b/pkg/utils/crypto/sha256/sha256.go similarity index 100% rename from pkg/crypto/sha256/sha256.go rename to pkg/utils/crypto/sha256/sha256.go diff --git a/pkg/crypto/sha256/sha256_test.go b/pkg/utils/crypto/sha256/sha256_test.go similarity index 100% rename from pkg/crypto/sha256/sha256_test.go rename to pkg/utils/crypto/sha256/sha256_test.go diff --git a/pkg/crypto/sha512/TODO b/pkg/utils/crypto/sha512/TODO similarity index 100% rename from pkg/crypto/sha512/TODO rename to pkg/utils/crypto/sha512/TODO diff --git a/pkg/crypto/sha512/asm.S b/pkg/utils/crypto/sha512/asm.S similarity index 100% rename from pkg/crypto/sha512/asm.S rename to pkg/utils/crypto/sha512/asm.S diff --git a/pkg/crypto/sha512/sha512-avx-asm.S b/pkg/utils/crypto/sha512/sha512-avx-asm.S similarity index 100% rename from pkg/crypto/sha512/sha512-avx-asm.S rename to pkg/utils/crypto/sha512/sha512-avx-asm.S diff --git a/pkg/crypto/sha512/sha512-avx2-asm.S b/pkg/utils/crypto/sha512/sha512-avx2-asm.S similarity index 100% rename from pkg/crypto/sha512/sha512-avx2-asm.S rename to pkg/utils/crypto/sha512/sha512-avx2-asm.S diff --git a/pkg/crypto/sha512/sha512-ssse3-asm.S b/pkg/utils/crypto/sha512/sha512-ssse3-asm.S similarity index 100% rename from pkg/crypto/sha512/sha512-ssse3-asm.S rename to pkg/utils/crypto/sha512/sha512-ssse3-asm.S diff --git a/pkg/crypto/sha512/sha512.go b/pkg/utils/crypto/sha512/sha512.go similarity index 100% rename from pkg/crypto/sha512/sha512.go rename to pkg/utils/crypto/sha512/sha512.go diff --git a/pkg/crypto/sha512/sha512_test.go b/pkg/utils/crypto/sha512/sha512_test.go similarity index 100% rename from pkg/crypto/sha512/sha512_test.go rename to pkg/utils/crypto/sha512/sha512_test.go diff --git a/pkg/fileutils/split/.gitignore b/pkg/utils/split/.gitignore similarity index 100% rename from pkg/fileutils/split/.gitignore rename to pkg/utils/split/.gitignore diff --git a/pkg/fileutils/split/split.go b/pkg/utils/split/split.go similarity index 100% rename from pkg/fileutils/split/split.go rename to pkg/utils/split/split.go diff --git a/pkg/fileutils/split/split_test.go b/pkg/utils/split/split_test.go similarity index 93% rename from pkg/fileutils/split/split_test.go rename to pkg/utils/split/split_test.go index 6ef7663a0..1a7314ec4 100644 --- a/pkg/fileutils/split/split_test.go +++ b/pkg/utils/split/split_test.go @@ -52,9 +52,9 @@ func (s *MySuite) TestSplitStream(c *C) { } func (s *MySuite) TestFileSplitJoin(c *C) { - err := SplitFileWithPrefix("TESTFILE", 1024, "TESTPREFIX") + err := SplitFileWithPrefix("test-data/TESTFILE", 1024, "TESTPREFIX") c.Assert(err, IsNil) - err = SplitFileWithPrefix("TESTFILE", 1024, "") + err = SplitFileWithPrefix("test-data/TESTFILE", 1024, "") c.Assert(err, Not(IsNil)) devnull, err := os.OpenFile(os.DevNull, 2, os.ModeAppend) diff --git a/pkg/fileutils/split/TESTFILE b/pkg/utils/split/test-data/TESTFILE similarity index 100% rename from pkg/fileutils/split/TESTFILE rename to pkg/utils/split/test-data/TESTFILE