func (s *UserdataSuite) TestJoyentUnknownOS(c *gc.C) { renderer := joyent.JoyentRenderer{} cloudcfg := &cloudinittest.CloudConfig{} result, err := renderer.Render(cloudcfg, os.Windows) c.Assert(result, gc.IsNil) c.Assert(err, gc.ErrorMatches, "Cannot encode userdata for OS: Windows") }
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) }
func (s *UserdataSuite) TestJoyentUnix(c *gc.C) { renderer := joyent.JoyentRenderer{} cloudcfg := &cloudinittest.CloudConfig{YAML: []byte("yaml")} result, err := renderer.Render(cloudcfg, os.Ubuntu) c.Assert(err, jc.ErrorIsNil) c.Assert(result, jc.DeepEquals, cloudcfg.YAML) result, err = renderer.Render(cloudcfg, os.CentOS) c.Assert(err, jc.ErrorIsNil) c.Assert(result, jc.DeepEquals, cloudcfg.YAML) }
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") }