Esempio n. 1
0
func (s *UserdataSuite) TestJoyentUnix(c *gc.C) {
	renderer := joyent.JoyentRenderer{}
	data := []byte("test")
	result, err := renderer.EncodeUserdata(data, os.Ubuntu)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(result, jc.DeepEquals, data)

	data = []byte("test")
	result, err = renderer.EncodeUserdata(data, os.CentOS)
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(result, jc.DeepEquals, data)
}
Esempio n. 2
0
func (s *UserdataSuite) TestJoyentUnknownOS(c *gc.C) {
	renderer := joyent.JoyentRenderer{}
	result, err := renderer.EncodeUserdata(nil, os.Windows)
	c.Assert(result, gc.IsNil)
	c.Assert(err, gc.ErrorMatches, "Cannot encode userdata for OS: Windows")
}