func (s *ServerSuite) SetUpTest(c *gc.C) { s.BaseSuite.SetUpTest(c) s.sockPath = filepath.Join(c.MkDir(), "test.sock") srv, err := jujuc.NewServer(factory, s.sockPath) c.Assert(err, gc.IsNil) c.Assert(srv, gc.NotNil) s.server = srv s.err = make(chan error) go func() { s.err <- s.server.Run() }() }
func (s *JujuCMainSuite) SetUpSuite(c *gc.C) { factory := func(contextId, cmdName string) (cmd.Command, error) { if contextId != "bill" { return nil, fmt.Errorf("bad context: %s", contextId) } if cmdName != "remote" { return nil, fmt.Errorf("bad command: %s", cmdName) } return &RemoteCommand{}, nil } s.sockPath = filepath.Join(c.MkDir(), "test.sock") srv, err := jujuc.NewServer(factory, s.sockPath) c.Assert(err, gc.IsNil) s.server = srv go func() { if err := s.server.Run(); err != nil { c.Fatalf("server died: %s", err) } }() }