modules, v23tests: Security usability improvement

NewChildCredentials now allows you to choose the name of the child
and the caveats on the blessings

My intention is to use this to make some other v23tests use the security
model in a more idiomatic way, where individual binaries can be run with
appropriate (and distinct) blessings. I'm looking to enable code like:

func V23TestFoo(t *v23tests.T) {
   // Create credentials for the client and server such
   // that the two recognize each other.
   screds, _ := t.Shell().NewChildCredentials("server")
   ccreds, _ := t.Shell().NewChildCredentials("client")

   sbin := i.BuildV23Pkg("path/to/server")
   cbin := i.BuildV23Pkg("path/to/client")

   sbin.StartWithOpts(
     sbin.StartOpts().WithCustomCredentials(screds),
     nil,
     "arg1", "arg2")
  output := cbin.StartWithOpts(
     cbin.StartOpts().WithCustomCredentials(creds),
     nil,
     "clientargs").Output()
  // Validate output
}

While the above is still a bit verbose, it is an improvement over
the existing option that requires another library to create credentials,
doesn't allow caveats on them, writes the credentials out to a directory
(i.e., doesn't use the Shell's agent) and then requires smoething like:
v23tests.Binary.WithEnv("VEYRON_CREDENTIALS="+directory)
to use them.

Change-Id: Ia1e5317d1a0b5c90ede257c247d08e5713bbea4f
3 files changed