|
|
@@ -18,11 +18,14 @@ package main
|
|
|
|
|
|
import (
|
|
|
"os"
|
|
|
+ "os/exec"
|
|
|
"path/filepath"
|
|
|
"runtime"
|
|
|
"testing"
|
|
|
"time"
|
|
|
|
|
|
+ "github.com/docker/api/errdefs"
|
|
|
+
|
|
|
. "github.com/onsi/gomega"
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
|
|
@@ -43,6 +46,14 @@ func (s *E2eSuite) TestContextHelp() {
|
|
|
Expect(output).To(ContainSubstring("--resource-group"))
|
|
|
}
|
|
|
|
|
|
+func (s *E2eSuite) TestContextCreateAciExitWithErrorCodeIfLoginRequired() {
|
|
|
+ cmd := exec.Command("docker", "context", "create", "aci", "someContext")
|
|
|
+ output, err := cmd.CombinedOutput()
|
|
|
+ Expect(err).NotTo(BeNil())
|
|
|
+ Expect(string(output)).To(ContainSubstring("not logged in to azure, you need to run \"docker login azure\" first"))
|
|
|
+ Expect(cmd.ProcessState.ExitCode()).To(Equal(errdefs.ExitCodeLoginRequired))
|
|
|
+}
|
|
|
+
|
|
|
func (s *E2eSuite) TestListAndShowDefaultContext() {
|
|
|
output := s.NewDockerCommand("context", "show").ExecOrDie()
|
|
|
Expect(output).To(ContainSubstring("default"))
|