veyron/services/mgmt: Remove unnecessary calls to CredentialsForChild.
Change-Id: Id57a205b91b4fd04dcaf885e7da68059484e9147
diff --git a/services/mgmt/application/impl/acl_test.go b/services/mgmt/application/impl/acl_test.go
index aae2619..2f5b710 100644
--- a/services/mgmt/application/impl/acl_test.go
+++ b/services/mgmt/application/impl/acl_test.go
@@ -104,11 +104,7 @@
t.Fatal(err)
}
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "repo")
- defer os.RemoveAll(crDir)
-
- // Make server credentials derived from the test harness.
- _, nms := mgmttest.RunShellCommand(t, sh, crEnv, repoCmd, "repo", storedir)
+ _, nms := mgmttest.RunShellCommand(t, sh, nil, repoCmd, "repo", storedir)
pid := mgmttest.ReadPID(t, nms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -239,11 +235,7 @@
t.Fatal(err)
}
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "repo")
- defer os.RemoveAll(crDir)
-
- // Make a server with the same credential as test harness.
- _, nms := mgmttest.RunShellCommand(t, sh, crEnv, repoCmd, "repo", storedir)
+ _, nms := mgmttest.RunShellCommand(t, sh, nil, repoCmd, "repo", storedir)
pid := mgmttest.ReadPID(t, nms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -372,8 +364,6 @@
if err := idp.Bless(veyron2.GetPrincipal(ctx), "self"); err != nil {
t.Fatal(err)
}
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "repo")
- defer os.RemoveAll(crDir)
// Make an TAM for use on the command line.
expected := access.TaggedACLMap{
@@ -389,8 +379,7 @@
t.Fatal(err)
}
- // Start a server with the same credential as test harness.
- _, nms := mgmttest.RunShellCommand(t, sh, crEnv, repoCmd, "--veyron.acl.literal", b.String(), "repo", storedir)
+ _, nms := mgmttest.RunShellCommand(t, sh, nil, repoCmd, "--veyron.acl.literal", b.String(), "repo", storedir)
pid := mgmttest.ReadPID(t, nms)
defer syscall.Kill(pid, syscall.SIGINT)
diff --git a/services/mgmt/device/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
index 79957c6..72402e9 100644
--- a/services/mgmt/device/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -567,12 +567,9 @@
// Create a script wrapping the test target that implements suidhelper.
helperPath := generateSuidHelperScript(t, root)
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crDir)
-
// Set up the device manager. Since we won't do device manager updates,
// don't worry about its application envelope and current link.
- dmh, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
+ dmh, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
mgmttest.ReadPID(t, dms)
// Create the local server that the app uses to let us know it's ready.
@@ -812,15 +809,12 @@
root, cleanup := mgmttest.SetupRootDir(t, "devicemanager")
defer cleanup()
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crDir)
-
// Create a script wrapping the test target that implements suidhelper.
helperPath := generateSuidHelperScript(t, root)
// Set up the device manager. Since we won't do device manager updates,
// don't worry about its application envelope and current link.
- _, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
+ _, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
pid := mgmttest.ReadPID(t, dms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -906,12 +900,9 @@
t.Fatal(err)
}
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crDir)
-
// Set up the device manager. Since we won't do device manager updates,
// don't worry about its application envelope and current link.
- _, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "dm", root, "unused_helper", "unused_app_repo_name", "unused_curr_link")
+ _, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "dm", root, "unused_helper", "unused_app_repo_name", "unused_curr_link")
pid := mgmttest.ReadPID(t, dms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -1052,15 +1043,12 @@
root, cleanup := mgmttest.SetupRootDir(t, "devicemanager")
defer cleanup()
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crDir)
-
// Create a script wrapping the test target that implements suidhelper.
helperPath := generateSuidHelperScript(t, root)
// Set up the device manager. Since we won't do device manager updates,
// don't worry about its application envelope and current link.
- _, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
+ _, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
pid := mgmttest.ReadPID(t, dms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -1222,15 +1210,12 @@
root, cleanup := mgmttest.SetupRootDir(t, "devicemanager")
defer cleanup()
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crDir)
-
// Create a script wrapping the test target that implements suidhelper.
helperPath := generateSuidHelperScript(t, root)
// Set up the device manager. Since we won't do device manager updates,
// don't worry about its application envelope and current link.
- _, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
+ _, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
pid := mgmttest.ReadPID(t, dms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -1308,10 +1293,8 @@
if err := idp.Bless(veyron2.GetPrincipal(otherCtx), "other"); err != nil {
t.Fatal(err)
}
- crFile, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crFile)
- _, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "dm", root, "unused_helper", "unused_app_repo_name", "unused_curr_link")
+ _, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "dm", root, "unused_helper", "unused_app_repo_name", "unused_curr_link")
pid := mgmttest.ReadPID(t, dms)
defer syscall.Kill(pid, syscall.SIGINT)
@@ -1418,13 +1401,10 @@
t.Fatal(err)
}
- crDir, crEnv := mgmttest.CredentialsForChild(ctx, "devicemanager")
- defer os.RemoveAll(crDir)
-
// Create a script wrapping the test target that implements suidhelper.
helperPath := generateSuidHelperScript(t, root)
- _, dms := mgmttest.RunShellCommand(t, sh, crEnv, deviceManagerCmd, "-mocksetuid", "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
+ _, dms := mgmttest.RunShellCommand(t, sh, nil, deviceManagerCmd, "-mocksetuid", "dm", root, helperPath, "unused_app_repo_name", "unused_curr_link")
pid := mgmttest.ReadPID(t, dms)
defer syscall.Kill(pid, syscall.SIGINT)