veyron/security/agent: Use already generated TestMain instead of
TestHelperProcess.
Now only 4 uses of TestHelperProcess/DispatchInTest remain, but removing
these seem to be a bit more involved.
Change-Id: I0b7511cb60876ea4ca7c892d856b452783660e06
diff --git a/security/agent/agent_test.go b/security/agent/agent_test.go
index 9237f50..b2061dd 100644
--- a/security/agent/agent_test.go
+++ b/security/agent/agent_test.go
@@ -23,13 +23,7 @@
"v.io/core/veyron2/security"
)
-func init() {
- modules.RegisterChild("hang", "", getPrincipalAndHang)
-}
-
-func TestHelperProcess(t *testing.T) {
- modules.DispatchInTest()
-}
+//go:generate v23 test generate
func getPrincipalAndHang(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
ctx, shutdown := testutil.InitForTest()
@@ -153,7 +147,7 @@
t.Fatal(err)
}
// The child process will connect to the agent
- h, err := sh.Start("hang", nil)
+ h, err := sh.Start("getPrincipalAndHang", nil)
if err != nil {
t.Fatal(err)
}