integration-cli: remove redundant logs from cp utils

Now that we marked these utilities as helpers, it should be
possible to find which test-case failed (if any), and we
can skip logging in the "happy path".

This makes these tests less noisy, which makes it easier
to find actually important information in the output:

     --- PASS: TestDockerSuite/TestCpFromCaseC (0.96s)
         docker_cli_cp_utils_test.go:244: checking that file "/tmp/test-cp-from-case-c450122079/file2" contains "file2\n"
         docker_cli_cp_utils_test.go:192: running `docker cp  962b1f3311e742b0842e13b2ad350214cea25883999fd26e87e8c9ddf40d5eb4:/root/file1 /tmp/test-cp-from-case-c450122079/file2`
         docker_cli_cp_utils_test.go:244: checking that file "/tmp/test-cp-from-case-c450122079/file2" contains "file1\n"

Some of these tests should probably be rewritten to use subtests,
but that's something for a follow-up.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-21 17:10:44 +02:00
parent 267a0294a7
commit 3ddb4100a0
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 0 additions and 5 deletions

View File

@ -192,7 +192,6 @@ func containerCpPathTrailingSep(containerID string, pathElements ...string) stri
func runDockerCp(c *testing.T, src, dst string) error {
c.Helper()
c.Logf("running `docker cp %s %s`", src, dst)
args := []string{"cp", src, dst}
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, args...)); err != nil {
@ -203,7 +202,6 @@ func runDockerCp(c *testing.T, src, dst string) error {
func startContainerGetOutput(c *testing.T, containerID string) (out string, err error) {
c.Helper()
c.Logf("running `docker start -a %s`", containerID)
args := []string{"start", "-a", containerID}
@ -240,7 +238,6 @@ func isCpCannotCopyReadOnly(err error) bool {
func fileContentEquals(c *testing.T, filename, contents string) error {
c.Helper()
c.Logf("checking that file %q contains %q\n", filename, contents)
fileBytes, err := ioutil.ReadFile(filename)
if err != nil {
@ -261,7 +258,6 @@ func fileContentEquals(c *testing.T, filename, contents string) error {
func symlinkTargetEquals(c *testing.T, symlink, expectedTarget string) error {
c.Helper()
c.Logf("checking that the symlink %q points to %q\n", symlink, expectedTarget)
actualTarget, err := os.Readlink(symlink)
if err != nil {
@ -277,7 +273,6 @@ func symlinkTargetEquals(c *testing.T, symlink, expectedTarget string) error {
func containerStartOutputEquals(c *testing.T, containerID, contents string) error {
c.Helper()
c.Logf("checking that container %q start output contains %q\n", containerID, contents)
out, err := startContainerGetOutput(c, containerID)
if err != nil {