diff --git a/pkg/test/world.go b/pkg/test/world.go index a0b050f77..ee88f6bb2 100644 --- a/pkg/test/world.go +++ b/pkg/test/world.go @@ -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...) }