forked from TrueCloudLab/distribution
Remove test as S3 does not support empty directories
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
This commit is contained in:
parent
72dc264241
commit
f78d81e78a
1 changed files with 0 additions and 33 deletions
|
@ -205,39 +205,6 @@ func TestEmptyRootList(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestWalkEmptySubDirectory assures we list an empty sub directory only once when walking
|
|
||||||
// through its parent directory.
|
|
||||||
func TestWalkEmptySubDirectory(t *testing.T) {
|
|
||||||
if skipS3() != "" {
|
|
||||||
t.Skip(skipS3())
|
|
||||||
}
|
|
||||||
|
|
||||||
drv, err := s3DriverConstructor("", s3.StorageClassStandard)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected error creating rooted driver: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// create an empty sub directory.
|
|
||||||
s3driver := drv.StorageDriver.(*driver)
|
|
||||||
if _, err := s3driver.S3.PutObject(&s3.PutObjectInput{
|
|
||||||
Bucket: aws.String(os.Getenv("S3_BUCKET")),
|
|
||||||
Key: aws.String("/testdir/emptydir/"),
|
|
||||||
}); err != nil {
|
|
||||||
t.Fatalf("error creating empty directory: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
bucketFiles := []string{}
|
|
||||||
s3driver.Walk(context.Background(), "/testdir", func(fileInfo storagedriver.FileInfo) error {
|
|
||||||
bucketFiles = append(bucketFiles, fileInfo.Path())
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
|
|
||||||
expected := []string{"/testdir/emptydir"}
|
|
||||||
if !reflect.DeepEqual(bucketFiles, expected) {
|
|
||||||
t.Errorf("expecting files %+v, found %+v instead", expected, bucketFiles)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestStorageClass(t *testing.T) {
|
func TestStorageClass(t *testing.T) {
|
||||||
if skipS3() != "" {
|
if skipS3() != "" {
|
||||||
t.Skip(skipS3())
|
t.Skip(skipS3())
|
||||||
|
|
Loading…
Reference in a new issue