Package v23test defines Shell, a wrapper around gosh.Shell that provides Vanadium-specific functionality such as credentials management, StartRootMountTable, and StartSyncbase.
BuildGoPkg compiles a Go package using the "go build" command and writes the resulting binary to a temporary directory, or to the -o flag location if specified. If -o is relative, it is interpreted as relative to the temporary directory. If the binary already exists at the target location, it is not rebuilt. Returns the absolute path to the binary.
func InitMain() func()
InitMain is called by v23test.TestMain; non-tests must call it early on in main(), before flags are parsed. It calls gosh.InitMain, initializes the directory used by v23test.BuildGoPkg, and returns a cleanup function.
InitMain can also be used by test developers with complex setup or teardown requirements, where v23test.TestMain is unsuitable. InitMain must be called early on in TestMain, before m.Run is called. The returned cleanup function should be called after m.Run but before os.Exit.
SkipUnlessRunningIntegrationTests should be called first thing inside of the test function body of an integration test. It causes this test to be skipped unless integration tests are being run, i.e. unless the -v23.tests flag is set. TODO(sadovsky): Switch to using -test.short. See TODO above.
TestMain calls flag.Parse and does some v23test/gosh setup work, then calls os.Exit(m.Run()). Developers with complex setup or teardown requirements may need to use InitMain instead.
Cmd wraps gosh.Cmd and provides Vanadium-specific functionality.
Clone returns a new Cmd with a copy of this Cmd's configuration.
WithCredentials returns a clone of this command, configured to use the given credentials.
Credentials represents a principal with a set of blessings. It is designed to be implementable using either the filesystem (with a credentials dir) or an external agent.
Shell wraps gosh.Shell and provides Vanadium-specific functionality.
NewShell creates a new Shell. Tests and benchmarks should pass their testing.TB; non-tests should pass nil. Ctx is the Vanadium context to use; if it's nil, NewShell will call v23.Init to create a context.
Cleanup cleans up all resources associated with this Shell. See gosh.Shell.Cleanup for detailed description.
Cmd returns a Cmd for an invocation of the named program. The given arguments are passed to the child as command-line arguments.
DebugSystemShell drops the user into a debug system shell (e.g. bash) that includes all environment variables from sh. If there is no controlling TTY, DebugSystemShell does nothing.
ForkContext creates a new context with forked credentials.
ForkCredentials creates a new Credentials (with a fresh principal) and blesses it with the given extensions and no caveats, using this principal's default blessings. Additionally, it calls SetDefaultBlessings.
func (sh *Shell) ForkCredentialsFromPrincipal(principal security.Principal, extensions ...string) *Credentials
ForkCredentialsFromPrincipal creates a new Credentials (with a fresh principal) and blesses it with the given extensions and no caveats, using the given principal's default blessings. Additionally, it calls SetDefaultBlessings.
FuncCmd returns a Cmd for an invocation of the given registered Func. The given arguments are gob-encoded in the parent process, then gob-decoded in the child and passed to the Func as parameters. To specify command-line arguments for the child invocation, append to the returned Cmd's Args.
StartRootMountTable calls StartRootMountTableWithOpts with default options.
StartRootMountTableWithOpts starts mounttabled and calls SetRoots. Returns a function that can be called to send a signal to the started process and wait for it to exit.