Ejemplo n.º 1
0
func (*serviceSuite) TestNoConfMissing(c *gc.C) {
	service := common.Service{
		Name: "a-application",
	}
	noConf := service.NoConf()

	c.Check(noConf, jc.IsTrue)
}
Ejemplo n.º 2
0
func (*serviceSuite) TestNoConfEmpty(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{},
	}
	noConf := service.NoConf()

	c.Check(noConf, jc.IsTrue)
}
Ejemplo n.º 3
0
func (*serviceSuite) TestValidateMissingExecStart(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			Desc: "some service",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, gc.ErrorMatches, ".*missing ExecStart.*")
}
Ejemplo n.º 4
0
func (*serviceSuite) TestValidateMissingDesc(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			ExecStart: "/path/to/some-command x y z",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, gc.ErrorMatches, ".*missing Desc.*")
}
Ejemplo n.º 5
0
func (*serviceSuite) TestValidateMissingName(c *gc.C) {
	service := common.Service{
		Conf: common.Conf{
			Desc:      "some service",
			ExecStart: "/path/to/some-command x y z",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, gc.ErrorMatches, ".*missing Name.*")
}
Ejemplo n.º 6
0
func (*serviceSuite) TestValidateOkay(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			Desc:      "some service",
			ExecStart: "/path/to/some-command x y z",
		},
	}
	err := service.Validate(renderer)

	c.Check(err, jc.ErrorIsNil)
}
Ejemplo n.º 7
0
func (*serviceSuite) TestNoConfFalse(c *gc.C) {
	service := common.Service{
		Name: "a-application",
		Conf: common.Conf{
			Desc:      "some service",
			ExecStart: "/path/to/some-command x y z",
		},
	}
	noConf := service.NoConf()

	c.Check(noConf, jc.IsFalse)
}