Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit a9011ff

Browse files
committed
[region] fix integration-cli
1 parent 6737547 commit a9011ff

16 files changed

+58
-47
lines changed

Dockerfile.dev

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ ENV DOCKER_TLS_VERIFY=
2929
ENV DOCKER_HOST=
3030
ENV ACCESS_KEY=
3131
ENV SECRET_KEY=
32-
32+
ENV REGION=
3333

3434
## Ensure /usr/bin/hyper
3535
RUN ln -s /go/src/github.com/hyperhq/hypercli/hyper/hyper /usr/bin/hyper
36-
RUN echo alias hypercli=\"hyper -H \${DOCKER_HOST}\" >> /root/.bashrc
36+
RUN echo alias hypercli=\"hyper --region \${DOCKER_HOST}\" >> /root/.bashrc
3737

3838

3939
## Ensure /go/src/github.com/docker/docker
@@ -51,7 +51,7 @@ ENTRYPOINT ["hack/generate-hyper-conf-dev.sh"]
5151
RUN yum install -y zsh
5252
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
5353
RUN sed -i "s/^ZSH_THEME=.*/ZSH_THEME=\"gianu\"/g" /root/.zshrc
54-
RUN echo alias hypercli=\"hyper -H \${DOCKER_HOST}\" >> /root/.zshrc
54+
RUN echo alias hypercli=\"hyper --region \${DOCKER_HOST}\" >> /root/.zshrc
5555

5656
# config git
5757
RUN git config --global color.ui true; \

hack/generate-hyper-conf-dev.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
if [ "${REGION}" == "" ];then
4+
REGION="us-west-1"
5+
fi
6+
37
if [ "$@" != "./build.sh" ];then
48
#ensure config for hyper cli
59
mkdir -p ~/.hyper
@@ -21,7 +25,7 @@ EOF
2125
echo "Current hyper config: ~/.hyper/config.json"
2226
echo "----------------------------------------------------------------------------------------------"
2327
cat ~/.hyper/config.json \
24-
| sed 's/"secretkey":.*/"secretkey": "******************************"/g' \
28+
| sed 's/"secretkey":.*/"secretkey": "******************************",/g' \
2529
| sed 's/"auth":.*/"auth": "******************************"/g'
2630
echo "----------------------------------------------------------------------------------------------"
2731

@@ -37,7 +41,7 @@ Run in container(example):
3741
-----------------------------------------------------------
3842
cd integration-cli && go test # start autotest
3943
40-
# 'hypercli' is the alias of 'hyper -H \${DOCKER_HOST}'
44+
# 'hypercli' is the alias of 'hyper --region \${DOCKER_HOST}'
4145
4246
EOF
4347
fi

hack/generate-hyper-conf-qa.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
env
44

5+
if [ "${REGION}" == "" ];then
6+
REGION="us-west-1"
7+
fi
8+
59
# set default value of DOCKER_HOST and BRANCH
610
if [[ "$DOCKER_HOST" == "" ]];then
711
DOCKER_HOST="tcp://us-west-1.hyper.sh:443"
@@ -74,7 +78,7 @@ fi
7478
./build.sh
7579
ln -s /go/src/github.com/hyperhq/hypercli /go/src/github.com/docker/docker
7680
ln -s /go/src/github.com/hyperhq/hypercli/hyper/hyper /usr/bin/hyper
77-
echo alias hypercli=\"hyper -H \${DOCKER_HOST}\" >> /root/.bashrc
81+
echo alias hypercli=\"hyper --region \${DOCKER_HOST}\" >> /root/.bashrc
7882
source /root/.bashrc
7983

8084
echo "##############################################################################################"
@@ -84,7 +88,7 @@ echo "##########################################################################
8488
echo "Current hyper config: ~/.hyper/config.json"
8589
echo "----------------------------------------------------------------------------------------------"
8690
cat ~/.hyper/config.json \
87-
| sed 's/"secretkey":.*/"secretkey": "******************************"/g' \
91+
| sed 's/"secretkey":.*/"secretkey": "******************************",/g' \
8892
| sed 's/"auth":.*/"auth": "******************************"/g'
8993
echo "----------------------------------------------------------------------------------------------"
9094

integration-cli/docker_utils.go

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ func (d *Daemon) waitRun(contID string) error {
482482
}
483483

