test: add World.NewPermanode

Change-Id: I737ae2f69b567eaebf13a3f7c786e06b791e2f7c
This commit is contained in:
Brad Fitzpatrick 2014-02-04 18:49:15 -08:00
parent dfce3b3f72
commit 78c50e8151
1 changed files with 11 additions and 0 deletions

View File

@ -28,9 +28,11 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
"camlistore.org/pkg/blob"
"camlistore.org/pkg/osutil"
)
@ -163,6 +165,15 @@ func (w *World) Stop() {
}
}
func (w *World) NewPermanode(t *testing.T) blob.Ref {
out := MustRunCmd(t, w.Cmd("camput", "permanode"))
br, ok := blob.Parse(strings.TrimSpace(out))
if !ok {
t.Fatalf("Expected permanode in camput stdout; got %q", out)
}
return br
}
func (w *World) Cmd(binary string, args ...string) *exec.Cmd {
return w.CmdWithEnv(binary, os.Environ(), args...)
}