(cmd string, args []string, asPrimary bool)
| 390 | } |
| 391 | |
| 392 | func startNode(cmd string, args []string, asPrimary bool) (pid int, err error) { |
| 393 | ncmd := exec.Command(cmd, args...) |
| 394 | // When using Ctrl-C on test, children (restored daemons) should not be |
| 395 | // killed as well. |
| 396 | // (see: https://groups.google.com/forum/#!topic/golang-nuts/shST-SDqIp4) |
| 397 | ncmd.SysProcAttr = &syscall.SysProcAttr{ |
| 398 | Setpgid: true, |
| 399 | } |
| 400 | if asPrimary { |
| 401 | // Sets the environment variable to start as primary proxy to true |
| 402 | environ := os.Environ() |
| 403 | environ = append(environ, fmt.Sprintf("%s=true", env.AIS.IsPrimary)) |
| 404 | ncmd.Env = environ |
| 405 | } |
| 406 | |
| 407 | if err = ncmd.Start(); err != nil { |
| 408 | return |
| 409 | } |
| 410 | pid = ncmd.Process.Pid |
| 411 | err = ncmd.Process.Release() |
| 412 | return |
| 413 | } |
| 414 | |
| 415 | func DeployNode(t *testing.T, node *cluster.Snode, conf *cmn.Config, localConf *cmn.LocalConfig) int { |
| 416 | conf.ConfigDir = t.TempDir() |
no test coverage detected