-/*
- Create a collection with multiple streams and blocks using arv-put
- Generated manifest will be for the format:
- ./stream034036412 ae1426cd6bb371ffd4e8eedf5e9f8288+265+A28b017187d22154d8ae2836d5644312196ddede9@565f7801 0:53:temp-test-file101128526 53:53:temp-test-file525370191 106:53:temp-test-file767521515 159:53:temp-test-file914425264 212:53:temp-test-file989413461
- ./stream043441762 2b421156d2751447d6fa22fda6742769+265+A4766df9d5a455d76ec3fbd5d1ceea6ab1207967d@565f7801 0:53:temp-test-file016029341 53:53:temp-test-file546920630 106:53:temp-test-file688432627 159:53:temp-test-file823040996 212:53:temp-test-file843401817
-*/
-func createMultiStreamBlockCollection(t *testing.T, data string, numStreams, numBlocks int) string {
- tempdir, err := ioutil.TempDir(os.TempDir(), "temp-test-dir")
- if err != nil {
- t.Fatalf("Error creating tempdir %s", err)
- }
- defer os.Remove(tempdir)
-
- for i := 0; i < numStreams; i++ {
- stream, err := ioutil.TempDir(tempdir, "stream")
- if err != nil {
- t.Fatalf("Error creating stream tempdir %s", err)
- }
- defer os.Remove(stream)
-
- for j := 0; j < numBlocks; j++ {
- tempfile, err := ioutil.TempFile(stream, "temp-test-file")
- if err != nil {
- t.Fatalf("Error creating tempfile %s", err)
- }
- defer os.Remove(tempfile.Name())
-
- _, err = tempfile.Write([]byte(fmt.Sprintf("%s%d", data, i)))
- if err != nil {
- t.Fatalf("Error writing to tempfile %v", err)
- }
- }
- }
-
- output, err := exec.Command("arv-put", tempdir).Output()
- if err != nil {
- t.Fatalf("Error running arv-put %s", err)
- }
-
- uuid := string(output[0:27]) // trim terminating char
- return uuid