mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add integration tests for swarm incompatible
Signed-off-by: Wonjun Kim <wonjun.kim@navercorp.com>
(cherry picked from commit d71789828f
)
This commit is contained in:
parent
bd572fcd8f
commit
9ce196dc3c
1 changed files with 24 additions and 0 deletions
|
@ -4,6 +4,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"io/ioutil"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/docker/pkg/integration/checker"
|
"github.com/docker/docker/pkg/integration/checker"
|
||||||
|
@ -134,3 +135,26 @@ func (s *DockerSwarmSuite) TestSwarmInitIPv6(c *check.C) {
|
||||||
c.Assert(err, checker.IsNil, check.Commentf("out: %v", out))
|
c.Assert(err, checker.IsNil, check.Commentf("out: %v", out))
|
||||||
c.Assert(out, checker.Contains, "Swarm: active")
|
c.Assert(out, checker.Contains, "Swarm: active")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *DockerSwarmSuite) TestSwarmIncompatibleDaemon(c *check.C) {
|
||||||
|
// init swarm mode and stop a daemon
|
||||||
|
d := s.AddDaemon(c, true, true)
|
||||||
|
info, err := d.info()
|
||||||
|
c.Assert(err, checker.IsNil)
|
||||||
|
c.Assert(info.LocalNodeState, checker.Equals, swarm.LocalNodeStateActive)
|
||||||
|
c.Assert(d.Stop(), checker.IsNil)
|
||||||
|
|
||||||
|
// start a daemon with --cluster-store and --cluster-advertise
|
||||||
|
err = d.Start("--cluster-store=consul://consuladdr:consulport/some/path", "--cluster-advertise=1.1.1.1:2375")
|
||||||
|
c.Assert(err, checker.NotNil)
|
||||||
|
content, _ := ioutil.ReadFile(d.logFile.Name())
|
||||||
|
c.Assert(string(content), checker.Contains, "--cluster-store and --cluster-advertise daemon configurations are incompatible with swarm mode")
|
||||||
|
|
||||||
|
// start a daemon with --live-restore
|
||||||
|
err = d.Start("--live-restore")
|
||||||
|
c.Assert(err, checker.NotNil)
|
||||||
|
content, _ = ioutil.ReadFile(d.logFile.Name())
|
||||||
|
c.Assert(string(content), checker.Contains, "--live-restore daemon configuration is incompatible with swarm mode")
|
||||||
|
// restart for teardown
|
||||||
|
c.Assert(d.Start(), checker.IsNil)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue