Ejemplo n.º 1
0
func (s *MySuite) TestClusterCreate(c *C) {
	err := cluster.CreateCmd("test", true, true, "pwd", true)
	c.Assert(err, IsNil)
	data, _ := ioutil.ReadFile(cluster.FilePath("test"))
	c.Assert(string(data), Equals, "name: test\nconsul: true\nweave: true\nweavepwd: pwd\ncleanup: true\n")
	err = cluster.CreateCmd("test", true, true, "pwd", true)
	c.Assert(err, NotNil)
}
Ejemplo n.º 2
0
func (s *MySuite) TestClusterRemove(c *C) {
	err := cluster.CreateCmd("test", true, true, "pwd", true)
	c.Assert(err, IsNil)
	err = cluster.RemoveCmd("test")
	c.Assert(err, IsNil)
	filePath := cluster.FilePath("test")
	_, err = os.Stat(filePath)
	c.Assert(err, NotNil)
	err = cluster.RemoveCmd("test")
	c.Assert(err, NotNil)
}