Example #1
0
func TestUpgradedFileBucket(t *testing.T) {
	b := &TestBucket{
		bucket: testutil.Upgrade(testutil.TempFileBucket("UpgradedFileBucket")),
		t:      t,
	}
	b.allTests()
}
Example #2
0
func TestFSPut(t *testing.T) {
	fsBucket = testutil.Upgrade(testutil.TempFileBucket("FSPutGet"))

	_, err := Put(fsBucket, testutil.TempDir, []string{"data"})
	if err != nil {
		t.Fatalf("Put failed: %s", err)
	}
	fsPutOk = true
}
Example #3
0
func TestUpgradedS3Bucket(t *testing.T) {
	if testutil.SkipS3 {
		t.SkipNow()
	}
	b := &TestBucket{
		bucket: testutil.Upgrade(testutil.TempS3Bucket("UpgradedS3Bucket")),
		t:      t,
	}
	b.allTests()
}
Example #4
0
func TestS3Put(t *testing.T) {
	if testutil.SkipS3 {
		t.SkipNow()
	}

	s3Bucket = testutil.Upgrade(testutil.TempS3Bucket("S3PutGet"))

	_, err := Put(s3Bucket, testutil.TempDir, []string{"data"})
	if err != nil {
		t.Fatalf("Put failed: %s", err)
	}
	s3PutOk = true
}
Example #5
0
func BenchmarkS3Put(b *testing.B) {
	if testutil.SkipS3 {
		b.SkipNow()
	}

	benchBucket = testutil.Upgrade(testutil.TempS3Bucket("BenchmarkPutS3"))

	for i := 0; i < b.N; i++ {
		n, err := Put(benchBucket, testutil.TempDir, []string{"data"})
		if err != nil {
			b.Fatalf("Put failed: %s", err)
		}
		b.SetBytes(n)
	}
	benchPutOk = true
}