Skip to content

Instantly share code, notes, and snippets.

@dpgoetz
Created October 18, 2017 15:23
Show Gist options
  • Save dpgoetz/569fc2b987f7983f3c3c90b0bd972c35 to your computer and use it in GitHub Desktop.
Save dpgoetz/569fc2b987f7983f3c3c90b0bd972c35 to your computer and use it in GitHub Desktop.
func TestSwiftObjectRoundtrip(t *testing.T) {
driveRoot, err := ioutil.TempDir("", "")
require.Nil(t, err)
defer os.RemoveAll(driveRoot)
testSwiftObjectRoundtrip(&SwiftEngine{driveRoot: driveRoot, hashPathPrefix: "prefix", hashPathSuffix: "suffix"}, t)
}
func TestNurseryObjectRoundtrip(t *testing.T) {
driveRoot, err := ioutil.TempDir("", "")
require.Nil(t, err)
defer os.RemoveAll(driveRoot)
testSwiftObjectRoundtrip(&nurseryEngine{driveRoot: driveRoot, hashPathPrefix: "prefix", hashPathSuffix: "suffix"}, t)
}
func testSwiftObjectRoundtrip(swcon ObjectEngine, t *testing.T) {
vars := map[string]string{"device": "sda", "account": "a", "container": "c", "object": "o", "partition": "1"}
//swcon := &oEngine{driveRoot: driveRoot, hashPathPrefix: "prefix", hashPathSuffix: "suffix"}
var wg sync.WaitGroup
defer wg.Wait()
swo, err := swcon.New(vars, false, &wg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment