Browse Source

Fix an issue in the swarm unlock-key rotate test where we were never updating the
previous generation unlock key.

Signed-off-by: cyli <cyli@twistedmatrix.com>

cyli 8 years ago
parent
commit
81f3e699c3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      integration-cli/docker_cli_swarm_test.go

+ 3 - 0
integration-cli/docker_cli_swarm_test.go

@@ -977,6 +977,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *check.C) {
 		// Strip \n
 		// Strip \n
 		newUnlockKey := outs[:len(outs)-1]
 		newUnlockKey := outs[:len(outs)-1]
 		c.Assert(newUnlockKey, checker.Not(checker.Equals), "")
 		c.Assert(newUnlockKey, checker.Not(checker.Equals), "")
+		c.Assert(newUnlockKey, checker.Not(checker.Equals), unlockKey)
 
 
 		c.Assert(d.Restart(), checker.IsNil)
 		c.Assert(d.Restart(), checker.IsNil)
 
 
@@ -1026,5 +1027,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *check.C) {
 		outs, err = d.Cmd("node", "ls")
 		outs, err = d.Cmd("node", "ls")
 		c.Assert(err, checker.IsNil)
 		c.Assert(err, checker.IsNil)
 		c.Assert(outs, checker.Not(checker.Contains), "Swarm is encrypted and needs to be unlocked")
 		c.Assert(outs, checker.Not(checker.Contains), "Swarm is encrypted and needs to be unlocked")
+
+		unlockKey = newUnlockKey
 	}
 	}
 }
 }