New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration-cli: use cmd.Stdin instead of cat/tee for TestExportContainerAndImportImage #10793

Merged
merged 1 commit into from Feb 16, 2015

Conversation

Projects
None yet
7 participants
@ahmetb
Contributor

ahmetb commented Feb 14, 2015

TestExportContainerAndImportImage:

os.Exec("bash", "-c", dockerBinary) ends up making a call like bash -c "c:\...\docker.exe" on windows which doesn't work because bash won't accept windows paths and there's no unix path available for dockerBinary.

This test makes use of exec.Command.Stdin to pass the docker exported image back to docker import using strings.Reader.

  • Upside: fixes the test on windows
  • Downside: cat/tee compatibility of the commands is no longer tested in this test case

Signed-off-by: Ahmet Alp Balkan ahmetalpbalkan@gmail.com
Label: #windows
cc: @tianon @unclejack @jfrazelle @icecrime

integration-cli: use cmd.Stdin instead of cat/tee for TestExportConta…
…inerAndImportImage

os.Exec("bash", "-c", dockerBinary) ends up making a call like
bash -c c:\...\docker.exe on windows msys shell, which does not work.

This test makes use of exec.Command.Stdin to pass image back to
docker import.

- Upside: fixes the test on windows
- Downside: cat/tee compatibility is no longer tested in this test case

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
@ahmetb

This comment has been minimized.

Contributor

ahmetb commented Feb 14, 2015

https://jenkins.dockerproject.com/job/Windows-PRs/35/console
=== RUN TestExportContainerAndImportImage
[PASSED]: export - export a container
[PASSED]: import - import an image
--- PASS: TestExportContainerAndImportImage (3.64s) 👍

@icecrime

This comment has been minimized.

Contributor

icecrime commented Feb 14, 2015

Nice! LGTM

@tianon

This comment has been minimized.

Member

tianon commented Feb 14, 2015

+100

LGTM

IMO, this is how this test (and similar tests) should've worked in the first place. 👍

@duglin

This comment has been minimized.

Contributor

duglin commented Feb 14, 2015

LGTM
I am curious though about keeping everything in a buffer. At some point, wouldn't using a pipe between the two commands be a more appropriate solution?

@unclejack

This comment has been minimized.

Contributor

unclejack commented Feb 14, 2015

LGTM

@ahmetb

This comment has been minimized.

Contributor

ahmetb commented Feb 14, 2015

IMO, this is how this test (and similar tests) should've worked in the first place.

I thought it was intentional to test how unix tools work with cli. 😮

@duglin valid concern. in this case image is small, so I ignored it, also in this case I'd prefer runCommandWithOutput to return []byte; not string.

@jessfraz

This comment has been minimized.

Contributor

jessfraz commented Feb 16, 2015

LGTM

jessfraz pushed a commit that referenced this pull request Feb 16, 2015

Jessie Frazelle
Merge pull request #10793 from ahmetalpbalkan/win-cli/TestExportConta…
…inerAndImportImage-fix

integration-cli: use cmd.Stdin instead of cat/tee for TestExportContainerAndImportImage

@jessfraz jessfraz merged commit 7e9dd94 into moby:master Feb 16, 2015

1 of 2 checks passed

windows Jenkins build Windows-PRs 35 has failed
Details
janky Jenkins build Docker-PRs 1073 has succeeded
Details

@ahmetb ahmetb deleted the ahmetb:win-cli/TestExportContainerAndImportImage-fix branch Feb 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment