From 4dcd28df92d0a4c2daa7aee632c25f1fc79dd960 Mon Sep 17 00:00:00 2001 From: James Hewitt Date: Sat, 27 Nov 2021 13:40:02 +0000 Subject: [PATCH] Use a dynamic temp dir for test This test was incorrectly assuming that nothing would be made on disk, but it was putting files into the source directory. Signed-off-by: James Hewitt --- integration/copy_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration/copy_test.go b/integration/copy_test.go index 7f438f4e..2c21ae56 100644 --- a/integration/copy_test.go +++ b/integration/copy_test.go @@ -1190,12 +1190,14 @@ func (s *SkopeoSuite) TestCopySrcAndDestWithAuth(c *check.C) { } func (s *CopySuite) TestCopyNoPanicOnHTTPResponseWithoutTLSVerifyFalse(c *check.C) { + topDir, err := ioutil.TempDir("", "no-panic-on-https-response-without-tls-verify-false") + c.Assert(err, check.IsNil) + defer os.RemoveAll(topDir) + const ourRegistry = "docker://" + v2DockerRegistryURL + "/" - // dir:test isn't created beforehand just because we already know this could - // just fail when evaluating the src assertSkopeoFails(c, ".*server gave HTTP response to HTTPS client.*", - "copy", ourRegistry+"foobar", "dir:test") + "copy", ourRegistry+"foobar", "dir:"+topDir) } func (s *CopySuite) TestCopySchemaConversion(c *check.C) {