Skip to content

Commit

Permalink
integration-cli: check err on tmp dir creation
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <[email protected]>
  • Loading branch information
runcom committed Sep 20, 2015
1 parent acdc0f8 commit b616b8a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions integration-cli/docker_cli_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4044,6 +4044,7 @@ RUN cat /existing-directory/test/foo | grep Hi
ADD test.tar /existing-directory-trailing-slash/
RUN cat /existing-directory-trailing-slash/test/foo | grep Hi`
tmpDir, err := ioutil.TempDir("", "fake-context")
c.Assert(err, check.IsNil)
testTar, err := os.Create(filepath.Join(tmpDir, "test.tar"))
if err != nil {
c.Fatalf("failed to create test.tar archive: %v", err)
Expand Down Expand Up @@ -4089,6 +4090,7 @@ func (s *DockerSuite) TestBuildAddTarXz(c *check.C) {
ADD test.tar.xz /
RUN cat /test/foo | grep Hi`
tmpDir, err := ioutil.TempDir("", "fake-context")
c.Assert(err, check.IsNil)
testTar, err := os.Create(filepath.Join(tmpDir, "test.tar"))
if err != nil {
c.Fatalf("failed to create test.tar archive: %v", err)
Expand Down Expand Up @@ -4141,6 +4143,7 @@ func (s *DockerSuite) TestBuildAddTarXzGz(c *check.C) {
ADD test.tar.xz.gz /
RUN ls /test.tar.xz.gz`
tmpDir, err := ioutil.TempDir("", "fake-context")
c.Assert(err, check.IsNil)
testTar, err := os.Create(filepath.Join(tmpDir, "test.tar"))
if err != nil {
c.Fatalf("failed to create test.tar archive: %v", err)
Expand Down Expand Up @@ -4787,9 +4790,7 @@ func (s *DockerSuite) TestBuildSymlinkBreakout(c *check.C) {
testRequires(c, DaemonIsLinux)
name := "testbuildsymlinkbreakout"
tmpdir, err := ioutil.TempDir("", name)
if err != nil {
c.Fatal(err)
}
c.Assert(err, check.IsNil)
defer os.RemoveAll(tmpdir)
ctx := filepath.Join(tmpdir, "context")
if err := os.MkdirAll(ctx, 0755); err != nil {
Expand Down Expand Up @@ -5143,9 +5144,7 @@ func (s *DockerSuite) TestBuildDockerfileOutsideContext(c *check.C) {

name := "testbuilddockerfileoutsidecontext"
tmpdir, err := ioutil.TempDir("", name)
if err != nil {
c.Fatal(err)
}
c.Assert(err, check.IsNil)
defer os.RemoveAll(tmpdir)
ctx := filepath.Join(tmpdir, "context")
if err := os.MkdirAll(ctx, 0755); err != nil {
Expand Down Expand Up @@ -5601,9 +5600,7 @@ func (s *DockerTrustSuite) TestTrustedBuildUntrustedTag(c *check.C) {
func (s *DockerTrustSuite) TestBuildContextDirIsSymlink(c *check.C) {
testRequires(c, DaemonIsLinux)
tempDir, err := ioutil.TempDir("", "test-build-dir-is-symlink-")
if err != nil {
c.Fatal(err)
}
c.Assert(err, check.IsNil)
defer os.RemoveAll(tempDir)

// Make a real context directory in this temp directory with a simple
Expand Down

0 comments on commit b616b8a

Please sign in to comment.