484484
// Cmd will execute a docker CLI command against this Daemon.
485-
// Example: d.Cmd("version") will run docker -H unix://path/to/unix.sock version
485+
// Example: d.Cmd("version") will run docker --region unix://path/to/unix.sock version
486486
func (d *Daemon) Cmd(name string, arg ...string) (string, error) {
487487
args := []string{"--region", os.Getenv("DOCKER_HOST"), name}
488488
args = append(args, arg...)
@@ -647,7 +647,7 @@ func newRequestClient(method, endpoint string, data io.Reader, ct string) (*http
647647
fmt.Println("--------------------------------------------------------------------------------------------")
648648
fmt.Println("curl -v -k \\")
649649
for k, v := range req.Header {
650-
fmt.Printf(" -H \"%v: %v\" \\\n", k, v[0])
650+
fmt.Printf(" --region \"%v: %v\" \\\n", k, v[0])
651651
}
652652
fmt.Printf(" -X %v \\\n", method)
653653
if req.Body != nil {
@@ -991,7 +991,7 @@ func dockerCmdWithStdoutStderr(c *check.C, args ...string) (string, string, int)
991991
}
992992

993993
func dockerCmd(c *check.C, args ...string) (string, int) {
994-
//append -H (--region)
994+
//append --region
995995
arg := []string{"--region=" + os.Getenv("DOCKER_HOST")}
996996
args = append(arg, args...)
997997
return integration.DockerCmd(dockerBinary, c, args...)

integration-cli/final/cli/hyper_cli_load_local_ext_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (s *DockerSuite) TestCliLoadFromLocalDocker(c *check.C) {
1818
testImage := "hello-world:latest"
1919

2020
//local docker pull image
21-
pullCmd := exec.Command("docker", "-H", os.Getenv("LOCAL_DOCKER_HOST"), "pull", testImage)
21+
pullCmd := exec.Command("docker", "--region", os.Getenv("LOCAL_DOCKER_HOST"), "pull", testImage)
2222
output, exitCode, err := runCommandWithOutput(pullCmd)
2323
c.Assert(err, checker.IsNil)
2424
c.Assert(exitCode, checker.Equals, 0)

integration-cli/hyper_cli_config_test.go

100644100755
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package main
22

33
import (
44
"path/filepath"
5+
"os"
56
"time"
6-
7+
78
"github.com/docker/docker/pkg/integration/checker"
89
"github.com/go-check/check"
910
"github.com/hyperhq/hypercli/cliconfig"
@@ -14,7 +15,7 @@ func (s *DockerSuite) TestCliConfigAndRewrite(c *check.C) {
1415
printTestCaseName()
1516
defer printTestDuration(time.Now())
1617

17-
out, _ := dockerCmd(c, "config", "--accesskey", "xx", "--secretkey", "xxxx", "tcp://127.0.0.1:6443")
18+
out, _ := dockerCmd(c, "config", "--default-region" , os.Getenv("REGION"), "--accesskey", "xx", "--secretkey", "xxxx", "tcp://127.0.0.1:6443")
1819
c.Assert(out, checker.Contains, "WARNING: Your login credentials has been saved in "+homedir.Get()+"/.hyper/config.json")
1920

2021
configDir := filepath.Join(homedir.Get(), ".hyper")
@@ -23,7 +24,7 @@ func (s *DockerSuite) TestCliConfigAndRewrite(c *check.C) {
2324
c.Assert(conf.CloudConfig["tcp://127.0.0.1:6443"].AccessKey, checker.Equals, "xx", check.Commentf("Should get xx, but get %s\n", conf.CloudConfig["tcp://127.0.0.1:6443"].AccessKey))
2425
c.Assert(conf.CloudConfig["tcp://127.0.0.1:6443"].SecretKey, checker.Equals, "xxxx", check.Commentf("Should get xxxx, but get %s\n", conf.CloudConfig["tcp://127.0.0.1:6443"].SecretKey))
2526

26-
out, _ = dockerCmd(c, "config", "--accesskey", "yy", "--secretkey", "yyyy", "tcp://127.0.0.1:6443")
27+
out, _ = dockerCmd(c, "config", "--default-region" , os.Getenv("REGION"), "--accesskey", "yy", "--secretkey", "yyyy", "tcp://127.0.0.1:6443")
2728
c.Assert(out, checker.Contains, "WARNING: Your login credentials has been saved in "+homedir.Get()+"/.hyper/config.json")
2829

2930
conf, err = cliconfig.Load(configDir)
@@ -36,7 +37,7 @@ func (s *DockerSuite) TestCliConfigMultiHostBasic(c *check.C) {
3637
printTestCaseName()
3738
defer printTestDuration(time.Now())
3839

39-
out, _ := dockerCmd(c, "config", "--accesskey", "xx", "--secretkey", "xxxx", "tcp://127.0.0.1:6443")
40+
out, _ := dockerCmd(c, "config", "--default-region" , os.Getenv("REGION"), "--accesskey", "xx", "--secretkey", "xxxx", "tcp://127.0.0.1:6443")
4041
c.Assert(out, checker.Contains, "WARNING: Your login credentials has been saved in "+homedir.Get()+"/.hyper/config.json")
4142

4243
configDir := filepath.Join(homedir.Get(), ".hyper")
@@ -45,7 +46,7 @@ func (s *DockerSuite) TestCliConfigMultiHostBasic(c *check.C) {
4546
c.Assert(conf.CloudConfig["tcp://127.0.0.1:6443"].AccessKey, checker.Equals, "xx", check.Commentf("Should get xx, but get %s\n", conf.CloudConfig["tcp://127.0.0.1:6443"].AccessKey))
4647
c.Assert(conf.CloudConfig["tcp://127.0.0.1:6443"].SecretKey, checker.Equals, "xxxx", check.Commentf("Should get xxxx, but get %s\n", conf.CloudConfig["tcp://127.0.0.1:6443"].SecretKey))
4748

48-
out, _ = dockerCmd(c, "config", "--accesskey", "yy", "--secretkey", "yyyy", "tcp://127.0.0.1:6444")
49+
out, _ = dockerCmd(c, "config", "--default-region" , os.Getenv("REGION"), "--accesskey", "yy", "--secretkey", "yyyy", "tcp://127.0.0.1:6444")
4950
c.Assert(out, checker.Contains, "WARNING: Your login credentials has been saved in "+homedir.Get()+"/.hyper/config.json")
5051

5152
conf, err = cliconfig.Load(configDir)

integration-cli/hyper_cli_links_test.go

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func (s *DockerSuite) TestCliLinksPingLinkedContainersBasic(c *check.C) {
4343
testRequires(c, DaemonIsLinux)
4444

4545
pullImageIfNotExist("busybox")
46-
dockerCmd(c, "run", "-d", "--name", "container1", "--regionname", "fred", "busybox", "top")
47-
dockerCmd(c, "run", "-d", "--name", "container2", "--regionname", "wilma", "busybox", "top")
46+
dockerCmd(c, "run", "-d", "--name", "container1", "--hostname", "fred", "busybox", "top")
47+
dockerCmd(c, "run", "-d", "--name", "container2", "--hostname", "wilma", "busybox", "top")
4848

4949
runArgs := []string{"run", "--rm", "--link", "container1:alias1", "--link", "container2:alias2", "busybox", "sh", "-c"}
5050
pingCmd := "ping -c 1 %s -W 5 && ping -c 1 %s -W 5"

integration-cli/hyper_cli_load_local_test.go

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (s *DockerSuite) TestCliLoadFromLocalTarPipeBasic(c *check.C) {
2828

2929
//load via pipe
3030
catCmd := exec.Command("cat", imagePath)
31-
loadCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "--config", os.Getenv("HYPER_CONFIG"), "load")
31+
loadCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "--config", os.Getenv("HYPER_CONFIG"), "load")
3232

3333
catOut, err := catCmd.StdoutPipe()
3434
catCmd.Start()

integration-cli/hyper_cli_login_test.go

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
func (s *DockerSuite) TestCliLoginWithoutTTYBasic(c *check.C) {
1313
printTestCaseName()
1414
defer printTestDuration(time.Now())
15-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "login")
15+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "login")
1616

1717
// Send to stdin so the process does not get the TTY
1818
cmd.Stdin = bytes.NewBufferString("buffer test string \n")

integration-cli/hyper_cli_run_test.go

100644100755
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (s *DockerSuite) TestCliRunStdinPipe(c *check.C) {
111111
// TODO Windows: This needs some work to make compatible.
112112
testRequires(c, DaemonIsLinux)
113113
printTestCaseName(); defer printTestDuration(time.Now())
114-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-i", "-a", "stdin", "busybox", "cat")
114+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-i", "-a", "stdin", "busybox", "cat")
115115
runCmd.Stdin = strings.NewReader("blahblah")
116116
out, _, _, err := runCommandWithStdoutStderr(runCmd)
117117
if err != nil {
@@ -328,7 +328,7 @@ func (s *DockerSuite) TestCliRunEnvironment(c *check.C) {
328328
testRequires(c, DaemonIsLinux)
329329
printTestCaseName(); defer printTestDuration(time.Now())
330330
pullImageIfNotExist("busybox")
331-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-h", "testing", "-e=FALSE=true", "-e=TRUE=", "-e=TRICKY=", "-e=HOME=", "busybox", "env")
331+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-h", "testing", "-e=FALSE=true", "-e=TRUE=", "-e=TRICKY=", "-e=HOME=", "busybox", "env")
332332
cmd.Env = append(os.Environ(),
333333
"TRUE=false",
334334
"TRICKY=tri\ncky\n",
@@ -376,7 +376,7 @@ func (s *DockerSuite) TestCliRunEnvironmentErase(c *check.C) {
376376
// not set in our local env that they're removed (if present) in
377377
// the container
378378
379-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-e", "FOO", "-e", "HOSTNAME", "busybox", "env")
379+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-e", "FOO", "-e", "HOSTNAME", "busybox", "env")
380380
cmd.Env = appendBaseEnv([]string{})
381381
382382
out, _, err := runCommandWithOutput(cmd)
@@ -415,7 +415,7 @@ func (s *DockerSuite) TestCliRunEnvironmentOverride(c *check.C) {
415415
// Test to make sure that when we use -e on env vars that are
416416
// already in the env that we're overriding them
417417

418-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-e", "HOSTNAME", "-e", "HOME=/root2", "busybox", "env")
418+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-e", "HOSTNAME", "-e", "HOME=/root2", "busybox", "env")
419419
cmd.Env = appendBaseEnv([]string{"HOSTNAME=bar"})
420420

421421
out, _, err := runCommandWithOutput(cmd)
@@ -693,7 +693,7 @@ func (s *DockerSuite) TestCliRunExitOnStdinClose(c *check.C) {
693693
meow = "cat"
694694
delay = 60
695695
}
696-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "--name", name, "-i", "busybox", meow)
696+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "--name", name, "-i", "busybox", meow)
697697
698698
stdin, err := runCmd.StdinPipe()
699699
if err != nil {
@@ -976,7 +976,7 @@ func (s *DockerSuite) TestCliRunNoOutputFromPullInStdout(c *check.C) {
976976
testRequires(c, DaemonIsLinux)
977977

978978
// just run with unknown image
979-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "asdfsg")
979+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "asdfsg")
980980
stdout := bytes.NewBuffer(nil)
981981
cmd.Stdout = stdout
982982
if err := cmd.Run(); err == nil {
@@ -995,7 +995,7 @@ func (s *DockerSuite) TestCliRunSlowStdoutConsumer(c *check.C) {
995995
testRequires(c, DaemonIsLinux)
996996
printTestCaseName(); defer printTestDuration(time.Now())
997997
pullImageIfNotExist("busybox")
998-
cont := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv")
998+
cont := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv")
999999
10001000
stdout, err := cont.StdoutPipe()
10011001
if err != nil {
@@ -1133,7 +1133,7 @@ func (s *DockerSuite) TestCliRunTTYWithPipe(c *check.C) {
11331133
go func() {
11341134
defer close(errChan)
11351135

1136-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-ti", "busybox", "true")
1136+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-ti", "busybox", "true")
11371137
if _, err := cmd.StdinPipe(); err != nil {
11381138
errChan <- err
11391139
return
@@ -1363,7 +1363,7 @@ func (s *DockerTrustSuite) TestCliRunWhenCertExpired(c *check.C) {
13631363

13641364
runAtDifferentDate(elevenYearsFromNow, func() {
13651365
// Try run
1366-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", repoName)
1366+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", repoName)
13671367
s.trustedCmd(runCmd)
13681368
out, _, err := runCommandWithOutput(runCmd)
13691369
if err == nil {
@@ -1377,7 +1377,7 @@ func (s *DockerTrustSuite) TestCliRunWhenCertExpired(c *check.C) {
13771377

13781378
runAtDifferentDate(elevenYearsFromNow, func() {
13791379
// Try run
1380-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "--disable-content-trust", repoName)
1380+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "--disable-content-trust", repoName)
13811381
s.trustedCmd(runCmd)
13821382
out, _, err := runCommandWithOutput(runCmd)
13831383
if err != nil {
@@ -1432,7 +1432,7 @@ func (s *DockerSuite) TestCliRunStdinBlockedAfterContainerExit(c *check.C) {
14321432
testRequires(c, DaemonIsLinux)
14331433

14341434
pullImageIfNotExist("busybox")
1435-
cmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-i", "--name=test", "busybox", "true")
1435+
cmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-i", "--name=test", "busybox", "true")
14361436
in, err := cmd.StdinPipe()
14371437
c.Assert(err, check.IsNil)
14381438
defer in.Close()
@@ -1459,7 +1459,7 @@ func (s *DockerSuite) TestCliRunNonExecutableCmd(c *check.C) {
14591459

14601460
pullImageIfNotExist("busybox")
14611461
name := "test-non-executable-cmd"
1462-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "--name", name, "busybox", "foo")
1462+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "--name", name, "busybox", "foo")
14631463
_, exit, _ := runCommandWithOutput(runCmd)
14641464
stateExitCode := findContainerExitCode(c, name)
14651465
if !(exit == 127 && strings.Contains(stateExitCode, "127")) {
@@ -1475,7 +1475,7 @@ func (s *DockerSuite) TestCliRunNonExistingCmd(c *check.C) {
14751475

14761476
pullImageIfNotExist("busybox")
14771477
name := "test-non-existing-cmd"
1478-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "--name", name, "busybox", "/bin/foo")
1478+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "--name", name, "busybox", "/bin/foo")
14791479
_, exit, _ := runCommandWithOutput(runCmd)
14801480
stateExitCode := findContainerExitCode(c, name)
14811481
if !(exit == 127 && strings.Contains(stateExitCode, "127")) {
@@ -1497,7 +1497,7 @@ func (s *DockerSuite) TestCliRunCmdCannotBeInvoked(c *check.C) {
14971497
expected = 127
14981498
}
14991499
name := "test-cmd-cannot-be-invoked"
1500-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "--name", name, "busybox", "/etc")
1500+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "--name", name, "busybox", "/etc")
15011501
_, exit, _ := runCommandWithOutput(runCmd)
15021502
stateExitCode := findContainerExitCode(c, name)
15031503
if !(exit == expected && strings.Contains(stateExitCode, strconv.Itoa(expected))) {
@@ -1511,7 +1511,7 @@ func (s *DockerSuite) TestCliRunNonExistingImage(c *check.C) {
15111511
defer printTestDuration(time.Now())
15121512
testRequires(c, DaemonIsLinux)
15131513

1514-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "foo")
1514+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "foo")
15151515
out, exit, err := runCommandWithOutput(runCmd)
15161516
if !(err != nil && exit == 125 && strings.Contains(out, "Unable to find image")) {
15171517
c.Fatalf("Run non-existing image should have errored with 'Unable to find image' code 125, but we got out: %s, exit: %d, err: %s", out, exit, err)
@@ -1525,7 +1525,7 @@ func (s *DockerSuite) TestCliRunDockerFails(c *check.C) {
15251525
testRequires(c, DaemonIsLinux)
15261526

15271527
pullImageIfNotExist("busybox")
1528-
runCmd := exec.Command(dockerBinary, "-H", os.Getenv("DOCKER_HOST"), "run", "-foo", "busybox")
1528+
runCmd := exec.Command(dockerBinary, "--region", os.Getenv("DOCKER_HOST"), "run", "-foo", "busybox")
15291529
out, exit, err := runCommandWithOutput(runCmd)
15301530
if !(err != nil && exit == 125) {
15311531
c.Fatalf("Docker run with flag not defined should exit with 125, but we got out: %s, exit: %d, err: %s", out, exit, err)

0 commit comments

Comments
 (0)