|
|
@@ -79,6 +79,18 @@ func (s *E2eSuite) TestInspectDefaultContext() {
|
|
|
Expect(output).To(ContainSubstring(`"Name": "default"`))
|
|
|
}
|
|
|
|
|
|
+func (s *E2eSuite) TestInspectContextNoArgs() {
|
|
|
+ output := s.NewDockerCommand("context", "inspect").ExecOrDie()
|
|
|
+ Expect(output).To(ContainSubstring(`"Name": "default"`))
|
|
|
+}
|
|
|
+
|
|
|
+func (s *E2eSuite) TestInspectContextRegardlessCurrentContext() {
|
|
|
+ s.NewDockerCommand("context", "create", "local", "localCtx").ExecOrDie()
|
|
|
+ s.NewDockerCommand("context", "use", "localCtx").ExecOrDie()
|
|
|
+ output := s.NewDockerCommand("context", "inspect").ExecOrDie()
|
|
|
+ Expect(output).To(ContainSubstring(`"Name": "localCtx"`))
|
|
|
+}
|
|
|
+
|
|
|
func (s *E2eSuite) TestContextCreateParseErrorDoesNotDelegateToLegacy() {
|
|
|
It("should dispay new cli error when parsing context create flags", func() {
|
|
|
_, err := s.NewDockerCommand("context", "create", "aci", "--subscription-id", "titi").Exec()
|
|
|
@@ -108,6 +120,14 @@ func (s *E2eSuite) TestClassicLoginWithparameters() {
|
|
|
Expect(err).NotTo(BeNil())
|
|
|
}
|
|
|
|
|
|
+func (s *E2eSuite) TestClassicLoginRegardlessCurrentContext() {
|
|
|
+ s.NewDockerCommand("context", "create", "local", "localCtx").ExecOrDie()
|
|
|
+ s.NewDockerCommand("context", "use", "localCtx").ExecOrDie()
|
|
|
+ output, err := s.NewDockerCommand("login", "-u", "nouser", "-p", "wrongpasword").Exec()
|
|
|
+ Expect(output).To(ContainSubstring("Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password"))
|
|
|
+ Expect(err).NotTo(BeNil())
|
|
|
+}
|
|
|
+
|
|
|
func (s *E2eSuite) TestClassicLogin() {
|
|
|
output, err := s.NewDockerCommand("login", "someregistry.docker.io").Exec()
|
|
|
Expect(output).To(ContainSubstring("Cannot perform an interactive login from a non TTY device"))
|
|
|
@@ -149,6 +169,13 @@ func (s *E2eSuite) TestLegacy() {
|
|
|
output := s.NewDockerCommand("run", "--rm", "hello-world").WithTimeout(time.NewTimer(20 * time.Second).C).ExecOrDie()
|
|
|
Expect(output).To(ContainSubstring("Hello from Docker!"))
|
|
|
})
|
|
|
+
|
|
|
+ It("should execute legacy commands in other moby contexts", func() {
|
|
|
+ s.NewDockerCommand("context", "create", "mobyCtx", "--from=default").ExecOrDie()
|
|
|
+ s.NewDockerCommand("context", "use", "mobyCtx").ExecOrDie()
|
|
|
+ output, _ := s.NewDockerCommand("swarm", "join").Exec()
|
|
|
+ Expect(output).To(ContainSubstring("\"docker swarm join\" requires exactly 1 argument."))
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
func (s *E2eSuite) TestLeaveLegacyErrorMessagesUnchanged() {
|