Esempio n. 1
0
func (s *facadeSuite) SetUpTest(c *gc.C) {
	s.BaseSuite.SetUpTest(c)

	s.backend = new(mockBackend)
	s.authorizer = new(apiservertesting.FakeAuthorizer)
	s.authorizer.Tag = names.NewUserTag("igor")
	facade, err := sshclient.New(s.backend, nil, s.authorizer)
	c.Assert(err, jc.ErrorIsNil)
	s.facade = facade
}
Esempio n. 2
0
func (s *facadeSuite) TestUnitAuthNotAllowed(c *gc.C) {
	s.authorizer.Tag = names.NewUnitTag("foo/0")
	_, err := sshclient.New(s.backend, nil, s.authorizer)
	c.Assert(err, gc.Equals, common.ErrPerm)
}