Uses random paths with slashes for storagedriver tests, adds edge cases

This replaces only using flat filenames, to better test nested file
behaviors.
Fixed inmemory/mfs.go and filesystem/driver.go after finding bugs with
the new tests and test behavior.
This commit is contained in:
Brian Bland 2014-12-08 18:22:08 -08:00
parent 9e38ca2231
commit cacf33ab62
3 changed files with 186 additions and 59 deletions

View file

@ -203,6 +203,10 @@ func (d *Driver) Move(sourcePath string, destPath string) error {
return storagedriver.PathNotFoundError{Path: sourcePath}
}
if err := os.MkdirAll(path.Dir(dest), 0755); err != nil {
return err
}
err := os.Rename(source, dest)
return err
}