Browse Source

Merge pull request #383 from thaJeztah/19.03_backport_test_fixes_2

[19.03 backport] Testing and Jenkinsfile changes [step 2]
Andrew Hsu 5 years ago
parent
commit
b6a7124855
100 changed files with 3251 additions and 3494 deletions
  1. 2 2
      Jenkinsfile
  2. 0 5
      daemon/bindmount_unix.go
  3. 3 6
      daemon/volumes_unix.go
  4. 4 4
      docs/contributing/test.md
  5. 4 6
      hack/ci/windows.ps1
  6. 11 33
      hack/make/.integration-test-helpers
  7. 3 7
      hack/test/e2e-run.sh
  8. 1 1
      hack/test/unit
  9. 0 1
      hack/validate/default
  10. 0 38
      hack/validate/test-imports
  11. 2 2
      integration-cli/benchmark_test.go
  12. 98 77
      integration-cli/check_test.go
  13. 79 19
      integration-cli/checker/checker.go
  14. 4 4
      integration-cli/daemon/daemon.go
  15. 37 37
      integration-cli/daemon/daemon_swarm.go
  16. 4 3
      integration-cli/daemon_swarm_hack_test.go
  17. 5 5
      integration-cli/docker_api_attach_test.go
  18. 17 17
      integration-cli/docker_api_build_test.go
  19. 2 2
      integration-cli/docker_api_build_windows_test.go
  20. 134 174
      integration-cli/docker_api_containers_test.go
  21. 2 2
      integration-cli/docker_api_containers_windows_test.go
  22. 3 3
      integration-cli/docker_api_exec_resize_test.go
  23. 25 24
      integration-cli/docker_api_exec_test.go
  24. 8 8
      integration-cli/docker_api_images_test.go
  25. 8 8
      integration-cli/docker_api_inspect_test.go
  26. 10 10
      integration-cli/docker_api_logs_test.go
  27. 17 17
      integration-cli/docker_api_network_test.go
  28. 9 9
      integration-cli/docker_api_stats_test.go
  29. 24 21
      integration-cli/docker_api_swarm_node_test.go
  30. 70 83
      integration-cli/docker_api_swarm_service_test.go
  31. 70 69
      integration-cli/docker_api_swarm_test.go
  32. 8 8
      integration-cli/docker_api_test.go
  33. 9 9
      integration-cli/docker_cli_attach_test.go
  34. 6 6
      integration-cli/docker_cli_attach_unix_test.go
  35. 115 115
      integration-cli/docker_cli_build_test.go
  36. 22 23
      integration-cli/docker_cli_build_unix_test.go
  37. 72 73
      integration-cli/docker_cli_by_digest_test.go
  38. 17 18
      integration-cli/docker_cli_commit_test.go
  39. 64 65
      integration-cli/docker_cli_cp_from_container_test.go
  40. 18 18
      integration-cli/docker_cli_cp_test.go
  41. 67 68
      integration-cli/docker_cli_cp_to_container_test.go
  42. 3 3
      integration-cli/docker_cli_cp_to_container_unix_test.go
  43. 9 9
      integration-cli/docker_cli_cp_utils_test.go
  44. 46 49
      integration-cli/docker_cli_create_test.go
  45. 11 11
      integration-cli/docker_cli_daemon_plugins_test.go
  46. 132 143
      integration-cli/docker_cli_daemon_test.go
  47. 32 32
      integration-cli/docker_cli_events_test.go
  48. 16 16
      integration-cli/docker_cli_events_unix_test.go
  49. 25 25
      integration-cli/docker_cli_exec_test.go
  50. 5 5
      integration-cli/docker_cli_exec_unix_test.go
  51. 94 107
      integration-cli/docker_cli_external_volume_driver_test.go
  52. 23 23
      integration-cli/docker_cli_health_test.go
  53. 15 13
      integration-cli/docker_cli_history_test.go
  54. 56 60
      integration-cli/docker_cli_images_test.go
  55. 17 18
      integration-cli/docker_cli_import_test.go
  56. 44 45
      integration-cli/docker_cli_info_test.go
  57. 6 4
      integration-cli/docker_cli_info_unix_test.go
  58. 92 94
      integration-cli/docker_cli_inspect_test.go
  59. 36 36
      integration-cli/docker_cli_links_test.go
  60. 3 3
      integration-cli/docker_cli_login_test.go
  61. 3 3
      integration-cli/docker_cli_logout_test.go
  62. 2 3
      integration-cli/docker_cli_logs_bench_test.go
  63. 17 17
      integration-cli/docker_cli_logs_test.go
  64. 26 36
      integration-cli/docker_cli_netmode_test.go
  65. 13 0
      integration-cli/docker_cli_network_test.go
  66. 179 217
      integration-cli/docker_cli_network_unix_test.go
  67. 3 3
      integration-cli/docker_cli_plugins_logdriver_test.go
  68. 73 103
      integration-cli/docker_cli_plugins_test.go
  69. 28 35
      integration-cli/docker_cli_port_test.go
  70. 3 3
      integration-cli/docker_cli_proxy_test.go
  71. 81 102
      integration-cli/docker_cli_prune_unix_test.go
  72. 115 117
      integration-cli/docker_cli_ps_test.go
  73. 30 34
      integration-cli/docker_cli_pull_local_test.go
  74. 9 9
      integration-cli/docker_cli_pull_test.go
  75. 29 29
      integration-cli/docker_cli_push_test.go
  76. 3 3
      integration-cli/docker_cli_registry_user_agent_test.go
  77. 27 20
      integration-cli/docker_cli_restart_test.go
  78. 40 44
      integration-cli/docker_cli_rmi_test.go
  79. 116 119
      integration-cli/docker_cli_run_test.go
  80. 127 135
      integration-cli/docker_cli_run_unix_test.go
  81. 27 29
      integration-cli/docker_cli_save_load_test.go
  82. 4 4
      integration-cli/docker_cli_save_load_unix_test.go
  83. 6 6
      integration-cli/docker_cli_search_test.go
  84. 104 103
      integration-cli/docker_cli_service_create_test.go
  85. 34 31
      integration-cli/docker_cli_service_health_test.go
  86. 32 32
      integration-cli/docker_cli_service_logs_test.go
  87. 2 2
      integration-cli/docker_cli_service_scale_test.go
  88. 2 2
      integration-cli/docker_cli_sni_test.go
  89. 24 26
      integration-cli/docker_cli_start_test.go
  90. 7 7
      integration-cli/docker_cli_stats_test.go
  91. 180 202
      integration-cli/docker_cli_swarm_test.go
  92. 10 9
      integration-cli/docker_cli_swarm_unix_test.go
  93. 5 5
      integration-cli/docker_cli_top_test.go
  94. 16 16
      integration-cli/docker_cli_update_unix_test.go
  95. 13 14
      integration-cli/docker_cli_userns_test.go
  96. 2 2
      integration-cli/docker_cli_v2_only_test.go
  97. 119 146
      integration-cli/docker_cli_volume_test.go
  98. 11 11
      integration-cli/docker_deprecated_api_v124_test.go
  99. 2 2
      integration-cli/docker_deprecated_api_v124_unix_test.go
  100. 8 17
      integration-cli/docker_hub_pull_suite_test.go

+ 2 - 2
Jenkinsfile

@@ -307,10 +307,10 @@ pipeline {
                                 TEST_INTEGRATION_DEST=1 CONTAINER_NAME=${CONTAINER_NAME}-1 TEST_SKIP_INTEGRATION_CLI=1 run_tests test-integration-flaky &
                                 TEST_INTEGRATION_DEST=1 CONTAINER_NAME=${CONTAINER_NAME}-1 TEST_SKIP_INTEGRATION_CLI=1 run_tests test-integration-flaky &
 
 
                                 # integration-cli first set
                                 # integration-cli first set
-                                TEST_INTEGRATION_DEST=2 CONTAINER_NAME=${CONTAINER_NAME}-2 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-check.f ^(DockerSuite|DockerNetworkSuite|DockerHubPullSuite|DockerRegistrySuite|DockerSchema1RegistrySuite|DockerRegistryAuthTokenSuite|DockerRegistryAuthHtpasswdSuite)" run_tests &
+                                TEST_INTEGRATION_DEST=2 CONTAINER_NAME=${CONTAINER_NAME}-2 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-test.run Test(DockerSuite|DockerNetworkSuite|DockerHubPullSuite|DockerRegistrySuite|DockerSchema1RegistrySuite|DockerRegistryAuthTokenSuite|DockerRegistryAuthHtpasswdSuite)/" run_tests &
 
 
                                 # integration-cli second set
                                 # integration-cli second set
-                                TEST_INTEGRATION_DEST=3 CONTAINER_NAME=${CONTAINER_NAME}-3 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-check.f ^(DockerSwarmSuite|DockerDaemonSuite|DockerExternalVolumeSuite)" run_tests &
+                                TEST_INTEGRATION_DEST=3 CONTAINER_NAME=${CONTAINER_NAME}-3 TEST_SKIP_INTEGRATION=1 TESTFLAGS="-test.run Test(DockerSwarmSuite|DockerDaemonSuite|DockerExternalVolumeSuite)/" run_tests &
 
 
                                 set +x
                                 set +x
                                 c=0
                                 c=0

+ 0 - 5
daemon/bindmount_unix.go

@@ -1,5 +0,0 @@
-// +build linux freebsd
-
-package daemon // import "github.com/docker/docker/daemon"
-
-const bindMountType = "bind"

+ 3 - 6
daemon/volumes_unix.go

@@ -141,10 +141,6 @@ func (daemon *Daemon) mountVolumes(container *container.Container) error {
 		if m.Writable {
 		if m.Writable {
 			writeMode = "rw"
 			writeMode = "rw"
 		}
 		}
-		opts := strings.Join([]string{bindMode, writeMode}, ",")
-		if err := mount.Mount(m.Source, dest, bindMountType, opts); err != nil {
-			return err
-		}
 
 
 		// mountVolumes() seems to be called for temporary mounts
 		// mountVolumes() seems to be called for temporary mounts
 		// outside the container. Soon these will be unmounted with
 		// outside the container. Soon these will be unmounted with
@@ -154,8 +150,9 @@ func (daemon *Daemon) mountVolumes(container *container.Container) error {
 		// then these unmounts will propagate and unmount original
 		// then these unmounts will propagate and unmount original
 		// mount as well. So make all these mounts rprivate.
 		// mount as well. So make all these mounts rprivate.
 		// Do not use propagation property of volume as that should
 		// Do not use propagation property of volume as that should
-		// apply only when mounting happen inside the container.
-		if err := mount.MakeRPrivate(dest); err != nil {
+		// apply only when mounting happens inside the container.
+		opts := strings.Join([]string{bindMode, writeMode, "rprivate"}, ",")
+		if err := mount.Mount(m.Source, dest, "", opts); err != nil {
 			return err
 			return err
 		}
 		}
 	}
 	}

+ 4 - 4
docs/contributing/test.md

@@ -174,13 +174,13 @@ flag's value is passed as arguments to the `go test` command. For example, from
 your local host you can run the `TestBuild` test with this command:
 your local host you can run the `TestBuild` test with this command:
 
 
 ```bash
 ```bash
-$ TESTFLAGS='-check.f DockerSuite.TestBuild*' make test-integration
+$ TESTFLAGS='-test.run TestDockerSuite/TestBuild*' make test-integration
 ```
 ```
 
 
 To run the same test inside your Docker development container, you do this:
 To run the same test inside your Docker development container, you do this:
 
 
 ```bash
 ```bash
-# TESTFLAGS='-check.f TestBuild*' hack/make.sh binary test-integration
+# TESTFLAGS='-test.run TestDockerSuite/TestBuild*' hack/make.sh binary test-integration
 ```
 ```
 
 
 ## Test the Windows binary against a Linux daemon
 ## Test the Windows binary against a Linux daemon
@@ -228,11 +228,11 @@ run a Bash terminal on Windows.
     ```
     ```
 
 
     Should you wish to run a single test such as one with the name
     Should you wish to run a single test such as one with the name
-    'TestExample', you can pass in `TESTFLAGS='-check.f TestExample'`. For
+    'TestExample', you can pass in `TESTFLAGS='-test.run /TestExample'`. For
     example
     example
 
 
     ```bash
     ```bash
-    $ TESTFLAGS='-check.f TestExample' hack/make.sh binary test-integration
+    $ TESTFLAGS='-test.run /TestExample' hack/make.sh binary test-integration
     ```
     ```
 
 
 You can now choose to make changes to the Moby source or the tests. If you
 You can now choose to make changes to the Moby source or the tests. If you

+ 4 - 6
hack/ci/windows.ps1

@@ -831,14 +831,13 @@ Try {
     
     
             #https://blogs.technet.microsoft.com/heyscriptingguy/2011/09/20/solve-problems-with-external-command-lines-in-powershell/ is useful to see tokenising
             #https://blogs.technet.microsoft.com/heyscriptingguy/2011/09/20/solve-problems-with-external-command-lines-in-powershell/ is useful to see tokenising
             $c = "go test "
             $c = "go test "
-            $c += "`"-check.v`" "
+            $c += "`"-test.v`" "
             if ($null -ne $env:INTEGRATION_TEST_NAME) { # Makes is quicker for debugging to be able to run only a subset of the integration tests
             if ($null -ne $env:INTEGRATION_TEST_NAME) { # Makes is quicker for debugging to be able to run only a subset of the integration tests
-                $c += "`"-check.f`" "
+                $c += "`"-test.run`" "
                 $c += "`"$env:INTEGRATION_TEST_NAME`" "
                 $c += "`"$env:INTEGRATION_TEST_NAME`" "
                 Write-Host -ForegroundColor Magenta "WARN: Only running integration tests matching $env:INTEGRATION_TEST_NAME"
                 Write-Host -ForegroundColor Magenta "WARN: Only running integration tests matching $env:INTEGRATION_TEST_NAME"
             }
             }
             $c += "`"-tags`" " + "`"autogen`" "
             $c += "`"-tags`" " + "`"autogen`" "
-            $c += "`"-check.timeout`" " + "`"10m`" "
             $c += "`"-test.timeout`" " + "`"200m`" "
             $c += "`"-test.timeout`" " + "`"200m`" "
     
     
             if ($null -ne $env:INTEGRATION_IN_CONTAINER) {
             if ($null -ne $env:INTEGRATION_IN_CONTAINER) {
@@ -926,14 +925,13 @@ Try {
             } else {
             } else {
                 #https://blogs.technet.microsoft.com/heyscriptingguy/2011/09/20/solve-problems-with-external-command-lines-in-powershell/ is useful to see tokenising
                 #https://blogs.technet.microsoft.com/heyscriptingguy/2011/09/20/solve-problems-with-external-command-lines-in-powershell/ is useful to see tokenising
                 $c = "go test "
                 $c = "go test "
-                $c += "`"-check.v`" "
+                $c += "`"-test.v`" "
                 if ($null -ne $env:INTEGRATION_TEST_NAME) { # Makes is quicker for debugging to be able to run only a subset of the integration tests
                 if ($null -ne $env:INTEGRATION_TEST_NAME) { # Makes is quicker for debugging to be able to run only a subset of the integration tests
-                    $c += "`"-check.f`" "
+                    $c += "`"-test.run`" "
                     $c += "`"$env:INTEGRATION_TEST_NAME`" "
                     $c += "`"$env:INTEGRATION_TEST_NAME`" "
                     Write-Host -ForegroundColor Magenta "WARN: Only running LCOW integration tests matching $env:INTEGRATION_TEST_NAME"
                     Write-Host -ForegroundColor Magenta "WARN: Only running LCOW integration tests matching $env:INTEGRATION_TEST_NAME"
                 }
                 }
                 $c += "`"-tags`" " + "`"autogen`" "
                 $c += "`"-tags`" " + "`"autogen`" "
-                $c += "`"-check.timeout`" " + "`"10m`" "
                 $c += "`"-test.timeout`" " + "`"200m`" "
                 $c += "`"-test.timeout`" " + "`"200m`" "
 
 
                 Write-Host -ForegroundColor Green "INFO: LCOW Integration tests being run from the host:"
                 Write-Host -ForegroundColor Green "INFO: LCOW Integration tests being run from the host:"

+ 11 - 33
hack/make/.integration-test-helpers

@@ -3,20 +3,9 @@
 # For integration-cli test, we use [gocheck](https://labix.org/gocheck), if you want
 # For integration-cli test, we use [gocheck](https://labix.org/gocheck), if you want
 # to run certain tests on your local host, you should run with command:
 # to run certain tests on your local host, you should run with command:
 #
 #
-#     TESTFLAGS='-check.f DockerSuite.TestBuild*' ./hack/make.sh binary test-integration
+#     TESTFLAGS='-test.run TestDockerSuite/TestBuild*' ./hack/make.sh binary test-integration
 #
 #
 
 
-if [[ "${TESTFLAGS}" = *-check.f* ]]; then
-	echo Skipping integration tests since TESTFLAGS includes integration-cli only flags
-	TEST_SKIP_INTEGRATION=1
-fi
-
-if [[ "${TESTFLAGS}" = *-test.run* ]]; then
-	echo Skipping integration-cli tests since TESTFLAGS includes integration only flags
-	TEST_SKIP_INTEGRATION_CLI=1
-fi
-
-
 if [ -z "${MAKEDIR}" ]; then
 if [ -z "${MAKEDIR}" ]; then
 	MAKEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 	MAKEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 	export MAKEDIR
 	export MAKEDIR
@@ -32,24 +21,22 @@ setup_integration_test_filter() {
 	if [ -z "${TEST_FILTER}" ]; then
 	if [ -z "${TEST_FILTER}" ]; then
 		return
 		return
 	fi
 	fi
+	TESTFLAGS+="-test.run ${TEST_FILTER}"
 
 
+	local dirs
+	dirs=$(grep -rIlE --include '*_test.go' "func .*${TEST_FILTER}.*\(. \*testing\.T\)" ./integration*/ | xargs -I file dirname file | uniq)
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
-		: "${TEST_INTEGRATION_DIR:=$(grep -rl "func\ .*${TEST_FILTER}.*\(t\ \*testing\.T\)" ./integration | grep '_test\.go' | xargs -I file dirname file | uniq)}"
+		: "${TEST_INTEGRATION_DIR:=$(echo "$dirs" | grep -v '^\./integration-cli$')}"
 		if [ -z "${TEST_INTEGRATION_DIR}" ]; then
 		if [ -z "${TEST_INTEGRATION_DIR}" ]; then
 			echo "Skipping integration tests since the supplied filter \"${TEST_FILTER}\" omits all integration tests"
 			echo "Skipping integration tests since the supplied filter \"${TEST_FILTER}\" omits all integration tests"
 			TEST_SKIP_INTEGRATION=1
 			TEST_SKIP_INTEGRATION=1
-		else
-			TESTFLAGS_INTEGRATION+="-test.run ${TEST_FILTER}"
 		fi
 		fi
 	fi
 	fi
 
 
 	if [ -z "${TEST_SKIP_INTEGRATION_CLI}" ]; then
 	if [ -z "${TEST_SKIP_INTEGRATION_CLI}" ]; then
-		# ease up on the filtering here since CLI suites are namespaced by an object
-		if grep -r "${TEST_FILTER}.*\(c\ \*check\.C\)" ./integration-cli | grep -q '_test\.go$'; then
+		if echo "$dirs" | grep -vq '^./integration-cli$'; then
 			TEST_SKIP_INTEGRATION_CLI=1
 			TEST_SKIP_INTEGRATION_CLI=1
 			echo "Skipping integration-cli tests since the supplied filter \"${TEST_FILTER}\" omits all integration-cli tests"
 			echo "Skipping integration-cli tests since the supplied filter \"${TEST_FILTER}\" omits all integration-cli tests"
-		else
-			TESTFLAGS_INTEGRATION_CLI+="-check.f ${TEST_FILTER}"
 		fi
 		fi
 	fi
 	fi
 }
 }
@@ -60,16 +47,17 @@ integration_api_dirs="${TEST_INTEGRATION_DIR:-$(go list  -test -f '{{- if ne .Fo
 run_test_integration() {
 run_test_integration() {
 	set_platform_timeout
 	set_platform_timeout
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
 	if [ -z "${TEST_SKIP_INTEGRATION}" ]; then
-		run_test_integration_suites
+		run_test_integration_suites "${integration_api_dirs}"
 	fi
 	fi
 	if [ -z "${TEST_SKIP_INTEGRATION_CLI}" ]; then
 	if [ -z "${TEST_SKIP_INTEGRATION_CLI}" ]; then
-		run_test_integration_legacy_suites
+		TIMEOUT=360m run_test_integration_suites integration-cli
 	fi
 	fi
 }
 }
 
 
 run_test_integration_suites() {
 run_test_integration_suites() {
-	local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS ${TESTFLAGS_INTEGRATION}"
-	for dir in ${integration_api_dirs}; do
+	local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
+	local dirs="$1"
+	for dir in ${dirs}; do
 		if ! (
 		if ! (
 			cd "$dir"
 			cd "$dir"
 			# Create a useful package name based on the tests's $dir. We need to take
 			# Create a useful package name based on the tests's $dir. We need to take
@@ -97,16 +85,6 @@ run_test_integration_suites() {
 	done
 	done
 }
 }
 
 
-run_test_integration_legacy_suites() {
-	(
-		flags="-check.v -check.timeout=${TIMEOUT} -test.timeout=360m $TESTFLAGS ${TESTFLAGS_INTEGRATION_CLI}"
-		cd integration-cli
-		echo "Running $PWD flags=${flags}"
-		# shellcheck disable=SC2086
-		test_env ./test.main $flags
-	)
-}
-
 build_test_suite_binaries() {
 build_test_suite_binaries() {
 	if [ -n "${DOCKER_INTEGRATION_TESTS_VERIFIED}" ]; then
 	if [ -n "${DOCKER_INTEGRATION_TESTS_VERIFIED}" ]; then
 		echo "Skipping building test binaries; as DOCKER_INTEGRATION_TESTS_VERIFIED is set"
 		echo "Skipping building test binaries; as DOCKER_INTEGRATION_TESTS_VERIFIED is set"

+ 3 - 7
hack/test/e2e-run.sh

@@ -18,12 +18,8 @@ integration_api_dirs=${TEST_INTEGRATION_DIR:-"$(
 
 
 run_test_integration() {
 run_test_integration() {
 	set_platform_timeout
 	set_platform_timeout
-	if [[ "$TESTFLAGS" != *-check.f* ]]; then
-		run_test_integration_suites
-	fi
-	if [[ "$TESTFLAGS" != *-test.run* ]]; then
-		run_test_integration_legacy_suites
-	fi
+	run_test_integration_suites
+	run_test_integration_legacy_suites
 }
 }
 
 
 run_test_integration_suites() {
 run_test_integration_suites() {
@@ -39,7 +35,7 @@ run_test_integration_suites() {
 
 
 run_test_integration_legacy_suites() {
 run_test_integration_legacy_suites() {
 	(
 	(
-		flags="-check.v -check.timeout=${TIMEOUT:-200m} -test.timeout=360m $TESTFLAGS"
+		flags="-test.v -test.timeout=360m $TESTFLAGS"
 		cd /tests/integration-cli
 		cd /tests/integration-cli
 		echo "Running $PWD"
 		echo "Running $PWD"
 		test_env ./test.main $flags
 		test_env ./test.main $flags

+ 1 - 1
hack/test/unit

@@ -13,7 +13,7 @@
 set -eu -o pipefail
 set -eu -o pipefail
 
 
 BUILDFLAGS=( -tags 'netgo seccomp libdm_no_deferred_remove' )
 BUILDFLAGS=( -tags 'netgo seccomp libdm_no_deferred_remove' )
-TESTFLAGS+="-test.timeout=${TIMEOUT:-5m}"
+TESTFLAGS+=" -test.timeout=${TIMEOUT:-5m}"
 TESTDIRS="${TESTDIRS:-./...}"
 TESTDIRS="${TESTDIRS:-./...}"
 exclude_paths='/vendor/|/integration'
 exclude_paths='/vendor/|/integration'
 pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")
 pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")

+ 0 - 1
hack/validate/default

@@ -10,7 +10,6 @@ export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 . ${SCRIPTDIR}/pkg-imports
 . ${SCRIPTDIR}/pkg-imports
 . ${SCRIPTDIR}/swagger
 . ${SCRIPTDIR}/swagger
 . ${SCRIPTDIR}/swagger-gen
 . ${SCRIPTDIR}/swagger-gen
-. ${SCRIPTDIR}/test-imports
 . ${SCRIPTDIR}/toml
 . ${SCRIPTDIR}/toml
 . ${SCRIPTDIR}/changelog-well-formed
 . ${SCRIPTDIR}/changelog-well-formed
 . ${SCRIPTDIR}/changelog-date-descending
 . ${SCRIPTDIR}/changelog-date-descending

+ 0 - 38
hack/validate/test-imports

@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-# Make sure we're not using gos' Testing package any more in integration-cli
-
-export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-source "${SCRIPTDIR}/.validate"
-
-IFS=$'\n'
-files=( $(validate_diff --diff-filter=ACMR --name-only -- 'integration-cli/*.go' || true) )
-unset IFS
-
-badFiles=()
-for f in "${files[@]}"; do
-	# skip check_test.go since it *does* use the testing package
-	if [ "$f" = "integration-cli/check_test.go" ]; then
-		continue
-	fi
-
-	# we use "git show" here to validate that what's committed doesn't contain golang built-in testing
-	if git show "$VALIDATE_HEAD:$f" | grep -q testing.T; then
-		if [ "$(echo $f | grep '_test')" ]; then
-			# allow testing.T for non- _test files
-			badFiles+=( "$f" )
-		fi
-	fi
-done
-
-if [ ${#badFiles[@]} -eq 0 ]; then
-	echo 'Congratulations!  No testing.T found.'
-else
-	{
-		echo "These files use the wrong testing infrastructure:"
-		for f in "${badFiles[@]}"; do
-			echo " - $f"
-		done
-		echo
-	} >&2
-	false
-fi

+ 2 - 2
integration-cli/benchmark_test.go

@@ -7,12 +7,12 @@ import (
 	"runtime"
 	"runtime"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) BenchmarkConcurrentContainerActions(c *check.C) {
+func (s *DockerSuite) BenchmarkConcurrentContainerActions(c *testing.B) {
 	maxConcurrency := runtime.GOMAXPROCS(0)
 	maxConcurrency := runtime.GOMAXPROCS(0)
 	numIterations := c.N
 	numIterations := c.N
 	outerGroup := &sync.WaitGroup{}
 	outerGroup := &sync.WaitGroup{}

+ 98 - 77
integration-cli/check_test.go

@@ -2,6 +2,7 @@ package main
 
 
 import (
 import (
 	"context"
 	"context"
+	"flag"
 	"fmt"
 	"fmt"
 	"io/ioutil"
 	"io/ioutil"
 	"net/http/httptest"
 	"net/http/httptest"
@@ -22,8 +23,8 @@ import (
 	"github.com/docker/docker/internal/test/fakestorage"
 	"github.com/docker/docker/internal/test/fakestorage"
 	"github.com/docker/docker/internal/test/fixtures/plugin"
 	"github.com/docker/docker/internal/test/fixtures/plugin"
 	"github.com/docker/docker/internal/test/registry"
 	"github.com/docker/docker/internal/test/registry"
+	"github.com/docker/docker/internal/test/suite"
 	"github.com/docker/docker/pkg/reexec"
 	"github.com/docker/docker/pkg/reexec"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -43,6 +44,8 @@ var (
 
 
 	// the docker client binary to use
 	// the docker client binary to use
 	dockerBinary = ""
 	dockerBinary = ""
+
+	testEnvOnce sync.Once
 )
 )
 
 
 func init() {
 func init() {
@@ -58,6 +61,9 @@ func init() {
 }
 }
 
 
 func TestMain(m *testing.M) {
 func TestMain(m *testing.M) {
+	flag.Parse()
+
+	// Global set up
 	dockerBinary = testEnv.DockerBinary()
 	dockerBinary = testEnv.DockerBinary()
 	err := ienv.EnsureFrozenImagesLinux(&testEnv.Execution)
 	err := ienv.EnsureFrozenImagesLinux(&testEnv.Execution)
 	if err != nil {
 	if err != nil {
@@ -69,21 +75,78 @@ func TestMain(m *testing.M) {
 	os.Exit(m.Run())
 	os.Exit(m.Run())
 }
 }
 
 
-func Test(t *testing.T) {
-	cli.SetTestEnvironment(testEnv)
-	fakestorage.SetTestEnvironment(&testEnv.Execution)
-	ienv.ProtectAll(t, &testEnv.Execution)
-	check.TestingT(t)
+func ensureTestEnvSetup(t *testing.T) {
+	testEnvOnce.Do(func() {
+		cli.SetTestEnvironment(testEnv)
+		fakestorage.SetTestEnvironment(&testEnv.Execution)
+		ienv.ProtectAll(t, &testEnv.Execution)
+	})
 }
 }
 
 
-func init() {
-	check.Suite(&DockerSuite{})
+func TestDockerSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerSuite{})
+}
+
+func TestDockerRegistrySuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerRegistrySuite{ds: &DockerSuite{}})
+}
+
+func TestDockerSchema1RegistrySuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerSchema1RegistrySuite{ds: &DockerSuite{}})
+}
+
+func TestDockerRegistryAuthHtpasswdSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerRegistryAuthHtpasswdSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerRegistryAuthTokenSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerRegistryAuthTokenSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerDaemonSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerDaemonSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerSwarmSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerSwarmSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerPluginSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	suite.Run(t, &DockerPluginSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerExternalVolumeSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	testRequires(t, DaemonIsLinux)
+	suite.Run(t, &DockerExternalVolumeSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerNetworkSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	testRequires(t, DaemonIsLinux)
+	suite.Run(t, &DockerExternalVolumeSuite{ds: &DockerSuite{}})
+}
+
+func TestDockerHubPullSuite(t *testing.T) {
+	ensureTestEnvSetup(t)
+	// FIXME. Temporarily turning this off for Windows as GH16039 was breaking
+	// Windows to Linux CI @icecrime
+	testRequires(t, DaemonIsLinux)
+	suite.Run(t, newDockerHubPullSuite())
 }
 }
 
 
 type DockerSuite struct {
 type DockerSuite struct {
 }
 }
 
 
-func (s *DockerSuite) OnTimeout(c *check.C) {
+func (s *DockerSuite) OnTimeout(c *testing.T) {
 	if testEnv.IsRemoteDaemon() {
 	if testEnv.IsRemoteDaemon() {
 		return
 		return
 	}
 	}
@@ -104,34 +167,28 @@ func (s *DockerSuite) OnTimeout(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TearDownTest(c *check.C) {
+func (s *DockerSuite) TearDownTest(c *testing.T) {
 	testEnv.Clean(c)
 	testEnv.Clean(c)
 }
 }
 
 
-func init() {
-	check.Suite(&DockerRegistrySuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerRegistrySuite struct {
 type DockerRegistrySuite struct {
 	ds  *DockerSuite
 	ds  *DockerSuite
 	reg *registry.V2
 	reg *registry.V2
 	d   *daemon.Daemon
 	d   *daemon.Daemon
 }
 }
 
 
-func (s *DockerRegistrySuite) OnTimeout(c *check.C) {
+func (s *DockerRegistrySuite) OnTimeout(c *testing.T) {
 	s.d.DumpStackAndQuit()
 	s.d.DumpStackAndQuit()
 }
 }
 
 
-func (s *DockerRegistrySuite) SetUpTest(c *check.C) {
+func (s *DockerRegistrySuite) SetUpTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
 	s.reg = registry.NewV2(c)
 	s.reg = registry.NewV2(c)
 	s.reg.WaitReady(c)
 	s.reg.WaitReady(c)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 }
 }
 
 
-func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
+func (s *DockerRegistrySuite) TearDownTest(c *testing.T) {
 	if s.reg != nil {
 	if s.reg != nil {
 		s.reg.Close()
 		s.reg.Close()
 	}
 	}
@@ -141,30 +198,24 @@ func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
 	s.ds.TearDownTest(c)
 	s.ds.TearDownTest(c)
 }
 }
 
 
-func init() {
-	check.Suite(&DockerSchema1RegistrySuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerSchema1RegistrySuite struct {
 type DockerSchema1RegistrySuite struct {
 	ds  *DockerSuite
 	ds  *DockerSuite
 	reg *registry.V2
 	reg *registry.V2
 	d   *daemon.Daemon
 	d   *daemon.Daemon
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) OnTimeout(c *check.C) {
+func (s *DockerSchema1RegistrySuite) OnTimeout(c *testing.T) {
 	s.d.DumpStackAndQuit()
 	s.d.DumpStackAndQuit()
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) SetUpTest(c *check.C) {
+func (s *DockerSchema1RegistrySuite) SetUpTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, RegistryHosting, NotArm64, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, RegistryHosting, NotArm64, testEnv.IsLocalDaemon)
 	s.reg = registry.NewV2(c, registry.Schema1)
 	s.reg = registry.NewV2(c, registry.Schema1)
 	s.reg.WaitReady(c)
 	s.reg.WaitReady(c)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TearDownTest(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TearDownTest(c *testing.T) {
 	if s.reg != nil {
 	if s.reg != nil {
 		s.reg.Close()
 		s.reg.Close()
 	}
 	}
@@ -174,30 +225,24 @@ func (s *DockerSchema1RegistrySuite) TearDownTest(c *check.C) {
 	s.ds.TearDownTest(c)
 	s.ds.TearDownTest(c)
 }
 }
 
 
-func init() {
-	check.Suite(&DockerRegistryAuthHtpasswdSuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerRegistryAuthHtpasswdSuite struct {
 type DockerRegistryAuthHtpasswdSuite struct {
 	ds  *DockerSuite
 	ds  *DockerSuite
 	reg *registry.V2
 	reg *registry.V2
 	d   *daemon.Daemon
 	d   *daemon.Daemon
 }
 }
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) OnTimeout(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) OnTimeout(c *testing.T) {
 	s.d.DumpStackAndQuit()
 	s.d.DumpStackAndQuit()
 }
 }
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) SetUpTest(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) SetUpTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
 	s.reg = registry.NewV2(c, registry.Htpasswd)
 	s.reg = registry.NewV2(c, registry.Htpasswd)
 	s.reg.WaitReady(c)
 	s.reg.WaitReady(c)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 }
 }
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) TearDownTest(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TearDownTest(c *testing.T) {
 	if s.reg != nil {
 	if s.reg != nil {
 		out, err := s.d.Cmd("logout", privateRegistryURL)
 		out, err := s.d.Cmd("logout", privateRegistryURL)
 		assert.NilError(c, err, out)
 		assert.NilError(c, err, out)
@@ -209,28 +254,22 @@ func (s *DockerRegistryAuthHtpasswdSuite) TearDownTest(c *check.C) {
 	s.ds.TearDownTest(c)
 	s.ds.TearDownTest(c)
 }
 }
 
 
-func init() {
-	check.Suite(&DockerRegistryAuthTokenSuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerRegistryAuthTokenSuite struct {
 type DockerRegistryAuthTokenSuite struct {
 	ds  *DockerSuite
 	ds  *DockerSuite
 	reg *registry.V2
 	reg *registry.V2
 	d   *daemon.Daemon
 	d   *daemon.Daemon
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) OnTimeout(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) OnTimeout(c *testing.T) {
 	s.d.DumpStackAndQuit()
 	s.d.DumpStackAndQuit()
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) SetUpTest(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) SetUpTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, RegistryHosting, testEnv.IsLocalDaemon)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) TearDownTest(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) TearDownTest(c *testing.T) {
 	if s.reg != nil {
 	if s.reg != nil {
 		out, err := s.d.Cmd("logout", privateRegistryURL)
 		out, err := s.d.Cmd("logout", privateRegistryURL)
 		assert.NilError(c, err, out)
 		assert.NilError(c, err, out)
@@ -242,7 +281,7 @@ func (s *DockerRegistryAuthTokenSuite) TearDownTest(c *check.C) {
 	s.ds.TearDownTest(c)
 	s.ds.TearDownTest(c)
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) setupRegistryWithTokenService(c *check.C, tokenURL string) {
+func (s *DockerRegistryAuthTokenSuite) setupRegistryWithTokenService(c *testing.T, tokenURL string) {
 	if s == nil {
 	if s == nil {
 		c.Fatal("registry suite isn't initialized")
 		c.Fatal("registry suite isn't initialized")
 	}
 	}
@@ -250,27 +289,21 @@ func (s *DockerRegistryAuthTokenSuite) setupRegistryWithTokenService(c *check.C,
 	s.reg.WaitReady(c)
 	s.reg.WaitReady(c)
 }
 }
 
 
-func init() {
-	check.Suite(&DockerDaemonSuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerDaemonSuite struct {
 type DockerDaemonSuite struct {
 	ds *DockerSuite
 	ds *DockerSuite
 	d  *daemon.Daemon
 	d  *daemon.Daemon
 }
 }
 
 
-func (s *DockerDaemonSuite) OnTimeout(c *check.C) {
+func (s *DockerDaemonSuite) OnTimeout(c *testing.T) {
 	s.d.DumpStackAndQuit()
 	s.d.DumpStackAndQuit()
 }
 }
 
 
-func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
+func (s *DockerDaemonSuite) SetUpTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 }
 }
 
 
-func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
+func (s *DockerDaemonSuite) TearDownTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	if s.d != nil {
 	if s.d != nil {
 		s.d.Stop(c)
 		s.d.Stop(c)
@@ -278,7 +311,7 @@ func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
 	s.ds.TearDownTest(c)
 	s.ds.TearDownTest(c)
 }
 }
 
 
-func (s *DockerDaemonSuite) TearDownSuite(c *check.C) {
+func (s *DockerDaemonSuite) TearDownSuite(c *testing.T) {
 	filepath.Walk(testdaemon.SockRoot, func(path string, fi os.FileInfo, err error) error {
 	filepath.Walk(testdaemon.SockRoot, func(path string, fi os.FileInfo, err error) error {
 		if err != nil {
 		if err != nil {
 			// ignore errors here
 			// ignore errors here
@@ -295,12 +328,6 @@ func (s *DockerDaemonSuite) TearDownSuite(c *check.C) {
 
 
 const defaultSwarmPort = 2477
 const defaultSwarmPort = 2477
 
 
-func init() {
-	check.Suite(&DockerSwarmSuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerSwarmSuite struct {
 type DockerSwarmSuite struct {
 	server      *httptest.Server
 	server      *httptest.Server
 	ds          *DockerSuite
 	ds          *DockerSuite
@@ -309,7 +336,7 @@ type DockerSwarmSuite struct {
 	portIndex   int
 	portIndex   int
 }
 }
 
 
-func (s *DockerSwarmSuite) OnTimeout(c *check.C) {
+func (s *DockerSwarmSuite) OnTimeout(c *testing.T) {
 	s.daemonsLock.Lock()
 	s.daemonsLock.Lock()
 	defer s.daemonsLock.Unlock()
 	defer s.daemonsLock.Unlock()
 	for _, d := range s.daemons {
 	for _, d := range s.daemons {
@@ -317,11 +344,11 @@ func (s *DockerSwarmSuite) OnTimeout(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) SetUpTest(c *check.C) {
+func (s *DockerSwarmSuite) SetUpTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 }
 }
 
 
-func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *daemon.Daemon {
+func (s *DockerSwarmSuite) AddDaemon(c *testing.T, joinSwarm, manager bool) *daemon.Daemon {
 	d := daemon.New(c, dockerBinary, dockerdBinary,
 	d := daemon.New(c, dockerBinary, dockerdBinary,
 		testdaemon.WithEnvironment(testEnv.Execution),
 		testdaemon.WithEnvironment(testEnv.Execution),
 		testdaemon.WithSwarmPort(defaultSwarmPort+s.portIndex),
 		testdaemon.WithSwarmPort(defaultSwarmPort+s.portIndex),
@@ -344,7 +371,7 @@ func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *daemo
 	return d
 	return d
 }
 }
 
 
-func (s *DockerSwarmSuite) TearDownTest(c *check.C) {
+func (s *DockerSwarmSuite) TearDownTest(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	s.daemonsLock.Lock()
 	s.daemonsLock.Lock()
 	for _, d := range s.daemons {
 	for _, d := range s.daemons {
@@ -359,12 +386,6 @@ func (s *DockerSwarmSuite) TearDownTest(c *check.C) {
 	s.ds.TearDownTest(c)
 	s.ds.TearDownTest(c)
 }
 }
 
 
-func init() {
-	check.Suite(&DockerPluginSuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type DockerPluginSuite struct {
 type DockerPluginSuite struct {
 	ds       *DockerSuite
 	ds       *DockerSuite
 	registry *registry.V2
 	registry *registry.V2
@@ -381,7 +402,7 @@ func (ps *DockerPluginSuite) getPluginRepoWithTag() string {
 	return ps.getPluginRepo() + ":" + "latest"
 	return ps.getPluginRepo() + ":" + "latest"
 }
 }
 
 
-func (ps *DockerPluginSuite) SetUpSuite(c *check.C) {
+func (ps *DockerPluginSuite) SetUpSuite(c *testing.T) {
 	testRequires(c, DaemonIsLinux, RegistryHosting)
 	testRequires(c, DaemonIsLinux, RegistryHosting)
 	ps.registry = registry.NewV2(c)
 	ps.registry = registry.NewV2(c)
 	ps.registry.WaitReady(c)
 	ps.registry.WaitReady(c)
@@ -393,16 +414,16 @@ func (ps *DockerPluginSuite) SetUpSuite(c *check.C) {
 	assert.NilError(c, err, "failed to create plugin")
 	assert.NilError(c, err, "failed to create plugin")
 }
 }
 
 
-func (ps *DockerPluginSuite) TearDownSuite(c *check.C) {
+func (ps *DockerPluginSuite) TearDownSuite(c *testing.T) {
 	if ps.registry != nil {
 	if ps.registry != nil {
 		ps.registry.Close()
 		ps.registry.Close()
 	}
 	}
 }
 }
 
 
-func (ps *DockerPluginSuite) TearDownTest(c *check.C) {
+func (ps *DockerPluginSuite) TearDownTest(c *testing.T) {
 	ps.ds.TearDownTest(c)
 	ps.ds.TearDownTest(c)
 }
 }
 
 
-func (ps *DockerPluginSuite) OnTimeout(c *check.C) {
+func (ps *DockerPluginSuite) OnTimeout(c *testing.T) {
 	ps.ds.OnTimeout(c)
 	ps.ds.OnTimeout(c)
 }
 }

+ 79 - 19
integration-cli/checker/checker.go

@@ -1,24 +1,84 @@
-// Package checker provides Docker specific implementations of the go-check.Checker interface.
+// Package checker provides helpers for gotest.tools/assert.
+// Please remove this package whenever possible.
 package checker // import "github.com/docker/docker/integration-cli/checker"
 package checker // import "github.com/docker/docker/integration-cli/checker"
 
 
 import (
 import (
-	"github.com/go-check/check"
-	"github.com/vdemeester/shakers"
-)
+	"fmt"
 
 
-// As a commodity, we bring all check.Checker variables into the current namespace to avoid having
-// to think about check.X versus checker.X.
-var (
-	DeepEquals = check.DeepEquals
-	HasLen     = check.HasLen
-	IsNil      = check.IsNil
-	Matches    = check.Matches
-	Not        = check.Not
-	NotNil     = check.NotNil
-
-	Contains    = shakers.Contains
-	Equals      = shakers.Equals
-	False       = shakers.False
-	GreaterThan = shakers.GreaterThan
-	True        = shakers.True
+	"gotest.tools/assert"
+	"gotest.tools/assert/cmp"
 )
 )
+
+// Compare defines the interface to compare values
+type Compare func(x interface{}) assert.BoolOrComparison
+
+// False checks if the value is false
+func False() Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return !x.(bool)
+	}
+}
+
+// True checks if the value is true
+func True() Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return x
+	}
+}
+
+// Equals checks if the value is equal to the given value
+func Equals(y interface{}) Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return cmp.Equal(x, y)
+	}
+}
+
+// Contains checks if the value contains the given value
+func Contains(y interface{}) Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return cmp.Contains(x, y)
+	}
+}
+
+// Not checks if two values are not
+func Not(c Compare) Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		r := c(x)
+		switch r := r.(type) {
+		case bool:
+			return !r
+		case cmp.Comparison:
+			return !r().Success()
+		default:
+			panic(fmt.Sprintf("unexpected type %T", r))
+		}
+	}
+}
+
+// DeepEquals checks if two values are equal
+func DeepEquals(y interface{}) Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return cmp.DeepEqual(x, y)
+	}
+}
+
+// DeepEquals compares if two values are deepequal
+func HasLen(y int) Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return cmp.Len(x, y)
+	}
+}
+
+// DeepEquals checks if the given value is nil
+func IsNil() Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return cmp.Nil(x)
+	}
+}
+
+// GreaterThan checks if the value is greater than the given value
+func GreaterThan(y int) Compare {
+	return func(x interface{}) assert.BoolOrComparison {
+		return x.(int) > y
+	}
+}

+ 4 - 4
integration-cli/daemon/daemon.go

@@ -3,10 +3,10 @@ package daemon // import "github.com/docker/docker/integration-cli/daemon"
 import (
 import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/internal/test/daemon"
 	"github.com/docker/docker/internal/test/daemon"
-	"github.com/go-check/check"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
@@ -88,13 +88,13 @@ func (d *Daemon) inspectFieldWithError(name, field string) (string, error) {
 
 
 // CheckActiveContainerCount returns the number of active containers
 // CheckActiveContainerCount returns the number of active containers
 // FIXME(vdemeester) should re-use ActivateContainers in some way
 // FIXME(vdemeester) should re-use ActivateContainers in some way
-func (d *Daemon) CheckActiveContainerCount(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckActiveContainerCount(c *testing.T) (interface{}, string) {
 	out, err := d.Cmd("ps", "-q")
 	out, err := d.Cmd("ps", "-q")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	if len(strings.TrimSpace(out)) == 0 {
 	if len(strings.TrimSpace(out)) == 0 {
-		return 0, nil
+		return 0, ""
 	}
 	}
-	return len(strings.Split(strings.TrimSpace(out), "\n")), check.Commentf("output: %q", string(out))
+	return len(strings.Split(strings.TrimSpace(out), "\n")), fmt.Sprintf("output: %q", string(out))
 }
 }
 
 
 // WaitRun waits for a container to be running for 10s
 // WaitRun waits for a container to be running for 10s

+ 37 - 37
integration-cli/daemon/daemon_swarm.go

@@ -4,19 +4,19 @@ import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // CheckServiceTasksInState returns the number of tasks with a matching state,
 // CheckServiceTasksInState returns the number of tasks with a matching state,
 // and optional message substring.
 // and optional message substring.
-func (d *Daemon) CheckServiceTasksInState(service string, state swarm.TaskState, message string) func(*check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckServiceTasksInState(service string, state swarm.TaskState, message string) func(*testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		tasks := d.GetServiceTasks(c, service)
 		tasks := d.GetServiceTasks(c, service)
 		var count int
 		var count int
 		for _, task := range tasks {
 		for _, task := range tasks {
@@ -26,14 +26,14 @@ func (d *Daemon) CheckServiceTasksInState(service string, state swarm.TaskState,
 				}
 				}
 			}
 			}
 		}
 		}
-		return count, nil
+		return count, ""
 	}
 	}
 }
 }
 
 
 // CheckServiceTasksInStateWithError returns the number of tasks with a matching state,
 // CheckServiceTasksInStateWithError returns the number of tasks with a matching state,
 // and optional message substring.
 // and optional message substring.
-func (d *Daemon) CheckServiceTasksInStateWithError(service string, state swarm.TaskState, errorMessage string) func(*check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckServiceTasksInStateWithError(service string, state swarm.TaskState, errorMessage string) func(*testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		tasks := d.GetServiceTasks(c, service)
 		tasks := d.GetServiceTasks(c, service)
 		var count int
 		var count int
 		for _, task := range tasks {
 		for _, task := range tasks {
@@ -43,62 +43,62 @@ func (d *Daemon) CheckServiceTasksInStateWithError(service string, state swarm.T
 				}
 				}
 			}
 			}
 		}
 		}
-		return count, nil
+		return count, ""
 	}
 	}
 }
 }
 
 
 // CheckServiceRunningTasks returns the number of running tasks for the specified service
 // CheckServiceRunningTasks returns the number of running tasks for the specified service
-func (d *Daemon) CheckServiceRunningTasks(service string) func(*check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckServiceRunningTasks(service string) func(*testing.T) (interface{}, string) {
 	return d.CheckServiceTasksInState(service, swarm.TaskStateRunning, "")
 	return d.CheckServiceTasksInState(service, swarm.TaskStateRunning, "")
 }
 }
 
 
 // CheckServiceUpdateState returns the current update state for the specified service
 // CheckServiceUpdateState returns the current update state for the specified service
-func (d *Daemon) CheckServiceUpdateState(service string) func(*check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckServiceUpdateState(service string) func(*testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		service := d.GetService(c, service)
 		service := d.GetService(c, service)
 		if service.UpdateStatus == nil {
 		if service.UpdateStatus == nil {
-			return "", nil
+			return "", ""
 		}
 		}
-		return service.UpdateStatus.State, nil
+		return service.UpdateStatus.State, ""
 	}
 	}
 }
 }
 
 
 // CheckPluginRunning returns the runtime state of the plugin
 // CheckPluginRunning returns the runtime state of the plugin
-func (d *Daemon) CheckPluginRunning(plugin string) func(c *check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckPluginRunning(plugin string) func(c *testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		apiclient := d.NewClientT(c)
 		apiclient := d.NewClientT(c)
 		resp, _, err := apiclient.PluginInspectWithRaw(context.Background(), plugin)
 		resp, _, err := apiclient.PluginInspectWithRaw(context.Background(), plugin)
 		if client.IsErrNotFound(err) {
 		if client.IsErrNotFound(err) {
-			return false, check.Commentf("%v", err)
+			return false, fmt.Sprintf("%v", err)
 		}
 		}
 		assert.NilError(c, err)
 		assert.NilError(c, err)
-		return resp.Enabled, check.Commentf("%+v", resp)
+		return resp.Enabled, fmt.Sprintf("%+v", resp)
 	}
 	}
 }
 }
 
 
 // CheckPluginImage returns the runtime state of the plugin
 // CheckPluginImage returns the runtime state of the plugin
-func (d *Daemon) CheckPluginImage(plugin string) func(c *check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckPluginImage(plugin string) func(c *testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		apiclient := d.NewClientT(c)
 		apiclient := d.NewClientT(c)
 		resp, _, err := apiclient.PluginInspectWithRaw(context.Background(), plugin)
 		resp, _, err := apiclient.PluginInspectWithRaw(context.Background(), plugin)
 		if client.IsErrNotFound(err) {
 		if client.IsErrNotFound(err) {
-			return false, check.Commentf("%v", err)
+			return false, fmt.Sprintf("%v", err)
 		}
 		}
 		assert.NilError(c, err)
 		assert.NilError(c, err)
-		return resp.PluginReference, check.Commentf("%+v", resp)
+		return resp.PluginReference, fmt.Sprintf("%+v", resp)
 	}
 	}
 }
 }
 
 
 // CheckServiceTasks returns the number of tasks for the specified service
 // CheckServiceTasks returns the number of tasks for the specified service
-func (d *Daemon) CheckServiceTasks(service string) func(*check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckServiceTasks(service string) func(*testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		tasks := d.GetServiceTasks(c, service)
 		tasks := d.GetServiceTasks(c, service)
-		return len(tasks), nil
+		return len(tasks), ""
 	}
 	}
 }
 }
 
 
 // CheckRunningTaskNetworks returns the number of times each network is referenced from a task.
 // CheckRunningTaskNetworks returns the number of times each network is referenced from a task.
-func (d *Daemon) CheckRunningTaskNetworks(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckRunningTaskNetworks(c *testing.T) (interface{}, string) {
 	cli := d.NewClientT(c)
 	cli := d.NewClientT(c)
 	defer cli.Close()
 	defer cli.Close()
 
 
@@ -118,11 +118,11 @@ func (d *Daemon) CheckRunningTaskNetworks(c *check.C) (interface{}, check.Commen
 			result[network.Target]++
 			result[network.Target]++
 		}
 		}
 	}
 	}
-	return result, nil
+	return result, ""
 }
 }
 
 
 // CheckRunningTaskImages returns the times each image is running as a task.
 // CheckRunningTaskImages returns the times each image is running as a task.
-func (d *Daemon) CheckRunningTaskImages(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckRunningTaskImages(c *testing.T) (interface{}, string) {
 	cli := d.NewClientT(c)
 	cli := d.NewClientT(c)
 	defer cli.Close()
 	defer cli.Close()
 
 
@@ -142,11 +142,11 @@ func (d *Daemon) CheckRunningTaskImages(c *check.C) (interface{}, check.CommentI
 			result[task.Spec.ContainerSpec.Image]++
 			result[task.Spec.ContainerSpec.Image]++
 		}
 		}
 	}
 	}
-	return result, nil
+	return result, ""
 }
 }
 
 
 // CheckNodeReadyCount returns the number of ready node on the swarm
 // CheckNodeReadyCount returns the number of ready node on the swarm
-func (d *Daemon) CheckNodeReadyCount(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckNodeReadyCount(c *testing.T) (interface{}, string) {
 	nodes := d.ListNodes(c)
 	nodes := d.ListNodes(c)
 	var readyCount int
 	var readyCount int
 	for _, node := range nodes {
 	for _, node := range nodes {
@@ -154,28 +154,28 @@ func (d *Daemon) CheckNodeReadyCount(c *check.C) (interface{}, check.CommentInte
 			readyCount++
 			readyCount++
 		}
 		}
 	}
 	}
-	return readyCount, nil
+	return readyCount, ""
 }
 }
 
 
 // CheckLocalNodeState returns the current swarm node state
 // CheckLocalNodeState returns the current swarm node state
-func (d *Daemon) CheckLocalNodeState(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckLocalNodeState(c *testing.T) (interface{}, string) {
 	info := d.SwarmInfo(c)
 	info := d.SwarmInfo(c)
-	return info.LocalNodeState, nil
+	return info.LocalNodeState, ""
 }
 }
 
 
 // CheckControlAvailable returns the current swarm control available
 // CheckControlAvailable returns the current swarm control available
-func (d *Daemon) CheckControlAvailable(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckControlAvailable(c *testing.T) (interface{}, string) {
 	info := d.SwarmInfo(c)
 	info := d.SwarmInfo(c)
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateActive)
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateActive)
-	return info.ControlAvailable, nil
+	return info.ControlAvailable, ""
 }
 }
 
 
 // CheckLeader returns whether there is a leader on the swarm or not
 // CheckLeader returns whether there is a leader on the swarm or not
-func (d *Daemon) CheckLeader(c *check.C) (interface{}, check.CommentInterface) {
+func (d *Daemon) CheckLeader(c *testing.T) (interface{}, string) {
 	cli := d.NewClientT(c)
 	cli := d.NewClientT(c)
 	defer cli.Close()
 	defer cli.Close()
 
 
-	errList := check.Commentf("could not get node list")
+	errList := "could not get node list"
 
 
 	ls, err := cli.NodeList(context.Background(), types.NodeListOptions{})
 	ls, err := cli.NodeList(context.Background(), types.NodeListOptions{})
 	if err != nil {
 	if err != nil {
@@ -184,10 +184,10 @@ func (d *Daemon) CheckLeader(c *check.C) (interface{}, check.CommentInterface) {
 
 
 	for _, node := range ls {
 	for _, node := range ls {
 		if node.ManagerStatus != nil && node.ManagerStatus.Leader {
 		if node.ManagerStatus != nil && node.ManagerStatus.Leader {
-			return nil, nil
+			return nil, ""
 		}
 		}
 	}
 	}
-	return fmt.Errorf("no leader"), check.Commentf("could not find leader")
+	return fmt.Errorf("no leader"), "could not find leader"
 }
 }
 
 
 // CmdRetryOutOfSequence tries the specified command against the current daemon
 // CmdRetryOutOfSequence tries the specified command against the current daemon

+ 4 - 3
integration-cli/daemon_swarm_hack_test.go

@@ -1,11 +1,12 @@
 package main
 package main
 
 
 import (
 import (
+	"testing"
+
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
-	"github.com/go-check/check"
 )
 )
 
 
-func (s *DockerSwarmSuite) getDaemon(c *check.C, nodeID string) *daemon.Daemon {
+func (s *DockerSwarmSuite) getDaemon(c *testing.T, nodeID string) *daemon.Daemon {
 	s.daemonsLock.Lock()
 	s.daemonsLock.Lock()
 	defer s.daemonsLock.Unlock()
 	defer s.daemonsLock.Unlock()
 	for _, d := range s.daemons {
 	for _, d := range s.daemons {
@@ -18,6 +19,6 @@ func (s *DockerSwarmSuite) getDaemon(c *check.C, nodeID string) *daemon.Daemon {
 }
 }
 
 
 // nodeCmd executes a command on a given node via the normal docker socket
 // nodeCmd executes a command on a given node via the normal docker socket
-func (s *DockerSwarmSuite) nodeCmd(c *check.C, id string, args ...string) (string, error) {
+func (s *DockerSwarmSuite) nodeCmd(c *testing.T, id string, args ...string) (string, error) {
 	return s.getDaemon(c, id).Cmd(args...)
 	return s.getDaemon(c, id).Cmd(args...)
 }
 }

+ 5 - 5
integration-cli/docker_api_attach_test.go

@@ -10,20 +10,20 @@ import (
 	"net/http"
 	"net/http"
 	"net/http/httputil"
 	"net/http/httputil"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/docker/docker/pkg/stdcopy"
-	"github.com/go-check/check"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 	"golang.org/x/net/websocket"
 	"golang.org/x/net/websocket"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestGetContainersAttachWebsocket(c *check.C) {
+func (s *DockerSuite) TestGetContainersAttachWebsocket(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-dit", "busybox", "cat")
 	out, _ := dockerCmd(c, "run", "-dit", "busybox", "cat")
 
 
@@ -76,7 +76,7 @@ func (s *DockerSuite) TestGetContainersAttachWebsocket(c *check.C) {
 }
 }
 
 
 // regression gh14320
 // regression gh14320
-func (s *DockerSuite) TestPostContainersAttachContainerNotFound(c *check.C) {
+func (s *DockerSuite) TestPostContainersAttachContainerNotFound(c *testing.T) {
 	resp, _, err := request.Post("/containers/doesnotexist/attach")
 	resp, _, err := request.Post("/containers/doesnotexist/attach")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	// connection will shutdown, err should be "persistent connection closed"
 	// connection will shutdown, err should be "persistent connection closed"
@@ -87,7 +87,7 @@ func (s *DockerSuite) TestPostContainersAttachContainerNotFound(c *check.C) {
 	assert.Equal(c, string(content), expected)
 	assert.Equal(c, string(content), expected)
 }
 }
 
 
-func (s *DockerSuite) TestGetContainersWsAttachContainerNotFound(c *check.C) {
+func (s *DockerSuite) TestGetContainersWsAttachContainerNotFound(c *testing.T) {
 	res, body, err := request.Get("/containers/doesnotexist/attach/ws")
 	res, body, err := request.Get("/containers/doesnotexist/attach/ws")
 	assert.Equal(c, res.StatusCode, http.StatusNotFound)
 	assert.Equal(c, res.StatusCode, http.StatusNotFound)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -97,7 +97,7 @@ func (s *DockerSuite) TestGetContainersWsAttachContainerNotFound(c *check.C) {
 	assert.Assert(c, strings.Contains(getErrorMessage(c, b), expected))
 	assert.Assert(c, strings.Contains(getErrorMessage(c, b), expected))
 }
 }
 
 
-func (s *DockerSuite) TestPostContainersAttach(c *check.C) {
+func (s *DockerSuite) TestPostContainersAttach(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	expectSuccess := func(conn net.Conn, br *bufio.Reader, stream string, tty bool) {
 	expectSuccess := func(conn net.Conn, br *bufio.Reader, stream string, tty bool) {

+ 17 - 17
integration-cli/docker_api_build_test.go

@@ -11,18 +11,18 @@ import (
 	"net/http"
 	"net/http"
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/internal/test/fakegit"
 	"github.com/docker/docker/internal/test/fakegit"
 	"github.com/docker/docker/internal/test/fakestorage"
 	"github.com/docker/docker/internal/test/fakestorage"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestBuildAPIDockerFileRemote(c *check.C) {
+func (s *DockerSuite) TestBuildAPIDockerFileRemote(c *testing.T) {
 	testRequires(c, NotUserNamespace)
 	testRequires(c, NotUserNamespace)
 
 
 	var testD string
 	var testD string
@@ -53,7 +53,7 @@ RUN find /tmp/`
 	assert.Assert(c, !strings.Contains(out, "baz"))
 	assert.Assert(c, !strings.Contains(out, "baz"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildAPIRemoteTarballContext(c *check.C) {
+func (s *DockerSuite) TestBuildAPIRemoteTarballContext(c *testing.T) {
 	buffer := new(bytes.Buffer)
 	buffer := new(bytes.Buffer)
 	tw := tar.NewWriter(buffer)
 	tw := tar.NewWriter(buffer)
 	defer tw.Close()
 	defer tw.Close()
@@ -80,7 +80,7 @@ func (s *DockerSuite) TestBuildAPIRemoteTarballContext(c *check.C) {
 	b.Close()
 	b.Close()
 }
 }
 
 
-func (s *DockerSuite) TestBuildAPIRemoteTarballContextWithCustomDockerfile(c *check.C) {
+func (s *DockerSuite) TestBuildAPIRemoteTarballContextWithCustomDockerfile(c *testing.T) {
 	buffer := new(bytes.Buffer)
 	buffer := new(bytes.Buffer)
 	tw := tar.NewWriter(buffer)
 	tw := tar.NewWriter(buffer)
 	defer tw.Close()
 	defer tw.Close()
@@ -134,7 +134,7 @@ RUN echo 'right'
 	assert.Assert(c, !strings.Contains(string(content), "wrong"))
 	assert.Assert(c, !strings.Contains(string(content), "wrong"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildAPILowerDockerfile(c *check.C) {
+func (s *DockerSuite) TestBuildAPILowerDockerfile(c *testing.T) {
 	git := fakegit.New(c, "repo", map[string]string{
 	git := fakegit.New(c, "repo", map[string]string{
 		"dockerfile": `FROM busybox
 		"dockerfile": `FROM busybox
 RUN echo from dockerfile`,
 RUN echo from dockerfile`,
@@ -152,7 +152,7 @@ RUN echo from dockerfile`,
 	assert.Assert(c, is.Contains(out, "from dockerfile"))
 	assert.Assert(c, is.Contains(out, "from dockerfile"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildAPIBuildGitWithF(c *check.C) {
+func (s *DockerSuite) TestBuildAPIBuildGitWithF(c *testing.T) {
 	git := fakegit.New(c, "repo", map[string]string{
 	git := fakegit.New(c, "repo", map[string]string{
 		"baz": `FROM busybox
 		"baz": `FROM busybox
 RUN echo from baz`,
 RUN echo from baz`,
@@ -173,7 +173,7 @@ RUN echo from Dockerfile`,
 	assert.Assert(c, is.Contains(out, "from baz"))
 	assert.Assert(c, is.Contains(out, "from baz"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildAPIDoubleDockerfile(c *check.C) {
+func (s *DockerSuite) TestBuildAPIDoubleDockerfile(c *testing.T) {
 	testRequires(c, UnixCli) // dockerfile overwrites Dockerfile on Windows
 	testRequires(c, UnixCli) // dockerfile overwrites Dockerfile on Windows
 	git := fakegit.New(c, "repo", map[string]string{
 	git := fakegit.New(c, "repo", map[string]string{
 		"Dockerfile": `FROM busybox
 		"Dockerfile": `FROM busybox
@@ -195,7 +195,7 @@ RUN echo from dockerfile`,
 	assert.Assert(c, is.Contains(out, "from Dockerfile"))
 	assert.Assert(c, is.Contains(out, "from Dockerfile"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *check.C) {
+func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *testing.T) {
 	// Make sure that build context tars with entries of the form
 	// Make sure that build context tars with entries of the form
 	// x/./y don't cause caching false positives.
 	// x/./y don't cause caching false positives.
 
 
@@ -254,7 +254,7 @@ func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *check.C) {
 	assert.Assert(c, imageA != imageB)
 	assert.Assert(c, imageA != imageB)
 }
 }
 
 
-func (s *DockerSuite) TestBuildOnBuildWithCopy(c *check.C) {
+func (s *DockerSuite) TestBuildOnBuildWithCopy(c *testing.T) {
 	dockerfile := `
 	dockerfile := `
 		FROM ` + minimalBaseImage() + ` as onbuildbase
 		FROM ` + minimalBaseImage() + ` as onbuildbase
 		ONBUILD COPY file /file
 		ONBUILD COPY file /file
@@ -279,7 +279,7 @@ func (s *DockerSuite) TestBuildOnBuildWithCopy(c *check.C) {
 	assert.Assert(c, is.Contains(string(out), "Successfully built"))
 	assert.Assert(c, is.Contains(string(out), "Successfully built"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildOnBuildCache(c *check.C) {
+func (s *DockerSuite) TestBuildOnBuildCache(c *testing.T) {
 	build := func(dockerfile string) []byte {
 	build := func(dockerfile string) []byte {
 		ctx := fakecontext.New(c, "",
 		ctx := fakecontext.New(c, "",
 			fakecontext.WithDockerfile(dockerfile),
 			fakecontext.WithDockerfile(dockerfile),
@@ -321,7 +321,7 @@ func (s *DockerSuite) TestBuildOnBuildCache(c *check.C) {
 	assert.Check(c, is.Equal(parentID, image.Parent))
 	assert.Check(c, is.Equal(parentID, image.Parent))
 }
 }
 
 
-func (s *DockerRegistrySuite) TestBuildCopyFromForcePull(c *check.C) {
+func (s *DockerRegistrySuite) TestBuildCopyFromForcePull(c *testing.T) {
 	client := testEnv.APIClient()
 	client := testEnv.APIClient()
 
 
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
@@ -358,7 +358,7 @@ func (s *DockerRegistrySuite) TestBuildCopyFromForcePull(c *check.C) {
 	assert.Check(c, is.Contains(string(out), "Successfully built"))
 	assert.Check(c, is.Contains(string(out), "Successfully built"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildAddRemoteNoDecompress(c *check.C) {
+func (s *DockerSuite) TestBuildAddRemoteNoDecompress(c *testing.T) {
 	buffer := new(bytes.Buffer)
 	buffer := new(bytes.Buffer)
 	tw := tar.NewWriter(buffer)
 	tw := tar.NewWriter(buffer)
 	dt := []byte("contents")
 	dt := []byte("contents")
@@ -402,7 +402,7 @@ func (s *DockerSuite) TestBuildAddRemoteNoDecompress(c *check.C) {
 	assert.Check(c, is.Contains(string(out), "Successfully built"))
 	assert.Check(c, is.Contains(string(out), "Successfully built"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildChownOnCopy(c *check.C) {
+func (s *DockerSuite) TestBuildChownOnCopy(c *testing.T) {
 	// new feature added in 1.31 - https://github.com/moby/moby/pull/34263
 	// new feature added in 1.31 - https://github.com/moby/moby/pull/34263
 	testRequires(c, DaemonIsLinux, MinimumAPIVersion("1.31"))
 	testRequires(c, DaemonIsLinux, MinimumAPIVersion("1.31"))
 	dockerfile := `FROM busybox
 	dockerfile := `FROM busybox
@@ -432,7 +432,7 @@ func (s *DockerSuite) TestBuildChownOnCopy(c *check.C) {
 	assert.Check(c, is.Contains(string(out), "Successfully built"))
 	assert.Check(c, is.Contains(string(out), "Successfully built"))
 }
 }
 
 
-func (s *DockerSuite) TestBuildCopyCacheOnFileChange(c *check.C) {
+func (s *DockerSuite) TestBuildCopyCacheOnFileChange(c *testing.T) {
 
 
 	dockerfile := `FROM busybox
 	dockerfile := `FROM busybox
 COPY file /file`
 COPY file /file`
@@ -473,7 +473,7 @@ COPY file /file`
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestBuildAddCacheOnFileChange(c *check.C) {
+func (s *DockerSuite) TestBuildAddCacheOnFileChange(c *testing.T) {
 
 
 	dockerfile := `FROM busybox
 	dockerfile := `FROM busybox
 ADD file /file`
 ADD file /file`
@@ -514,7 +514,7 @@ ADD file /file`
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestBuildScratchCopy(c *check.C) {
+func (s *DockerSuite) TestBuildScratchCopy(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerfile := `FROM scratch
 	dockerfile := `FROM scratch
 ADD Dockerfile /
 ADD Dockerfile /
@@ -543,7 +543,7 @@ type buildLine struct {
 	}
 	}
 }
 }
 
 
-func getImageIDsFromBuild(c *check.C, output []byte) []string {
+func getImageIDsFromBuild(c *testing.T, output []byte) []string {
 	var ids []string
 	var ids []string
 	for _, line := range bytes.Split(output, []byte("\n")) {
 	for _, line := range bytes.Split(output, []byte("\n")) {
 		if len(line) == 0 {
 		if len(line) == 0 {

+ 2 - 2
integration-cli/docker_api_build_windows_test.go

@@ -4,15 +4,15 @@ package main
 
 
 import (
 import (
 	"net/http"
 	"net/http"
+	"testing"
 
 
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestBuildWithRecycleBin(c *check.C) {
+func (s *DockerSuite) TestBuildWithRecycleBin(c *testing.T) {
 	testRequires(c, DaemonIsWindows)
 	testRequires(c, DaemonIsWindows)
 
 
 	dockerfile := "" +
 	dockerfile := "" +

File diff suppressed because it is too large
+ 134 - 174
integration-cli/docker_api_containers_test.go


+ 2 - 2
integration-cli/docker_api_containers_windows_test.go

@@ -8,17 +8,17 @@ import (
 	"io/ioutil"
 	"io/ioutil"
 	"math/rand"
 	"math/rand"
 	"strings"
 	"strings"
+	"testing"
 
 
 	winio "github.com/Microsoft/go-winio"
 	winio "github.com/Microsoft/go-winio"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/mount"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *check.C) {
+func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsWindowsAtLeastBuild(16299)) // Named pipe support was added in RS3
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsWindowsAtLeastBuild(16299)) // Named pipe support was added in RS3
 
 
 	// Create a host pipe to map into the container
 	// Create a host pipe to map into the container

+ 3 - 3
integration-cli/docker_api_exec_resize_test.go

@@ -8,14 +8,14 @@ import (
 	"net/http"
 	"net/http"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 
 
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestExecResizeAPIHeightWidthNoInt(c *check.C) {
+func (s *DockerSuite) TestExecResizeAPIHeightWidthNoInt(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -31,7 +31,7 @@ func (s *DockerSuite) TestExecResizeAPIHeightWidthNoInt(c *check.C) {
 }
 }
 
 
 // Part of #14845
 // Part of #14845
-func (s *DockerSuite) TestExecResizeImmediatelyAfterExecStart(c *check.C) {
+func (s *DockerSuite) TestExecResizeImmediatelyAfterExecStart(c *testing.T) {
 	name := "exec_resize_test"
 	name := "exec_resize_test"
 	dockerCmd(c, "run", "-d", "-i", "-t", "--name", name, "--restart", "always", "busybox", "/bin/sh")
 	dockerCmd(c, "run", "-d", "-i", "-t", "--name", name, "--restart", "always", "busybox", "/bin/sh")
 
 

+ 25 - 24
integration-cli/docker_api_exec_test.go

@@ -9,6 +9,7 @@ import (
 	"net/http"
 	"net/http"
 	"os"
 	"os"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
@@ -16,12 +17,12 @@ import (
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
+	"gotest.tools/poll"
 )
 )
 
 
 // Regression test for #9414
 // Regression test for #9414
-func (s *DockerSuite) TestExecAPICreateNoCmd(c *check.C) {
+func (s *DockerSuite) TestExecAPICreateNoCmd(c *testing.T) {
 	name := "exec_test"
 	name := "exec_test"
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 
 
@@ -37,7 +38,7 @@ func (s *DockerSuite) TestExecAPICreateNoCmd(c *check.C) {
 	assert.Assert(c, strings.Contains(getErrorMessage(c, b), "No exec command specified"), "Expected message when creating exec command with no Cmd specified")
 	assert.Assert(c, strings.Contains(getErrorMessage(c, b), "No exec command specified"), "Expected message when creating exec command with no Cmd specified")
 }
 }
 
 
-func (s *DockerSuite) TestExecAPICreateNoValidContentType(c *check.C) {
+func (s *DockerSuite) TestExecAPICreateNoValidContentType(c *testing.T) {
 	name := "exec_test"
 	name := "exec_test"
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 
 
@@ -58,7 +59,7 @@ func (s *DockerSuite) TestExecAPICreateNoValidContentType(c *check.C) {
 	assert.Assert(c, strings.Contains(getErrorMessage(c, b), "Content-Type specified"), "Expected message when creating exec command with invalid Content-Type specified")
 	assert.Assert(c, strings.Contains(getErrorMessage(c, b), "Content-Type specified"), "Expected message when creating exec command with invalid Content-Type specified")
 }
 }
 
 
-func (s *DockerSuite) TestExecAPICreateContainerPaused(c *check.C) {
+func (s *DockerSuite) TestExecAPICreateContainerPaused(c *testing.T) {
 	// Not relevant on Windows as Windows containers cannot be paused
 	// Not relevant on Windows as Windows containers cannot be paused
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "exec_create_test"
 	name := "exec_create_test"
@@ -77,7 +78,7 @@ func (s *DockerSuite) TestExecAPICreateContainerPaused(c *check.C) {
 	assert.ErrorContains(c, err, "Container "+name+" is paused, unpause the container before exec", "Expected message when creating exec command with Container %s is paused", name)
 	assert.ErrorContains(c, err, "Container "+name+" is paused, unpause the container before exec", "Expected message when creating exec command with Container %s is paused", name)
 }
 }
 
 
-func (s *DockerSuite) TestExecAPIStart(c *check.C) {
+func (s *DockerSuite) TestExecAPIStart(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // Uses pause/unpause but bits may be salvageable to Windows to Windows CI
 	testRequires(c, DaemonIsLinux) // Uses pause/unpause but bits may be salvageable to Windows to Windows CI
 	dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top")
 
 
@@ -104,7 +105,7 @@ func (s *DockerSuite) TestExecAPIStart(c *check.C) {
 	startExec(c, id, http.StatusOK)
 	startExec(c, id, http.StatusOK)
 }
 }
 
 
-func (s *DockerSuite) TestExecAPIStartEnsureHeaders(c *check.C) {
+func (s *DockerSuite) TestExecAPIStartEnsureHeaders(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top")
 
 
@@ -114,7 +115,7 @@ func (s *DockerSuite) TestExecAPIStartEnsureHeaders(c *check.C) {
 	assert.Assert(c, resp.Header.Get("Server") != "")
 	assert.Assert(c, resp.Header.Get("Server") != "")
 }
 }
 
 
-func (s *DockerSuite) TestExecAPIStartBackwardsCompatible(c *check.C) {
+func (s *DockerSuite) TestExecAPIStartBackwardsCompatible(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // Windows only supports 1.25 or later
 	testRequires(c, DaemonIsLinux) // Windows only supports 1.25 or later
 	runSleepingContainer(c, "-d", "--name", "test")
 	runSleepingContainer(c, "-d", "--name", "test")
 	id := createExec(c, "test")
 	id := createExec(c, "test")
@@ -123,13 +124,13 @@ func (s *DockerSuite) TestExecAPIStartBackwardsCompatible(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	b, err := request.ReadBody(body)
 	b, err := request.ReadBody(body)
-	comment := check.Commentf("response body: %s", b)
+	comment := fmt.Sprintf("response body: %s", b)
 	assert.NilError(c, err, comment)
 	assert.NilError(c, err, comment)
 	assert.Equal(c, resp.StatusCode, http.StatusOK, comment)
 	assert.Equal(c, resp.StatusCode, http.StatusOK, comment)
 }
 }
 
 
 // #19362
 // #19362
-func (s *DockerSuite) TestExecAPIStartMultipleTimesError(c *check.C) {
+func (s *DockerSuite) TestExecAPIStartMultipleTimesError(c *testing.T) {
 	runSleepingContainer(c, "-d", "--name", "test")
 	runSleepingContainer(c, "-d", "--name", "test")
 	execID := createExec(c, "test")
 	execID := createExec(c, "test")
 	startExec(c, execID, http.StatusOK)
 	startExec(c, execID, http.StatusOK)
@@ -139,7 +140,7 @@ func (s *DockerSuite) TestExecAPIStartMultipleTimesError(c *check.C) {
 }
 }
 
 
 // #20638
 // #20638
-func (s *DockerSuite) TestExecAPIStartWithDetach(c *check.C) {
+func (s *DockerSuite) TestExecAPIStartWithDetach(c *testing.T) {
 	name := "foo"
 	name := "foo"
 	runSleepingContainer(c, "-d", "-t", "--name", name)
 	runSleepingContainer(c, "-d", "-t", "--name", name)
 
 
@@ -159,7 +160,7 @@ func (s *DockerSuite) TestExecAPIStartWithDetach(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	b, err := request.ReadBody(body)
 	b, err := request.ReadBody(body)
-	comment := check.Commentf("response body: %s", b)
+	comment := fmt.Sprintf("response body: %s", b)
 	assert.NilError(c, err, comment)
 	assert.NilError(c, err, comment)
 
 
 	resp, _, err := request.Get("/_ping")
 	resp, _, err := request.Get("/_ping")
@@ -170,7 +171,7 @@ func (s *DockerSuite) TestExecAPIStartWithDetach(c *check.C) {
 }
 }
 
 
 // #30311
 // #30311
-func (s *DockerSuite) TestExecAPIStartValidCommand(c *check.C) {
+func (s *DockerSuite) TestExecAPIStartValidCommand(c *testing.T) {
 	name := "exec_test"
 	name := "exec_test"
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 
 
@@ -186,7 +187,7 @@ func (s *DockerSuite) TestExecAPIStartValidCommand(c *check.C) {
 }
 }
 
 
 // #30311
 // #30311
-func (s *DockerSuite) TestExecAPIStartInvalidCommand(c *check.C) {
+func (s *DockerSuite) TestExecAPIStartInvalidCommand(c *testing.T) {
 	name := "exec_test"
 	name := "exec_test"
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 
 
@@ -204,7 +205,7 @@ func (s *DockerSuite) TestExecAPIStartInvalidCommand(c *check.C) {
 	assert.Assert(c, inspectJSON.ExecIDs == nil)
 	assert.Assert(c, inspectJSON.ExecIDs == nil)
 }
 }
 
 
-func (s *DockerSuite) TestExecStateCleanup(c *check.C) {
+func (s *DockerSuite) TestExecStateCleanup(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 
 
 	// This test checks accidental regressions. Not part of stable API.
 	// This test checks accidental regressions. Not part of stable API.
@@ -215,10 +216,10 @@ func (s *DockerSuite) TestExecStateCleanup(c *check.C) {
 
 
 	stateDir := "/var/run/docker/containerd/" + cid
 	stateDir := "/var/run/docker/containerd/" + cid
 
 
-	checkReadDir := func(c *check.C) (interface{}, check.CommentInterface) {
+	checkReadDir := func(c *testing.T) (interface{}, string) {
 		fi, err := ioutil.ReadDir(stateDir)
 		fi, err := ioutil.ReadDir(stateDir)
 		assert.NilError(c, err)
 		assert.NilError(c, err)
-		return len(fi), nil
+		return len(fi), ""
 	}
 	}
 
 
 	fi, err := ioutil.ReadDir(stateDir)
 	fi, err := ioutil.ReadDir(stateDir)
@@ -229,13 +230,13 @@ func (s *DockerSuite) TestExecStateCleanup(c *check.C) {
 	startExec(c, id, http.StatusOK)
 	startExec(c, id, http.StatusOK)
 	waitForExec(c, id)
 	waitForExec(c, id)
 
 
-	waitAndAssert(c, 5*time.Second, checkReadDir, checker.Equals, len(fi))
+	poll.WaitOn(c, pollCheck(c, checkReadDir, checker.Equals(len(fi))), poll.WithTimeout(5*time.Second))
 
 
 	id = createExecCmd(c, name, "invalid")
 	id = createExecCmd(c, name, "invalid")
 	startExec(c, id, http.StatusBadRequest)
 	startExec(c, id, http.StatusBadRequest)
 	waitForExec(c, id)
 	waitForExec(c, id)
 
 
-	waitAndAssert(c, 5*time.Second, checkReadDir, checker.Equals, len(fi))
+	poll.WaitOn(c, pollCheck(c, checkReadDir, checker.Equals(len(fi))), poll.WithTimeout(5*time.Second))
 
 
 	dockerCmd(c, "stop", name)
 	dockerCmd(c, "stop", name)
 	_, err = os.Stat(stateDir)
 	_, err = os.Stat(stateDir)
@@ -243,11 +244,11 @@ func (s *DockerSuite) TestExecStateCleanup(c *check.C) {
 	assert.Assert(c, os.IsNotExist(err))
 	assert.Assert(c, os.IsNotExist(err))
 }
 }
 
 
-func createExec(c *check.C, name string) string {
+func createExec(c *testing.T, name string) string {
 	return createExecCmd(c, name, "true")
 	return createExecCmd(c, name, "true")
 }
 }
 
 
-func createExecCmd(c *check.C, name string, cmd string) string {
+func createExecCmd(c *testing.T, name string, cmd string) string {
 	_, reader, err := request.Post(fmt.Sprintf("/containers/%s/exec", name), request.JSONBody(map[string]interface{}{"Cmd": []string{cmd}}))
 	_, reader, err := request.Post(fmt.Sprintf("/containers/%s/exec", name), request.JSONBody(map[string]interface{}{"Cmd": []string{cmd}}))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	b, err := ioutil.ReadAll(reader)
 	b, err := ioutil.ReadAll(reader)
@@ -260,7 +261,7 @@ func createExecCmd(c *check.C, name string, cmd string) string {
 	return createResp.ID
 	return createResp.ID
 }
 }
 
 
-func startExec(c *check.C, id string, code int) {
+func startExec(c *testing.T, id string, code int) {
 	resp, body, err := request.Post(fmt.Sprintf("/exec/%s/start", id), request.RawString(`{"Detach": true}`), request.JSON)
 	resp, body, err := request.Post(fmt.Sprintf("/exec/%s/start", id), request.RawString(`{"Detach": true}`), request.JSON)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
@@ -269,7 +270,7 @@ func startExec(c *check.C, id string, code int) {
 	assert.Equal(c, resp.StatusCode, code, "response body: %s", b)
 	assert.Equal(c, resp.StatusCode, code, "response body: %s", b)
 }
 }
 
 
-func inspectExec(c *check.C, id string, out interface{}) {
+func inspectExec(c *testing.T, id string, out interface{}) {
 	resp, body, err := request.Get(fmt.Sprintf("/exec/%s/json", id))
 	resp, body, err := request.Get(fmt.Sprintf("/exec/%s/json", id))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer body.Close()
 	defer body.Close()
@@ -278,7 +279,7 @@ func inspectExec(c *check.C, id string, out interface{}) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func waitForExec(c *check.C, id string) {
+func waitForExec(c *testing.T, id string) {
 	timeout := time.After(60 * time.Second)
 	timeout := time.After(60 * time.Second)
 	var execJSON struct{ Running bool }
 	var execJSON struct{ Running bool }
 	for {
 	for {
@@ -295,7 +296,7 @@ func waitForExec(c *check.C, id string) {
 	}
 	}
 }
 }
 
 
-func inspectContainer(c *check.C, id string, out interface{}) {
+func inspectContainer(c *testing.T, id string, out interface{}) {
 	resp, body, err := request.Get(fmt.Sprintf("/containers/%s/json", id))
 	resp, body, err := request.Get(fmt.Sprintf("/containers/%s/json", id))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer body.Close()
 	defer body.Close()

+ 8 - 8
integration-cli/docker_api_images_test.go

@@ -7,6 +7,7 @@ import (
 	"runtime"
 	"runtime"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/filters"
@@ -15,11 +16,10 @@ import (
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/pkg/parsers/kernel"
 	"github.com/docker/docker/pkg/parsers/kernel"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestAPIImagesFilter(c *check.C) {
+func (s *DockerSuite) TestAPIImagesFilter(c *testing.T) {
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer cli.Close()
 	defer cli.Close()
@@ -57,7 +57,7 @@ func (s *DockerSuite) TestAPIImagesFilter(c *check.C) {
 	assert.Equal(c, len(images[0].RepoTags), 1)
 	assert.Equal(c, len(images[0].RepoTags), 1)
 }
 }
 
 
-func (s *DockerSuite) TestAPIImagesSaveAndLoad(c *check.C) {
+func (s *DockerSuite) TestAPIImagesSaveAndLoad(c *testing.T) {
 	if runtime.GOOS == "windows" {
 	if runtime.GOOS == "windows" {
 		v, err := kernel.GetKernelVersion()
 		v, err := kernel.GetKernelVersion()
 		assert.NilError(c, err)
 		assert.NilError(c, err)
@@ -87,7 +87,7 @@ func (s *DockerSuite) TestAPIImagesSaveAndLoad(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(string(inspectOut)), id, "load did not work properly")
 	assert.Equal(c, strings.TrimSpace(string(inspectOut)), id, "load did not work properly")
 }
 }
 
 
-func (s *DockerSuite) TestAPIImagesDelete(c *check.C) {
+func (s *DockerSuite) TestAPIImagesDelete(c *testing.T) {
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer cli.Close()
 	defer cli.Close()
@@ -111,7 +111,7 @@ func (s *DockerSuite) TestAPIImagesDelete(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerSuite) TestAPIImagesHistory(c *check.C) {
+func (s *DockerSuite) TestAPIImagesHistory(c *testing.T) {
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer cli.Close()
 	defer cli.Close()
@@ -137,7 +137,7 @@ func (s *DockerSuite) TestAPIImagesHistory(c *check.C) {
 	assert.Assert(c, found)
 	assert.Assert(c, found)
 }
 }
 
 
-func (s *DockerSuite) TestAPIImagesImportBadSrc(c *check.C) {
+func (s *DockerSuite) TestAPIImagesImportBadSrc(c *testing.T) {
 	if runtime.GOOS == "windows" {
 	if runtime.GOOS == "windows" {
 		v, err := kernel.GetKernelVersion()
 		v, err := kernel.GetKernelVersion()
 		assert.NilError(c, err)
 		assert.NilError(c, err)
@@ -172,7 +172,7 @@ func (s *DockerSuite) TestAPIImagesImportBadSrc(c *check.C) {
 }
 }
 
 
 // #14846
 // #14846
-func (s *DockerSuite) TestAPIImagesSearchJSONContentType(c *check.C) {
+func (s *DockerSuite) TestAPIImagesSearchJSONContentType(c *testing.T) {
 	testRequires(c, Network)
 	testRequires(c, Network)
 
 
 	res, b, err := request.Get("/images/search?term=test", request.JSON)
 	res, b, err := request.Get("/images/search?term=test", request.JSON)
@@ -184,7 +184,7 @@ func (s *DockerSuite) TestAPIImagesSearchJSONContentType(c *check.C) {
 
 
 // Test case for 30027: image size reported as -1 in v1.12 client against v1.13 daemon.
 // Test case for 30027: image size reported as -1 in v1.12 client against v1.13 daemon.
 // This test checks to make sure both v1.12 and v1.13 client against v1.13 daemon get correct `Size` after the fix.
 // This test checks to make sure both v1.12 and v1.13 client against v1.13 daemon get correct `Size` after the fix.
-func (s *DockerSuite) TestAPIImagesSizeCompatibility(c *check.C) {
+func (s *DockerSuite) TestAPIImagesSizeCompatibility(c *testing.T) {
 	apiclient := testEnv.APIClient()
 	apiclient := testEnv.APIClient()
 	defer apiclient.Close()
 	defer apiclient.Close()
 
 

+ 8 - 8
integration-cli/docker_api_inspect_test.go

@@ -4,16 +4,16 @@ import (
 	"context"
 	"context"
 	"encoding/json"
 	"encoding/json"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/versions/v1p20"
 	"github.com/docker/docker/api/types/versions/v1p20"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestInspectAPIContainerResponse(c *check.C) {
+func (s *DockerSuite) TestInspectAPIContainerResponse(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -57,7 +57,7 @@ func (s *DockerSuite) TestInspectAPIContainerResponse(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestInspectAPIContainerVolumeDriverLegacy(c *check.C) {
+func (s *DockerSuite) TestInspectAPIContainerVolumeDriverLegacy(c *testing.T) {
 	// No legacy implications for Windows
 	// No legacy implications for Windows
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
@@ -80,7 +80,7 @@ func (s *DockerSuite) TestInspectAPIContainerVolumeDriverLegacy(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestInspectAPIContainerVolumeDriver(c *check.C) {
+func (s *DockerSuite) TestInspectAPIContainerVolumeDriver(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "--volume-driver", "local", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "--volume-driver", "local", "busybox", "true")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -104,7 +104,7 @@ func (s *DockerSuite) TestInspectAPIContainerVolumeDriver(c *check.C) {
 	assert.Assert(c, ok, "API version 1.25 expected to include VolumeDriver in 'HostConfig'")
 	assert.Assert(c, ok, "API version 1.25 expected to include VolumeDriver in 'HostConfig'")
 }
 }
 
 
-func (s *DockerSuite) TestInspectAPIImageResponse(c *check.C) {
+func (s *DockerSuite) TestInspectAPIImageResponse(c *testing.T) {
 	dockerCmd(c, "tag", "busybox:latest", "busybox:mytag")
 	dockerCmd(c, "tag", "busybox:latest", "busybox:mytag")
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -119,7 +119,7 @@ func (s *DockerSuite) TestInspectAPIImageResponse(c *check.C) {
 }
 }
 
 
 // #17131, #17139, #17173
 // #17131, #17139, #17173
-func (s *DockerSuite) TestInspectAPIEmptyFieldsInConfigPre121(c *check.C) {
+func (s *DockerSuite) TestInspectAPIEmptyFieldsInConfigPre121(c *testing.T) {
 	// Not relevant on Windows
 	// Not relevant on Windows
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
@@ -143,7 +143,7 @@ func (s *DockerSuite) TestInspectAPIEmptyFieldsInConfigPre121(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestInspectAPIBridgeNetworkSettings120(c *check.C) {
+func (s *DockerSuite) TestInspectAPIBridgeNetworkSettings120(c *testing.T) {
 	// Not relevant on Windows, and besides it doesn't have any bridge network settings
 	// Not relevant on Windows, and besides it doesn't have any bridge network settings
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
@@ -160,7 +160,7 @@ func (s *DockerSuite) TestInspectAPIBridgeNetworkSettings120(c *check.C) {
 	assert.Assert(c, len(settings.IPAddress) != 0)
 	assert.Assert(c, len(settings.IPAddress) != 0)
 }
 }
 
 
-func (s *DockerSuite) TestInspectAPIBridgeNetworkSettings121(c *check.C) {
+func (s *DockerSuite) TestInspectAPIBridgeNetworkSettings121(c *testing.T) {
 	// Windows doesn't have any bridge network settings
 	// Windows doesn't have any bridge network settings
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")

+ 10 - 10
integration-cli/docker_api_logs_test.go

@@ -10,17 +10,17 @@ import (
 	"net/http"
 	"net/http"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/pkg/stdcopy"
 	"github.com/docker/docker/pkg/stdcopy"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestLogsAPIWithStdout(c *check.C) {
+func (s *DockerSuite) TestLogsAPIWithStdout(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "-t", "busybox", "/bin/sh", "-c", "while true; do echo hello; sleep 1; done")
 	out, _ := dockerCmd(c, "run", "-d", "-t", "busybox", "/bin/sh", "-c", "while true; do echo hello; sleep 1; done")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(id))
 	assert.NilError(c, waitRun(id))
@@ -56,7 +56,7 @@ func (s *DockerSuite) TestLogsAPIWithStdout(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsAPINoStdoutNorStderr(c *check.C) {
+func (s *DockerSuite) TestLogsAPINoStdoutNorStderr(c *testing.T) {
 	name := "logs_test"
 	name := "logs_test"
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh")
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
@@ -68,7 +68,7 @@ func (s *DockerSuite) TestLogsAPINoStdoutNorStderr(c *check.C) {
 }
 }
 
 
 // Regression test for #12704
 // Regression test for #12704
-func (s *DockerSuite) TestLogsAPIFollowEmptyOutput(c *check.C) {
+func (s *DockerSuite) TestLogsAPIFollowEmptyOutput(c *testing.T) {
 	name := "logs_test"
 	name := "logs_test"
 	t0 := time.Now()
 	t0 := time.Now()
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "sleep", "10")
 	dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "sleep", "10")
@@ -83,14 +83,14 @@ func (s *DockerSuite) TestLogsAPIFollowEmptyOutput(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsAPIContainerNotFound(c *check.C) {
+func (s *DockerSuite) TestLogsAPIContainerNotFound(c *testing.T) {
 	name := "nonExistentContainer"
 	name := "nonExistentContainer"
 	resp, _, err := request.Get(fmt.Sprintf("/containers/%s/logs?follow=1&stdout=1&stderr=1&tail=all", name))
 	resp, _, err := request.Get(fmt.Sprintf("/containers/%s/logs?follow=1&stdout=1&stderr=1&tail=all", name))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	assert.Equal(c, resp.StatusCode, http.StatusNotFound)
 	assert.Equal(c, resp.StatusCode, http.StatusNotFound)
 }
 }
 
 
-func (s *DockerSuite) TestLogsAPIUntilFutureFollow(c *check.C) {
+func (s *DockerSuite) TestLogsAPIUntilFutureFollow(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "logsuntilfuturefollow"
 	name := "logsuntilfuturefollow"
 	dockerCmd(c, "run", "-d", "--name", name, "busybox", "/bin/sh", "-c", "while true; do date +%s; sleep 1; done")
 	dockerCmd(c, "run", "-d", "--name", name, "busybox", "/bin/sh", "-c", "while true; do date +%s; sleep 1; done")
@@ -147,7 +147,7 @@ func (s *DockerSuite) TestLogsAPIUntilFutureFollow(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsAPIUntil(c *check.C) {
+func (s *DockerSuite) TestLogsAPIUntil(c *testing.T) {
 	testRequires(c, MinimumAPIVersion("1.34"))
 	testRequires(c, MinimumAPIVersion("1.34"))
 	name := "logsuntil"
 	name := "logsuntil"
 	dockerCmd(c, "run", "--name", name, "busybox", "/bin/sh", "-c", "for i in $(seq 1 3); do echo log$i; sleep 1; done")
 	dockerCmd(c, "run", "--name", name, "busybox", "/bin/sh", "-c", "for i in $(seq 1 3); do echo log$i; sleep 1; done")
@@ -157,7 +157,7 @@ func (s *DockerSuite) TestLogsAPIUntil(c *check.C) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 
 
-	extractBody := func(c *check.C, cfg types.ContainerLogsOptions) []string {
+	extractBody := func(c *testing.T, cfg types.ContainerLogsOptions) []string {
 		reader, err := client.ContainerLogs(context.Background(), name, cfg)
 		reader, err := client.ContainerLogs(context.Background(), name, cfg)
 		assert.NilError(c, err)
 		assert.NilError(c, err)
 
 
@@ -185,7 +185,7 @@ func (s *DockerSuite) TestLogsAPIUntil(c *check.C) {
 	assert.Assert(c, !strings.Contains(logsString, "log3"), "unexpected log message returned, until=%v", until)
 	assert.Assert(c, !strings.Contains(logsString, "log3"), "unexpected log message returned, until=%v", until)
 }
 }
 
 
-func (s *DockerSuite) TestLogsAPIUntilDefaultValue(c *check.C) {
+func (s *DockerSuite) TestLogsAPIUntilDefaultValue(c *testing.T) {
 	name := "logsuntildefaultval"
 	name := "logsuntildefaultval"
 	dockerCmd(c, "run", "--name", name, "busybox", "/bin/sh", "-c", "for i in $(seq 1 3); do echo log$i; done")
 	dockerCmd(c, "run", "--name", name, "busybox", "/bin/sh", "-c", "for i in $(seq 1 3); do echo log$i; done")
 
 
@@ -194,7 +194,7 @@ func (s *DockerSuite) TestLogsAPIUntilDefaultValue(c *check.C) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 
 
-	extractBody := func(c *check.C, cfg types.ContainerLogsOptions) []string {
+	extractBody := func(c *testing.T, cfg types.ContainerLogsOptions) []string {
 		reader, err := client.ContainerLogs(context.Background(), name, cfg)
 		reader, err := client.ContainerLogs(context.Background(), name, cfg)
 		assert.NilError(c, err)
 		assert.NilError(c, err)
 
 

+ 17 - 17
integration-cli/docker_api_network_test.go

@@ -7,17 +7,17 @@ import (
 	"net/http"
 	"net/http"
 	"net/url"
 	"net/url"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestAPINetworkGetDefaults(c *check.C) {
+func (s *DockerSuite) TestAPINetworkGetDefaults(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// By default docker daemon creates 3 networks. check if they are present
 	// By default docker daemon creates 3 networks. check if they are present
 	defaults := []string{"bridge", "host", "none"}
 	defaults := []string{"bridge", "host", "none"}
@@ -26,7 +26,7 @@ func (s *DockerSuite) TestAPINetworkGetDefaults(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestAPINetworkCreateCheckDuplicate(c *check.C) {
+func (s *DockerSuite) TestAPINetworkCreateCheckDuplicate(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "testcheckduplicate"
 	name := "testcheckduplicate"
 	configOnCheck := types.NetworkCreateRequest{
 	configOnCheck := types.NetworkCreateRequest{
@@ -64,13 +64,13 @@ func (s *DockerSuite) TestAPINetworkCreateCheckDuplicate(c *check.C) {
 	createNetwork(c, configNotCheck, http.StatusCreated)
 	createNetwork(c, configNotCheck, http.StatusCreated)
 }
 }
 
 
-func (s *DockerSuite) TestAPINetworkFilter(c *check.C) {
+func (s *DockerSuite) TestAPINetworkFilter(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	nr := getNetworkResource(c, getNetworkIDByName(c, "bridge"))
 	nr := getNetworkResource(c, getNetworkIDByName(c, "bridge"))
 	assert.Equal(c, nr.Name, "bridge")
 	assert.Equal(c, nr.Name, "bridge")
 }
 }
 
 
-func (s *DockerSuite) TestAPINetworkInspectBridge(c *check.C) {
+func (s *DockerSuite) TestAPINetworkInspectBridge(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// Inspect default bridge network
 	// Inspect default bridge network
 	nr := getNetworkResource(c, "bridge")
 	nr := getNetworkResource(c, "bridge")
@@ -96,7 +96,7 @@ func (s *DockerSuite) TestAPINetworkInspectBridge(c *check.C) {
 	assert.Equal(c, ip.String(), containerIP)
 	assert.Equal(c, ip.String(), containerIP)
 }
 }
 
 
-func (s *DockerSuite) TestAPINetworkInspectUserDefinedNetwork(c *check.C) {
+func (s *DockerSuite) TestAPINetworkInspectUserDefinedNetwork(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// IPAM configuration inspect
 	// IPAM configuration inspect
 	ipam := &network.IPAM{
 	ipam := &network.IPAM{
@@ -127,7 +127,7 @@ func (s *DockerSuite) TestAPINetworkInspectUserDefinedNetwork(c *check.C) {
 	assert.Assert(c, !isNetworkAvailable(c, "br0"))
 	assert.Assert(c, !isNetworkAvailable(c, "br0"))
 }
 }
 
 
-func (s *DockerSuite) TestAPINetworkConnectDisconnect(c *check.C) {
+func (s *DockerSuite) TestAPINetworkConnectDisconnect(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// Create test network
 	// Create test network
 	name := "testnetwork"
 	name := "testnetwork"
@@ -169,7 +169,7 @@ func (s *DockerSuite) TestAPINetworkConnectDisconnect(c *check.C) {
 	deleteNetwork(c, nr.ID, true)
 	deleteNetwork(c, nr.ID, true)
 }
 }
 
 
-func (s *DockerSuite) TestAPINetworkIPAMMultipleBridgeNetworks(c *check.C) {
+func (s *DockerSuite) TestAPINetworkIPAMMultipleBridgeNetworks(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// test0 bridge network
 	// test0 bridge network
 	ipam0 := &network.IPAM{
 	ipam0 := &network.IPAM{
@@ -238,14 +238,14 @@ func (s *DockerSuite) TestAPINetworkIPAMMultipleBridgeNetworks(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestAPICreateDeletePredefinedNetworks(c *check.C) {
+func (s *DockerSuite) TestAPICreateDeletePredefinedNetworks(c *testing.T) {
 	testRequires(c, DaemonIsLinux, SwarmInactive)
 	testRequires(c, DaemonIsLinux, SwarmInactive)
 	createDeletePredefinedNetwork(c, "bridge")
 	createDeletePredefinedNetwork(c, "bridge")
 	createDeletePredefinedNetwork(c, "none")
 	createDeletePredefinedNetwork(c, "none")
 	createDeletePredefinedNetwork(c, "host")
 	createDeletePredefinedNetwork(c, "host")
 }
 }
 
 
-func createDeletePredefinedNetwork(c *check.C, name string) {
+func createDeletePredefinedNetwork(c *testing.T, name string) {
 	// Create pre-defined network
 	// Create pre-defined network
 	config := types.NetworkCreateRequest{
 	config := types.NetworkCreateRequest{
 		Name: name,
 		Name: name,
@@ -267,7 +267,7 @@ func createDeletePredefinedNetwork(c *check.C, name string) {
 	deleteNetwork(c, name, false)
 	deleteNetwork(c, name, false)
 }
 }
 
 
-func isNetworkAvailable(c *check.C, name string) bool {
+func isNetworkAvailable(c *testing.T, name string) bool {
 	resp, body, err := request.Get("/networks")
 	resp, body, err := request.Get("/networks")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer resp.Body.Close()
 	defer resp.Body.Close()
@@ -285,7 +285,7 @@ func isNetworkAvailable(c *check.C, name string) bool {
 	return false
 	return false
 }
 }
 
 
-func getNetworkIDByName(c *check.C, name string) string {
+func getNetworkIDByName(c *testing.T, name string) string {
 	var (
 	var (
 		v          = url.Values{}
 		v          = url.Values{}
 		filterArgs = filters.NewArgs()
 		filterArgs = filters.NewArgs()
@@ -314,7 +314,7 @@ func getNetworkIDByName(c *check.C, name string) string {
 	return res
 	return res
 }
 }
 
 
-func getNetworkResource(c *check.C, id string) *types.NetworkResource {
+func getNetworkResource(c *testing.T, id string) *types.NetworkResource {
 	_, obj, err := request.Get("/networks/" + id)
 	_, obj, err := request.Get("/networks/" + id)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
@@ -325,7 +325,7 @@ func getNetworkResource(c *check.C, id string) *types.NetworkResource {
 	return &nr
 	return &nr
 }
 }
 
 
-func createNetwork(c *check.C, config types.NetworkCreateRequest, expectedStatusCode int) string {
+func createNetwork(c *testing.T, config types.NetworkCreateRequest, expectedStatusCode int) string {
 	resp, body, err := request.Post("/networks/create", request.JSONBody(config))
 	resp, body, err := request.Post("/networks/create", request.JSONBody(config))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer resp.Body.Close()
 	defer resp.Body.Close()
@@ -346,7 +346,7 @@ func createNetwork(c *check.C, config types.NetworkCreateRequest, expectedStatus
 	return ""
 	return ""
 }
 }
 
 
-func connectNetwork(c *check.C, nid, cid string) {
+func connectNetwork(c *testing.T, nid, cid string) {
 	config := types.NetworkConnect{
 	config := types.NetworkConnect{
 		Container: cid,
 		Container: cid,
 	}
 	}
@@ -356,7 +356,7 @@ func connectNetwork(c *check.C, nid, cid string) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func disconnectNetwork(c *check.C, nid, cid string) {
+func disconnectNetwork(c *testing.T, nid, cid string) {
 	config := types.NetworkConnect{
 	config := types.NetworkConnect{
 		Container: cid,
 		Container: cid,
 	}
 	}
@@ -366,7 +366,7 @@ func disconnectNetwork(c *check.C, nid, cid string) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func deleteNetwork(c *check.C, id string, shouldSucceed bool) {
+func deleteNetwork(c *testing.T, id string, shouldSucceed bool) {
 	resp, _, err := request.Delete("/networks/" + id)
 	resp, _, err := request.Delete("/networks/" + id)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer resp.Body.Close()
 	defer resp.Body.Close()

+ 9 - 9
integration-cli/docker_api_stats_test.go

@@ -10,19 +10,19 @@ import (
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 var expectedNetworkInterfaceStats = strings.Split("rx_bytes rx_dropped rx_errors rx_packets tx_bytes tx_dropped tx_errors tx_packets", " ")
 var expectedNetworkInterfaceStats = strings.Split("rx_bytes rx_dropped rx_errors rx_packets tx_bytes tx_dropped tx_errors tx_packets", " ")
 
 
-func (s *DockerSuite) TestAPIStatsNoStreamGetCpu(c *check.C) {
+func (s *DockerSuite) TestAPIStatsNoStreamGetCpu(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "while true;usleep 100; do echo 'Hello'; done")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "while true;usleep 100; do echo 'Hello'; done")
 
 
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -62,7 +62,7 @@ func (s *DockerSuite) TestAPIStatsNoStreamGetCpu(c *check.C) {
 	assert.Assert(c, cpuPercent != 0.0, "docker stats with no-stream get cpu usage failed: was %v", cpuPercent)
 	assert.Assert(c, cpuPercent != 0.0, "docker stats with no-stream get cpu usage failed: was %v", cpuPercent)
 }
 }
 
 
-func (s *DockerSuite) TestAPIStatsStoppedContainerInGoroutines(c *check.C) {
+func (s *DockerSuite) TestAPIStatsStoppedContainerInGoroutines(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo 1")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo 1")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
@@ -97,7 +97,7 @@ func (s *DockerSuite) TestAPIStatsStoppedContainerInGoroutines(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestAPIStatsNetworkStats(c *check.C) {
+func (s *DockerSuite) TestAPIStatsNetworkStats(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 
 
 	out := runSleepingContainer(c)
 	out := runSleepingContainer(c)
@@ -162,7 +162,7 @@ func (s *DockerSuite) TestAPIStatsNetworkStats(c *check.C) {
 	assert.Assert(c, postRxPackets >= expRxPkts, "Reported less RxPackets than expected. Expected >= %d. Found %d. %s", expRxPkts, postRxPackets, pingouts)
 	assert.Assert(c, postRxPackets >= expRxPkts, "Reported less RxPackets than expected. Expected >= %d. Found %d. %s", expRxPkts, postRxPackets, pingouts)
 }
 }
 
 
-func (s *DockerSuite) TestAPIStatsNetworkStatsVersioning(c *check.C) {
+func (s *DockerSuite) TestAPIStatsNetworkStatsVersioning(c *testing.T) {
 	// Windows doesn't support API versions less than 1.25, so no point testing 1.17 .. 1.21
 	// Windows doesn't support API versions less than 1.25, so no point testing 1.17 .. 1.21
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
@@ -187,7 +187,7 @@ func (s *DockerSuite) TestAPIStatsNetworkStatsVersioning(c *check.C) {
 	wg.Wait()
 	wg.Wait()
 }
 }
 
 
-func getNetworkStats(c *check.C, id string) map[string]types.NetworkStats {
+func getNetworkStats(c *testing.T, id string) map[string]types.NetworkStats {
 	var st *types.StatsJSON
 	var st *types.StatsJSON
 
 
 	_, body, err := request.Get(fmt.Sprintf("/containers/%s/stats?stream=false", id))
 	_, body, err := request.Get(fmt.Sprintf("/containers/%s/stats?stream=false", id))
@@ -204,7 +204,7 @@ func getNetworkStats(c *check.C, id string) map[string]types.NetworkStats {
 // container with id using an API call with version apiVersion. Since the
 // container with id using an API call with version apiVersion. Since the
 // stats result type differs between API versions, we simply return
 // stats result type differs between API versions, we simply return
 // map[string]interface{}.
 // map[string]interface{}.
-func getVersionedStats(c *check.C, id string, apiVersion string) map[string]interface{} {
+func getVersionedStats(c *testing.T, id string, apiVersion string) map[string]interface{} {
 	stats := make(map[string]interface{})
 	stats := make(map[string]interface{})
 
 
 	_, body, err := request.Get(fmt.Sprintf("/%s/containers/%s/stats?stream=false", apiVersion, id))
 	_, body, err := request.Get(fmt.Sprintf("/%s/containers/%s/stats?stream=false", apiVersion, id))
@@ -257,7 +257,7 @@ func jsonBlobHasGTE121NetworkStats(blob map[string]interface{}) bool {
 	return true
 	return true
 }
 }
 
 
-func (s *DockerSuite) TestAPIStatsContainerNotFound(c *check.C) {
+func (s *DockerSuite) TestAPIStatsContainerNotFound(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	cli, err := client.NewClientWithOpts(client.FromEnv)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -271,7 +271,7 @@ func (s *DockerSuite) TestAPIStatsContainerNotFound(c *check.C) {
 	assert.ErrorContains(c, err, expected)
 	assert.ErrorContains(c, err, expected)
 }
 }
 
 
-func (s *DockerSuite) TestAPIStatsNoStreamConnectedContainers(c *check.C) {
+func (s *DockerSuite) TestAPIStatsNoStreamConnectedContainers(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	out1 := runSleepingContainer(c)
 	out1 := runSleepingContainer(c)

+ 24 - 21
integration-cli/docker_api_swarm_node_test.go

@@ -3,21 +3,24 @@
 package main
 package main
 
 
 import (
 import (
+	"fmt"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
-	"github.com/go-check/check"
+	"gotest.tools/assert"
+	"gotest.tools/poll"
 )
 )
 
 
-func (s *DockerSwarmSuite) TestAPISwarmListNodes(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmListNodes(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
 	d3 := s.AddDaemon(c, true, false)
 	d3 := s.AddDaemon(c, true, false)
 
 
 	nodes := d1.ListNodes(c)
 	nodes := d1.ListNodes(c)
-	c.Assert(len(nodes), checker.Equals, 3, check.Commentf("nodes: %#v", nodes))
+	assert.Equal(c, len(nodes), 3, fmt.Sprintf("nodes: %#v", nodes))
 
 
 loop0:
 loop0:
 	for _, n := range nodes {
 	for _, n := range nodes {
@@ -30,7 +33,7 @@ loop0:
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmNodeUpdate(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmNodeUpdate(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	nodes := d.ListNodes(c)
 	nodes := d.ListNodes(c)
@@ -40,17 +43,17 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeUpdate(c *check.C) {
 	})
 	})
 
 
 	n := d.GetNode(c, nodes[0].ID)
 	n := d.GetNode(c, nodes[0].ID)
-	c.Assert(n.Spec.Availability, checker.Equals, swarm.NodeAvailabilityPause)
+	assert.Equal(c, n.Spec.Availability, swarm.NodeAvailabilityPause)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *testing.T) {
 	testRequires(c, Network)
 	testRequires(c, Network)
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
 	_ = s.AddDaemon(c, true, false)
 	_ = s.AddDaemon(c, true, false)
 
 
 	nodes := d1.ListNodes(c)
 	nodes := d1.ListNodes(c)
-	c.Assert(len(nodes), checker.Equals, 3, check.Commentf("nodes: %#v", nodes))
+	assert.Equal(c, len(nodes), 3, fmt.Sprintf("nodes: %#v", nodes))
 
 
 	// Getting the info so we can take the NodeID
 	// Getting the info so we can take the NodeID
 	d2Info := d2.SwarmInfo(c)
 	d2Info := d2.SwarmInfo(c)
@@ -59,7 +62,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *check.C) {
 	d1.RemoveNode(c, d2Info.NodeID, true)
 	d1.RemoveNode(c, d2Info.NodeID, true)
 
 
 	nodes = d1.ListNodes(c)
 	nodes = d1.ListNodes(c)
-	c.Assert(len(nodes), checker.Equals, 2, check.Commentf("nodes: %#v", nodes))
+	assert.Equal(c, len(nodes), 2, fmt.Sprintf("nodes: %#v", nodes))
 
 
 	// Restart the node that was removed
 	// Restart the node that was removed
 	d2.RestartNode(c)
 	d2.RestartNode(c)
@@ -69,10 +72,10 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *check.C) {
 
 
 	// Make sure the node didn't rejoin
 	// Make sure the node didn't rejoin
 	nodes = d1.ListNodes(c)
 	nodes = d1.ListNodes(c)
-	c.Assert(len(nodes), checker.Equals, 2, check.Commentf("nodes: %#v", nodes))
+	assert.Equal(c, len(nodes), 2, fmt.Sprintf("nodes: %#v", nodes))
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
 
 
@@ -82,16 +85,16 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
 	instances := 2
 	instances := 2
 	id := d1.CreateService(c, simpleTestService, setInstances(instances))
 	id := d1.CreateService(c, simpleTestService, setInstances(instances))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.GreaterThan, 0)
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.GreaterThan, 0)
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// drain d2, all containers should move to d1
 	// drain d2, all containers should move to d1
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 		n.Spec.Availability = swarm.NodeAvailabilityDrain
 		n.Spec.Availability = swarm.NodeAvailabilityDrain
 	})
 	})
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances)
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, 0)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(0)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// set d2 back to active
 	// set d2 back to active
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
@@ -100,15 +103,15 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
 
 
 	instances = 1
 	instances = 1
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout*2, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout*2))
 
 
 	instances = 2
 	instances = 2
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
 
 
 	// drained node first so we don't get any old containers
 	// drained node first so we don't get any old containers
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.GreaterThan, 0)
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.GreaterThan, 0)
-	waitAndAssert(c, defaultReconciliationTimeout*2, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout*2))
 
 
 	d2ContainerCount := len(d2.ActiveContainers(c))
 	d2ContainerCount := len(d2.ActiveContainers(c))
 
 
@@ -119,7 +122,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *check.C) {
 
 
 	instances = 4
 	instances = 4
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances-d2ContainerCount)
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, d2ContainerCount)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(instances-d2ContainerCount)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(d2ContainerCount)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 }
 }

+ 70 - 83
integration-cli/docker_api_swarm_service_test.go

@@ -7,6 +7,7 @@ import (
 	"fmt"
 	"fmt"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
@@ -16,10 +17,10 @@ import (
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
-	"github.com/go-check/check"
 	"golang.org/x/sys/unix"
 	"golang.org/x/sys/unix"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
+	"gotest.tools/poll"
 )
 )
 
 
 func setPortConfig(portConfig []swarm.PortConfig) testdaemon.ServiceConstructor {
 func setPortConfig(portConfig []swarm.PortConfig) testdaemon.ServiceConstructor {
@@ -31,13 +32,13 @@ func setPortConfig(portConfig []swarm.PortConfig) testdaemon.ServiceConstructor
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPIServiceUpdatePort(c *check.C) {
+func (s *DockerSwarmSuite) TestAPIServiceUpdatePort(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	// Create a service with a port mapping of 8080:8081.
 	// Create a service with a port mapping of 8080:8081.
 	portConfig := []swarm.PortConfig{{TargetPort: 8081, PublishedPort: 8080}}
 	portConfig := []swarm.PortConfig{{TargetPort: 8081, PublishedPort: 8080}}
 	serviceID := d.CreateService(c, simpleTestService, setInstances(1), setPortConfig(portConfig))
 	serviceID := d.CreateService(c, simpleTestService, setInstances(1), setPortConfig(portConfig))
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// Update the service: changed the port mapping from 8080:8081 to 8082:8083.
 	// Update the service: changed the port mapping from 8080:8081 to 8082:8083.
 	updatedPortConfig := []swarm.PortConfig{{TargetPort: 8083, PublishedPort: 8082}}
 	updatedPortConfig := []swarm.PortConfig{{TargetPort: 8083, PublishedPort: 8082}}
@@ -52,7 +53,7 @@ func (s *DockerSwarmSuite) TestAPIServiceUpdatePort(c *check.C) {
 	assert.Equal(c, updatedService.Spec.EndpointSpec.Ports[0].PublishedPort, uint32(8082))
 	assert.Equal(c, updatedService.Spec.EndpointSpec.Ports[0].PublishedPort, uint32(8082))
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesEmptyList(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesEmptyList(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	services := d.ListServices(c)
 	services := d.ListServices(c)
@@ -60,12 +61,12 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesEmptyList(c *check.C) {
 	assert.Assert(c, len(services) == 0, "services: %#v", services)
 	assert.Assert(c, len(services) == 0, "services: %#v", services)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesCreate(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesCreate(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	instances := 2
 	instances := 2
 	id := d.CreateService(c, simpleTestService, setInstances(instances))
 	id := d.CreateService(c, simpleTestService, setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	client := d.NewClientT(c)
 	client := d.NewClientT(c)
 	defer client.Close()
 	defer client.Close()
@@ -87,13 +88,13 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesCreate(c *check.C) {
 	service := d.GetService(c, id)
 	service := d.GetService(c, id)
 	instances = 5
 	instances = 5
 	d.UpdateService(c, service, setInstances(instances))
 	d.UpdateService(c, service, setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d.RemoveService(c, service.ID)
 	d.RemoveService(c, service.ID)
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 0)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(0)), poll.WithTimeout(defaultReconciliationTimeout))
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesMultipleAgents(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesMultipleAgents(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
 	d3 := s.AddDaemon(c, true, false)
 	d3 := s.AddDaemon(c, true, false)
@@ -103,50 +104,50 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesMultipleAgents(c *check.C) {
 	instances := 9
 	instances := 9
 	id := d1.CreateService(c, simpleTestService, setInstances(instances))
 	id := d1.CreateService(c, simpleTestService, setInstances(instances))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.GreaterThan, 0)
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.GreaterThan, 0)
-	waitAndAssert(c, defaultReconciliationTimeout, d3.CheckActiveContainerCount, checker.GreaterThan, 0)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d3.CheckActiveContainerCount, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// reconciliation on d2 node down
 	// reconciliation on d2 node down
 	d2.Stop(c)
 	d2.Stop(c)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// test downscaling
 	// test downscaling
 	instances = 5
 	instances = 5
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
 	d1.UpdateService(c, d1.GetService(c, id), setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesCreateGlobal(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesCreateGlobal(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
 	d3 := s.AddDaemon(c, true, false)
 	d3 := s.AddDaemon(c, true, false)
 
 
 	d1.CreateService(c, simpleTestService, setGlobalMode)
 	d1.CreateService(c, simpleTestService, setGlobalMode)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, 1)
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, 1)
-	waitAndAssert(c, defaultReconciliationTimeout, d3.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d3.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d4 := s.AddDaemon(c, true, false)
 	d4 := s.AddDaemon(c, true, false)
 	d5 := s.AddDaemon(c, true, false)
 	d5 := s.AddDaemon(c, true, false)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d4.CheckActiveContainerCount, checker.Equals, 1)
-	waitAndAssert(c, defaultReconciliationTimeout, d5.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d4.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d5.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *testing.T) {
 	const nodeCount = 3
 	const nodeCount = 3
 	var daemons [nodeCount]*daemon.Daemon
 	var daemons [nodeCount]*daemon.Daemon
 	for i := 0; i < nodeCount; i++ {
 	for i := 0; i < nodeCount; i++ {
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 	}
 	}
 	// wait for nodes ready
 	// wait for nodes ready
-	waitAndAssert(c, 5*time.Second, daemons[0].CheckNodeReadyCount, checker.Equals, nodeCount)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckNodeReadyCount, checker.Equals(nodeCount)), poll.WithTimeout(5*time.Second))
 
 
 	// service image at start
 	// service image at start
 	image1 := "busybox:latest"
 	image1 := "busybox:latest"
@@ -166,24 +167,20 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *check.C) {
 	id := daemons[0].CreateService(c, serviceForUpdate, setInstances(instances))
 	id := daemons[0].CreateService(c, serviceForUpdate, setInstances(instances))
 
 
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// issue service update
 	// issue service update
 	service := daemons[0].GetService(c, id)
 	service := daemons[0].GetService(c, id)
 	daemons[0].UpdateService(c, service, setImage(image2))
 	daemons[0].UpdateService(c, service, setImage(image2))
 
 
 	// first batch
 	// first batch
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances - parallelism, image2: parallelism})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances - parallelism, image2: parallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// 2nd batch
 	// 2nd batch
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances - 2*parallelism, image2: 2 * parallelism})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances - 2*parallelism, image2: 2 * parallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// 3nd batch
 	// 3nd batch
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image2: instances})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image2: instances})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// Roll back to the previous version. This uses the CLI because
 	// Roll back to the previous version. This uses the CLI because
 	// rollback used to be a client-side operation.
 	// rollback used to be a client-side operation.
@@ -191,15 +188,14 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdate(c *check.C) {
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	// first batch
 	// first batch
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image2: instances - rollbackParallelism, image1: rollbackParallelism})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image2: instances - rollbackParallelism, image1: rollbackParallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// 2nd batch
 	// 2nd batch
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
+
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	// service image at start
 	// service image at start
@@ -223,7 +219,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
 
 
 	checkStartingTasks := func(expected int) []swarm.Task {
 	checkStartingTasks := func(expected int) []swarm.Task {
 		var startingTasks []swarm.Task
 		var startingTasks []swarm.Task
-		waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+		poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 			tasks := d.GetServiceTasks(c, id)
 			tasks := d.GetServiceTasks(c, id)
 			startingTasks = nil
 			startingTasks = nil
 			for _, t := range tasks {
 			for _, t := range tasks {
@@ -231,8 +227,8 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
 					startingTasks = append(startingTasks, t)
 					startingTasks = append(startingTasks, t)
 				}
 				}
 			}
 			}
-			return startingTasks, nil
-		}, checker.HasLen, expected)
+			return startingTasks, ""
+		}, checker.HasLen(expected)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 		return startingTasks
 		return startingTasks
 	}
 	}
@@ -245,8 +241,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
 	}
 	}
 
 
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// issue service update
 	// issue service update
 	service := d.GetService(c, id)
 	service := d.GetService(c, id)
@@ -257,42 +252,36 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
 	// The old tasks should be running, and the new ones should be starting.
 	// The old tasks should be running, and the new ones should be starting.
 	startingTasks := checkStartingTasks(parallelism)
 	startingTasks := checkStartingTasks(parallelism)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// make it healthy
 	// make it healthy
 	makeTasksHealthy(startingTasks)
 	makeTasksHealthy(startingTasks)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances - parallelism, image2: parallelism})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances - parallelism, image2: parallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// 2nd batch
 	// 2nd batch
 
 
 	// The old tasks should be running, and the new ones should be starting.
 	// The old tasks should be running, and the new ones should be starting.
 	startingTasks = checkStartingTasks(parallelism)
 	startingTasks = checkStartingTasks(parallelism)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances - parallelism, image2: parallelism})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances - parallelism, image2: parallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// make it healthy
 	// make it healthy
 	makeTasksHealthy(startingTasks)
 	makeTasksHealthy(startingTasks)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances - 2*parallelism, image2: 2 * parallelism})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances - 2*parallelism, image2: 2 * parallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// 3nd batch
 	// 3nd batch
 
 
 	// The old tasks should be running, and the new ones should be starting.
 	// The old tasks should be running, and the new ones should be starting.
 	startingTasks = checkStartingTasks(1)
 	startingTasks = checkStartingTasks(1)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances - 2*parallelism, image2: 2 * parallelism})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances - 2*parallelism, image2: 2 * parallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// make it healthy
 	// make it healthy
 	makeTasksHealthy(startingTasks)
 	makeTasksHealthy(startingTasks)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image2: instances})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image2: instances})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// Roll back to the previous version. This uses the CLI because
 	// Roll back to the previous version. This uses the CLI because
 	// rollback is a client-side operation.
 	// rollback is a client-side operation.
@@ -300,22 +289,21 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateStartFirst(c *check.C) {
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	// first batch
 	// first batch
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image2: instances - rollbackParallelism, image1: rollbackParallelism})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image2: instances - rollbackParallelism, image1: rollbackParallelism})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// 2nd batch
 	// 2nd batch
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
+
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *testing.T) {
 	const nodeCount = 3
 	const nodeCount = 3
 	var daemons [nodeCount]*daemon.Daemon
 	var daemons [nodeCount]*daemon.Daemon
 	for i := 0; i < nodeCount; i++ {
 	for i := 0; i < nodeCount; i++ {
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 	}
 	}
 	// wait for nodes ready
 	// wait for nodes ready
-	waitAndAssert(c, 5*time.Second, daemons[0].CheckNodeReadyCount, checker.Equals, nodeCount)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckNodeReadyCount, checker.Equals(nodeCount)), poll.WithTimeout(5*time.Second))
 
 
 	// service image at start
 	// service image at start
 	image1 := "busybox:latest"
 	image1 := "busybox:latest"
@@ -327,15 +315,14 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *check.C) {
 	id := daemons[0].CreateService(c, serviceForUpdate, setInstances(instances))
 	id := daemons[0].CreateService(c, serviceForUpdate, setInstances(instances))
 
 
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// issue service update
 	// issue service update
 	service := daemons[0].GetService(c, id)
 	service := daemons[0].GetService(c, id)
 	daemons[0].UpdateService(c, service, setImage(image2), setFailureAction(swarm.UpdateFailureActionPause), setMaxFailureRatio(0.25), setParallelism(1))
 	daemons[0].UpdateService(c, service, setImage(image2), setFailureAction(swarm.UpdateFailureActionPause), setMaxFailureRatio(0.25), setParallelism(1))
 
 
 	// should update 2 tasks and then pause
 	// should update 2 tasks and then pause
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceUpdateState(id), checker.Equals, swarm.UpdateStatePaused)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceUpdateState(id), checker.Equals(swarm.UpdateStatePaused)), poll.WithTimeout(defaultReconciliationTimeout))
 	v, _ := daemons[0].CheckServiceRunningTasks(id)(c)
 	v, _ := daemons[0].CheckServiceRunningTasks(id)(c)
 	assert.Assert(c, v == instances-2)
 	assert.Assert(c, v == instances-2)
 
 
@@ -344,25 +331,25 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesFailedUpdate(c *check.C) {
 	out, err := daemons[0].Cmd("service", "update", "--detach", "--rollback", id)
 	out, err := daemons[0].Cmd("service", "update", "--detach", "--rollback", id)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image1: instances})
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckRunningTaskImages, checker.DeepEquals(map[string]int{image1: instances})), poll.WithTimeout(defaultReconciliationTimeout))
+
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *testing.T) {
 	const nodeCount = 3
 	const nodeCount = 3
 	var daemons [nodeCount]*daemon.Daemon
 	var daemons [nodeCount]*daemon.Daemon
 	for i := 0; i < nodeCount; i++ {
 	for i := 0; i < nodeCount; i++ {
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 	}
 	}
 	// wait for nodes ready
 	// wait for nodes ready
-	waitAndAssert(c, 5*time.Second, daemons[0].CheckNodeReadyCount, checker.Equals, nodeCount)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckNodeReadyCount, checker.Equals(nodeCount)), poll.WithTimeout(5*time.Second))
 
 
 	// create service
 	// create service
 	constraints := []string{"node.role==worker"}
 	constraints := []string{"node.role==worker"}
 	instances := 3
 	instances := 3
 	id := daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id := daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceRunningTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceRunningTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	// validate tasks are running on worker nodes
 	// validate tasks are running on worker nodes
 	tasks := daemons[0].GetServiceTasks(c, id)
 	tasks := daemons[0].GetServiceTasks(c, id)
 	for _, task := range tasks {
 	for _, task := range tasks {
@@ -376,7 +363,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *check.C) {
 	constraints = []string{"node.role!=worker"}
 	constraints = []string{"node.role!=worker"}
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceRunningTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceRunningTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	tasks = daemons[0].GetServiceTasks(c, id)
 	tasks = daemons[0].GetServiceTasks(c, id)
 	// validate tasks are running on manager nodes
 	// validate tasks are running on manager nodes
 	for _, task := range tasks {
 	for _, task := range tasks {
@@ -390,7 +377,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *check.C) {
 	constraints = []string{"node.role==nosuchrole"}
 	constraints = []string{"node.role==nosuchrole"}
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks created
 	// wait for tasks created
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	// let scheduler try
 	// let scheduler try
 	time.Sleep(250 * time.Millisecond)
 	time.Sleep(250 * time.Millisecond)
 	// validate tasks are not assigned to any node
 	// validate tasks are not assigned to any node
@@ -400,14 +387,14 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintRole(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *testing.T) {
 	const nodeCount = 3
 	const nodeCount = 3
 	var daemons [nodeCount]*daemon.Daemon
 	var daemons [nodeCount]*daemon.Daemon
 	for i := 0; i < nodeCount; i++ {
 	for i := 0; i < nodeCount; i++ {
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 	}
 	}
 	// wait for nodes ready
 	// wait for nodes ready
-	waitAndAssert(c, 5*time.Second, daemons[0].CheckNodeReadyCount, checker.Equals, nodeCount)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckNodeReadyCount, checker.Equals(nodeCount)), poll.WithTimeout(5*time.Second))
 	nodes := daemons[0].ListNodes(c)
 	nodes := daemons[0].ListNodes(c)
 	assert.Equal(c, len(nodes), nodeCount)
 	assert.Equal(c, len(nodes), nodeCount)
 
 
@@ -430,7 +417,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *check.C) {
 	constraints := []string{"node.labels.security==high"}
 	constraints := []string{"node.labels.security==high"}
 	id := daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id := daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceRunningTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceRunningTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	tasks := daemons[0].GetServiceTasks(c, id)
 	tasks := daemons[0].GetServiceTasks(c, id)
 	// validate all tasks are running on nodes[0]
 	// validate all tasks are running on nodes[0]
 	for _, task := range tasks {
 	for _, task := range tasks {
@@ -443,7 +430,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *check.C) {
 	constraints = []string{"node.labels.security!=high"}
 	constraints = []string{"node.labels.security!=high"}
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceRunningTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceRunningTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	tasks = daemons[0].GetServiceTasks(c, id)
 	tasks = daemons[0].GetServiceTasks(c, id)
 	// validate all tasks are NOT running on nodes[0]
 	// validate all tasks are NOT running on nodes[0]
 	for _, task := range tasks {
 	for _, task := range tasks {
@@ -455,7 +442,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *check.C) {
 	constraints = []string{"node.labels.security==medium"}
 	constraints = []string{"node.labels.security==medium"}
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks created
 	// wait for tasks created
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	// let scheduler try
 	// let scheduler try
 	time.Sleep(250 * time.Millisecond)
 	time.Sleep(250 * time.Millisecond)
 	tasks = daemons[0].GetServiceTasks(c, id)
 	tasks = daemons[0].GetServiceTasks(c, id)
@@ -473,7 +460,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *check.C) {
 	}
 	}
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	id = daemons[0].CreateService(c, simpleTestService, setConstraints(constraints), setInstances(instances))
 	// wait for tasks created
 	// wait for tasks created
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	// let scheduler try
 	// let scheduler try
 	time.Sleep(250 * time.Millisecond)
 	time.Sleep(250 * time.Millisecond)
 	tasks = daemons[0].GetServiceTasks(c, id)
 	tasks = daemons[0].GetServiceTasks(c, id)
@@ -488,21 +475,21 @@ func (s *DockerSwarmSuite) TestAPISwarmServiceConstraintLabel(c *check.C) {
 		}
 		}
 	})
 	})
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceRunningTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceRunningTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	tasks = daemons[0].GetServiceTasks(c, id)
 	tasks = daemons[0].GetServiceTasks(c, id)
 	for _, task := range tasks {
 	for _, task := range tasks {
 		assert.Assert(c, task.NodeID == nodes[1].ID)
 		assert.Assert(c, task.NodeID == nodes[1].ID)
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicePlacementPrefs(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicePlacementPrefs(c *testing.T) {
 	const nodeCount = 3
 	const nodeCount = 3
 	var daemons [nodeCount]*daemon.Daemon
 	var daemons [nodeCount]*daemon.Daemon
 	for i := 0; i < nodeCount; i++ {
 	for i := 0; i < nodeCount; i++ {
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 		daemons[i] = s.AddDaemon(c, true, i == 0)
 	}
 	}
 	// wait for nodes ready
 	// wait for nodes ready
-	waitAndAssert(c, 5*time.Second, daemons[0].CheckNodeReadyCount, checker.Equals, nodeCount)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckNodeReadyCount, checker.Equals(nodeCount)), poll.WithTimeout(5*time.Second))
 	nodes := daemons[0].ListNodes(c)
 	nodes := daemons[0].ListNodes(c)
 	assert.Equal(c, len(nodes), nodeCount)
 	assert.Equal(c, len(nodes), nodeCount)
 
 
@@ -525,7 +512,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicePlacementPrefs(c *check.C) {
 	prefs := []swarm.PlacementPreference{{Spread: &swarm.SpreadOver{SpreadDescriptor: "node.labels.rack"}}}
 	prefs := []swarm.PlacementPreference{{Spread: &swarm.SpreadOver{SpreadDescriptor: "node.labels.rack"}}}
 	id := daemons[0].CreateService(c, simpleTestService, setPlacementPrefs(prefs), setInstances(instances))
 	id := daemons[0].CreateService(c, simpleTestService, setPlacementPrefs(prefs), setInstances(instances))
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, daemons[0].CheckServiceRunningTasks(id), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, daemons[0].CheckServiceRunningTasks(id), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	tasks := daemons[0].GetServiceTasks(c, id)
 	tasks := daemons[0].GetServiceTasks(c, id)
 	// validate all tasks are running on nodes[0]
 	// validate all tasks are running on nodes[0]
 	tasksOnNode := make(map[string]int)
 	tasksOnNode := make(map[string]int)
@@ -537,7 +524,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicePlacementPrefs(c *check.C) {
 	assert.Assert(c, tasksOnNode[nodes[2].ID] == 1)
 	assert.Assert(c, tasksOnNode[nodes[2].ID] == 1)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesStateReporting(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesStateReporting(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -550,7 +537,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesStateReporting(c *check.C) {
 	instances := 9
 	instances := 9
 	d1.CreateService(c, simpleTestService, setInstances(instances))
 	d1.CreateService(c, simpleTestService, setInstances(instances))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	getContainers := func() map[string]*daemon.Daemon {
 	getContainers := func() map[string]*daemon.Daemon {
 		m := make(map[string]*daemon.Daemon)
 		m := make(map[string]*daemon.Daemon)
@@ -572,7 +559,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesStateReporting(c *check.C) {
 	_, err := containers[toRemove].Cmd("stop", toRemove)
 	_, err := containers[toRemove].Cmd("stop", toRemove)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	containers2 := getContainers()
 	containers2 := getContainers()
 	assert.Assert(c, len(containers2) == instances)
 	assert.Assert(c, len(containers2) == instances)
@@ -598,7 +585,7 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesStateReporting(c *check.C) {
 
 
 	time.Sleep(time.Second) // give some time to handle the signal
 	time.Sleep(time.Second) // give some time to handle the signal
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	containers2 = getContainers()
 	containers2 = getContainers()
 	assert.Assert(c, len(containers2) == instances)
 	assert.Assert(c, len(containers2) == instances)

+ 70 - 69
integration-cli/docker_api_swarm_test.go

@@ -12,6 +12,7 @@ import (
 	"runtime"
 	"runtime"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/cloudflare/cfssl/csr"
 	"github.com/cloudflare/cfssl/csr"
@@ -26,15 +27,15 @@ import (
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/swarmkit/ca"
 	"github.com/docker/swarmkit/ca"
-	"github.com/go-check/check"
 	"github.com/pkg/errors"
 	"github.com/pkg/errors"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
+	"gotest.tools/poll"
 )
 )
 
 
 var defaultReconciliationTimeout = 30 * time.Second
 var defaultReconciliationTimeout = 30 * time.Second
 
 
-func (s *DockerSwarmSuite) TestAPISwarmInit(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmInit(c *testing.T) {
 	// todo: should find a better way to verify that components are running than /info
 	// todo: should find a better way to verify that components are running than /info
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	info := d1.SwarmInfo(c)
 	info := d1.SwarmInfo(c)
@@ -80,7 +81,7 @@ func (s *DockerSwarmSuite) TestAPISwarmInit(c *check.C) {
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateActive)
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateActive)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmJoinToken(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmJoinToken(c *testing.T) {
 	d1 := s.AddDaemon(c, false, false)
 	d1 := s.AddDaemon(c, false, false)
 	d1.SwarmInit(c, swarm.InitRequest{})
 	d1.SwarmInit(c, swarm.InitRequest{})
 
 
@@ -158,7 +159,7 @@ func (s *DockerSwarmSuite) TestAPISwarmJoinToken(c *check.C) {
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateInactive)
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateInactive)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestUpdateSwarmAddExternalCA(c *check.C) {
+func (s *DockerSwarmSuite) TestUpdateSwarmAddExternalCA(c *testing.T) {
 	d1 := s.AddDaemon(c, false, false)
 	d1 := s.AddDaemon(c, false, false)
 	d1.SwarmInit(c, swarm.InitRequest{})
 	d1.SwarmInit(c, swarm.InitRequest{})
 	d1.UpdateSwarm(c, func(s *swarm.Spec) {
 	d1.UpdateSwarm(c, func(s *swarm.Spec) {
@@ -180,7 +181,7 @@ func (s *DockerSwarmSuite) TestUpdateSwarmAddExternalCA(c *check.C) {
 	assert.Equal(c, info.Cluster.Spec.CAConfig.ExternalCAs[1].CACert, "cacert")
 	assert.Equal(c, info.Cluster.Spec.CAConfig.ExternalCAs[1].CACert, "cacert")
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmCAHash(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmCAHash(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, false, false)
 	d2 := s.AddDaemon(c, false, false)
 	splitToken := strings.Split(d1.JoinTokens(c).Worker, "-")
 	splitToken := strings.Split(d1.JoinTokens(c).Worker, "-")
@@ -195,7 +196,7 @@ func (s *DockerSwarmSuite) TestAPISwarmCAHash(c *check.C) {
 	assert.ErrorContains(c, err, "remote CA does not match fingerprint")
 	assert.ErrorContains(c, err, "remote CA does not match fingerprint")
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmPromoteDemote(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmPromoteDemote(c *testing.T) {
 	d1 := s.AddDaemon(c, false, false)
 	d1 := s.AddDaemon(c, false, false)
 	d1.SwarmInit(c, swarm.InitRequest{})
 	d1.SwarmInit(c, swarm.InitRequest{})
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
@@ -208,13 +209,13 @@ func (s *DockerSwarmSuite) TestAPISwarmPromoteDemote(c *check.C) {
 		n.Spec.Role = swarm.NodeRoleManager
 		n.Spec.Role = swarm.NodeRoleManager
 	})
 	})
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckControlAvailable, checker.True)
+	poll.WaitOn(c, pollCheck(c, d2.CheckControlAvailable, checker.True()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 		n.Spec.Role = swarm.NodeRoleWorker
 		n.Spec.Role = swarm.NodeRoleWorker
 	})
 	})
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckControlAvailable, checker.False)
+	poll.WaitOn(c, pollCheck(c, d2.CheckControlAvailable, checker.False()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// Wait for the role to change to worker in the cert. This is partially
 	// Wait for the role to change to worker in the cert. This is partially
 	// done because it's something worth testing in its own right, and
 	// done because it's something worth testing in its own right, and
@@ -222,17 +223,17 @@ func (s *DockerSwarmSuite) TestAPISwarmPromoteDemote(c *check.C) {
 	// back to manager quickly might cause the node to pause for awhile
 	// back to manager quickly might cause the node to pause for awhile
 	// while waiting for the role to change to worker, and the test can
 	// while waiting for the role to change to worker, and the test can
 	// time out during this interval.
 	// time out during this interval.
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		certBytes, err := ioutil.ReadFile(filepath.Join(d2.Folder, "root", "swarm", "certificates", "swarm-node.crt"))
 		certBytes, err := ioutil.ReadFile(filepath.Join(d2.Folder, "root", "swarm", "certificates", "swarm-node.crt"))
 		if err != nil {
 		if err != nil {
-			return "", check.Commentf("error: %v", err)
+			return "", fmt.Sprintf("error: %v", err)
 		}
 		}
 		certs, err := helpers.ParseCertificatesPEM(certBytes)
 		certs, err := helpers.ParseCertificatesPEM(certBytes)
 		if err == nil && len(certs) > 0 && len(certs[0].Subject.OrganizationalUnit) > 0 {
 		if err == nil && len(certs) > 0 && len(certs[0].Subject.OrganizationalUnit) > 0 {
-			return certs[0].Subject.OrganizationalUnit[0], nil
+			return certs[0].Subject.OrganizationalUnit[0], ""
 		}
 		}
-		return "", check.Commentf("could not get organizational unit from certificate")
-	}, checker.Equals, "swarm-worker")
+		return "", "could not get organizational unit from certificate"
+	}, checker.Equals("swarm-worker")), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// Demoting last node should fail
 	// Demoting last node should fail
 	node := d1.GetNode(c, d1.NodeID())
 	node := d1.GetNode(c, d1.NodeID())
@@ -262,10 +263,10 @@ func (s *DockerSwarmSuite) TestAPISwarmPromoteDemote(c *check.C) {
 		n.Spec.Role = swarm.NodeRoleManager
 		n.Spec.Role = swarm.NodeRoleManager
 	})
 	})
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckControlAvailable, checker.True)
+	poll.WaitOn(c, pollCheck(c, d2.CheckControlAvailable, checker.True()), poll.WithTimeout(defaultReconciliationTimeout))
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmLeaderProxy(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmLeaderProxy(c *testing.T) {
 	// add three managers, one of these is leader
 	// add three managers, one of these is leader
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, true)
@@ -290,7 +291,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderProxy(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *testing.T) {
 	if runtime.GOARCH == "s390x" {
 	if runtime.GOARCH == "s390x" {
 		c.Skip("Disabled on s390x")
 		c.Skip("Disabled on s390x")
 	}
 	}
@@ -316,7 +317,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) {
 	)
 	)
 	var lastErr error
 	var lastErr error
 	checkLeader := func(nodes ...*daemon.Daemon) checkF {
 	checkLeader := func(nodes ...*daemon.Daemon) checkF {
-		return func(c *check.C) (interface{}, check.CommentInterface) {
+		return func(c *testing.T) (interface{}, string) {
 			// clear these out before each run
 			// clear these out before each run
 			leader = nil
 			leader = nil
 			followers = nil
 			followers = nil
@@ -329,7 +330,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) {
 					return false
 					return false
 				})
 				})
 				if n == nil {
 				if n == nil {
-					return false, check.Commentf("failed to get node: %v", lastErr)
+					return false, fmt.Sprintf("failed to get node: %v", lastErr)
 				}
 				}
 				if n.ManagerStatus.Leader {
 				if n.ManagerStatus.Leader {
 					leader = d
 					leader = d
@@ -339,16 +340,16 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) {
 			}
 			}
 
 
 			if leader == nil {
 			if leader == nil {
-				return false, check.Commentf("no leader elected")
+				return false, "no leader elected"
 			}
 			}
 
 
-			return true, check.Commentf("elected %v", leader.ID())
+			return true, fmt.Sprintf("elected %v", leader.ID())
 		}
 		}
 	}
 	}
 
 
 	// wait for an election to occur
 	// wait for an election to occur
 	c.Logf("Waiting for election to occur...")
 	c.Logf("Waiting for election to occur...")
-	waitAndAssert(c, defaultReconciliationTimeout, checkLeader(d2, d3), checker.True)
+	poll.WaitOn(c, pollCheck(c, checkLeader(d2, d3), checker.True()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// assert that we have a new leader
 	// assert that we have a new leader
 	assert.Assert(c, leader != nil)
 	assert.Assert(c, leader != nil)
@@ -361,7 +362,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) {
 
 
 	// wait for possible election
 	// wait for possible election
 	c.Logf("Waiting for possible election...")
 	c.Logf("Waiting for possible election...")
-	waitAndAssert(c, defaultReconciliationTimeout, checkLeader(d1, d2, d3), checker.True)
+	poll.WaitOn(c, pollCheck(c, checkLeader(d1, d2, d3), checker.True()), poll.WithTimeout(defaultReconciliationTimeout))
 	// pick out the leader and the followers again
 	// pick out the leader and the followers again
 
 
 	// verify that we still only have 1 leader and 2 followers
 	// verify that we still only have 1 leader and 2 followers
@@ -371,7 +372,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaderElection(c *check.C) {
 	assert.Equal(c, leader.NodeID(), stableleader.NodeID())
 	assert.Equal(c, leader.NodeID(), stableleader.NodeID())
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmRaftQuorum(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmRaftQuorum(c *testing.T) {
 	if runtime.GOARCH == "s390x" {
 	if runtime.GOARCH == "s390x" {
 		c.Skip("Disabled on s390x")
 		c.Skip("Disabled on s390x")
 	}
 	}
@@ -388,7 +389,7 @@ func (s *DockerSwarmSuite) TestAPISwarmRaftQuorum(c *check.C) {
 	d2.Stop(c)
 	d2.Stop(c)
 
 
 	// make sure there is a leader
 	// make sure there is a leader
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckLeader, checker.IsNil)
+	poll.WaitOn(c, pollCheck(c, d1.CheckLeader, checker.IsNil()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d1.CreateService(c, simpleTestService, func(s *swarm.Service) {
 	d1.CreateService(c, simpleTestService, func(s *swarm.Service) {
 		s.Spec.Name = "top1"
 		s.Spec.Name = "top1"
@@ -403,22 +404,22 @@ func (s *DockerSwarmSuite) TestAPISwarmRaftQuorum(c *check.C) {
 	defer cli.Close()
 	defer cli.Close()
 
 
 	// d1 will eventually step down from leader because there is no longer an active quorum, wait for that to happen
 	// d1 will eventually step down from leader because there is no longer an active quorum, wait for that to happen
-	waitAndAssert(c, defaultReconciliationTimeout*2, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		_, err := cli.ServiceCreate(context.Background(), service.Spec, types.ServiceCreateOptions{})
 		_, err := cli.ServiceCreate(context.Background(), service.Spec, types.ServiceCreateOptions{})
-		return err.Error(), nil
-	}, checker.Contains, "Make sure more than half of the managers are online.")
+		return err.Error(), ""
+	}, checker.Contains("Make sure more than half of the managers are online.")), poll.WithTimeout(defaultReconciliationTimeout*2))
 
 
 	d2.StartNode(c)
 	d2.StartNode(c)
 
 
 	// make sure there is a leader
 	// make sure there is a leader
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckLeader, checker.IsNil)
+	poll.WaitOn(c, pollCheck(c, d1.CheckLeader, checker.IsNil()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d1.CreateService(c, simpleTestService, func(s *swarm.Service) {
 	d1.CreateService(c, simpleTestService, func(s *swarm.Service) {
 		s.Spec.Name = "top3"
 		s.Spec.Name = "top3"
 	})
 	})
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmLeaveRemovesContainer(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmLeaveRemovesContainer(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	instances := 2
 	instances := 2
@@ -428,12 +429,12 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaveRemovesContainer(c *check.C) {
 	assert.NilError(c, err, id)
 	assert.NilError(c, err, id)
 	id = strings.TrimSpace(id)
 	id = strings.TrimSpace(id)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances+1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances+1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	assert.ErrorContains(c, d.SwarmLeave(c, false), "")
 	assert.ErrorContains(c, d.SwarmLeave(c, false), "")
 	assert.NilError(c, d.SwarmLeave(c, true))
 	assert.NilError(c, d.SwarmLeave(c, true))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	id2, err := d.Cmd("ps", "-q")
 	id2, err := d.Cmd("ps", "-q")
 	assert.NilError(c, err, id2)
 	assert.NilError(c, err, id2)
@@ -441,7 +442,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaveRemovesContainer(c *check.C) {
 }
 }
 
 
 // #23629
 // #23629
-func (s *DockerSwarmSuite) TestAPISwarmLeaveOnPendingJoin(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmLeaveOnPendingJoin(c *testing.T) {
 	testRequires(c, Network)
 	testRequires(c, Network)
 	s.AddDaemon(c, true, true)
 	s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, false, false)
 	d2 := s.AddDaemon(c, false, false)
@@ -462,7 +463,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaveOnPendingJoin(c *check.C) {
 
 
 	assert.NilError(c, d2.SwarmLeave(c, true))
 	assert.NilError(c, d2.SwarmLeave(c, true))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	id2, err := d2.Cmd("ps", "-q")
 	id2, err := d2.Cmd("ps", "-q")
 	assert.NilError(c, err, id2)
 	assert.NilError(c, err, id2)
@@ -470,7 +471,7 @@ func (s *DockerSwarmSuite) TestAPISwarmLeaveOnPendingJoin(c *check.C) {
 }
 }
 
 
 // #23705
 // #23705
-func (s *DockerSwarmSuite) TestAPISwarmRestoreOnPendingJoin(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmRestoreOnPendingJoin(c *testing.T) {
 	testRequires(c, Network)
 	testRequires(c, Network)
 	d := s.AddDaemon(c, false, false)
 	d := s.AddDaemon(c, false, false)
 	client := d.NewClientT(c)
 	client := d.NewClientT(c)
@@ -480,7 +481,7 @@ func (s *DockerSwarmSuite) TestAPISwarmRestoreOnPendingJoin(c *check.C) {
 	})
 	})
 	assert.ErrorContains(c, err, "Timeout was reached")
 	assert.ErrorContains(c, err, "Timeout was reached")
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckLocalNodeState, checker.Equals, swarm.LocalNodeStatePending)
+	poll.WaitOn(c, pollCheck(c, d.CheckLocalNodeState, checker.Equals(swarm.LocalNodeStatePending)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d.RestartNode(c)
 	d.RestartNode(c)
 
 
@@ -488,7 +489,7 @@ func (s *DockerSwarmSuite) TestAPISwarmRestoreOnPendingJoin(c *check.C) {
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateInactive)
 	assert.Equal(c, info.LocalNodeState, swarm.LocalNodeStateInactive)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmManagerRestore(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmManagerRestore(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 
 
 	instances := 2
 	instances := 2
@@ -515,17 +516,17 @@ func (s *DockerSwarmSuite) TestAPISwarmManagerRestore(c *check.C) {
 	d3.GetService(c, id)
 	d3.GetService(c, id)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmScaleNoRollingUpdate(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmScaleNoRollingUpdate(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	instances := 2
 	instances := 2
 	id := d.CreateService(c, simpleTestService, setInstances(instances))
 	id := d.CreateService(c, simpleTestService, setInstances(instances))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	containers := d.ActiveContainers(c)
 	containers := d.ActiveContainers(c)
 	instances = 4
 	instances = 4
 	d.UpdateService(c, d.GetService(c, id), setInstances(instances))
 	d.UpdateService(c, d.GetService(c, id), setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 	containers2 := d.ActiveContainers(c)
 	containers2 := d.ActiveContainers(c)
 
 
 loop0:
 loop0:
@@ -539,7 +540,7 @@ loop0:
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmInvalidAddress(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmInvalidAddress(c *testing.T) {
 	d := s.AddDaemon(c, false, false)
 	d := s.AddDaemon(c, false, false)
 	req := swarm.InitRequest{
 	req := swarm.InitRequest{
 		ListenAddr: "",
 		ListenAddr: "",
@@ -557,20 +558,20 @@ func (s *DockerSwarmSuite) TestAPISwarmInvalidAddress(c *check.C) {
 	assert.Equal(c, res.StatusCode, http.StatusBadRequest)
 	assert.Equal(c, res.StatusCode, http.StatusBadRequest)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmForceNewCluster(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmForceNewCluster(c *testing.T) {
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, true)
 
 
 	instances := 2
 	instances := 2
 	id := d1.CreateService(c, simpleTestService, setInstances(instances))
 	id := d1.CreateService(c, simpleTestService, setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// drain d2, all containers should move to d1
 	// drain d2, all containers should move to d1
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 	d1.UpdateNode(c, d2.NodeID(), func(n *swarm.Node) {
 		n.Spec.Availability = swarm.NodeAvailabilityDrain
 		n.Spec.Availability = swarm.NodeAvailabilityDrain
 	})
 	})
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances)
-	waitAndAssert(c, defaultReconciliationTimeout, d2.CheckActiveContainerCount, checker.Equals, 0)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, d2.CheckActiveContainerCount, checker.Equals(0)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d2.Stop(c)
 	d2.Stop(c)
 
 
@@ -579,7 +580,7 @@ func (s *DockerSwarmSuite) TestAPISwarmForceNewCluster(c *check.C) {
 		Spec:            swarm.Spec{},
 		Spec:            swarm.Spec{},
 	})
 	})
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d1.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	d3 := s.AddDaemon(c, true, true)
 	d3 := s.AddDaemon(c, true, true)
 	info := d3.SwarmInfo(c)
 	info := d3.SwarmInfo(c)
@@ -589,7 +590,7 @@ func (s *DockerSwarmSuite) TestAPISwarmForceNewCluster(c *check.C) {
 	instances = 4
 	instances = 4
 	d3.UpdateService(c, d3.GetService(c, id), setInstances(instances))
 	d3.UpdateService(c, d3.GetService(c, id), setInstances(instances))
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d3.CheckActiveContainerCount), checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 }
 }
 
 
 func simpleTestService(s *swarm.Service) {
 func simpleTestService(s *swarm.Service) {
@@ -728,7 +729,7 @@ func setGlobalMode(s *swarm.Service) {
 	}
 	}
 }
 }
 
 
-func checkClusterHealth(c *check.C, cl []*daemon.Daemon, managerCount, workerCount int) {
+func checkClusterHealth(c *testing.T, cl []*daemon.Daemon, managerCount, workerCount int) {
 	var totalMCount, totalWCount int
 	var totalMCount, totalWCount int
 
 
 	for _, d := range cl {
 	for _, d := range cl {
@@ -737,13 +738,13 @@ func checkClusterHealth(c *check.C, cl []*daemon.Daemon, managerCount, workerCou
 		)
 		)
 
 
 		// check info in a waitAndAssert, because if the cluster doesn't have a leader, `info` will return an error
 		// check info in a waitAndAssert, because if the cluster doesn't have a leader, `info` will return an error
-		checkInfo := func(c *check.C) (interface{}, check.CommentInterface) {
+		checkInfo := func(c *testing.T) (interface{}, string) {
 			client := d.NewClientT(c)
 			client := d.NewClientT(c)
 			daemonInfo, err := client.Info(context.Background())
 			daemonInfo, err := client.Info(context.Background())
 			info = daemonInfo.Swarm
 			info = daemonInfo.Swarm
-			return err, check.Commentf("cluster not ready in time")
+			return err, "cluster not ready in time"
 		}
 		}
-		waitAndAssert(c, defaultReconciliationTimeout, checkInfo, checker.IsNil)
+		poll.WaitOn(c, pollCheck(c, checkInfo, checker.IsNil()), poll.WithTimeout(defaultReconciliationTimeout))
 		if !info.ControlAvailable {
 		if !info.ControlAvailable {
 			totalWCount++
 			totalWCount++
 			continue
 			continue
@@ -754,25 +755,25 @@ func checkClusterHealth(c *check.C, cl []*daemon.Daemon, managerCount, workerCou
 		var mCount, wCount int
 		var mCount, wCount int
 
 
 		for _, n := range d.ListNodes(c) {
 		for _, n := range d.ListNodes(c) {
-			waitReady := func(c *check.C) (interface{}, check.CommentInterface) {
+			waitReady := func(c *testing.T) (interface{}, string) {
 				if n.Status.State == swarm.NodeStateReady {
 				if n.Status.State == swarm.NodeStateReady {
-					return true, nil
+					return true, ""
 				}
 				}
 				nn := d.GetNode(c, n.ID)
 				nn := d.GetNode(c, n.ID)
 				n = *nn
 				n = *nn
-				return n.Status.State == swarm.NodeStateReady, check.Commentf("state of node %s, reported by %s", n.ID, d.NodeID())
+				return n.Status.State == swarm.NodeStateReady, fmt.Sprintf("state of node %s, reported by %s", n.ID, d.NodeID())
 			}
 			}
-			waitAndAssert(c, defaultReconciliationTimeout, waitReady, checker.True)
+			poll.WaitOn(c, pollCheck(c, waitReady, checker.True()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
-			waitActive := func(c *check.C) (interface{}, check.CommentInterface) {
+			waitActive := func(c *testing.T) (interface{}, string) {
 				if n.Spec.Availability == swarm.NodeAvailabilityActive {
 				if n.Spec.Availability == swarm.NodeAvailabilityActive {
-					return true, nil
+					return true, ""
 				}
 				}
 				nn := d.GetNode(c, n.ID)
 				nn := d.GetNode(c, n.ID)
 				n = *nn
 				n = *nn
-				return n.Spec.Availability == swarm.NodeAvailabilityActive, check.Commentf("availability of node %s, reported by %s", n.ID, d.NodeID())
+				return n.Spec.Availability == swarm.NodeAvailabilityActive, fmt.Sprintf("availability of node %s, reported by %s", n.ID, d.NodeID())
 			}
 			}
-			waitAndAssert(c, defaultReconciliationTimeout, waitActive, checker.True)
+			poll.WaitOn(c, pollCheck(c, waitActive, checker.True()), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 			if n.Spec.Role == swarm.NodeRoleManager {
 			if n.Spec.Role == swarm.NodeRoleManager {
 				assert.Assert(c, n.ManagerStatus != nil, "manager status of node %s (manager), reported by %s", n.ID, d.NodeID())
 				assert.Assert(c, n.ManagerStatus != nil, "manager status of node %s (manager), reported by %s", n.ID, d.NodeID())
@@ -793,7 +794,7 @@ func checkClusterHealth(c *check.C, cl []*daemon.Daemon, managerCount, workerCou
 	assert.Equal(c, totalWCount, workerCount)
 	assert.Equal(c, totalWCount, workerCount)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmRestartCluster(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmRestartCluster(c *testing.T) {
 	mCount, wCount := 5, 1
 	mCount, wCount := 5, 1
 
 
 	var nodes []*daemon.Daemon
 	var nodes []*daemon.Daemon
@@ -858,12 +859,12 @@ func (s *DockerSwarmSuite) TestAPISwarmRestartCluster(c *check.C) {
 	checkClusterHealth(c, nodes, mCount, wCount)
 	checkClusterHealth(c, nodes, mCount, wCount)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateWithName(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateWithName(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	instances := 2
 	instances := 2
 	id := d.CreateService(c, simpleTestService, setInstances(instances))
 	id := d.CreateService(c, simpleTestService, setInstances(instances))
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	service := d.GetService(c, id)
 	service := d.GetService(c, id)
 	instances = 5
 	instances = 5
@@ -873,18 +874,18 @@ func (s *DockerSwarmSuite) TestAPISwarmServicesUpdateWithName(c *check.C) {
 	defer cli.Close()
 	defer cli.Close()
 	_, err := cli.ServiceUpdate(context.Background(), service.Spec.Name, service.Version, service.Spec, types.ServiceUpdateOptions{})
 	_, err := cli.ServiceUpdate(context.Background(), service.Spec.Name, service.Version, service.Spec, types.ServiceUpdateOptions{})
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 }
 }
 
 
 // Unlocking an unlocked swarm results in an error
 // Unlocking an unlocked swarm results in an error
-func (s *DockerSwarmSuite) TestAPISwarmUnlockNotLocked(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmUnlockNotLocked(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 	err := d.SwarmUnlock(c, swarm.UnlockRequest{UnlockKey: "wrong-key"})
 	err := d.SwarmUnlock(c, swarm.UnlockRequest{UnlockKey: "wrong-key"})
 	assert.ErrorContains(c, err, "swarm is not locked")
 	assert.ErrorContains(c, err, "swarm is not locked")
 }
 }
 
 
 // #29885
 // #29885
-func (s *DockerSwarmSuite) TestAPISwarmErrorHandling(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmErrorHandling(c *testing.T) {
 	ln, err := net.Listen("tcp", fmt.Sprintf(":%d", defaultSwarmPort))
 	ln, err := net.Listen("tcp", fmt.Sprintf(":%d", defaultSwarmPort))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer ln.Close()
 	defer ln.Close()
@@ -899,7 +900,7 @@ func (s *DockerSwarmSuite) TestAPISwarmErrorHandling(c *check.C) {
 // Test case for 30242, where duplicate networks, with different drivers `bridge` and `overlay`,
 // Test case for 30242, where duplicate networks, with different drivers `bridge` and `overlay`,
 // caused both scopes to be `swarm` for `docker network inspect` and `docker network ls`.
 // caused both scopes to be `swarm` for `docker network inspect` and `docker network ls`.
 // This test makes sure the fixes correctly output scopes instead.
 // This test makes sure the fixes correctly output scopes instead.
-func (s *DockerSwarmSuite) TestAPIDuplicateNetworks(c *check.C) {
+func (s *DockerSwarmSuite) TestAPIDuplicateNetworks(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 	cli := d.NewClientT(c)
 	cli := d.NewClientT(c)
 	defer cli.Close()
 	defer cli.Close()
@@ -929,7 +930,7 @@ func (s *DockerSwarmSuite) TestAPIDuplicateNetworks(c *check.C) {
 }
 }
 
 
 // Test case for 30178
 // Test case for 30178
-func (s *DockerSwarmSuite) TestAPISwarmHealthcheckNone(c *check.C) {
+func (s *DockerSwarmSuite) TestAPISwarmHealthcheckNone(c *testing.T) {
 	// Issue #36386 can be a independent one, which is worth further investigation.
 	// Issue #36386 can be a independent one, which is worth further investigation.
 	c.Skip("Root cause of Issue #36386 is needed")
 	c.Skip("Root cause of Issue #36386 is needed")
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
@@ -948,7 +949,7 @@ func (s *DockerSwarmSuite) TestAPISwarmHealthcheckNone(c *check.C) {
 		}
 		}
 	})
 	})
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, instances)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(instances)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	containers := d.ActiveContainers(c)
 	containers := d.ActiveContainers(c)
 
 
@@ -956,7 +957,7 @@ func (s *DockerSwarmSuite) TestAPISwarmHealthcheckNone(c *check.C) {
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestSwarmRepeatedRootRotation(c *check.C) {
+func (s *DockerSwarmSuite) TestSwarmRepeatedRootRotation(c *testing.T) {
 	m := s.AddDaemon(c, true, true)
 	m := s.AddDaemon(c, true, true)
 	w := s.AddDaemon(c, true, false)
 	w := s.AddDaemon(c, true, false)
 
 
@@ -1025,7 +1026,7 @@ func (s *DockerSwarmSuite) TestSwarmRepeatedRootRotation(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestAPINetworkInspectWithScope(c *check.C) {
+func (s *DockerSwarmSuite) TestAPINetworkInspectWithScope(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "test-scoped-network"
 	name := "test-scoped-network"

+ 8 - 8
integration-cli/docker_api_test.go

@@ -7,21 +7,21 @@ import (
 	"runtime"
 	"runtime"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/api"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestAPIOptionsRoute(c *check.C) {
+func (s *DockerSuite) TestAPIOptionsRoute(c *testing.T) {
 	resp, _, err := request.Do("/", request.Method(http.MethodOptions))
 	resp, _, err := request.Do("/", request.Method(http.MethodOptions))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	assert.Equal(c, resp.StatusCode, http.StatusOK)
 	assert.Equal(c, resp.StatusCode, http.StatusOK)
 }
 }
 
 
-func (s *DockerSuite) TestAPIGetEnabledCORS(c *check.C) {
+func (s *DockerSuite) TestAPIGetEnabledCORS(c *testing.T) {
 	res, body, err := request.Get("/version")
 	res, body, err := request.Get("/version")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	assert.Equal(c, res.StatusCode, http.StatusOK)
 	assert.Equal(c, res.StatusCode, http.StatusOK)
@@ -33,7 +33,7 @@ func (s *DockerSuite) TestAPIGetEnabledCORS(c *check.C) {
 	//assert.Equal(c, res.Header.Get("Access-Control-Allow-Headers"), "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
 	//assert.Equal(c, res.Header.Get("Access-Control-Allow-Headers"), "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth")
 }
 }
 
 
-func (s *DockerSuite) TestAPIClientVersionOldNotSupported(c *check.C) {
+func (s *DockerSuite) TestAPIClientVersionOldNotSupported(c *testing.T) {
 	if testEnv.OSType != runtime.GOOS {
 	if testEnv.OSType != runtime.GOOS {
 		c.Skip("Daemon platform doesn't match test platform")
 		c.Skip("Daemon platform doesn't match test platform")
 	}
 	}
@@ -57,7 +57,7 @@ func (s *DockerSuite) TestAPIClientVersionOldNotSupported(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(string(content)), expected)
 	assert.Equal(c, strings.TrimSpace(string(content)), expected)
 }
 }
 
 
-func (s *DockerSuite) TestAPIErrorJSON(c *check.C) {
+func (s *DockerSuite) TestAPIErrorJSON(c *testing.T) {
 	httpResp, body, err := request.Post("/containers/create", request.JSONBody(struct{}{}))
 	httpResp, body, err := request.Post("/containers/create", request.JSONBody(struct{}{}))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	if versions.LessThan(testEnv.DaemonAPIVersion(), "1.32") {
 	if versions.LessThan(testEnv.DaemonAPIVersion(), "1.32") {
@@ -71,7 +71,7 @@ func (s *DockerSuite) TestAPIErrorJSON(c *check.C) {
 	assert.Equal(c, getErrorMessage(c, b), "Config cannot be empty in order to create a container")
 	assert.Equal(c, getErrorMessage(c, b), "Config cannot be empty in order to create a container")
 }
 }
 
 
-func (s *DockerSuite) TestAPIErrorPlainText(c *check.C) {
+func (s *DockerSuite) TestAPIErrorPlainText(c *testing.T) {
 	// Windows requires API 1.25 or later. This test is validating a behaviour which was present
 	// Windows requires API 1.25 or later. This test is validating a behaviour which was present
 	// in v1.23, but changed in 1.24, hence not applicable on Windows. See apiVersionSupportsJSONErrors
 	// in v1.23, but changed in 1.24, hence not applicable on Windows. See apiVersionSupportsJSONErrors
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -88,7 +88,7 @@ func (s *DockerSuite) TestAPIErrorPlainText(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(string(b)), "Config cannot be empty in order to create a container")
 	assert.Equal(c, strings.TrimSpace(string(b)), "Config cannot be empty in order to create a container")
 }
 }
 
 
-func (s *DockerSuite) TestAPIErrorNotFoundJSON(c *check.C) {
+func (s *DockerSuite) TestAPIErrorNotFoundJSON(c *testing.T) {
 	// 404 is a different code path to normal errors, so test separately
 	// 404 is a different code path to normal errors, so test separately
 	httpResp, body, err := request.Get("/notfound", request.JSON)
 	httpResp, body, err := request.Get("/notfound", request.JSON)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -99,7 +99,7 @@ func (s *DockerSuite) TestAPIErrorNotFoundJSON(c *check.C) {
 	assert.Equal(c, getErrorMessage(c, b), "page not found")
 	assert.Equal(c, getErrorMessage(c, b), "page not found")
 }
 }
 
 
-func (s *DockerSuite) TestAPIErrorNotFoundPlainText(c *check.C) {
+func (s *DockerSuite) TestAPIErrorNotFoundPlainText(c *testing.T) {
 	httpResp, body, err := request.Get("/v1.23/notfound", request.JSON)
 	httpResp, body, err := request.Get("/v1.23/notfound", request.JSON)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	assert.Equal(c, httpResp.StatusCode, http.StatusNotFound)
 	assert.Equal(c, httpResp.StatusCode, http.StatusNotFound)

+ 9 - 9
integration-cli/docker_cli_attach_test.go

@@ -8,17 +8,17 @@ import (
 	"runtime"
 	"runtime"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 const attachWait = 5 * time.Second
 const attachWait = 5 * time.Second
 
 
-func (s *DockerSuite) TestAttachMultipleAndRestart(c *check.C) {
+func (s *DockerSuite) TestAttachMultipleAndRestart(c *testing.T) {
 	endGroup := &sync.WaitGroup{}
 	endGroup := &sync.WaitGroup{}
 	startGroup := &sync.WaitGroup{}
 	startGroup := &sync.WaitGroup{}
 	endGroup.Add(3)
 	endGroup.Add(3)
@@ -88,7 +88,7 @@ func (s *DockerSuite) TestAttachMultipleAndRestart(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestAttachTTYWithoutStdin(c *check.C) {
+func (s *DockerSuite) TestAttachTTYWithoutStdin(c *testing.T) {
 	// TODO @jhowardmsft. Figure out how to get this running again reliable on Windows.
 	// TODO @jhowardmsft. Figure out how to get this running again reliable on Windows.
 	// It works by accident at the moment. Sometimes. I've gone back to v1.13.0 and see the same.
 	// It works by accident at the moment. Sometimes. I've gone back to v1.13.0 and see the same.
 	// On Windows, docker run -d -ti busybox causes the container to exit immediately.
 	// On Windows, docker run -d -ti busybox causes the container to exit immediately.
@@ -133,7 +133,7 @@ func (s *DockerSuite) TestAttachTTYWithoutStdin(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestAttachDisconnect(c *check.C) {
+func (s *DockerSuite) TestAttachDisconnect(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-di", "busybox", "/bin/cat")
 	out, _ := dockerCmd(c, "run", "-di", "busybox", "/bin/cat")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -147,7 +147,7 @@ func (s *DockerSuite) TestAttachDisconnect(c *check.C) {
 	stdout, err := cmd.StdoutPipe()
 	stdout, err := cmd.StdoutPipe()
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer stdout.Close()
 	defer stdout.Close()
-	c.Assert(cmd.Start(), check.IsNil)
+	assert.Assert(c, cmd.Start() == nil)
 	defer func() {
 	defer func() {
 		cmd.Process.Kill()
 		cmd.Process.Kill()
 		cmd.Wait()
 		cmd.Wait()
@@ -157,16 +157,16 @@ func (s *DockerSuite) TestAttachDisconnect(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	out, err = bufio.NewReader(stdout).ReadString('\n')
 	out, err = bufio.NewReader(stdout).ReadString('\n')
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), check.Equals, "hello")
+	assert.Equal(c, strings.TrimSpace(out), "hello")
 
 
-	c.Assert(stdin.Close(), check.IsNil)
+	assert.Assert(c, stdin.Close() == nil)
 
 
 	// Expect container to still be running after stdin is closed
 	// Expect container to still be running after stdin is closed
 	running := inspectField(c, id, "State.Running")
 	running := inspectField(c, id, "State.Running")
-	c.Assert(running, check.Equals, "true")
+	assert.Equal(c, running, "true")
 }
 }
 
 
-func (s *DockerSuite) TestAttachPausedContainer(c *check.C) {
+func (s *DockerSuite) TestAttachPausedContainer(c *testing.T) {
 	testRequires(c, IsPausable)
 	testRequires(c, IsPausable)
 	runSleepingContainer(c, "-d", "--name=test")
 	runSleepingContainer(c, "-d", "--name=test")
 	dockerCmd(c, "pause", "test")
 	dockerCmd(c, "pause", "test")

+ 6 - 6
integration-cli/docker_cli_attach_unix_test.go

@@ -7,15 +7,15 @@ import (
 	"io/ioutil"
 	"io/ioutil"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/creack/pty"
 	"github.com/creack/pty"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // #9860 Make sure attach ends when container ends (with no errors)
 // #9860 Make sure attach ends when container ends (with no errors)
-func (s *DockerSuite) TestAttachClosedOnContainerStop(c *check.C) {
+func (s *DockerSuite) TestAttachClosedOnContainerStop(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 
 
 	out, _ := dockerCmd(c, "run", "-dti", "busybox", "/bin/sh", "-c", `trap 'exit 0' SIGTERM; while true; do sleep 1; done`)
 	out, _ := dockerCmd(c, "run", "-dti", "busybox", "/bin/sh", "-c", `trap 'exit 0' SIGTERM; while true; do sleep 1; done`)
@@ -51,14 +51,14 @@ func (s *DockerSuite) TestAttachClosedOnContainerStop(c *check.C) {
 	case err := <-errChan:
 	case err := <-errChan:
 		tty.Close()
 		tty.Close()
 		out, _ := ioutil.ReadAll(pty)
 		out, _ := ioutil.ReadAll(pty)
-		c.Assert(err, check.IsNil, check.Commentf("out: %v", string(out)))
+		assert.Assert(c, err == nil, "out: %v", string(out))
 	case <-time.After(attachWait):
 	case <-time.After(attachWait):
 		c.Fatal("timed out without attach returning")
 		c.Fatal("timed out without attach returning")
 	}
 	}
 
 
 }
 }
 
 
-func (s *DockerSuite) TestAttachAfterDetach(c *check.C) {
+func (s *DockerSuite) TestAttachAfterDetach(c *testing.T) {
 	name := "detachtest"
 	name := "detachtest"
 
 
 	cpty, tty, err := pty.Open()
 	cpty, tty, err := pty.Open()
@@ -74,7 +74,7 @@ func (s *DockerSuite) TestAttachAfterDetach(c *check.C) {
 		close(cmdExit)
 		close(cmdExit)
 	}()
 	}()
 
 
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	cpty.Write([]byte{16})
 	cpty.Write([]byte{16})
 	time.Sleep(100 * time.Millisecond)
 	time.Sleep(100 * time.Millisecond)
@@ -123,7 +123,7 @@ func (s *DockerSuite) TestAttachAfterDetach(c *check.C) {
 }
 }
 
 
 // TestAttachDetach checks that attach in tty mode can be detached using the long container ID
 // TestAttachDetach checks that attach in tty mode can be detached using the long container ID
-func (s *DockerSuite) TestAttachDetach(c *check.C) {
+func (s *DockerSuite) TestAttachDetach(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "cat")
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "cat")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(id))
 	assert.NilError(c, waitRun(id))

File diff suppressed because it is too large
+ 115 - 115
integration-cli/docker_cli_build_test.go


+ 22 - 23
integration-cli/docker_cli_build_unix_test.go

@@ -13,19 +13,18 @@ import (
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
 	"syscall"
 	"syscall"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/go-units"
 	"github.com/docker/go-units"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {
+func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *testing.T) {
 	testRequires(c, cpuCfsQuota)
 	testRequires(c, cpuCfsQuota)
 	name := "testbuildresourceconstraints"
 	name := "testbuildresourceconstraints"
 	buildLabel := "DockerSuite.TestBuildResourceConstraintsAreUsed"
 	buildLabel := "DockerSuite.TestBuildResourceConstraintsAreUsed"
@@ -56,16 +55,16 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {
 
 
 	var c1 hostConfig
 	var c1 hostConfig
 	err := json.Unmarshal([]byte(cfg), &c1)
 	err := json.Unmarshal([]byte(cfg), &c1)
-	c.Assert(err, checker.IsNil, check.Commentf(cfg))
+	assert.Assert(c, err == nil, cfg)
 
 
-	c.Assert(c1.Memory, checker.Equals, int64(64*1024*1024), check.Commentf("resource constraints not set properly for Memory"))
-	c.Assert(c1.MemorySwap, checker.Equals, int64(-1), check.Commentf("resource constraints not set properly for MemorySwap"))
-	c.Assert(c1.CpusetCpus, checker.Equals, "0", check.Commentf("resource constraints not set properly for CpusetCpus"))
-	c.Assert(c1.CpusetMems, checker.Equals, "0", check.Commentf("resource constraints not set properly for CpusetMems"))
-	c.Assert(c1.CPUShares, checker.Equals, int64(100), check.Commentf("resource constraints not set properly for CPUShares"))
-	c.Assert(c1.CPUQuota, checker.Equals, int64(8000), check.Commentf("resource constraints not set properly for CPUQuota"))
-	c.Assert(c1.Ulimits[0].Name, checker.Equals, "nofile", check.Commentf("resource constraints not set properly for Ulimits"))
-	c.Assert(c1.Ulimits[0].Hard, checker.Equals, int64(42), check.Commentf("resource constraints not set properly for Ulimits"))
+	assert.Equal(c, c1.Memory, int64(64*1024*1024), "resource constraints not set properly for Memory")
+	assert.Equal(c, c1.MemorySwap, int64(-1), "resource constraints not set properly for MemorySwap")
+	assert.Equal(c, c1.CpusetCpus, "0", "resource constraints not set properly for CpusetCpus")
+	assert.Equal(c, c1.CpusetMems, "0", "resource constraints not set properly for CpusetMems")
+	assert.Equal(c, c1.CPUShares, int64(100), "resource constraints not set properly for CPUShares")
+	assert.Equal(c, c1.CPUQuota, int64(8000), "resource constraints not set properly for CPUQuota")
+	assert.Equal(c, c1.Ulimits[0].Name, "nofile", "resource constraints not set properly for Ulimits")
+	assert.Equal(c, c1.Ulimits[0].Hard, int64(42), "resource constraints not set properly for Ulimits")
 
 
 	// Make sure constraints aren't saved to image
 	// Make sure constraints aren't saved to image
 	cli.DockerCmd(c, "run", "--name=test", name)
 	cli.DockerCmd(c, "run", "--name=test", name)
@@ -74,18 +73,18 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {
 
 
 	var c2 hostConfig
 	var c2 hostConfig
 	err = json.Unmarshal([]byte(cfg), &c2)
 	err = json.Unmarshal([]byte(cfg), &c2)
-	c.Assert(err, checker.IsNil, check.Commentf(cfg))
-
-	c.Assert(c2.Memory, check.Not(checker.Equals), int64(64*1024*1024), check.Commentf("resource leaked from build for Memory"))
-	c.Assert(c2.MemorySwap, check.Not(checker.Equals), int64(-1), check.Commentf("resource leaked from build for MemorySwap"))
-	c.Assert(c2.CpusetCpus, check.Not(checker.Equals), "0", check.Commentf("resource leaked from build for CpusetCpus"))
-	c.Assert(c2.CpusetMems, check.Not(checker.Equals), "0", check.Commentf("resource leaked from build for CpusetMems"))
-	c.Assert(c2.CPUShares, check.Not(checker.Equals), int64(100), check.Commentf("resource leaked from build for CPUShares"))
-	c.Assert(c2.CPUQuota, check.Not(checker.Equals), int64(8000), check.Commentf("resource leaked from build for CPUQuota"))
-	c.Assert(c2.Ulimits, checker.IsNil, check.Commentf("resource leaked from build for Ulimits"))
+	assert.Assert(c, err == nil, cfg)
+
+	assert.Assert(c, c2.Memory != int64(64*1024*1024), "resource leaked from build for Memory")
+	assert.Assert(c, c2.MemorySwap != int64(-1), "resource leaked from build for MemorySwap")
+	assert.Assert(c, c2.CpusetCpus != "0", "resource leaked from build for CpusetCpus")
+	assert.Assert(c, c2.CpusetMems != "0", "resource leaked from build for CpusetMems")
+	assert.Assert(c, c2.CPUShares != int64(100), "resource leaked from build for CPUShares")
+	assert.Assert(c, c2.CPUQuota != int64(8000), "resource leaked from build for CPUQuota")
+	assert.Assert(c, c2.Ulimits == nil, "resource leaked from build for Ulimits")
 }
 }
 
 
-func (s *DockerSuite) TestBuildAddChangeOwnership(c *check.C) {
+func (s *DockerSuite) TestBuildAddChangeOwnership(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "testbuildaddown"
 	name := "testbuildaddown"
 
 
@@ -131,7 +130,7 @@ func (s *DockerSuite) TestBuildAddChangeOwnership(c *check.C) {
 // TODO(buildkit): this test needs to be rewritten for buildkit.
 // TODO(buildkit): this test needs to be rewritten for buildkit.
 // It has been manually tested positive. Confirmed issue: docker build output parsing.
 // It has been manually tested positive. Confirmed issue: docker build output parsing.
 // Potential issue: newEventObserver uses docker events, which is not hooked up to buildkit.
 // Potential issue: newEventObserver uses docker events, which is not hooked up to buildkit.
-func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
+func (s *DockerSuite) TestBuildCancellationKillsSleep(c *testing.T) {
 	testRequires(c, DaemonIsLinux, TODOBuildkit)
 	testRequires(c, DaemonIsLinux, TODOBuildkit)
 	name := "testbuildcancellation"
 	name := "testbuildcancellation"
 
 

+ 72 - 73
integration-cli/docker_cli_by_digest_test.go

@@ -7,14 +7,13 @@ import (
 	"path/filepath"
 	"path/filepath"
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/distribution/manifest/schema1"
 	"github.com/docker/distribution/manifest/schema1"
 	"github.com/docker/distribution/manifest/schema2"
 	"github.com/docker/distribution/manifest/schema2"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"github.com/opencontainers/go-digest"
 	"github.com/opencontainers/go-digest"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
@@ -27,11 +26,11 @@ var (
 	digestRegex     = regexp.MustCompile("Digest: ([\\S]+)")
 	digestRegex     = regexp.MustCompile("Digest: ([\\S]+)")
 )
 )
 
 
-func setupImage(c *check.C) (digest.Digest, error) {
+func setupImage(c *testing.T) (digest.Digest, error) {
 	return setupImageWithTag(c, "latest")
 	return setupImageWithTag(c, "latest")
 }
 }
 
 
-func setupImageWithTag(c *check.C, tag string) (digest.Digest, error) {
+func setupImageWithTag(c *testing.T, tag string) (digest.Digest, error) {
 	containerName := "busyboxbydigest"
 	containerName := "busyboxbydigest"
 
 
 	// new file is committed because this layer is used for detecting malicious
 	// new file is committed because this layer is used for detecting malicious
@@ -59,7 +58,7 @@ func setupImageWithTag(c *check.C, tag string) (digest.Digest, error) {
 	return digest.Digest(pushDigest), nil
 	return digest.Digest(pushDigest), nil
 }
 }
 
 
-func testPullByTagDisplaysDigest(c *check.C) {
+func testPullByTagDisplaysDigest(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
@@ -73,18 +72,18 @@ func testPullByTagDisplaysDigest(c *check.C) {
 	pullDigest := matches[1]
 	pullDigest := matches[1]
 
 
 	// make sure the pushed and pull digests match
 	// make sure the pushed and pull digests match
-	c.Assert(pushDigest.String(), checker.Equals, pullDigest)
+	assert.Equal(c, pushDigest.String(), pullDigest)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullByTagDisplaysDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestPullByTagDisplaysDigest(c *testing.T) {
 	testPullByTagDisplaysDigest(c)
 	testPullByTagDisplaysDigest(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPullByTagDisplaysDigest(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullByTagDisplaysDigest(c *testing.T) {
 	testPullByTagDisplaysDigest(c)
 	testPullByTagDisplaysDigest(c)
 }
 }
 
 
-func testPullByDigest(c *check.C) {
+func testPullByDigest(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
@@ -99,35 +98,35 @@ func testPullByDigest(c *check.C) {
 	pullDigest := matches[1]
 	pullDigest := matches[1]
 
 
 	// make sure the pushed and pull digests match
 	// make sure the pushed and pull digests match
-	c.Assert(pushDigest.String(), checker.Equals, pullDigest)
+	assert.Equal(c, pushDigest.String(), pullDigest)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestPullByDigest(c *testing.T) {
 	testPullByDigest(c)
 	testPullByDigest(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPullByDigest(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullByDigest(c *testing.T) {
 	testPullByDigest(c)
 	testPullByDigest(c)
 }
 }
 
 
-func testPullByDigestNoFallback(c *check.C) {
+func testPullByDigestNoFallback(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// pull from the registry using the <name>@<digest> reference
 	// pull from the registry using the <name>@<digest> reference
 	imageReference := fmt.Sprintf("%s@sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", repoName)
 	imageReference := fmt.Sprintf("%s@sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", repoName)
 	out, _, err := dockerCmdWithError("pull", imageReference)
 	out, _, err := dockerCmdWithError("pull", imageReference)
-	c.Assert(err, checker.NotNil, check.Commentf("expected non-zero exit status and correct error message when pulling non-existing image"))
-	c.Assert(out, checker.Contains, fmt.Sprintf("manifest for %s not found", imageReference), check.Commentf("expected non-zero exit status and correct error message when pulling non-existing image"))
+	assert.Assert(c, err != nil, "expected non-zero exit status and correct error message when pulling non-existing image")
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("manifest for %s not found", imageReference)), "expected non-zero exit status and correct error message when pulling non-existing image")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullByDigestNoFallback(c *check.C) {
+func (s *DockerRegistrySuite) TestPullByDigestNoFallback(c *testing.T) {
 	testPullByDigestNoFallback(c)
 	testPullByDigestNoFallback(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPullByDigestNoFallback(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullByDigestNoFallback(c *testing.T) {
 	testPullByDigestNoFallback(c)
 	testPullByDigestNoFallback(c)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestCreateByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestCreateByDigest(c *testing.T) {
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -140,7 +139,7 @@ func (s *DockerRegistrySuite) TestCreateByDigest(c *check.C) {
 	assert.Equal(c, res, imageReference)
 	assert.Equal(c, res, imageReference)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestRunByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestRunByDigest(c *testing.T) {
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
@@ -151,14 +150,14 @@ func (s *DockerRegistrySuite) TestRunByDigest(c *check.C) {
 
 
 	foundRegex := regexp.MustCompile("found=([^\n]+)")
 	foundRegex := regexp.MustCompile("found=([^\n]+)")
 	matches := foundRegex.FindStringSubmatch(out)
 	matches := foundRegex.FindStringSubmatch(out)
-	c.Assert(matches, checker.HasLen, 2, check.Commentf("unable to parse digest from pull output: %s", out))
-	c.Assert(matches[1], checker.Equals, "1", check.Commentf("Expected %q, got %q", "1", matches[1]))
+	assert.Equal(c, len(matches), 2, fmt.Sprintf("unable to parse digest from pull output: %s", out))
+	assert.Equal(c, matches[1], "1", fmt.Sprintf("Expected %q, got %q", "1", matches[1]))
 
 
 	res := inspectField(c, containerName, "Config.Image")
 	res := inspectField(c, containerName, "Config.Image")
 	assert.Equal(c, res, imageReference)
 	assert.Equal(c, res, imageReference)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestRemoveImageByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestRemoveImageByDigest(c *testing.T) {
 	digest, err := setupImage(c)
 	digest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -180,7 +179,7 @@ func (s *DockerRegistrySuite) TestRemoveImageByDigest(c *check.C) {
 	assert.ErrorContains(c, err, "No such object")
 	assert.ErrorContains(c, err, "No such object")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestBuildByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestBuildByDigest(c *testing.T) {
 	digest, err := setupImage(c)
 	digest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -205,7 +204,7 @@ func (s *DockerRegistrySuite) TestBuildByDigest(c *check.C) {
 	assert.Equal(c, res, imageID)
 	assert.Equal(c, res, imageID)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestTagByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestTagByDigest(c *testing.T) {
 	digest, err := setupImage(c)
 	digest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -224,7 +223,7 @@ func (s *DockerRegistrySuite) TestTagByDigest(c *check.C) {
 	assert.Equal(c, tagID, expectedID)
 	assert.Equal(c, tagID, expectedID)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestListImagesWithoutDigests(c *check.C) {
+func (s *DockerRegistrySuite) TestListImagesWithoutDigests(c *testing.T) {
 	digest, err := setupImage(c)
 	digest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -234,10 +233,10 @@ func (s *DockerRegistrySuite) TestListImagesWithoutDigests(c *check.C) {
 	dockerCmd(c, "pull", imageReference)
 	dockerCmd(c, "pull", imageReference)
 
 
 	out, _ := dockerCmd(c, "images")
 	out, _ := dockerCmd(c, "images")
-	c.Assert(out, checker.Not(checker.Contains), "DIGEST", check.Commentf("list output should not have contained DIGEST header"))
+	assert.Assert(c, !strings.Contains(out, "DIGEST"), "list output should not have contained DIGEST header")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestListImagesWithDigests(c *check.C) {
+func (s *DockerRegistrySuite) TestListImagesWithDigests(c *testing.T) {
 
 
 	// setup image1
 	// setup image1
 	digest1, err := setupImageWithTag(c, "tag1")
 	digest1, err := setupImageWithTag(c, "tag1")
@@ -253,7 +252,7 @@ func (s *DockerRegistrySuite) TestListImagesWithDigests(c *check.C) {
 
 
 	// make sure repo shown, tag=<none>, digest = $digest1
 	// make sure repo shown, tag=<none>, digest = $digest1
 	re1 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest1.String() + `\s`)
 	re1 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest1.String() + `\s`)
-	c.Assert(re1.MatchString(out), checker.True, check.Commentf("expected %q: %s", re1.String(), out))
+	assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
 	// setup image2
 	// setup image2
 	digest2, err := setupImageWithTag(c, "tag2")
 	digest2, err := setupImageWithTag(c, "tag2")
 	//error setting up image
 	//error setting up image
@@ -271,11 +270,11 @@ func (s *DockerRegistrySuite) TestListImagesWithDigests(c *check.C) {
 	out, _ = dockerCmd(c, "images", "--digests")
 	out, _ = dockerCmd(c, "images", "--digests")
 
 
 	// make sure repo shown, tag=<none>, digest = $digest1
 	// make sure repo shown, tag=<none>, digest = $digest1
-	c.Assert(re1.MatchString(out), checker.True, check.Commentf("expected %q: %s", re1.String(), out))
+	assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
 
 
 	// make sure repo shown, tag=<none>, digest = $digest2
 	// make sure repo shown, tag=<none>, digest = $digest2
 	re2 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest2.String() + `\s`)
 	re2 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest2.String() + `\s`)
-	c.Assert(re2.MatchString(out), checker.True, check.Commentf("expected %q: %s", re2.String(), out))
+	assert.Assert(c, re2.MatchString(out), "expected %q: %s", re2.String(), out)
 
 
 	// pull tag1
 	// pull tag1
 	dockerCmd(c, "pull", repoName+":tag1")
 	dockerCmd(c, "pull", repoName+":tag1")
@@ -285,9 +284,9 @@ func (s *DockerRegistrySuite) TestListImagesWithDigests(c *check.C) {
 
 
 	// make sure image 1 has repo, tag, <none> AND repo, <none>, digest
 	// make sure image 1 has repo, tag, <none> AND repo, <none>, digest
 	reWithDigest1 := regexp.MustCompile(`\s*` + repoName + `\s*tag1\s*` + digest1.String() + `\s`)
 	reWithDigest1 := regexp.MustCompile(`\s*` + repoName + `\s*tag1\s*` + digest1.String() + `\s`)
-	c.Assert(reWithDigest1.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest1.String(), out))
+	assert.Assert(c, reWithDigest1.MatchString(out), "expected %q: %s", reWithDigest1.String(), out)
 	// make sure image 2 has repo, <none>, digest
 	// make sure image 2 has repo, <none>, digest
-	c.Assert(re2.MatchString(out), checker.True, check.Commentf("expected %q: %s", re2.String(), out))
+	assert.Assert(c, re2.MatchString(out), "expected %q: %s", re2.String(), out)
 
 
 	// pull tag 2
 	// pull tag 2
 	dockerCmd(c, "pull", repoName+":tag2")
 	dockerCmd(c, "pull", repoName+":tag2")
@@ -296,25 +295,25 @@ func (s *DockerRegistrySuite) TestListImagesWithDigests(c *check.C) {
 	out, _ = dockerCmd(c, "images", "--digests")
 	out, _ = dockerCmd(c, "images", "--digests")
 
 
 	// make sure image 1 has repo, tag, digest
 	// make sure image 1 has repo, tag, digest
-	c.Assert(reWithDigest1.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest1.String(), out))
+	assert.Assert(c, reWithDigest1.MatchString(out), "expected %q: %s", reWithDigest1.String(), out)
 
 
 	// make sure image 2 has repo, tag, digest
 	// make sure image 2 has repo, tag, digest
 	reWithDigest2 := regexp.MustCompile(`\s*` + repoName + `\s*tag2\s*` + digest2.String() + `\s`)
 	reWithDigest2 := regexp.MustCompile(`\s*` + repoName + `\s*tag2\s*` + digest2.String() + `\s`)
-	c.Assert(reWithDigest2.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest2.String(), out))
+	assert.Assert(c, reWithDigest2.MatchString(out), "expected %q: %s", reWithDigest2.String(), out)
 
 
 	// list images
 	// list images
 	out, _ = dockerCmd(c, "images", "--digests")
 	out, _ = dockerCmd(c, "images", "--digests")
 
 
 	// make sure image 1 has repo, tag, digest
 	// make sure image 1 has repo, tag, digest
-	c.Assert(reWithDigest1.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest1.String(), out))
+	assert.Assert(c, reWithDigest1.MatchString(out), "expected %q: %s", reWithDigest1.String(), out)
 	// make sure image 2 has repo, tag, digest
 	// make sure image 2 has repo, tag, digest
-	c.Assert(reWithDigest2.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest2.String(), out))
+	assert.Assert(c, reWithDigest2.MatchString(out), "expected %q: %s", reWithDigest2.String(), out)
 	// make sure busybox has tag, but not digest
 	// make sure busybox has tag, but not digest
 	busyboxRe := regexp.MustCompile(`\s*busybox\s*latest\s*<none>\s`)
 	busyboxRe := regexp.MustCompile(`\s*busybox\s*latest\s*<none>\s`)
-	c.Assert(busyboxRe.MatchString(out), checker.True, check.Commentf("expected %q: %s", busyboxRe.String(), out))
+	assert.Assert(c, busyboxRe.MatchString(out), "expected %q: %s", busyboxRe.String(), out)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *check.C) {
+func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *testing.T) {
 	// setup image1
 	// setup image1
 	digest1, err := setupImageWithTag(c, "dangle1")
 	digest1, err := setupImageWithTag(c, "dangle1")
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
@@ -329,7 +328,7 @@ func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *check.C) {
 
 
 	// make sure repo shown, tag=<none>, digest = $digest1
 	// make sure repo shown, tag=<none>, digest = $digest1
 	re1 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest1.String() + `\s`)
 	re1 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest1.String() + `\s`)
-	c.Assert(re1.MatchString(out), checker.True, check.Commentf("expected %q: %s", re1.String(), out))
+	assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
 	// setup image2
 	// setup image2
 	digest2, err := setupImageWithTag(c, "dangle2")
 	digest2, err := setupImageWithTag(c, "dangle2")
 	//error setting up image
 	//error setting up image
@@ -347,11 +346,11 @@ func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *check.C) {
 	out, _ = dockerCmd(c, "images", "--digests", "--filter=dangling=true")
 	out, _ = dockerCmd(c, "images", "--digests", "--filter=dangling=true")
 
 
 	// make sure repo shown, tag=<none>, digest = $digest1
 	// make sure repo shown, tag=<none>, digest = $digest1
-	c.Assert(re1.MatchString(out), checker.True, check.Commentf("expected %q: %s", re1.String(), out))
+	assert.Assert(c, re1.MatchString(out), "expected %q: %s", re1.String(), out)
 
 
 	// make sure repo shown, tag=<none>, digest = $digest2
 	// make sure repo shown, tag=<none>, digest = $digest2
 	re2 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest2.String() + `\s`)
 	re2 := regexp.MustCompile(`\s*` + repoName + `\s*<none>\s*` + digest2.String() + `\s`)
-	c.Assert(re2.MatchString(out), checker.True, check.Commentf("expected %q: %s", re2.String(), out))
+	assert.Assert(c, re2.MatchString(out), "expected %q: %s", re2.String(), out)
 
 
 	// pull dangle1 tag
 	// pull dangle1 tag
 	dockerCmd(c, "pull", repoName+":dangle1")
 	dockerCmd(c, "pull", repoName+":dangle1")
@@ -361,9 +360,9 @@ func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *check.C) {
 
 
 	// make sure image 1 has repo, tag, <none> AND repo, <none>, digest
 	// make sure image 1 has repo, tag, <none> AND repo, <none>, digest
 	reWithDigest1 := regexp.MustCompile(`\s*` + repoName + `\s*dangle1\s*` + digest1.String() + `\s`)
 	reWithDigest1 := regexp.MustCompile(`\s*` + repoName + `\s*dangle1\s*` + digest1.String() + `\s`)
-	c.Assert(reWithDigest1.MatchString(out), checker.False, check.Commentf("unexpected %q: %s", reWithDigest1.String(), out))
+	assert.Assert(c, !reWithDigest1.MatchString(out), "unexpected %q: %s", reWithDigest1.String(), out)
 	// make sure image 2 has repo, <none>, digest
 	// make sure image 2 has repo, <none>, digest
-	c.Assert(re2.MatchString(out), checker.True, check.Commentf("expected %q: %s", re2.String(), out))
+	assert.Assert(c, re2.MatchString(out), "expected %q: %s", re2.String(), out)
 
 
 	// pull dangle2 tag
 	// pull dangle2 tag
 	dockerCmd(c, "pull", repoName+":dangle2")
 	dockerCmd(c, "pull", repoName+":dangle2")
@@ -372,24 +371,24 @@ func (s *DockerRegistrySuite) TestListDanglingImagesWithDigests(c *check.C) {
 	out, _ = dockerCmd(c, "images", "--digests")
 	out, _ = dockerCmd(c, "images", "--digests")
 
 
 	// make sure image 1 has repo, tag, digest
 	// make sure image 1 has repo, tag, digest
-	c.Assert(reWithDigest1.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest1.String(), out))
+	assert.Assert(c, reWithDigest1.MatchString(out), "expected %q: %s", reWithDigest1.String(), out)
 
 
 	// make sure image 2 has repo, tag, digest
 	// make sure image 2 has repo, tag, digest
 	reWithDigest2 := regexp.MustCompile(`\s*` + repoName + `\s*dangle2\s*` + digest2.String() + `\s`)
 	reWithDigest2 := regexp.MustCompile(`\s*` + repoName + `\s*dangle2\s*` + digest2.String() + `\s`)
-	c.Assert(reWithDigest2.MatchString(out), checker.True, check.Commentf("expected %q: %s", reWithDigest2.String(), out))
+	assert.Assert(c, reWithDigest2.MatchString(out), "expected %q: %s", reWithDigest2.String(), out)
 
 
 	// list images, no longer dangling, should not match
 	// list images, no longer dangling, should not match
 	out, _ = dockerCmd(c, "images", "--digests", "--filter=dangling=true")
 	out, _ = dockerCmd(c, "images", "--digests", "--filter=dangling=true")
 
 
 	// make sure image 1 has repo, tag, digest
 	// make sure image 1 has repo, tag, digest
-	c.Assert(reWithDigest1.MatchString(out), checker.False, check.Commentf("unexpected %q: %s", reWithDigest1.String(), out))
+	assert.Assert(c, !reWithDigest1.MatchString(out), "unexpected %q: %s", reWithDigest1.String(), out)
 	// make sure image 2 has repo, tag, digest
 	// make sure image 2 has repo, tag, digest
-	c.Assert(reWithDigest2.MatchString(out), checker.False, check.Commentf("unexpected %q: %s", reWithDigest2.String(), out))
+	assert.Assert(c, !reWithDigest2.MatchString(out), "unexpected %q: %s", reWithDigest2.String(), out)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestInspectImageWithDigests(c *check.C) {
+func (s *DockerRegistrySuite) TestInspectImageWithDigests(c *testing.T) {
 	digest, err := setupImage(c)
 	digest, err := setupImage(c)
-	c.Assert(err, check.IsNil, check.Commentf("error setting up image"))
+	assert.Assert(c, err == nil, "error setting up image")
 
 
 	imageReference := fmt.Sprintf("%s@%s", repoName, digest)
 	imageReference := fmt.Sprintf("%s@%s", repoName, digest)
 
 
@@ -401,12 +400,12 @@ func (s *DockerRegistrySuite) TestInspectImageWithDigests(c *check.C) {
 	var imageJSON []types.ImageInspect
 	var imageJSON []types.ImageInspect
 	err = json.Unmarshal([]byte(out), &imageJSON)
 	err = json.Unmarshal([]byte(out), &imageJSON)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(imageJSON, checker.HasLen, 1)
-	c.Assert(imageJSON[0].RepoDigests, checker.HasLen, 1)
+	assert.Equal(c, len(imageJSON), 1)
+	assert.Equal(c, len(imageJSON[0].RepoDigests), 1)
 	assert.Check(c, is.Contains(imageJSON[0].RepoDigests, imageReference))
 	assert.Check(c, is.Contains(imageJSON[0].RepoDigests, imageReference))
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPsListContainersFilterAncestorImageByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestPsListContainersFilterAncestorImageByDigest(c *testing.T) {
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
 
 
 	digest, err := setupImage(c)
 	digest, err := setupImage(c)
@@ -442,7 +441,7 @@ func (s *DockerRegistrySuite) TestPsListContainersFilterAncestorImageByDigest(c
 	checkPsAncestorFilterOutput(c, RemoveOutputForExistingElements(out, existingContainers), imageReference, expectedIDs)
 	checkPsAncestorFilterOutput(c, RemoveOutputForExistingElements(out, existingContainers), imageReference, expectedIDs)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestDeleteImageByIDOnlyPulledByDigest(c *check.C) {
+func (s *DockerRegistrySuite) TestDeleteImageByIDOnlyPulledByDigest(c *testing.T) {
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -461,7 +460,7 @@ func (s *DockerRegistrySuite) TestDeleteImageByIDOnlyPulledByDigest(c *check.C)
 	assert.ErrorContains(c, err, "", "image should have been deleted")
 	assert.ErrorContains(c, err, "", "image should have been deleted")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestDeleteImageWithDigestAndTag(c *check.C) {
+func (s *DockerRegistrySuite) TestDeleteImageWithDigestAndTag(c *testing.T) {
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -488,7 +487,7 @@ func (s *DockerRegistrySuite) TestDeleteImageWithDigestAndTag(c *check.C) {
 	assert.ErrorContains(c, err, "", "image should have been deleted")
 	assert.ErrorContains(c, err, "", "image should have been deleted")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestDeleteImageWithDigestAndMultiRepoTag(c *check.C) {
+func (s *DockerRegistrySuite) TestDeleteImageWithDigestAndMultiRepoTag(c *testing.T) {
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
 
 
@@ -525,7 +524,7 @@ func (s *DockerRegistrySuite) TestDeleteImageWithDigestAndMultiRepoTag(c *check.
 // TestPullFailsWithAlteredManifest tests that a `docker pull` fails when
 // TestPullFailsWithAlteredManifest tests that a `docker pull` fails when
 // we have modified a manifest blob and its digest cannot be verified.
 // we have modified a manifest blob and its digest cannot be verified.
 // This is the schema2 version of the test.
 // This is the schema2 version of the test.
-func (s *DockerRegistrySuite) TestPullFailsWithAlteredManifest(c *check.C) {
+func (s *DockerRegistrySuite) TestPullFailsWithAlteredManifest(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	manifestDigest, err := setupImage(c)
 	manifestDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
@@ -556,7 +555,7 @@ func (s *DockerRegistrySuite) TestPullFailsWithAlteredManifest(c *check.C) {
 	// Pull from the registry using the <name>@<digest> reference.
 	// Pull from the registry using the <name>@<digest> reference.
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
-	c.Assert(exitStatus, checker.Not(check.Equals), 0)
+	assert.Assert(c, exitStatus != 0)
 
 
 	expectedErrorMsg := fmt.Sprintf("manifest verification failed for digest %s", manifestDigest)
 	expectedErrorMsg := fmt.Sprintf("manifest verification failed for digest %s", manifestDigest)
 	assert.Assert(c, is.Contains(out, expectedErrorMsg))
 	assert.Assert(c, is.Contains(out, expectedErrorMsg))
@@ -565,17 +564,17 @@ func (s *DockerRegistrySuite) TestPullFailsWithAlteredManifest(c *check.C) {
 // TestPullFailsWithAlteredManifest tests that a `docker pull` fails when
 // TestPullFailsWithAlteredManifest tests that a `docker pull` fails when
 // we have modified a manifest blob and its digest cannot be verified.
 // we have modified a manifest blob and its digest cannot be verified.
 // This is the schema1 version of the test.
 // This is the schema1 version of the test.
-func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredManifest(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredManifest(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	manifestDigest, err := setupImage(c)
 	manifestDigest, err := setupImage(c)
-	c.Assert(err, checker.IsNil, check.Commentf("error setting up image"))
+	assert.Assert(c, err == nil, "error setting up image")
 
 
 	// Load the target manifest blob.
 	// Load the target manifest blob.
 	manifestBlob := s.reg.ReadBlobContents(c, manifestDigest)
 	manifestBlob := s.reg.ReadBlobContents(c, manifestDigest)
 
 
 	var imgManifest schema1.Manifest
 	var imgManifest schema1.Manifest
 	err = json.Unmarshal(manifestBlob, &imgManifest)
 	err = json.Unmarshal(manifestBlob, &imgManifest)
-	c.Assert(err, checker.IsNil, check.Commentf("unable to decode image manifest from blob"))
+	assert.Assert(c, err == nil, "unable to decode image manifest from blob")
 
 
 	// Change a layer in the manifest.
 	// Change a layer in the manifest.
 	imgManifest.FSLayers[0] = schema1.FSLayer{
 	imgManifest.FSLayers[0] = schema1.FSLayer{
@@ -588,7 +587,7 @@ func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredManifest(c *check.C
 	defer undo()
 	defer undo()
 
 
 	alteredManifestBlob, err := json.MarshalIndent(imgManifest, "", "   ")
 	alteredManifestBlob, err := json.MarshalIndent(imgManifest, "", "   ")
-	c.Assert(err, checker.IsNil, check.Commentf("unable to encode altered image manifest to JSON"))
+	assert.Assert(c, err == nil, "unable to encode altered image manifest to JSON")
 
 
 	s.reg.WriteBlobContents(c, manifestDigest, alteredManifestBlob)
 	s.reg.WriteBlobContents(c, manifestDigest, alteredManifestBlob)
 
 
@@ -598,26 +597,26 @@ func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredManifest(c *check.C
 	// Pull from the registry using the <name>@<digest> reference.
 	// Pull from the registry using the <name>@<digest> reference.
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
-	c.Assert(exitStatus, checker.Not(check.Equals), 0)
+	assert.Assert(c, exitStatus != 0)
 
 
 	expectedErrorMsg := fmt.Sprintf("image verification failed for digest %s", manifestDigest)
 	expectedErrorMsg := fmt.Sprintf("image verification failed for digest %s", manifestDigest)
-	c.Assert(out, checker.Contains, expectedErrorMsg)
+	assert.Assert(c, strings.Contains(out, expectedErrorMsg))
 }
 }
 
 
 // TestPullFailsWithAlteredLayer tests that a `docker pull` fails when
 // TestPullFailsWithAlteredLayer tests that a `docker pull` fails when
 // we have modified a layer blob and its digest cannot be verified.
 // we have modified a layer blob and its digest cannot be verified.
 // This is the schema2 version of the test.
 // This is the schema2 version of the test.
-func (s *DockerRegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) {
+func (s *DockerRegistrySuite) TestPullFailsWithAlteredLayer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	manifestDigest, err := setupImage(c)
 	manifestDigest, err := setupImage(c)
-	c.Assert(err, checker.IsNil)
+	assert.Assert(c, err == nil)
 
 
 	// Load the target manifest blob.
 	// Load the target manifest blob.
 	manifestBlob := s.reg.ReadBlobContents(c, manifestDigest)
 	manifestBlob := s.reg.ReadBlobContents(c, manifestDigest)
 
 
 	var imgManifest schema2.Manifest
 	var imgManifest schema2.Manifest
 	err = json.Unmarshal(manifestBlob, &imgManifest)
 	err = json.Unmarshal(manifestBlob, &imgManifest)
-	c.Assert(err, checker.IsNil)
+	assert.Assert(c, err == nil)
 
 
 	// Next, get the digest of one of the layers from the manifest.
 	// Next, get the digest of one of the layers from the manifest.
 	targetLayerDigest := imgManifest.Layers[0].Digest
 	targetLayerDigest := imgManifest.Layers[0].Digest
@@ -641,26 +640,26 @@ func (s *DockerRegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) {
 	// Pull from the registry using the <name>@<digest> reference.
 	// Pull from the registry using the <name>@<digest> reference.
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
-	c.Assert(exitStatus, checker.Not(check.Equals), 0, check.Commentf("expected a non-zero exit status"))
+	assert.Assert(c, exitStatus != 0, "expected a non-zero exit status")
 
 
 	expectedErrorMsg := fmt.Sprintf("filesystem layer verification failed for digest %s", targetLayerDigest)
 	expectedErrorMsg := fmt.Sprintf("filesystem layer verification failed for digest %s", targetLayerDigest)
-	c.Assert(out, checker.Contains, expectedErrorMsg, check.Commentf("expected error message in output: %s", out))
+	assert.Assert(c, strings.Contains(out, expectedErrorMsg), "expected error message in output: %s", out)
 }
 }
 
 
 // TestPullFailsWithAlteredLayer tests that a `docker pull` fails when
 // TestPullFailsWithAlteredLayer tests that a `docker pull` fails when
 // we have modified a layer blob and its digest cannot be verified.
 // we have modified a layer blob and its digest cannot be verified.
 // This is the schema1 version of the test.
 // This is the schema1 version of the test.
-func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredLayer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	manifestDigest, err := setupImage(c)
 	manifestDigest, err := setupImage(c)
-	c.Assert(err, checker.IsNil)
+	assert.Assert(c, err == nil)
 
 
 	// Load the target manifest blob.
 	// Load the target manifest blob.
 	manifestBlob := s.reg.ReadBlobContents(c, manifestDigest)
 	manifestBlob := s.reg.ReadBlobContents(c, manifestDigest)
 
 
 	var imgManifest schema1.Manifest
 	var imgManifest schema1.Manifest
 	err = json.Unmarshal(manifestBlob, &imgManifest)
 	err = json.Unmarshal(manifestBlob, &imgManifest)
-	c.Assert(err, checker.IsNil)
+	assert.Assert(c, err == nil)
 
 
 	// Next, get the digest of one of the layers from the manifest.
 	// Next, get the digest of one of the layers from the manifest.
 	targetLayerDigest := imgManifest.FSLayers[0].BlobSum
 	targetLayerDigest := imgManifest.FSLayers[0].BlobSum
@@ -684,8 +683,8 @@ func (s *DockerSchema1RegistrySuite) TestPullFailsWithAlteredLayer(c *check.C) {
 	// Pull from the registry using the <name>@<digest> reference.
 	// Pull from the registry using the <name>@<digest> reference.
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	imageReference := fmt.Sprintf("%s@%s", repoName, manifestDigest)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
 	out, exitStatus, _ := dockerCmdWithError("pull", imageReference)
-	c.Assert(exitStatus, checker.Not(check.Equals), 0, check.Commentf("expected a non-zero exit status"))
+	assert.Assert(c, exitStatus != 0, "expected a non-zero exit status")
 
 
 	expectedErrorMsg := fmt.Sprintf("filesystem layer verification failed for digest %s", targetLayerDigest)
 	expectedErrorMsg := fmt.Sprintf("filesystem layer verification failed for digest %s", targetLayerDigest)
-	c.Assert(out, checker.Contains, expectedErrorMsg, check.Commentf("expected error message in output: %s", out))
+	assert.Assert(c, strings.Contains(out, expectedErrorMsg), "expected error message in output: %s", out)
 }
 }

+ 17 - 18
integration-cli/docker_cli_commit_test.go

@@ -2,14 +2,14 @@ package main
 
 
 import (
 import (
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
-	"github.com/go-check/check"
+	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestCommitAfterContainerIsDone(c *check.C) {
+func (s *DockerSuite) TestCommitAfterContainerIsDone(c *testing.T) {
 	out := cli.DockerCmd(c, "run", "-i", "-a", "stdin", "busybox", "echo", "foo").Combined()
 	out := cli.DockerCmd(c, "run", "-i", "-a", "stdin", "busybox", "echo", "foo").Combined()
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -23,7 +23,7 @@ func (s *DockerSuite) TestCommitAfterContainerIsDone(c *check.C) {
 	cli.DockerCmd(c, "inspect", cleanedImageID)
 	cli.DockerCmd(c, "inspect", cleanedImageID)
 }
 }
 
 
-func (s *DockerSuite) TestCommitWithoutPause(c *check.C) {
+func (s *DockerSuite) TestCommitWithoutPause(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-i", "-a", "stdin", "busybox", "echo", "foo")
 	out, _ := dockerCmd(c, "run", "-i", "-a", "stdin", "busybox", "echo", "foo")
 
 
@@ -39,7 +39,7 @@ func (s *DockerSuite) TestCommitWithoutPause(c *check.C) {
 }
 }
 
 
 //test commit a paused container should not unpause it after commit
 //test commit a paused container should not unpause it after commit
-func (s *DockerSuite) TestCommitPausedContainer(c *check.C) {
+func (s *DockerSuite) TestCommitPausedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-i", "-d", "busybox")
 	out, _ := dockerCmd(c, "run", "-i", "-d", "busybox")
 
 
@@ -50,10 +50,10 @@ func (s *DockerSuite) TestCommitPausedContainer(c *check.C) {
 
 
 	out = inspectField(c, cleanedContainerID, "State.Paused")
 	out = inspectField(c, cleanedContainerID, "State.Paused")
 	// commit should not unpause a paused container
 	// commit should not unpause a paused container
-	c.Assert(out, checker.Contains, "true")
+	assert.Assert(c, strings.Contains(out, "true"))
 }
 }
 
 
-func (s *DockerSuite) TestCommitNewFile(c *check.C) {
+func (s *DockerSuite) TestCommitNewFile(c *testing.T) {
 	dockerCmd(c, "run", "--name", "committer", "busybox", "/bin/sh", "-c", "echo koye > /foo")
 	dockerCmd(c, "run", "--name", "committer", "busybox", "/bin/sh", "-c", "echo koye > /foo")
 
 
 	imageID, _ := dockerCmd(c, "commit", "committer")
 	imageID, _ := dockerCmd(c, "commit", "committer")
@@ -61,18 +61,17 @@ func (s *DockerSuite) TestCommitNewFile(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "run", imageID, "cat", "/foo")
 	out, _ := dockerCmd(c, "run", imageID, "cat", "/foo")
 	actual := strings.TrimSpace(out)
 	actual := strings.TrimSpace(out)
-	c.Assert(actual, checker.Equals, "koye")
+	assert.Equal(c, actual, "koye")
 }
 }
 
 
-func (s *DockerSuite) TestCommitHardlink(c *check.C) {
+func (s *DockerSuite) TestCommitHardlink(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	firstOutput, _ := dockerCmd(c, "run", "-t", "--name", "hardlinks", "busybox", "sh", "-c", "touch file1 && ln file1 file2 && ls -di file1 file2")
 	firstOutput, _ := dockerCmd(c, "run", "-t", "--name", "hardlinks", "busybox", "sh", "-c", "touch file1 && ln file1 file2 && ls -di file1 file2")
 
 
 	chunks := strings.Split(strings.TrimSpace(firstOutput), " ")
 	chunks := strings.Split(strings.TrimSpace(firstOutput), " ")
 	inode := chunks[0]
 	inode := chunks[0]
 	chunks = strings.SplitAfterN(strings.TrimSpace(firstOutput), " ", 2)
 	chunks = strings.SplitAfterN(strings.TrimSpace(firstOutput), " ", 2)
-	c.Assert(chunks[1], checker.Contains, chunks[0], check.Commentf("Failed to create hardlink in a container. Expected to find %q in %q", inode, chunks[1:]))
-
+	assert.Assert(c, strings.Contains(chunks[1], chunks[0]), "Failed to create hardlink in a container. Expected to find %q in %q", inode, chunks[1:])
 	imageID, _ := dockerCmd(c, "commit", "hardlinks", "hardlinks")
 	imageID, _ := dockerCmd(c, "commit", "hardlinks", "hardlinks")
 	imageID = strings.TrimSpace(imageID)
 	imageID = strings.TrimSpace(imageID)
 
 
@@ -81,10 +80,10 @@ func (s *DockerSuite) TestCommitHardlink(c *check.C) {
 	chunks = strings.Split(strings.TrimSpace(secondOutput), " ")
 	chunks = strings.Split(strings.TrimSpace(secondOutput), " ")
 	inode = chunks[0]
 	inode = chunks[0]
 	chunks = strings.SplitAfterN(strings.TrimSpace(secondOutput), " ", 2)
 	chunks = strings.SplitAfterN(strings.TrimSpace(secondOutput), " ", 2)
-	c.Assert(chunks[1], checker.Contains, chunks[0], check.Commentf("Failed to create hardlink in a container. Expected to find %q in %q", inode, chunks[1:]))
+	assert.Assert(c, strings.Contains(chunks[1], chunks[0]), "Failed to create hardlink in a container. Expected to find %q in %q", inode, chunks[1:])
 }
 }
 
 
-func (s *DockerSuite) TestCommitTTY(c *check.C) {
+func (s *DockerSuite) TestCommitTTY(c *testing.T) {
 	dockerCmd(c, "run", "-t", "--name", "tty", "busybox", "/bin/ls")
 	dockerCmd(c, "run", "-t", "--name", "tty", "busybox", "/bin/ls")
 
 
 	imageID, _ := dockerCmd(c, "commit", "tty", "ttytest")
 	imageID, _ := dockerCmd(c, "commit", "tty", "ttytest")
@@ -93,7 +92,7 @@ func (s *DockerSuite) TestCommitTTY(c *check.C) {
 	dockerCmd(c, "run", imageID, "/bin/ls")
 	dockerCmd(c, "run", imageID, "/bin/ls")
 }
 }
 
 
-func (s *DockerSuite) TestCommitWithHostBindMount(c *check.C) {
+func (s *DockerSuite) TestCommitWithHostBindMount(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "--name", "bind-commit", "-v", "/dev/null:/winning", "busybox", "true")
 	dockerCmd(c, "run", "--name", "bind-commit", "-v", "/dev/null:/winning", "busybox", "true")
 
 
@@ -103,7 +102,7 @@ func (s *DockerSuite) TestCommitWithHostBindMount(c *check.C) {
 	dockerCmd(c, "run", imageID, "true")
 	dockerCmd(c, "run", imageID, "true")
 }
 }
 
 
-func (s *DockerSuite) TestCommitChange(c *check.C) {
+func (s *DockerSuite) TestCommitChange(c *testing.T) {
 	dockerCmd(c, "run", "--name", "test", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test", "busybox", "true")
 
 
 	imageID, _ := dockerCmd(c, "commit",
 	imageID, _ := dockerCmd(c, "commit",
@@ -153,7 +152,7 @@ func (s *DockerSuite) TestCommitChange(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestCommitChangeLabels(c *check.C) {
+func (s *DockerSuite) TestCommitChangeLabels(c *testing.T) {
 	dockerCmd(c, "run", "--name", "test", "--label", "some=label", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test", "--label", "some=label", "busybox", "true")
 
 
 	imageID, _ := dockerCmd(c, "commit",
 	imageID, _ := dockerCmd(c, "commit",
@@ -161,7 +160,7 @@ func (s *DockerSuite) TestCommitChangeLabels(c *check.C) {
 		"test", "test-commit")
 		"test", "test-commit")
 	imageID = strings.TrimSpace(imageID)
 	imageID = strings.TrimSpace(imageID)
 
 
-	c.Assert(inspectField(c, imageID, "Config.Labels"), checker.Equals, "map[some:label2]")
+	assert.Equal(c, inspectField(c, imageID, "Config.Labels"), "map[some:label2]")
 	// check that container labels didn't change
 	// check that container labels didn't change
-	c.Assert(inspectField(c, "test", "Config.Labels"), checker.Equals, "map[some:label]")
+	assert.Equal(c, inspectField(c, "test", "Config.Labels"), "map[some:label]")
 }
 }

+ 64 - 65
integration-cli/docker_cli_cp_from_container_test.go

@@ -3,9 +3,8 @@ package main
 import (
 import (
 	"os"
 	"os"
 	"path/filepath"
 	"path/filepath"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -22,7 +21,7 @@ import (
 // Check that copying from a container to a local symlink copies to the symlink
 // Check that copying from a container to a local symlink copies to the symlink
 // target and does not overwrite the local symlink itself.
 // target and does not overwrite the local symlink itself.
 // TODO: move to docker/cli and/or integration/container/copy_test.go
 // TODO: move to docker/cli and/or integration/container/copy_test.go
-func (s *DockerSuite) TestCpFromSymlinkDestination(c *check.C) {
+func (s *DockerSuite) TestCpFromSymlinkDestination(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 
 
@@ -36,38 +35,38 @@ func (s *DockerSuite) TestCpFromSymlinkDestination(c *check.C) {
 	srcPath := containerCpPath(containerID, "/file2")
 	srcPath := containerCpPath(containerID, "/file2")
 	dstPath := cpPath(tmpDir, "symlinkToFile1")
 	dstPath := cpPath(tmpDir, "symlinkToFile1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, dstPath, "file1"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, dstPath, "file1") == nil)
 
 
 	// The file should have the contents of "file2" now.
 	// The file should have the contents of "file2" now.
-	c.Assert(fileContentEquals(c, cpPath(tmpDir, "file1"), "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(tmpDir, "file1"), "file2\n") == nil)
 
 
 	// Next, copy a file from the container to a symlink to a directory. This
 	// Next, copy a file from the container to a symlink to a directory. This
 	// should copy the file into the symlink target directory.
 	// should copy the file into the symlink target directory.
 	dstPath = cpPath(tmpDir, "symlinkToDir1")
 	dstPath = cpPath(tmpDir, "symlinkToDir1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, dstPath, "dir1"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, dstPath, "dir1") == nil)
 
 
 	// The file should have the contents of "file2" now.
 	// The file should have the contents of "file2" now.
-	c.Assert(fileContentEquals(c, cpPath(tmpDir, "file2"), "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(tmpDir, "file2"), "file2\n") == nil)
 
 
 	// Next, copy a file from the container to a symlink to a file that does
 	// Next, copy a file from the container to a symlink to a file that does
 	// not exist (a broken symlink). This should create the target file with
 	// not exist (a broken symlink). This should create the target file with
 	// the contents of the source file.
 	// the contents of the source file.
 	dstPath = cpPath(tmpDir, "brokenSymlinkToFileX")
 	dstPath = cpPath(tmpDir, "brokenSymlinkToFileX")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, dstPath, "fileX"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, dstPath, "fileX") == nil)
 
 
 	// The file should have the contents of "file2" now.
 	// The file should have the contents of "file2" now.
-	c.Assert(fileContentEquals(c, cpPath(tmpDir, "fileX"), "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(tmpDir, "fileX"), "file2\n") == nil)
 
 
 	// Next, copy a directory from the container to a symlink to a local
 	// Next, copy a directory from the container to a symlink to a local
 	// directory. This should copy the directory into the symlink target
 	// directory. This should copy the directory into the symlink target
@@ -75,13 +74,13 @@ func (s *DockerSuite) TestCpFromSymlinkDestination(c *check.C) {
 	srcPath = containerCpPath(containerID, "/dir2")
 	srcPath = containerCpPath(containerID, "/dir2")
 	dstPath = cpPath(tmpDir, "symlinkToDir1")
 	dstPath = cpPath(tmpDir, "symlinkToDir1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, dstPath, "dir1"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, dstPath, "dir1") == nil)
 
 
 	// The directory should now contain a copy of "dir2".
 	// The directory should now contain a copy of "dir2".
-	c.Assert(fileContentEquals(c, cpPath(tmpDir, "dir1/dir2/file2-1"), "file2-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(tmpDir, "dir1/dir2/file2-1"), "file2-1\n") == nil)
 
 
 	// Next, copy a directory from the container to a symlink to a local
 	// Next, copy a directory from the container to a symlink to a local
 	// directory that does not exist (a broken symlink). This should create
 	// directory that does not exist (a broken symlink). This should create
@@ -89,13 +88,13 @@ func (s *DockerSuite) TestCpFromSymlinkDestination(c *check.C) {
 	// should not modify the symlink.
 	// should not modify the symlink.
 	dstPath = cpPath(tmpDir, "brokenSymlinkToDirX")
 	dstPath = cpPath(tmpDir, "brokenSymlinkToDirX")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, dstPath, "dirX"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, dstPath, "dirX") == nil)
 
 
 	// The "dirX" directory should now be a copy of "dir2".
 	// The "dirX" directory should now be a copy of "dir2".
-	c.Assert(fileContentEquals(c, cpPath(tmpDir, "dirX/file2-1"), "file2-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(tmpDir, "dirX/file2-1"), "file2-1\n") == nil)
 }
 }
 
 
 // Possibilities are reduced to the remaining 10 cases:
 // Possibilities are reduced to the remaining 10 cases:
@@ -117,7 +116,7 @@ func (s *DockerSuite) TestCpFromSymlinkDestination(c *check.C) {
 // A. SRC specifies a file and DST (no trailing path separator) doesn't
 // A. SRC specifies a file and DST (no trailing path separator) doesn't
 //    exist. This should create a file with the name DST and copy the
 //    exist. This should create a file with the name DST and copy the
 //    contents of the source file into it.
 //    contents of the source file into it.
-func (s *DockerSuite) TestCpFromCaseA(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseA(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -129,15 +128,15 @@ func (s *DockerSuite) TestCpFromCaseA(c *check.C) {
 	srcPath := containerCpPath(containerID, "/root/file1")
 	srcPath := containerCpPath(containerID, "/root/file1")
 	dstPath := cpPath(tmpDir, "itWorks.txt")
 	dstPath := cpPath(tmpDir, "itWorks.txt")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1\n") == nil)
 }
 }
 
 
 // B. SRC specifies a file and DST (with trailing path separator) doesn't
 // B. SRC specifies a file and DST (with trailing path separator) doesn't
 //    exist. This should cause an error because the copy operation cannot
 //    exist. This should cause an error because the copy operation cannot
 //    create a directory when copying a single file.
 //    create a directory when copying a single file.
-func (s *DockerSuite) TestCpFromCaseB(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseB(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 
 
@@ -150,12 +149,12 @@ func (s *DockerSuite) TestCpFromCaseB(c *check.C) {
 	err := runDockerCp(c, srcPath, dstDir, nil)
 	err := runDockerCp(c, srcPath, dstDir, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpDirNotExist(err), checker.True, check.Commentf("expected DirNotExists error, but got %T: %s", err, err))
+	assert.Assert(c, isCpDirNotExist(err), "expected DirNotExists error, but got %T: %s", err, err)
 }
 }
 
 
 // C. SRC specifies a file and DST exists as a file. This should overwrite
 // C. SRC specifies a file and DST exists as a file. This should overwrite
 //    the file at DST with the contents of the source file.
 //    the file at DST with the contents of the source file.
-func (s *DockerSuite) TestCpFromCaseC(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseC(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -170,17 +169,17 @@ func (s *DockerSuite) TestCpFromCaseC(c *check.C) {
 	dstPath := cpPath(tmpDir, "file2")
 	dstPath := cpPath(tmpDir, "file2")
 
 
 	// Ensure the local file starts with different content.
 	// Ensure the local file starts with different content.
-	c.Assert(fileContentEquals(c, dstPath, "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file2\n") == nil)
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1\n") == nil)
 }
 }
 
 
 // D. SRC specifies a file and DST exists as a directory. This should place
 // D. SRC specifies a file and DST exists as a directory. This should place
 //    a copy of the source file inside it using the basename from SRC. Ensure
 //    a copy of the source file inside it using the basename from SRC. Ensure
 //    this works whether DST has a trailing path separator or not.
 //    this works whether DST has a trailing path separator or not.
-func (s *DockerSuite) TestCpFromCaseD(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseD(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 
 
@@ -195,32 +194,32 @@ func (s *DockerSuite) TestCpFromCaseD(c *check.C) {
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
 	_, err := os.Stat(dstPath)
 	_, err := os.Stat(dstPath)
-	c.Assert(os.IsNotExist(err), checker.True, check.Commentf("did not expect dstPath %q to exist", dstPath))
+	assert.Assert(c, os.IsNotExist(err), "did not expect dstPath %q to exist", dstPath)
 
 
-	c.Assert(runDockerCp(c, srcPath, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
 	// unable to remove dstDir
 	// unable to remove dstDir
-	c.Assert(os.RemoveAll(dstDir), checker.IsNil)
+	assert.Assert(c, os.RemoveAll(dstDir) == nil)
 
 
 	// unable to make dstDir
 	// unable to make dstDir
-	c.Assert(os.MkdirAll(dstDir, os.FileMode(0755)), checker.IsNil)
+	assert.Assert(c, os.MkdirAll(dstDir, os.FileMode(0755)) == nil)
 
 
 	dstDir = cpPathTrailingSep(tmpDir, "dir1")
 	dstDir = cpPathTrailingSep(tmpDir, "dir1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1\n") == nil)
 }
 }
 
 
 // E. SRC specifies a directory and DST does not exist. This should create a
 // E. SRC specifies a directory and DST does not exist. This should create a
 //    directory at DST and copy the contents of the SRC directory into the DST
 //    directory at DST and copy the contents of the SRC directory into the DST
 //    directory. Ensure this works whether DST has a trailing path separator or
 //    directory. Ensure this works whether DST has a trailing path separator or
 //    not.
 //    not.
-func (s *DockerSuite) TestCpFromCaseE(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseE(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 
 
@@ -231,25 +230,25 @@ func (s *DockerSuite) TestCpFromCaseE(c *check.C) {
 	dstDir := cpPath(tmpDir, "testDir")
 	dstDir := cpPath(tmpDir, "testDir")
 	dstPath := filepath.Join(dstDir, "file1-1")
 	dstPath := filepath.Join(dstDir, "file1-1")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
 	// unable to remove dstDir
 	// unable to remove dstDir
-	c.Assert(os.RemoveAll(dstDir), checker.IsNil)
+	assert.Assert(c, os.RemoveAll(dstDir) == nil)
 
 
 	dstDir = cpPathTrailingSep(tmpDir, "testDir")
 	dstDir = cpPathTrailingSep(tmpDir, "testDir")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 }
 }
 
 
 // F. SRC specifies a directory and DST exists as a file. This should cause an
 // F. SRC specifies a directory and DST exists as a file. This should cause an
 //    error as it is not possible to overwrite a file with a directory.
 //    error as it is not possible to overwrite a file with a directory.
-func (s *DockerSuite) TestCpFromCaseF(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseF(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -266,13 +265,13 @@ func (s *DockerSuite) TestCpFromCaseF(c *check.C) {
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpCannotCopyDir(err), checker.True, check.Commentf("expected ErrCannotCopyDir error, but got %T: %s", err, err))
+	assert.Assert(c, isCpCannotCopyDir(err), "expected ErrCannotCopyDir error, but got %T: %s", err, err)
 }
 }
 
 
 // G. SRC specifies a directory and DST exists as a directory. This should copy
 // G. SRC specifies a directory and DST exists as a directory. This should copy
 //    the SRC directory and all its contents to the DST directory. Ensure this
 //    the SRC directory and all its contents to the DST directory. Ensure this
 //    works whether DST has a trailing path separator or not.
 //    works whether DST has a trailing path separator or not.
-func (s *DockerSuite) TestCpFromCaseG(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseG(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -288,30 +287,30 @@ func (s *DockerSuite) TestCpFromCaseG(c *check.C) {
 	resultDir := filepath.Join(dstDir, "dir1")
 	resultDir := filepath.Join(dstDir, "dir1")
 	dstPath := filepath.Join(resultDir, "file1-1")
 	dstPath := filepath.Join(resultDir, "file1-1")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
 	// unable to remove dstDir
 	// unable to remove dstDir
-	c.Assert(os.RemoveAll(dstDir), checker.IsNil)
+	assert.Assert(c, os.RemoveAll(dstDir) == nil)
 
 
 	// unable to make dstDir
 	// unable to make dstDir
-	c.Assert(os.MkdirAll(dstDir, os.FileMode(0755)), checker.IsNil)
+	assert.Assert(c, os.MkdirAll(dstDir, os.FileMode(0755)) == nil)
 
 
 	dstDir = cpPathTrailingSep(tmpDir, "dir2")
 	dstDir = cpPathTrailingSep(tmpDir, "dir2")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 }
 }
 
 
 // H. SRC specifies a directory's contents only and DST does not exist. This
 // H. SRC specifies a directory's contents only and DST does not exist. This
 //    should create a directory at DST and copy the contents of the SRC
 //    should create a directory at DST and copy the contents of the SRC
 //    directory (but not the directory itself) into the DST directory. Ensure
 //    directory (but not the directory itself) into the DST directory. Ensure
 //    this works whether DST has a trailing path separator or not.
 //    this works whether DST has a trailing path separator or not.
-func (s *DockerSuite) TestCpFromCaseH(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseH(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 	containerID := makeTestContainer(c, testContainerOptions{addContent: true})
 
 
@@ -322,26 +321,26 @@ func (s *DockerSuite) TestCpFromCaseH(c *check.C) {
 	dstDir := cpPath(tmpDir, "testDir")
 	dstDir := cpPath(tmpDir, "testDir")
 	dstPath := filepath.Join(dstDir, "file1-1")
 	dstPath := filepath.Join(dstDir, "file1-1")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
 	// unable to remove resultDir
 	// unable to remove resultDir
-	c.Assert(os.RemoveAll(dstDir), checker.IsNil)
+	assert.Assert(c, os.RemoveAll(dstDir) == nil)
 
 
 	dstDir = cpPathTrailingSep(tmpDir, "testDir")
 	dstDir = cpPathTrailingSep(tmpDir, "testDir")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 }
 }
 
 
 // I. SRC specifies a directory's contents only and DST exists as a file. This
 // I. SRC specifies a directory's contents only and DST exists as a file. This
 //    should cause an error as it is not possible to overwrite a file with a
 //    should cause an error as it is not possible to overwrite a file with a
 //    directory.
 //    directory.
-func (s *DockerSuite) TestCpFromCaseI(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseI(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -358,14 +357,14 @@ func (s *DockerSuite) TestCpFromCaseI(c *check.C) {
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpCannotCopyDir(err), checker.True, check.Commentf("expected ErrCannotCopyDir error, but got %T: %s", err, err))
+	assert.Assert(c, isCpCannotCopyDir(err), "expected ErrCannotCopyDir error, but got %T: %s", err, err)
 }
 }
 
 
 // J. SRC specifies a directory's contents only and DST exists as a directory.
 // J. SRC specifies a directory's contents only and DST exists as a directory.
 //    This should copy the contents of the SRC directory (but not the directory
 //    This should copy the contents of the SRC directory (but not the directory
 //    itself) into the DST directory. Ensure this works whether DST has a
 //    itself) into the DST directory. Ensure this works whether DST has a
 //    trailing path separator or not.
 //    trailing path separator or not.
-func (s *DockerSuite) TestCpFromCaseJ(c *check.C) {
+func (s *DockerSuite) TestCpFromCaseJ(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -380,21 +379,21 @@ func (s *DockerSuite) TestCpFromCaseJ(c *check.C) {
 	dstDir := cpPath(tmpDir, "dir2")
 	dstDir := cpPath(tmpDir, "dir2")
 	dstPath := filepath.Join(dstDir, "file1-1")
 	dstPath := filepath.Join(dstDir, "file1-1")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
 	// unable to remove dstDir
 	// unable to remove dstDir
-	c.Assert(os.RemoveAll(dstDir), checker.IsNil)
+	assert.Assert(c, os.RemoveAll(dstDir) == nil)
 
 
 	// unable to make dstDir
 	// unable to make dstDir
-	c.Assert(os.MkdirAll(dstDir, os.FileMode(0755)), checker.IsNil)
+	assert.Assert(c, os.MkdirAll(dstDir, os.FileMode(0755)) == nil)
 
 
 	dstDir = cpPathTrailingSep(tmpDir, "dir2")
 	dstDir = cpPathTrailingSep(tmpDir, "dir2")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
-	c.Assert(fileContentEquals(c, dstPath, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, dstPath, "file1-1\n") == nil)
 }
 }

+ 18 - 18
integration-cli/docker_cli_cp_test.go

@@ -9,8 +9,8 @@ import (
 	"path"
 	"path"
 	"path/filepath"
 	"path/filepath"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
@@ -27,14 +27,14 @@ const (
 )
 )
 
 
 // Ensure that an all-local path case returns an error.
 // Ensure that an all-local path case returns an error.
-func (s *DockerSuite) TestCpLocalOnly(c *check.C) {
+func (s *DockerSuite) TestCpLocalOnly(c *testing.T) {
 	err := runDockerCp(c, "foo", "bar", nil)
 	err := runDockerCp(c, "foo", "bar", nil)
 	assert.ErrorContains(c, err, "must specify at least one container source")
 	assert.ErrorContains(c, err, "must specify at least one container source")
 }
 }
 
 
 // Test for #5656
 // Test for #5656
 // Check that garbage paths don't escape the container's rootfs
 // Check that garbage paths don't escape the container's rootfs
-func (s *DockerSuite) TestCpGarbagePath(c *check.C) {
+func (s *DockerSuite) TestCpGarbagePath(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath)
 
 
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
@@ -70,7 +70,7 @@ func (s *DockerSuite) TestCpGarbagePath(c *check.C) {
 }
 }
 
 
 // Check that relative paths are relative to the container's rootfs
 // Check that relative paths are relative to the container's rootfs
-func (s *DockerSuite) TestCpRelativePath(c *check.C) {
+func (s *DockerSuite) TestCpRelativePath(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath)
 
 
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
@@ -112,7 +112,7 @@ func (s *DockerSuite) TestCpRelativePath(c *check.C) {
 }
 }
 
 
 // Check that absolute paths are relative to the container's rootfs
 // Check that absolute paths are relative to the container's rootfs
-func (s *DockerSuite) TestCpAbsolutePath(c *check.C) {
+func (s *DockerSuite) TestCpAbsolutePath(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath)
 
 
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
@@ -149,7 +149,7 @@ func (s *DockerSuite) TestCpAbsolutePath(c *check.C) {
 
 
 // Test for #5619
 // Test for #5619
 // Check that absolute symlinks are still relative to the container's rootfs
 // Check that absolute symlinks are still relative to the container's rootfs
-func (s *DockerSuite) TestCpAbsoluteSymlink(c *check.C) {
+func (s *DockerSuite) TestCpAbsoluteSymlink(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpFullPath+" container_path")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpFullPath+" container_path")
 
 
@@ -185,7 +185,7 @@ func (s *DockerSuite) TestCpAbsoluteSymlink(c *check.C) {
 
 
 // Check that symlinks to a directory behave as expected when copying one from
 // Check that symlinks to a directory behave as expected when copying one from
 // a container.
 // a container.
-func (s *DockerSuite) TestCpFromSymlinkToDirectory(c *check.C) {
+func (s *DockerSuite) TestCpFromSymlinkToDirectory(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpTestPathParent+" /dir_link")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpTestPathParent+" /dir_link")
 
 
@@ -231,7 +231,7 @@ func (s *DockerSuite) TestCpFromSymlinkToDirectory(c *check.C) {
 
 
 // Check that symlinks to a directory behave as expected when copying one to a
 // Check that symlinks to a directory behave as expected when copying one to a
 // container.
 // container.
-func (s *DockerSuite) TestCpToSymlinkToDirectory(c *check.C) {
+func (s *DockerSuite) TestCpToSymlinkToDirectory(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon) // Requires local volume mount bind.
 	testRequires(c, testEnv.IsLocalDaemon) // Requires local volume mount bind.
 
 
@@ -308,7 +308,7 @@ func (s *DockerSuite) TestCpToSymlinkToDirectory(c *check.C) {
 
 
 // Test for #5619
 // Test for #5619
 // Check that symlinks which are part of the resource path are still relative to the container's rootfs
 // Check that symlinks which are part of the resource path are still relative to the container's rootfs
-func (s *DockerSuite) TestCpSymlinkComponent(c *check.C) {
+func (s *DockerSuite) TestCpSymlinkComponent(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpTestPath+" container_path")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpTestPath+" container_path")
 
 
@@ -347,7 +347,7 @@ func (s *DockerSuite) TestCpSymlinkComponent(c *check.C) {
 }
 }
 
 
 // Check that cp with unprivileged user doesn't return any error
 // Check that cp with unprivileged user doesn't return any error
-func (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {
+func (s *DockerSuite) TestCpUnprivilegedUser(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, UnixCli) // uses chmod/su: not available on windows
 	testRequires(c, UnixCli) // uses chmod/su: not available on windows
 
 
@@ -371,7 +371,7 @@ func (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {
 	result.Assert(c, icmd.Expected{})
 	result.Assert(c, icmd.Expected{})
 }
 }
 
 
-func (s *DockerSuite) TestCpSpecialFiles(c *check.C) {
+func (s *DockerSuite) TestCpSpecialFiles(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 
 
@@ -411,7 +411,7 @@ func (s *DockerSuite) TestCpSpecialFiles(c *check.C) {
 	assert.Assert(c, bytes.Equal(actual, expected), "Expected copied file to be duplicate of the container hostname")
 	assert.Assert(c, bytes.Equal(actual, expected), "Expected copied file to be duplicate of the container hostname")
 }
 }
 
 
-func (s *DockerSuite) TestCpVolumePath(c *check.C) {
+func (s *DockerSuite) TestCpVolumePath(c *testing.T) {
 	//  stat /tmp/cp-test-volumepath851508420/test gets permission denied for the user
 	//  stat /tmp/cp-test-volumepath851508420/test gets permission denied for the user
 	testRequires(c, NotUserNamespace)
 	testRequires(c, NotUserNamespace)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -474,7 +474,7 @@ func (s *DockerSuite) TestCpVolumePath(c *check.C) {
 	assert.Assert(c, bytes.Equal(fb, fb2), "Expected copied file to be duplicate of bind-mounted file")
 	assert.Assert(c, bytes.Equal(fb, fb2), "Expected copied file to be duplicate of bind-mounted file")
 }
 }
 
 
-func (s *DockerSuite) TestCpToDot(c *check.C) {
+func (s *DockerSuite) TestCpToDot(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /test")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /test")
 
 
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
@@ -497,7 +497,7 @@ func (s *DockerSuite) TestCpToDot(c *check.C) {
 	assert.Equal(c, string(content), "lololol\n")
 	assert.Equal(c, string(content), "lololol\n")
 }
 }
 
 
-func (s *DockerSuite) TestCpToStdout(c *check.C) {
+func (s *DockerSuite) TestCpToStdout(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /test")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /test")
 
 
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
@@ -514,7 +514,7 @@ func (s *DockerSuite) TestCpToStdout(c *check.C) {
 	assert.Check(c, is.Contains(out, "-rw"))
 	assert.Check(c, is.Contains(out, "-rw"))
 }
 }
 
 
-func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
+func (s *DockerSuite) TestCpNameHasColon(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /te:s:t")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "echo lololol > /te:s:t")
@@ -533,7 +533,7 @@ func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
 	assert.Equal(c, string(content), "lololol\n")
 	assert.Equal(c, string(content), "lololol\n")
 }
 }
 
 
-func (s *DockerSuite) TestCopyAndRestart(c *check.C) {
+func (s *DockerSuite) TestCopyAndRestart(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	expectedMsg := "hello"
 	expectedMsg := "hello"
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "echo", expectedMsg)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "echo", expectedMsg)
@@ -552,7 +552,7 @@ func (s *DockerSuite) TestCopyAndRestart(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), expectedMsg)
 	assert.Equal(c, strings.TrimSpace(out), expectedMsg)
 }
 }
 
 
-func (s *DockerSuite) TestCopyCreatedContainer(c *check.C) {
+func (s *DockerSuite) TestCopyCreatedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "create", "--name", "test_cp", "-v", "/test", "busybox")
 	dockerCmd(c, "create", "--name", "test_cp", "-v", "/test", "busybox")
 
 
@@ -565,7 +565,7 @@ func (s *DockerSuite) TestCopyCreatedContainer(c *check.C) {
 // test copy with option `-L`: following symbol link
 // test copy with option `-L`: following symbol link
 // Check that symlinks to a file behave as expected when copying one from
 // Check that symlinks to a file behave as expected when copying one from
 // a container to host following symbol link
 // a container to host following symbol link
-func (s *DockerSuite) TestCpSymlinkFromConToHostFollowSymlink(c *check.C) {
+func (s *DockerSuite) TestCpSymlinkFromConToHostFollowSymlink(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, exitCode := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpFullPath+" /dir_link")
 	out, exitCode := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir -p '"+cpTestPath+"' && echo -n '"+cpContainerContents+"' > "+cpFullPath+" && ln -s "+cpFullPath+" /dir_link")
 	assert.Equal(c, exitCode, 0, "failed to set up container: %s", out)
 	assert.Equal(c, exitCode, 0, "failed to set up container: %s", out)

+ 67 - 68
integration-cli/docker_cli_cp_to_container_test.go

@@ -2,9 +2,8 @@ package main
 
 
 import (
 import (
 	"os"
 	"os"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -20,7 +19,7 @@ import (
 
 
 // Check that copying from a local path to a symlink in a container copies to
 // Check that copying from a local path to a symlink in a container copies to
 // the symlink target and does not overwrite the container symlink itself.
 // the symlink target and does not overwrite the container symlink itself.
-func (s *DockerSuite) TestCpToSymlinkDestination(c *check.C) {
+func (s *DockerSuite) TestCpToSymlinkDestination(c *testing.T) {
 	//  stat /tmp/test-cp-to-symlink-destination-262430901/vol3 gets permission denied for the user
 	//  stat /tmp/test-cp-to-symlink-destination-262430901/vol3 gets permission denied for the user
 	testRequires(c, NotUserNamespace)
 	testRequires(c, NotUserNamespace)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -40,38 +39,38 @@ func (s *DockerSuite) TestCpToSymlinkDestination(c *check.C) {
 	srcPath := cpPath(testVol, "file2")
 	srcPath := cpPath(testVol, "file2")
 	dstPath := containerCpPath(containerID, "/vol2/symlinkToFile1")
 	dstPath := containerCpPath(containerID, "/vol2/symlinkToFile1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, cpPath(testVol, "symlinkToFile1"), "file1"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, cpPath(testVol, "symlinkToFile1"), "file1") == nil)
 
 
 	// The file should have the contents of "file2" now.
 	// The file should have the contents of "file2" now.
-	c.Assert(fileContentEquals(c, cpPath(testVol, "file1"), "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(testVol, "file1"), "file2\n") == nil)
 
 
 	// Next, copy a local file to a symlink to a directory in the container.
 	// Next, copy a local file to a symlink to a directory in the container.
 	// This should copy the file into the symlink target directory.
 	// This should copy the file into the symlink target directory.
 	dstPath = containerCpPath(containerID, "/vol2/symlinkToDir1")
 	dstPath = containerCpPath(containerID, "/vol2/symlinkToDir1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, cpPath(testVol, "symlinkToDir1"), "dir1"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, cpPath(testVol, "symlinkToDir1"), "dir1") == nil)
 
 
 	// The file should have the contents of "file2" now.
 	// The file should have the contents of "file2" now.
-	c.Assert(fileContentEquals(c, cpPath(testVol, "file2"), "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(testVol, "file2"), "file2\n") == nil)
 
 
 	// Next, copy a file to a symlink to a file that does not exist (a broken
 	// Next, copy a file to a symlink to a file that does not exist (a broken
 	// symlink) in the container. This should create the target file with the
 	// symlink) in the container. This should create the target file with the
 	// contents of the source file.
 	// contents of the source file.
 	dstPath = containerCpPath(containerID, "/vol2/brokenSymlinkToFileX")
 	dstPath = containerCpPath(containerID, "/vol2/brokenSymlinkToFileX")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, cpPath(testVol, "brokenSymlinkToFileX"), "fileX"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, cpPath(testVol, "brokenSymlinkToFileX"), "fileX") == nil)
 
 
 	// The file should have the contents of "file2" now.
 	// The file should have the contents of "file2" now.
-	c.Assert(fileContentEquals(c, cpPath(testVol, "fileX"), "file2\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(testVol, "fileX"), "file2\n") == nil)
 
 
 	// Next, copy a local directory to a symlink to a directory in the
 	// Next, copy a local directory to a symlink to a directory in the
 	// container. This should copy the directory into the symlink target
 	// container. This should copy the directory into the symlink target
@@ -79,13 +78,13 @@ func (s *DockerSuite) TestCpToSymlinkDestination(c *check.C) {
 	srcPath = cpPath(testVol, "/dir2")
 	srcPath = cpPath(testVol, "/dir2")
 	dstPath = containerCpPath(containerID, "/vol2/symlinkToDir1")
 	dstPath = containerCpPath(containerID, "/vol2/symlinkToDir1")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, cpPath(testVol, "symlinkToDir1"), "dir1"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, cpPath(testVol, "symlinkToDir1"), "dir1") == nil)
 
 
 	// The directory should now contain a copy of "dir2".
 	// The directory should now contain a copy of "dir2".
-	c.Assert(fileContentEquals(c, cpPath(testVol, "dir1/dir2/file2-1"), "file2-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(testVol, "dir1/dir2/file2-1"), "file2-1\n") == nil)
 
 
 	// Next, copy a local directory to a symlink to a local directory that does
 	// Next, copy a local directory to a symlink to a local directory that does
 	// not exist (a broken symlink) in the container. This should create the
 	// not exist (a broken symlink) in the container. This should create the
@@ -93,13 +92,13 @@ func (s *DockerSuite) TestCpToSymlinkDestination(c *check.C) {
 	// should not modify the symlink.
 	// should not modify the symlink.
 	dstPath = containerCpPath(containerID, "/vol2/brokenSymlinkToDirX")
 	dstPath = containerCpPath(containerID, "/vol2/brokenSymlinkToDirX")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// The symlink should not have been modified.
 	// The symlink should not have been modified.
-	c.Assert(symlinkTargetEquals(c, cpPath(testVol, "brokenSymlinkToDirX"), "dirX"), checker.IsNil)
+	assert.Assert(c, symlinkTargetEquals(c, cpPath(testVol, "brokenSymlinkToDirX"), "dirX") == nil)
 
 
 	// The "dirX" directory should now be a copy of "dir2".
 	// The "dirX" directory should now be a copy of "dir2".
-	c.Assert(fileContentEquals(c, cpPath(testVol, "dirX/file2-1"), "file2-1\n"), checker.IsNil)
+	assert.Assert(c, fileContentEquals(c, cpPath(testVol, "dirX/file2-1"), "file2-1\n") == nil)
 }
 }
 
 
 // Possibilities are reduced to the remaining 10 cases:
 // Possibilities are reduced to the remaining 10 cases:
@@ -121,7 +120,7 @@ func (s *DockerSuite) TestCpToSymlinkDestination(c *check.C) {
 // A. SRC specifies a file and DST (no trailing path separator) doesn't
 // A. SRC specifies a file and DST (no trailing path separator) doesn't
 //    exist. This should create a file with the name DST and copy the
 //    exist. This should create a file with the name DST and copy the
 //    contents of the source file into it.
 //    contents of the source file into it.
-func (s *DockerSuite) TestCpToCaseA(c *check.C) {
+func (s *DockerSuite) TestCpToCaseA(c *testing.T) {
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		workDir: "/root", command: makeCatFileCommand("itWorks.txt"),
 		workDir: "/root", command: makeCatFileCommand("itWorks.txt"),
 	})
 	})
@@ -134,15 +133,15 @@ func (s *DockerSuite) TestCpToCaseA(c *check.C) {
 	srcPath := cpPath(tmpDir, "file1")
 	srcPath := cpPath(tmpDir, "file1")
 	dstPath := containerCpPath(containerID, "/root/itWorks.txt")
 	dstPath := containerCpPath(containerID, "/root/itWorks.txt")
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
-	c.Assert(containerStartOutputEquals(c, containerID, "file1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1\n") == nil)
 }
 }
 
 
 // B. SRC specifies a file and DST (with trailing path separator) doesn't
 // B. SRC specifies a file and DST (with trailing path separator) doesn't
 //    exist. This should cause an error because the copy operation cannot
 //    exist. This should cause an error because the copy operation cannot
 //    create a directory when copying a single file.
 //    create a directory when copying a single file.
-func (s *DockerSuite) TestCpToCaseB(c *check.C) {
+func (s *DockerSuite) TestCpToCaseB(c *testing.T) {
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		command: makeCatFileCommand("testDir/file1"),
 		command: makeCatFileCommand("testDir/file1"),
 	})
 	})
@@ -158,12 +157,12 @@ func (s *DockerSuite) TestCpToCaseB(c *check.C) {
 	err := runDockerCp(c, srcPath, dstDir, nil)
 	err := runDockerCp(c, srcPath, dstDir, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpDirNotExist(err), checker.True, check.Commentf("expected DirNotExists error, but got %T: %s", err, err))
+	assert.Assert(c, isCpDirNotExist(err), "expected DirNotExists error, but got %T: %s", err, err)
 }
 }
 
 
 // C. SRC specifies a file and DST exists as a file. This should overwrite
 // C. SRC specifies a file and DST exists as a file. This should overwrite
 //    the file at DST with the contents of the source file.
 //    the file at DST with the contents of the source file.
-func (s *DockerSuite) TestCpToCaseC(c *check.C) {
+func (s *DockerSuite) TestCpToCaseC(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -179,18 +178,18 @@ func (s *DockerSuite) TestCpToCaseC(c *check.C) {
 	dstPath := containerCpPath(containerID, "/root/file2")
 	dstPath := containerCpPath(containerID, "/root/file2")
 
 
 	// Ensure the container's file starts with the original content.
 	// Ensure the container's file starts with the original content.
-	c.Assert(containerStartOutputEquals(c, containerID, "file2\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file2\n") == nil)
 
 
-	c.Assert(runDockerCp(c, srcPath, dstPath, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstPath, nil) == nil)
 
 
 	// Should now contain file1's contents.
 	// Should now contain file1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1\n") == nil)
 }
 }
 
 
 // D. SRC specifies a file and DST exists as a directory. This should place
 // D. SRC specifies a file and DST exists as a directory. This should place
 //    a copy of the source file inside it using the basename from SRC. Ensure
 //    a copy of the source file inside it using the basename from SRC. Ensure
 //    this works whether DST has a trailing path separator or not.
 //    this works whether DST has a trailing path separator or not.
-func (s *DockerSuite) TestCpToCaseD(c *check.C) {
+func (s *DockerSuite) TestCpToCaseD(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true,
 		addContent: true,
@@ -206,12 +205,12 @@ func (s *DockerSuite) TestCpToCaseD(c *check.C) {
 	dstDir := containerCpPath(containerID, "dir1")
 	dstDir := containerCpPath(containerID, "dir1")
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 
 
-	c.Assert(runDockerCp(c, srcPath, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstDir, nil) == nil)
 
 
 	// Should now contain file1's contents.
 	// Should now contain file1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
@@ -224,19 +223,19 @@ func (s *DockerSuite) TestCpToCaseD(c *check.C) {
 	dstDir = containerCpPathTrailingSep(containerID, "dir1")
 	dstDir = containerCpPathTrailingSep(containerID, "dir1")
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 
 
-	c.Assert(runDockerCp(c, srcPath, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcPath, dstDir, nil) == nil)
 
 
 	// Should now contain file1's contents.
 	// Should now contain file1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1\n") == nil)
 }
 }
 
 
 // E. SRC specifies a directory and DST does not exist. This should create a
 // E. SRC specifies a directory and DST does not exist. This should create a
 //    directory at DST and copy the contents of the SRC directory into the DST
 //    directory at DST and copy the contents of the SRC directory into the DST
 //    directory. Ensure this works whether DST has a trailing path separator or
 //    directory. Ensure this works whether DST has a trailing path separator or
 //    not.
 //    not.
-func (s *DockerSuite) TestCpToCaseE(c *check.C) {
+func (s *DockerSuite) TestCpToCaseE(c *testing.T) {
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		command: makeCatFileCommand("/testDir/file1-1"),
 		command: makeCatFileCommand("/testDir/file1-1"),
 	})
 	})
@@ -249,10 +248,10 @@ func (s *DockerSuite) TestCpToCaseE(c *check.C) {
 	srcDir := cpPath(tmpDir, "dir1")
 	srcDir := cpPath(tmpDir, "dir1")
 	dstDir := containerCpPath(containerID, "testDir")
 	dstDir := containerCpPath(containerID, "testDir")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
@@ -263,15 +262,15 @@ func (s *DockerSuite) TestCpToCaseE(c *check.C) {
 
 
 	dstDir = containerCpPathTrailingSep(containerID, "testDir")
 	dstDir = containerCpPathTrailingSep(containerID, "testDir")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 }
 }
 
 
 // F. SRC specifies a directory and DST exists as a file. This should cause an
 // F. SRC specifies a directory and DST exists as a file. This should cause an
 //    error as it is not possible to overwrite a file with a directory.
 //    error as it is not possible to overwrite a file with a directory.
-func (s *DockerSuite) TestCpToCaseF(c *check.C) {
+func (s *DockerSuite) TestCpToCaseF(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -288,13 +287,13 @@ func (s *DockerSuite) TestCpToCaseF(c *check.C) {
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpCannotCopyDir(err), checker.True, check.Commentf("expected ErrCannotCopyDir error, but got %T: %s", err, err))
+	assert.Assert(c, isCpCannotCopyDir(err), "expected ErrCannotCopyDir error, but got %T: %s", err, err)
 }
 }
 
 
 // G. SRC specifies a directory and DST exists as a directory. This should copy
 // G. SRC specifies a directory and DST exists as a directory. This should copy
 //    the SRC directory and all its contents to the DST directory. Ensure this
 //    the SRC directory and all its contents to the DST directory. Ensure this
 //    works whether DST has a trailing path separator or not.
 //    works whether DST has a trailing path separator or not.
-func (s *DockerSuite) TestCpToCaseG(c *check.C) {
+func (s *DockerSuite) TestCpToCaseG(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -310,12 +309,12 @@ func (s *DockerSuite) TestCpToCaseG(c *check.C) {
 	dstDir := containerCpPath(containerID, "/root/dir2")
 	dstDir := containerCpPath(containerID, "/root/dir2")
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
@@ -328,19 +327,19 @@ func (s *DockerSuite) TestCpToCaseG(c *check.C) {
 	dstDir = containerCpPathTrailingSep(containerID, "/dir2")
 	dstDir = containerCpPathTrailingSep(containerID, "/dir2")
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 }
 }
 
 
 // H. SRC specifies a directory's contents only and DST does not exist. This
 // H. SRC specifies a directory's contents only and DST does not exist. This
 //    should create a directory at DST and copy the contents of the SRC
 //    should create a directory at DST and copy the contents of the SRC
 //    directory (but not the directory itself) into the DST directory. Ensure
 //    directory (but not the directory itself) into the DST directory. Ensure
 //    this works whether DST has a trailing path separator or not.
 //    this works whether DST has a trailing path separator or not.
-func (s *DockerSuite) TestCpToCaseH(c *check.C) {
+func (s *DockerSuite) TestCpToCaseH(c *testing.T) {
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		command: makeCatFileCommand("/testDir/file1-1"),
 		command: makeCatFileCommand("/testDir/file1-1"),
 	})
 	})
@@ -353,10 +352,10 @@ func (s *DockerSuite) TestCpToCaseH(c *check.C) {
 	srcDir := cpPathTrailingSep(tmpDir, "dir1") + "."
 	srcDir := cpPathTrailingSep(tmpDir, "dir1") + "."
 	dstDir := containerCpPath(containerID, "testDir")
 	dstDir := containerCpPath(containerID, "testDir")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
@@ -367,16 +366,16 @@ func (s *DockerSuite) TestCpToCaseH(c *check.C) {
 
 
 	dstDir = containerCpPathTrailingSep(containerID, "testDir")
 	dstDir = containerCpPathTrailingSep(containerID, "testDir")
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 }
 }
 
 
 // I. SRC specifies a directory's contents only and DST exists as a file. This
 // I. SRC specifies a directory's contents only and DST exists as a file. This
 //    should cause an error as it is not possible to overwrite a file with a
 //    should cause an error as it is not possible to overwrite a file with a
 //    directory.
 //    directory.
-func (s *DockerSuite) TestCpToCaseI(c *check.C) {
+func (s *DockerSuite) TestCpToCaseI(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -393,14 +392,14 @@ func (s *DockerSuite) TestCpToCaseI(c *check.C) {
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	err := runDockerCp(c, srcDir, dstFile, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpCannotCopyDir(err), checker.True, check.Commentf("expected ErrCannotCopyDir error, but got %T: %s", err, err))
+	assert.Assert(c, isCpCannotCopyDir(err), "expected ErrCannotCopyDir error, but got %T: %s", err, err)
 }
 }
 
 
 // J. SRC specifies a directory's contents only and DST exists as a directory.
 // J. SRC specifies a directory's contents only and DST exists as a directory.
 //    This should copy the contents of the SRC directory (but not the directory
 //    This should copy the contents of the SRC directory (but not the directory
 //    itself) into the DST directory. Ensure this works whether DST has a
 //    itself) into the DST directory. Ensure this works whether DST has a
 //    trailing path separator or not.
 //    trailing path separator or not.
-func (s *DockerSuite) TestCpToCaseJ(c *check.C) {
+func (s *DockerSuite) TestCpToCaseJ(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	containerID := makeTestContainer(c, testContainerOptions{
 	containerID := makeTestContainer(c, testContainerOptions{
 		addContent: true, workDir: "/root",
 		addContent: true, workDir: "/root",
@@ -416,12 +415,12 @@ func (s *DockerSuite) TestCpToCaseJ(c *check.C) {
 	dstDir := containerCpPath(containerID, "/dir2")
 	dstDir := containerCpPath(containerID, "/dir2")
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 
 
 	// Now try again but using a trailing path separator for dstDir.
 	// Now try again but using a trailing path separator for dstDir.
 
 
@@ -433,17 +432,17 @@ func (s *DockerSuite) TestCpToCaseJ(c *check.C) {
 	dstDir = containerCpPathTrailingSep(containerID, "/dir2")
 	dstDir = containerCpPathTrailingSep(containerID, "/dir2")
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 
 
-	c.Assert(runDockerCp(c, srcDir, dstDir, nil), checker.IsNil)
+	assert.Assert(c, runDockerCp(c, srcDir, dstDir, nil) == nil)
 
 
 	// Should now contain file1-1's contents.
 	// Should now contain file1-1's contents.
-	c.Assert(containerStartOutputEquals(c, containerID, "file1-1\n"), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "file1-1\n") == nil)
 }
 }
 
 
 // The `docker cp` command should also ensure that you cannot
 // The `docker cp` command should also ensure that you cannot
 // write to a container rootfs that is marked as read-only.
 // write to a container rootfs that is marked as read-only.
-func (s *DockerSuite) TestCpToErrReadOnlyRootfs(c *check.C) {
+func (s *DockerSuite) TestCpToErrReadOnlyRootfs(c *testing.T) {
 	// --read-only + userns has remount issues
 	// --read-only + userns has remount issues
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	tmpDir := getTestDir(c, "test-cp-to-err-read-only-rootfs")
 	tmpDir := getTestDir(c, "test-cp-to-err-read-only-rootfs")
@@ -462,15 +461,15 @@ func (s *DockerSuite) TestCpToErrReadOnlyRootfs(c *check.C) {
 	err := runDockerCp(c, srcPath, dstPath, nil)
 	err := runDockerCp(c, srcPath, dstPath, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpCannotCopyReadOnly(err), checker.True, check.Commentf("expected ErrContainerRootfsReadonly error, but got %T: %s", err, err))
+	assert.Assert(c, isCpCannotCopyReadOnly(err), "expected ErrContainerRootfsReadonly error, but got %T: %s", err, err)
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 }
 }
 
 
 // The `docker cp` command should also ensure that you
 // The `docker cp` command should also ensure that you
 // cannot write to a volume that is mounted as read-only.
 // cannot write to a volume that is mounted as read-only.
-func (s *DockerSuite) TestCpToErrReadOnlyVolume(c *check.C) {
+func (s *DockerSuite) TestCpToErrReadOnlyVolume(c *testing.T) {
 	// --read-only + userns has remount issues
 	// --read-only + userns has remount issues
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	tmpDir := getTestDir(c, "test-cp-to-err-read-only-volume")
 	tmpDir := getTestDir(c, "test-cp-to-err-read-only-volume")
@@ -489,8 +488,8 @@ func (s *DockerSuite) TestCpToErrReadOnlyVolume(c *check.C) {
 	err := runDockerCp(c, srcPath, dstPath, nil)
 	err := runDockerCp(c, srcPath, dstPath, nil)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 
 
-	c.Assert(isCpCannotCopyReadOnly(err), checker.True, check.Commentf("expected ErrVolumeReadonly error, but got %T: %s", err, err))
+	assert.Assert(c, isCpCannotCopyReadOnly(err), "expected ErrVolumeReadonly error, but got %T: %s", err, err)
 
 
 	// Ensure that dstPath doesn't exist.
 	// Ensure that dstPath doesn't exist.
-	c.Assert(containerStartOutputEquals(c, containerID, ""), checker.IsNil)
+	assert.Assert(c, containerStartOutputEquals(c, containerID, "") == nil)
 }
 }

+ 3 - 3
integration-cli/docker_cli_cp_to_container_unix_test.go

@@ -8,13 +8,13 @@ import (
 	"path/filepath"
 	"path/filepath"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/pkg/system"
 	"github.com/docker/docker/pkg/system"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestCpToContainerWithPermissions(c *check.C) {
+func (s *DockerSuite) TestCpToContainerWithPermissions(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	tmpDir := getTestDir(c, "test-cp-to-host-with-permissions")
 	tmpDir := getTestDir(c, "test-cp-to-host-with-permissions")
@@ -38,7 +38,7 @@ func (s *DockerSuite) TestCpToContainerWithPermissions(c *check.C) {
 }
 }
 
 
 // Check ownership is root, both in non-userns and userns enabled modes
 // Check ownership is root, both in non-userns and userns enabled modes
-func (s *DockerSuite) TestCpCheckDestOwnership(c *check.C) {
+func (s *DockerSuite) TestCpCheckDestOwnership(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	tmpVolDir := getTestDir(c, "test-cp-tmpvol")
 	tmpVolDir := getTestDir(c, "test-cp-tmpvol")
 	containerID := makeTestContainer(c,
 	containerID := makeTestContainer(c,

+ 9 - 9
integration-cli/docker_cli_cp_utils_test.go

@@ -9,9 +9,9 @@ import (
 	"path/filepath"
 	"path/filepath"
 	"runtime"
 	"runtime"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/pkg/archive"
 	"github.com/docker/docker/pkg/archive"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -92,7 +92,7 @@ func defaultMkContentCommand() string {
 	return mkFilesCommand(defaultFileData)
 	return mkFilesCommand(defaultFileData)
 }
 }
 
 
-func makeTestContentInDir(c *check.C, dir string) {
+func makeTestContentInDir(c *testing.T, dir string) {
 	for _, fd := range defaultFileData {
 	for _, fd := range defaultFileData {
 		path := filepath.Join(dir, filepath.FromSlash(fd.path))
 		path := filepath.Join(dir, filepath.FromSlash(fd.path))
 		switch fd.filetype {
 		switch fd.filetype {
@@ -118,7 +118,7 @@ type testContainerOptions struct {
 	command    string
 	command    string
 }
 }
 
 
-func makeTestContainer(c *check.C, options testContainerOptions) (containerID string) {
+func makeTestContainer(c *testing.T, options testContainerOptions) (containerID string) {
 	if options.addContent {
 	if options.addContent {
 		mkContentCmd := defaultMkContentCommand()
 		mkContentCmd := defaultMkContentCommand()
 		if options.command == "" {
 		if options.command == "" {
@@ -188,7 +188,7 @@ func containerCpPathTrailingSep(containerID string, pathElements ...string) stri
 	return fmt.Sprintf("%s/", containerCpPath(containerID, pathElements...))
 	return fmt.Sprintf("%s/", containerCpPath(containerID, pathElements...))
 }
 }
 
 
-func runDockerCp(c *check.C, src, dst string, params []string) (err error) {
+func runDockerCp(c *testing.T, src, dst string, params []string) (err error) {
 	c.Logf("running `docker cp %s %s %s`", strings.Join(params, " "), src, dst)
 	c.Logf("running `docker cp %s %s %s`", strings.Join(params, " "), src, dst)
 
 
 	args := []string{"cp"}
 	args := []string{"cp"}
@@ -205,7 +205,7 @@ func runDockerCp(c *check.C, src, dst string, params []string) (err error) {
 	return
 	return
 }
 }
 
 
-func startContainerGetOutput(c *check.C, containerID string) (out string, err error) {
+func startContainerGetOutput(c *testing.T, containerID string) (out string, err error) {
 	c.Logf("running `docker start -a %s`", containerID)
 	c.Logf("running `docker start -a %s`", containerID)
 
 
 	args := []string{"start", "-a", containerID}
 	args := []string{"start", "-a", containerID}
@@ -218,7 +218,7 @@ func startContainerGetOutput(c *check.C, containerID string) (out string, err er
 	return
 	return
 }
 }
 
 
-func getTestDir(c *check.C, label string) (tmpDir string) {
+func getTestDir(c *testing.T, label string) (tmpDir string) {
 	var err error
 	var err error
 
 
 	tmpDir, err = ioutil.TempDir("", label)
 	tmpDir, err = ioutil.TempDir("", label)
@@ -240,7 +240,7 @@ func isCpCannotCopyReadOnly(err error) bool {
 	return strings.Contains(err.Error(), "marked read-only")
 	return strings.Contains(err.Error(), "marked read-only")
 }
 }
 
 
-func fileContentEquals(c *check.C, filename, contents string) (err error) {
+func fileContentEquals(c *testing.T, filename, contents string) (err error) {
 	c.Logf("checking that file %q contains %q\n", filename, contents)
 	c.Logf("checking that file %q contains %q\n", filename, contents)
 
 
 	fileBytes, err := ioutil.ReadFile(filename)
 	fileBytes, err := ioutil.ReadFile(filename)
@@ -260,7 +260,7 @@ func fileContentEquals(c *check.C, filename, contents string) (err error) {
 	return
 	return
 }
 }
 
 
-func symlinkTargetEquals(c *check.C, symlink, expectedTarget string) (err error) {
+func symlinkTargetEquals(c *testing.T, symlink, expectedTarget string) (err error) {
 	c.Logf("checking that the symlink %q points to %q\n", symlink, expectedTarget)
 	c.Logf("checking that the symlink %q points to %q\n", symlink, expectedTarget)
 
 
 	actualTarget, err := os.Readlink(symlink)
 	actualTarget, err := os.Readlink(symlink)
@@ -275,7 +275,7 @@ func symlinkTargetEquals(c *check.C, symlink, expectedTarget string) (err error)
 	return
 	return
 }
 }
 
 
-func containerStartOutputEquals(c *check.C, containerID, contents string) (err error) {
+func containerStartOutputEquals(c *testing.T, containerID, contents string) (err error) {
 	c.Logf("checking that container %q start output contains %q\n", containerID, contents)
 	c.Logf("checking that container %q start output contains %q\n", containerID, contents)
 
 
 	out, err := startContainerGetOutput(c, containerID)
 	out, err := startContainerGetOutput(c, containerID)

+ 46 - 49
integration-cli/docker_cli_create_test.go

@@ -6,21 +6,20 @@ import (
 	"os"
 	"os"
 	"reflect"
 	"reflect"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/internal/test/fakecontext"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/go-connections/nat"
 	"github.com/docker/go-connections/nat"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
 // Make sure we can create a simple container with some args
 // Make sure we can create a simple container with some args
-func (s *DockerSuite) TestCreateArgs(c *check.C) {
+func (s *DockerSuite) TestCreateArgs(c *testing.T) {
 	// Intentionally clear entrypoint, as the Windows busybox image needs an entrypoint, which breaks this test
 	// Intentionally clear entrypoint, as the Windows busybox image needs an entrypoint, which breaks this test
 	out, _ := dockerCmd(c, "create", "--entrypoint=", "busybox", "command", "arg1", "arg2", "arg with space", "-c", "flags")
 	out, _ := dockerCmd(c, "create", "--entrypoint=", "busybox", "command", "arg1", "arg2", "arg with space", "-c", "flags")
 
 
@@ -37,11 +36,11 @@ func (s *DockerSuite) TestCreateArgs(c *check.C) {
 	}
 	}
 
 
 	err := json.Unmarshal([]byte(out), &containers)
 	err := json.Unmarshal([]byte(out), &containers)
-	c.Assert(err, check.IsNil, check.Commentf("Error inspecting the container: %s", err))
+	assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
 	assert.Equal(c, len(containers), 1)
 	assert.Equal(c, len(containers), 1)
 
 
 	cont := containers[0]
 	cont := containers[0]
-	c.Assert(string(cont.Path), checker.Equals, "command", check.Commentf("Unexpected container path. Expected command, received: %s", cont.Path))
+	assert.Equal(c, string(cont.Path), "command", fmt.Sprintf("Unexpected container path. Expected command, received: %s", cont.Path))
 
 
 	b := false
 	b := false
 	expected := []string{"arg1", "arg2", "arg with space", "-c", "flags"}
 	expected := []string{"arg1", "arg2", "arg with space", "-c", "flags"}
@@ -58,7 +57,7 @@ func (s *DockerSuite) TestCreateArgs(c *check.C) {
 }
 }
 
 
 // Make sure we can grow the container's rootfs at creation time.
 // Make sure we can grow the container's rootfs at creation time.
-func (s *DockerSuite) TestCreateGrowRootfs(c *check.C) {
+func (s *DockerSuite) TestCreateGrowRootfs(c *testing.T) {
 	// Windows and Devicemapper support growing the rootfs
 	// Windows and Devicemapper support growing the rootfs
 	if testEnv.OSType != "windows" {
 	if testEnv.OSType != "windows" {
 		testRequires(c, Devicemapper)
 		testRequires(c, Devicemapper)
@@ -68,21 +67,21 @@ func (s *DockerSuite) TestCreateGrowRootfs(c *check.C) {
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
 
 
 	inspectOut := inspectField(c, cleanedContainerID, "HostConfig.StorageOpt")
 	inspectOut := inspectField(c, cleanedContainerID, "HostConfig.StorageOpt")
-	c.Assert(inspectOut, checker.Equals, "map[size:120G]")
+	assert.Equal(c, inspectOut, "map[size:120G]")
 }
 }
 
 
 // Make sure we cannot shrink the container's rootfs at creation time.
 // Make sure we cannot shrink the container's rootfs at creation time.
-func (s *DockerSuite) TestCreateShrinkRootfs(c *check.C) {
+func (s *DockerSuite) TestCreateShrinkRootfs(c *testing.T) {
 	testRequires(c, Devicemapper)
 	testRequires(c, Devicemapper)
 
 
 	// Ensure this fails because of the defaultBaseFsSize is 10G
 	// Ensure this fails because of the defaultBaseFsSize is 10G
 	out, _, err := dockerCmdWithError("create", "--storage-opt", "size=5G", "busybox")
 	out, _, err := dockerCmdWithError("create", "--storage-opt", "size=5G", "busybox")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
-	c.Assert(out, checker.Contains, "Container size cannot be smaller than")
+	assert.Assert(c, strings.Contains(out, "Container size cannot be smaller than"))
 }
 }
 
 
 // Make sure we can set hostconfig options too
 // Make sure we can set hostconfig options too
-func (s *DockerSuite) TestCreateHostConfig(c *check.C) {
+func (s *DockerSuite) TestCreateHostConfig(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "-P", "busybox", "echo")
 	out, _ := dockerCmd(c, "create", "-P", "busybox", "echo")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -96,15 +95,15 @@ func (s *DockerSuite) TestCreateHostConfig(c *check.C) {
 	}
 	}
 
 
 	err := json.Unmarshal([]byte(out), &containers)
 	err := json.Unmarshal([]byte(out), &containers)
-	c.Assert(err, check.IsNil, check.Commentf("Error inspecting the container: %s", err))
+	assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
 	assert.Equal(c, len(containers), 1)
 	assert.Equal(c, len(containers), 1)
 
 
 	cont := containers[0]
 	cont := containers[0]
-	c.Assert(cont.HostConfig, check.NotNil, check.Commentf("Expected HostConfig, got none"))
-	c.Assert(cont.HostConfig.PublishAllPorts, check.NotNil, check.Commentf("Expected PublishAllPorts, got false"))
+	assert.Assert(c, cont.HostConfig != nil, "Expected HostConfig, got none")
+	assert.Assert(c, cont.HostConfig.PublishAllPorts, "Expected PublishAllPorts, got false")
 }
 }
 
 
-func (s *DockerSuite) TestCreateWithPortRange(c *check.C) {
+func (s *DockerSuite) TestCreateWithPortRange(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "-p", "3300-3303:3300-3303/tcp", "busybox", "echo")
 	out, _ := dockerCmd(c, "create", "-p", "3300-3303:3300-3303/tcp", "busybox", "echo")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -117,23 +116,23 @@ func (s *DockerSuite) TestCreateWithPortRange(c *check.C) {
 		}
 		}
 	}
 	}
 	err := json.Unmarshal([]byte(out), &containers)
 	err := json.Unmarshal([]byte(out), &containers)
-	c.Assert(err, check.IsNil, check.Commentf("Error inspecting the container: %s", err))
+	assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
 	assert.Equal(c, len(containers), 1)
 	assert.Equal(c, len(containers), 1)
 
 
 	cont := containers[0]
 	cont := containers[0]
 
 
-	c.Assert(cont.HostConfig, check.NotNil, check.Commentf("Expected HostConfig, got none"))
-	c.Assert(cont.HostConfig.PortBindings, checker.HasLen, 4, check.Commentf("Expected 4 ports bindings, got %d", len(cont.HostConfig.PortBindings)))
+	assert.Assert(c, cont.HostConfig != nil, "Expected HostConfig, got none")
+	assert.Equal(c, len(cont.HostConfig.PortBindings), 4, fmt.Sprintf("Expected 4 ports bindings, got %d", len(cont.HostConfig.PortBindings)))
 
 
 	for k, v := range cont.HostConfig.PortBindings {
 	for k, v := range cont.HostConfig.PortBindings {
-		c.Assert(v, checker.HasLen, 1, check.Commentf("Expected 1 ports binding, for the port  %s but found %s", k, v))
-		c.Assert(k.Port(), checker.Equals, v[0].HostPort, check.Commentf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
+		assert.Equal(c, len(v), 1, fmt.Sprintf("Expected 1 ports binding, for the port  %s but found %s", k, v))
+		assert.Equal(c, k.Port(), v[0].HostPort, fmt.Sprintf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
 
 
 	}
 	}
 
 
 }
 }
 
 
-func (s *DockerSuite) TestCreateWithLargePortRange(c *check.C) {
+func (s *DockerSuite) TestCreateWithLargePortRange(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "-p", "1-65535:1-65535/tcp", "busybox", "echo")
 	out, _ := dockerCmd(c, "create", "-p", "1-65535:1-65535/tcp", "busybox", "echo")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -147,22 +146,22 @@ func (s *DockerSuite) TestCreateWithLargePortRange(c *check.C) {
 	}
 	}
 
 
 	err := json.Unmarshal([]byte(out), &containers)
 	err := json.Unmarshal([]byte(out), &containers)
-	c.Assert(err, check.IsNil, check.Commentf("Error inspecting the container: %s", err))
+	assert.Assert(c, err == nil, "Error inspecting the container: %s", err)
 	assert.Equal(c, len(containers), 1)
 	assert.Equal(c, len(containers), 1)
 
 
 	cont := containers[0]
 	cont := containers[0]
-	c.Assert(cont.HostConfig, check.NotNil, check.Commentf("Expected HostConfig, got none"))
-	c.Assert(cont.HostConfig.PortBindings, checker.HasLen, 65535)
+	assert.Assert(c, cont.HostConfig != nil, "Expected HostConfig, got none")
+	assert.Equal(c, len(cont.HostConfig.PortBindings), 65535)
 
 
 	for k, v := range cont.HostConfig.PortBindings {
 	for k, v := range cont.HostConfig.PortBindings {
-		c.Assert(v, checker.HasLen, 1)
-		c.Assert(k.Port(), checker.Equals, v[0].HostPort, check.Commentf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
+		assert.Equal(c, len(v), 1)
+		assert.Equal(c, k.Port(), v[0].HostPort, fmt.Sprintf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort))
 	}
 	}
 
 
 }
 }
 
 
 // "test123" should be printed by docker create + start
 // "test123" should be printed by docker create + start
-func (s *DockerSuite) TestCreateEchoStdout(c *check.C) {
+func (s *DockerSuite) TestCreateEchoStdout(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "busybox", "echo", "test123")
 	out, _ := dockerCmd(c, "create", "busybox", "echo", "test123")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -171,7 +170,7 @@ func (s *DockerSuite) TestCreateEchoStdout(c *check.C) {
 	assert.Equal(c, out, "test123\n", "container should've printed 'test123', got %q", out)
 	assert.Equal(c, out, "test123\n", "container should've printed 'test123', got %q", out)
 }
 }
 
 
-func (s *DockerSuite) TestCreateVolumesCreated(c *check.C) {
+func (s *DockerSuite) TestCreateVolumesCreated(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 
 
@@ -179,7 +178,7 @@ func (s *DockerSuite) TestCreateVolumesCreated(c *check.C) {
 	dockerCmd(c, "create", "--name", name, "-v", prefix+slash+"foo", "busybox")
 	dockerCmd(c, "create", "--name", name, "-v", prefix+slash+"foo", "busybox")
 
 
 	dir, err := inspectMountSourceField(name, prefix+slash+"foo")
 	dir, err := inspectMountSourceField(name, prefix+slash+"foo")
-	c.Assert(err, check.IsNil, check.Commentf("Error getting volume host path: %q", err))
+	assert.Assert(c, err == nil, "Error getting volume host path: %q", err)
 
 
 	if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {
 	if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {
 		c.Fatalf("Volume was not created")
 		c.Fatalf("Volume was not created")
@@ -190,7 +189,7 @@ func (s *DockerSuite) TestCreateVolumesCreated(c *check.C) {
 
 
 }
 }
 
 
-func (s *DockerSuite) TestCreateLabels(c *check.C) {
+func (s *DockerSuite) TestCreateLabels(c *testing.T) {
 	name := "test_create_labels"
 	name := "test_create_labels"
 	expected := map[string]string{"k1": "v1", "k2": "v2"}
 	expected := map[string]string{"k1": "v1", "k2": "v2"}
 	dockerCmd(c, "create", "--name", name, "-l", "k1=v1", "--label", "k2=v2", "busybox")
 	dockerCmd(c, "create", "--name", name, "-l", "k1=v1", "--label", "k2=v2", "busybox")
@@ -203,7 +202,7 @@ func (s *DockerSuite) TestCreateLabels(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestCreateLabelFromImage(c *check.C) {
+func (s *DockerSuite) TestCreateLabelFromImage(c *testing.T) {
 	imageName := "testcreatebuildlabel"
 	imageName := "testcreatebuildlabel"
 	buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox
 	buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox
 		LABEL k1=v1 k2=v2`))
 		LABEL k1=v1 k2=v2`))
@@ -220,7 +219,7 @@ func (s *DockerSuite) TestCreateLabelFromImage(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestCreateHostnameWithNumber(c *check.C) {
+func (s *DockerSuite) TestCreateHostnameWithNumber(c *testing.T) {
 	image := "busybox"
 	image := "busybox"
 	// Busybox on Windows does not implement hostname command
 	// Busybox on Windows does not implement hostname command
 	if testEnv.OSType == "windows" {
 	if testEnv.OSType == "windows" {
@@ -230,7 +229,7 @@ func (s *DockerSuite) TestCreateHostnameWithNumber(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "web.0", "hostname not set, expected `web.0`, got: %s", out)
 	assert.Equal(c, strings.TrimSpace(out), "web.0", "hostname not set, expected `web.0`, got: %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestCreateRM(c *check.C) {
+func (s *DockerSuite) TestCreateRM(c *testing.T) {
 	// Test to make sure we can 'rm' a new container that is in
 	// Test to make sure we can 'rm' a new container that is in
 	// "Created" state, and has ever been run. Test "rm -f" too.
 	// "Created" state, and has ever been run. Test "rm -f" too.
 
 
@@ -247,7 +246,7 @@ func (s *DockerSuite) TestCreateRM(c *check.C) {
 	dockerCmd(c, "rm", "-f", cID)
 	dockerCmd(c, "rm", "-f", cID)
 }
 }
 
 
-func (s *DockerSuite) TestCreateModeIpcContainer(c *check.C) {
+func (s *DockerSuite) TestCreateModeIpcContainer(c *testing.T) {
 	// Uses Linux specific functionality (--ipc)
 	// Uses Linux specific functionality (--ipc)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 
 
@@ -257,7 +256,7 @@ func (s *DockerSuite) TestCreateModeIpcContainer(c *check.C) {
 	dockerCmd(c, "create", fmt.Sprintf("--ipc=container:%s", id), "busybox")
 	dockerCmd(c, "create", fmt.Sprintf("--ipc=container:%s", id), "busybox")
 }
 }
 
 
-func (s *DockerSuite) TestCreateByImageID(c *check.C) {
+func (s *DockerSuite) TestCreateByImageID(c *testing.T) {
 	imageName := "testcreatebyimageid"
 	imageName := "testcreatebyimageid"
 	buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox
 	buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox
 		MAINTAINER dockerio`))
 		MAINTAINER dockerio`))
@@ -290,16 +289,15 @@ func (s *DockerSuite) TestCreateByImageID(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestCreateStopSignal(c *check.C) {
+func (s *DockerSuite) TestCreateStopSignal(c *testing.T) {
 	name := "test_create_stop_signal"
 	name := "test_create_stop_signal"
 	dockerCmd(c, "create", "--name", name, "--stop-signal", "9", "busybox")
 	dockerCmd(c, "create", "--name", name, "--stop-signal", "9", "busybox")
 
 
 	res := inspectFieldJSON(c, name, "Config.StopSignal")
 	res := inspectFieldJSON(c, name, "Config.StopSignal")
-	c.Assert(res, checker.Contains, "9")
-
+	assert.Assert(c, strings.Contains(res, "9"))
 }
 }
 
 
-func (s *DockerSuite) TestCreateWithWorkdir(c *check.C) {
+func (s *DockerSuite) TestCreateWithWorkdir(c *testing.T) {
 	name := "foo"
 	name := "foo"
 
 
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
@@ -321,19 +319,19 @@ func (s *DockerSuite) TestCreateWithWorkdir(c *check.C) {
 	dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), prefix+slash+"tmp")
 	dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), prefix+slash+"tmp")
 }
 }
 
 
-func (s *DockerSuite) TestCreateWithInvalidLogOpts(c *check.C) {
+func (s *DockerSuite) TestCreateWithInvalidLogOpts(c *testing.T) {
 	name := "test-invalidate-log-opts"
 	name := "test-invalidate-log-opts"
 	out, _, err := dockerCmdWithError("create", "--name", name, "--log-opt", "invalid=true", "busybox")
 	out, _, err := dockerCmdWithError("create", "--name", name, "--log-opt", "invalid=true", "busybox")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "unknown log opt")
+	assert.Assert(c, strings.Contains(out, "unknown log opt"))
 	assert.Assert(c, is.Contains(out, "unknown log opt"))
 	assert.Assert(c, is.Contains(out, "unknown log opt"))
 
 
 	out, _ = dockerCmd(c, "ps", "-a")
 	out, _ = dockerCmd(c, "ps", "-a")
-	c.Assert(out, checker.Not(checker.Contains), name)
+	assert.Assert(c, !strings.Contains(out, name))
 }
 }
 
 
 // #20972
 // #20972
-func (s *DockerSuite) TestCreate64ByteHexID(c *check.C) {
+func (s *DockerSuite) TestCreate64ByteHexID(c *testing.T) {
 	out := inspectField(c, "busybox", "Id")
 	out := inspectField(c, "busybox", "Id")
 	imageID := strings.TrimPrefix(strings.TrimSpace(string(out)), "sha256:")
 	imageID := strings.TrimPrefix(strings.TrimSpace(string(out)), "sha256:")
 
 
@@ -341,7 +339,7 @@ func (s *DockerSuite) TestCreate64ByteHexID(c *check.C) {
 }
 }
 
 
 // Test case for #23498
 // Test case for #23498
-func (s *DockerSuite) TestCreateUnsetEntrypoint(c *check.C) {
+func (s *DockerSuite) TestCreateUnsetEntrypoint(c *testing.T) {
 	name := "test-entrypoint"
 	name := "test-entrypoint"
 	dockerfile := `FROM busybox
 	dockerfile := `FROM busybox
 ADD entrypoint.sh /entrypoint.sh
 ADD entrypoint.sh /entrypoint.sh
@@ -362,22 +360,21 @@ exec "$@"`,
 
 
 	out := cli.DockerCmd(c, "create", "--entrypoint=", name, "echo", "foo").Combined()
 	out := cli.DockerCmd(c, "create", "--entrypoint=", name, "echo", "foo").Combined()
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
-	c.Assert(id, check.Not(check.Equals), "")
+	assert.Assert(c, id != "")
 	out = cli.DockerCmd(c, "start", "-a", id).Combined()
 	out = cli.DockerCmd(c, "start", "-a", id).Combined()
-	c.Assert(strings.TrimSpace(out), check.Equals, "foo")
+	assert.Equal(c, strings.TrimSpace(out), "foo")
 }
 }
 
 
 // #22471
 // #22471
-func (s *DockerSuite) TestCreateStopTimeout(c *check.C) {
+func (s *DockerSuite) TestCreateStopTimeout(c *testing.T) {
 	name1 := "test_create_stop_timeout_1"
 	name1 := "test_create_stop_timeout_1"
 	dockerCmd(c, "create", "--name", name1, "--stop-timeout", "15", "busybox")
 	dockerCmd(c, "create", "--name", name1, "--stop-timeout", "15", "busybox")
 
 
 	res := inspectFieldJSON(c, name1, "Config.StopTimeout")
 	res := inspectFieldJSON(c, name1, "Config.StopTimeout")
-	c.Assert(res, checker.Contains, "15")
-
+	assert.Assert(c, strings.Contains(res, "15"))
 	name2 := "test_create_stop_timeout_2"
 	name2 := "test_create_stop_timeout_2"
 	dockerCmd(c, "create", "--name", name2, "busybox")
 	dockerCmd(c, "create", "--name", name2, "busybox")
 
 
 	res = inspectFieldJSON(c, name2, "Config.StopTimeout")
 	res = inspectFieldJSON(c, name2, "Config.StopTimeout")
-	c.Assert(res, checker.Contains, "null")
+	assert.Assert(c, strings.Contains(res, "null"))
 }
 }

+ 11 - 11
integration-cli/docker_cli_daemon_plugins_test.go

@@ -4,16 +4,16 @@ package main
 
 
 import (
 import (
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/pkg/mount"
 	"github.com/docker/docker/pkg/mount"
-	"github.com/go-check/check"
 	"golang.org/x/sys/unix"
 	"golang.org/x/sys/unix"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 // TestDaemonRestartWithPluginEnabled tests state restore for an enabled plugin
 // TestDaemonRestartWithPluginEnabled tests state restore for an enabled plugin
-func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c)
 	s.d.Start(c)
@@ -42,7 +42,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *check.C) {
 }
 }
 
 
 // TestDaemonRestartWithPluginDisabled tests state restore for a disabled plugin
 // TestDaemonRestartWithPluginDisabled tests state restore for a disabled plugin
-func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c)
 	s.d.Start(c)
@@ -69,7 +69,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
 
 
 // TestDaemonKillLiveRestoreWithPlugins SIGKILLs daemon started with --live-restore.
 // TestDaemonKillLiveRestoreWithPlugins SIGKILLs daemon started with --live-restore.
 // Plugins should continue to run.
 // Plugins should continue to run.
-func (s *DockerDaemonSuite) TestDaemonKillLiveRestoreWithPlugins(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonKillLiveRestoreWithPlugins(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c, "--live-restore")
 	s.d.Start(c, "--live-restore")
@@ -95,7 +95,7 @@ func (s *DockerDaemonSuite) TestDaemonKillLiveRestoreWithPlugins(c *check.C) {
 
 
 // TestDaemonShutdownLiveRestoreWithPlugins SIGTERMs daemon started with --live-restore.
 // TestDaemonShutdownLiveRestoreWithPlugins SIGTERMs daemon started with --live-restore.
 // Plugins should continue to run.
 // Plugins should continue to run.
-func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c, "--live-restore")
 	s.d.Start(c, "--live-restore")
@@ -120,7 +120,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C)
 }
 }
 
 
 // TestDaemonShutdownWithPlugins shuts down running plugins.
 // TestDaemonShutdownWithPlugins shuts down running plugins.
-func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c)
 	s.d.Start(c)
@@ -158,7 +158,7 @@ func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
 }
 }
 
 
 // TestDaemonKillWithPlugins leaves plugins running.
 // TestDaemonKillWithPlugins leaves plugins running.
-func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c)
 	s.d.Start(c)
@@ -185,7 +185,7 @@ func (s *DockerDaemonSuite) TestDaemonKillWithPlugins(c *check.C) {
 }
 }
 
 
 // TestVolumePlugin tests volume creation using a plugin.
 // TestVolumePlugin tests volume creation using a plugin.
-func (s *DockerDaemonSuite) TestVolumePlugin(c *check.C) {
+func (s *DockerDaemonSuite) TestVolumePlugin(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	volName := "plugin-volume"
 	volName := "plugin-volume"
@@ -231,7 +231,7 @@ func (s *DockerDaemonSuite) TestVolumePlugin(c *check.C) {
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 }
 }
 
 
-func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *check.C) {
+func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c, "--live-restore=true")
 	s.d.Start(c, "--live-restore=true")
@@ -272,7 +272,7 @@ func existsMountpointWithPrefix(mountpointPrefix string) (bool, error) {
 	return false, nil
 	return false, nil
 }
 }
 
 
-func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *check.C) {
+func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c)
 	s.d.Start(c)
@@ -300,7 +300,7 @@ func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *check.C) {
 	assert.Assert(c, strings.Contains(out, pName))
 	assert.Assert(c, strings.Contains(out, pName))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestPluginListFilterCapability(c *check.C) {
+func (s *DockerDaemonSuite) TestPluginListFilterCapability(c *testing.T) {
 	testRequires(c, IsAmd64, Network)
 	testRequires(c, IsAmd64, Network)
 
 
 	s.d.Start(c)
 	s.d.Start(c)

File diff suppressed because it is too large
+ 132 - 143
integration-cli/docker_cli_daemon_test.go


+ 32 - 32
integration-cli/docker_cli_events_test.go

@@ -11,6 +11,7 @@ import (
 	"os/exec"
 	"os/exec"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
@@ -19,13 +20,12 @@ import (
 	eventstestutils "github.com/docker/docker/daemon/events/testutils"
 	eventstestutils "github.com/docker/docker/daemon/events/testutils"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestEventsTimestampFormats(c *check.C) {
+func (s *DockerSuite) TestEventsTimestampFormats(c *testing.T) {
 	name := "events-time-format-test"
 	name := "events-time-format-test"
 
 
 	// Start stopwatch, generate an event
 	// Start stopwatch, generate an event
@@ -54,7 +54,7 @@ func (s *DockerSuite) TestEventsTimestampFormats(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestEventsUntag(c *check.C) {
+func (s *DockerSuite) TestEventsUntag(c *testing.T) {
 	image := "busybox"
 	image := "busybox"
 	dockerCmd(c, "tag", image, "utest:tag1")
 	dockerCmd(c, "tag", image, "utest:tag1")
 	dockerCmd(c, "tag", image, "utest:tag2")
 	dockerCmd(c, "tag", image, "utest:tag2")
@@ -77,7 +77,7 @@ func (s *DockerSuite) TestEventsUntag(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestEventsContainerEvents(c *check.C) {
+func (s *DockerSuite) TestEventsContainerEvents(c *testing.T) {
 	dockerCmd(c, "run", "--rm", "--name", "container-events-test", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "--name", "container-events-test", "busybox", "true")
 
 
 	out, _ := dockerCmd(c, "events", "--until", daemonUnixTime(c))
 	out, _ := dockerCmd(c, "events", "--until", daemonUnixTime(c))
@@ -89,7 +89,7 @@ func (s *DockerSuite) TestEventsContainerEvents(c *check.C) {
 	assert.Assert(c, is.DeepEqual(containerEvents[:5], []string{"create", "attach", "start", "die", "destroy"}), out)
 	assert.Assert(c, is.DeepEqual(containerEvents[:5], []string{"create", "attach", "start", "die", "destroy"}), out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *check.C) {
+func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	dockerCmd(c, "run", "--rm", "--name", "container-events-test", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "--name", "container-events-test", "busybox", "true")
 
 
@@ -113,7 +113,7 @@ func (s *DockerSuite) TestEventsContainerEventsAttrSort(c *check.C) {
 	assert.Equal(c, matchedEvents, 2, "missing events for container container-events-test:\n%s", out)
 	assert.Equal(c, matchedEvents, 2, "missing events for container container-events-test:\n%s", out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *check.C) {
+func (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *testing.T) {
 	dockerCmd(c, "run", "--rm", "--name", "since-epoch-test", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "--name", "since-epoch-test", "busybox", "true")
 	timeBeginning := time.Unix(0, 0).Format(time.RFC3339Nano)
 	timeBeginning := time.Unix(0, 0).Format(time.RFC3339Nano)
 	timeBeginning = strings.Replace(timeBeginning, "Z", ".000000000Z", -1)
 	timeBeginning = strings.Replace(timeBeginning, "Z", ".000000000Z", -1)
@@ -127,7 +127,7 @@ func (s *DockerSuite) TestEventsContainerEventsSinceUnixEpoch(c *check.C) {
 	assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
 	assert.Assert(c, is.DeepEqual(containerEvents, []string{"create", "attach", "start", "die", "destroy"}), out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsImageTag(c *check.C) {
+func (s *DockerSuite) TestEventsImageTag(c *testing.T) {
 	time.Sleep(1 * time.Second) // because API has seconds granularity
 	time.Sleep(1 * time.Second) // because API has seconds granularity
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	image := "testimageevents:tag"
 	image := "testimageevents:tag"
@@ -145,7 +145,7 @@ func (s *DockerSuite) TestEventsImageTag(c *check.C) {
 	assert.Equal(c, matches["action"], "tag")
 	assert.Equal(c, matches["action"], "tag")
 }
 }
 
 
-func (s *DockerSuite) TestEventsImagePull(c *check.C) {
+func (s *DockerSuite) TestEventsImagePull(c *testing.T) {
 	// TODO Windows: Enable this test once pull and reliable image names are available
 	// TODO Windows: Enable this test once pull and reliable image names are available
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -163,7 +163,7 @@ func (s *DockerSuite) TestEventsImagePull(c *check.C) {
 	assert.Equal(c, matches["action"], "pull")
 	assert.Equal(c, matches["action"], "pull")
 }
 }
 
 
-func (s *DockerSuite) TestEventsImageImport(c *check.C) {
+func (s *DockerSuite) TestEventsImageImport(c *testing.T) {
 	// TODO Windows CI. This should be portable once export/import are
 	// TODO Windows CI. This should be portable once export/import are
 	// more reliable (@swernli)
 	// more reliable (@swernli)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -187,7 +187,7 @@ func (s *DockerSuite) TestEventsImageImport(c *check.C) {
 	assert.Equal(c, matches["action"], "import", "matches: %v\nout:\n%s\n", matches, out)
 	assert.Equal(c, matches["action"], "import", "matches: %v\nout:\n%s\n", matches, out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsImageLoad(c *check.C) {
+func (s *DockerSuite) TestEventsImageLoad(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	myImageName := "footest:v1"
 	myImageName := "footest:v1"
 	dockerCmd(c, "tag", "busybox", myImageName)
 	dockerCmd(c, "tag", "busybox", myImageName)
@@ -226,7 +226,7 @@ func (s *DockerSuite) TestEventsImageLoad(c *check.C) {
 	assert.Equal(c, matches["action"], "save", "matches: %v\nout:\n%s\n", matches, out)
 	assert.Equal(c, matches["action"], "save", "matches: %v\nout:\n%s\n", matches, out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsPluginOps(c *check.C) {
+func (s *DockerSuite) TestEventsPluginOps(c *testing.T) {
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 
 
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -245,7 +245,7 @@ func (s *DockerSuite) TestEventsPluginOps(c *check.C) {
 	assert.Assert(c, is.DeepEqual(pluginEvents, []string{"pull", "enable", "disable", "remove"}), out)
 	assert.Assert(c, is.DeepEqual(pluginEvents, []string{"pull", "enable", "disable", "remove"}), out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilters(c *check.C) {
+func (s *DockerSuite) TestEventsFilters(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	dockerCmd(c, "run", "--rm", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "busybox", "true")
@@ -260,7 +260,7 @@ func (s *DockerSuite) TestEventsFilters(c *check.C) {
 	assert.Assert(c, count >= 2, "should have had 2 start events but had %d, out: %s", count, out)
 	assert.Assert(c, count >= 2, "should have had 2 start events but had %d, out: %s", count, out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterImageName(c *check.C) {
+func (s *DockerSuite) TestEventsFilterImageName(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 
 
 	out, _ := dockerCmd(c, "run", "--name", "container_1", "-d", "busybox:latest", "true")
 	out, _ := dockerCmd(c, "run", "--name", "container_1", "-d", "busybox:latest", "true")
@@ -288,7 +288,7 @@ func (s *DockerSuite) TestEventsFilterImageName(c *check.C) {
 	assert.Assert(c, count2 != 0, "Expected event from container but got %d from %s", count2, container2)
 	assert.Assert(c, count2 != 0, "Expected event from container but got %d from %s", count2, container2)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterLabels(c *check.C) {
+func (s *DockerSuite) TestEventsFilterLabels(c *testing.T) {
 	since := strconv.FormatUint(uint64(daemonTime(c).Unix()), 10)
 	since := strconv.FormatUint(uint64(daemonTime(c).Unix()), 10)
 	label := "io.docker.testing=foo"
 	label := "io.docker.testing=foo"
 
 
@@ -323,7 +323,7 @@ func (s *DockerSuite) TestEventsFilterLabels(c *check.C) {
 	assert.Assert(c, found)
 	assert.Assert(c, found)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterImageLabels(c *check.C) {
+func (s *DockerSuite) TestEventsFilterImageLabels(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	name := "labelfiltertest"
 	name := "labelfiltertest"
 	label := "io.docker.testing=image"
 	label := "io.docker.testing=image"
@@ -353,7 +353,7 @@ func (s *DockerSuite) TestEventsFilterImageLabels(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterContainer(c *check.C) {
+func (s *DockerSuite) TestEventsFilterContainer(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	nameID := make(map[string]string)
 	nameID := make(map[string]string)
 
 
@@ -391,7 +391,7 @@ func (s *DockerSuite) TestEventsFilterContainer(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestEventsCommit(c *check.C) {
+func (s *DockerSuite) TestEventsCommit(c *testing.T) {
 	// Problematic on Windows as cannot commit a running container
 	// Problematic on Windows as cannot commit a running container
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -408,7 +408,7 @@ func (s *DockerSuite) TestEventsCommit(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "commit"), "Missing 'commit' log event")
 	assert.Assert(c, strings.Contains(out, "commit"), "Missing 'commit' log event")
 }
 }
 
 
-func (s *DockerSuite) TestEventsCopy(c *check.C) {
+func (s *DockerSuite) TestEventsCopy(c *testing.T) {
 	// Build a test image.
 	// Build a test image.
 	buildImageSuccessfully(c, "cpimg", build.WithDockerfile(`
 	buildImageSuccessfully(c, "cpimg", build.WithDockerfile(`
 		  FROM busybox
 		  FROM busybox
@@ -437,7 +437,7 @@ func (s *DockerSuite) TestEventsCopy(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "extract-to-dir"), "Missing 'extract-to-dir' log event")
 	assert.Assert(c, strings.Contains(out, "extract-to-dir"), "Missing 'extract-to-dir' log event")
 }
 }
 
 
-func (s *DockerSuite) TestEventsResize(c *check.C) {
+func (s *DockerSuite) TestEventsResize(c *testing.T) {
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
 	cID := strings.TrimSpace(out)
 	cID := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(cID))
 	assert.NilError(c, waitRun(cID))
@@ -460,7 +460,7 @@ func (s *DockerSuite) TestEventsResize(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "resize"), "Missing 'resize' log event")
 	assert.Assert(c, strings.Contains(out, "resize"), "Missing 'resize' log event")
 }
 }
 
 
-func (s *DockerSuite) TestEventsAttach(c *check.C) {
+func (s *DockerSuite) TestEventsAttach(c *testing.T) {
 	// TODO Windows CI: Figure out why this test fails intermittently (TP5).
 	// TODO Windows CI: Figure out why this test fails intermittently (TP5).
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -498,7 +498,7 @@ func (s *DockerSuite) TestEventsAttach(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "attach"), "Missing 'attach' log event")
 	assert.Assert(c, strings.Contains(out, "attach"), "Missing 'attach' log event")
 }
 }
 
 
-func (s *DockerSuite) TestEventsRename(c *check.C) {
+func (s *DockerSuite) TestEventsRename(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "--name", "oldName", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "--name", "oldName", "busybox", "true")
 	cID := strings.TrimSpace(out)
 	cID := strings.TrimSpace(out)
 	dockerCmd(c, "rename", "oldName", "newName")
 	dockerCmd(c, "rename", "oldName", "newName")
@@ -509,7 +509,7 @@ func (s *DockerSuite) TestEventsRename(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "rename"), "Missing 'rename' log event")
 	assert.Assert(c, strings.Contains(out, "rename"), "Missing 'rename' log event")
 }
 }
 
 
-func (s *DockerSuite) TestEventsTop(c *check.C) {
+func (s *DockerSuite) TestEventsTop(c *testing.T) {
 	// Problematic on Windows as Windows does not support top
 	// Problematic on Windows as Windows does not support top
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -526,7 +526,7 @@ func (s *DockerSuite) TestEventsTop(c *check.C) {
 }
 }
 
 
 // #14316
 // #14316
-func (s *DockerRegistrySuite) TestEventsImageFilterPush(c *check.C) {
+func (s *DockerRegistrySuite) TestEventsImageFilterPush(c *testing.T) {
 	// Problematic to port for Windows CI during TP5 timeframe until
 	// Problematic to port for Windows CI during TP5 timeframe until
 	// supporting push
 	// supporting push
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -546,7 +546,7 @@ func (s *DockerRegistrySuite) TestEventsImageFilterPush(c *check.C) {
 	assert.Assert(c, strings.Contains(out, repoName), "Missing 'push' log event for %s", repoName)
 	assert.Assert(c, strings.Contains(out, repoName), "Missing 'push' log event for %s", repoName)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterType(c *check.C) {
+func (s *DockerSuite) TestEventsFilterType(c *testing.T) {
 	// FIXME(vdemeester) fails on e2e run
 	// FIXME(vdemeester) fails on e2e run
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -600,7 +600,7 @@ func (s *DockerSuite) TestEventsFilterType(c *check.C) {
 }
 }
 
 
 // #25798
 // #25798
-func (s *DockerSuite) TestEventsSpecialFiltersWithExecCreate(c *check.C) {
+func (s *DockerSuite) TestEventsSpecialFiltersWithExecCreate(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	runSleepingContainer(c, "--name", "test-container", "-d")
 	runSleepingContainer(c, "--name", "test-container", "-d")
 	waitRun("test-container")
 	waitRun("test-container")
@@ -630,7 +630,7 @@ func (s *DockerSuite) TestEventsSpecialFiltersWithExecCreate(c *check.C) {
 	assert.Equal(c, len(events), 1, out)
 	assert.Equal(c, len(events), 1, out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterImageInContainerAction(c *check.C) {
+func (s *DockerSuite) TestEventsFilterImageInContainerAction(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	dockerCmd(c, "run", "--name", "test-container", "-d", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test-container", "-d", "busybox", "true")
 	waitRun("test-container")
 	waitRun("test-container")
@@ -640,7 +640,7 @@ func (s *DockerSuite) TestEventsFilterImageInContainerAction(c *check.C) {
 	assert.Assert(c, len(events) > 1, out)
 	assert.Assert(c, len(events) > 1, out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsContainerRestart(c *check.C) {
+func (s *DockerSuite) TestEventsContainerRestart(c *testing.T) {
 	dockerCmd(c, "run", "-d", "--name=testEvent", "--restart=on-failure:3", "busybox", "false")
 	dockerCmd(c, "run", "-d", "--name=testEvent", "--restart=on-failure:3", "busybox", "false")
 
 
 	// wait until test2 is auto removed.
 	// wait until test2 is auto removed.
@@ -680,7 +680,7 @@ func (s *DockerSuite) TestEventsContainerRestart(c *check.C) {
 	assert.Equal(c, dieCount, 4, "testEvent should die 4 times: %v", actions)
 	assert.Equal(c, dieCount, 4, "testEvent should die 4 times: %v", actions)
 }
 }
 
 
-func (s *DockerSuite) TestEventsSinceInTheFuture(c *check.C) {
+func (s *DockerSuite) TestEventsSinceInTheFuture(c *testing.T) {
 	dockerCmd(c, "run", "--name", "test-container", "-d", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test-container", "-d", "busybox", "true")
 	waitRun("test-container")
 	waitRun("test-container")
 
 
@@ -692,7 +692,7 @@ func (s *DockerSuite) TestEventsSinceInTheFuture(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "cannot be after `until`"))
 	assert.Assert(c, strings.Contains(out, "cannot be after `until`"))
 }
 }
 
 
-func (s *DockerSuite) TestEventsUntilInThePast(c *check.C) {
+func (s *DockerSuite) TestEventsUntilInThePast(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 
 
 	dockerCmd(c, "run", "--name", "test-container", "-d", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test-container", "-d", "busybox", "true")
@@ -709,7 +709,7 @@ func (s *DockerSuite) TestEventsUntilInThePast(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "test-container"))
 	assert.Assert(c, strings.Contains(out, "test-container"))
 }
 }
 
 
-func (s *DockerSuite) TestEventsFormat(c *check.C) {
+func (s *DockerSuite) TestEventsFormat(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	dockerCmd(c, "run", "--rm", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "busybox", "true")
 	dockerCmd(c, "run", "--rm", "busybox", "true")
@@ -732,7 +732,7 @@ func (s *DockerSuite) TestEventsFormat(c *check.C) {
 	assert.Equal(c, startCount, 2, "should have had 2 start events but had %d, out: %s", startCount, out)
 	assert.Equal(c, startCount, 2, "should have had 2 start events but had %d, out: %s", startCount, out)
 }
 }
 
 
-func (s *DockerSuite) TestEventsFormatBadFunc(c *check.C) {
+func (s *DockerSuite) TestEventsFormatBadFunc(c *testing.T) {
 	// make sure it fails immediately, without receiving any event
 	// make sure it fails immediately, without receiving any event
 	result := dockerCmdWithResult("events", "--format", "{{badFuncString .}}")
 	result := dockerCmdWithResult("events", "--format", "{{badFuncString .}}")
 	result.Assert(c, icmd.Expected{
 	result.Assert(c, icmd.Expected{
@@ -742,7 +742,7 @@ func (s *DockerSuite) TestEventsFormatBadFunc(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestEventsFormatBadField(c *check.C) {
+func (s *DockerSuite) TestEventsFormatBadField(c *testing.T) {
 	// make sure it fails immediately, without receiving any event
 	// make sure it fails immediately, without receiving any event
 	result := dockerCmdWithResult("events", "--format", "{{.badFieldString}}")
 	result := dockerCmdWithResult("events", "--format", "{{.badFieldString}}")
 	result.Assert(c, icmd.Expected{
 	result.Assert(c, icmd.Expected{

+ 16 - 16
integration-cli/docker_cli_events_unix_test.go

@@ -10,18 +10,18 @@ import (
 	"os"
 	"os"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 	"unicode"
 	"unicode"
 
 
 	"github.com/creack/pty"
 	"github.com/creack/pty"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"golang.org/x/sys/unix"
 	"golang.org/x/sys/unix"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // #5979
 // #5979
-func (s *DockerSuite) TestEventsRedirectStdout(c *check.C) {
+func (s *DockerSuite) TestEventsRedirectStdout(c *testing.T) {
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
 	dockerCmd(c, "run", "busybox", "true")
 	dockerCmd(c, "run", "busybox", "true")
 
 
@@ -47,7 +47,7 @@ func (s *DockerSuite) TestEventsRedirectStdout(c *check.C) {
 	assert.NilError(c, scanner.Err(), "Scan err for command %q", command)
 	assert.NilError(c, scanner.Err(), "Scan err for command %q", command)
 }
 }
 
 
-func (s *DockerSuite) TestEventsOOMDisableFalse(c *check.C) {
+func (s *DockerSuite) TestEventsOOMDisableFalse(c *testing.T) {
 	testRequires(c, DaemonIsLinux, oomControl, memoryLimitSupport, swapMemorySupport, NotPpc64le)
 	testRequires(c, DaemonIsLinux, oomControl, memoryLimitSupport, swapMemorySupport, NotPpc64le)
 
 
 	errChan := make(chan error)
 	errChan := make(chan error)
@@ -77,7 +77,7 @@ func (s *DockerSuite) TestEventsOOMDisableFalse(c *check.C) {
 	assert.Equal(c, parseEventAction(c, events[nEvents-1]), "die")
 	assert.Equal(c, parseEventAction(c, events[nEvents-1]), "die")
 }
 }
 
 
-func (s *DockerSuite) TestEventsOOMDisableTrue(c *check.C) {
+func (s *DockerSuite) TestEventsOOMDisableTrue(c *testing.T) {
 	testRequires(c, DaemonIsLinux, oomControl, memoryLimitSupport, NotArm, swapMemorySupport, NotPpc64le)
 	testRequires(c, DaemonIsLinux, oomControl, memoryLimitSupport, NotArm, swapMemorySupport, NotPpc64le)
 
 
 	errChan := make(chan error)
 	errChan := make(chan error)
@@ -125,7 +125,7 @@ func (s *DockerSuite) TestEventsOOMDisableTrue(c *check.C) {
 }
 }
 
 
 // #18453
 // #18453
-func (s *DockerSuite) TestEventsContainerFilterByName(c *check.C) {
+func (s *DockerSuite) TestEventsContainerFilterByName(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	cOut, _ := dockerCmd(c, "run", "--name=foo", "-d", "busybox", "top")
 	cOut, _ := dockerCmd(c, "run", "--name=foo", "-d", "busybox", "top")
 	c1 := strings.TrimSpace(cOut)
 	c1 := strings.TrimSpace(cOut)
@@ -139,7 +139,7 @@ func (s *DockerSuite) TestEventsContainerFilterByName(c *check.C) {
 }
 }
 
 
 // #18453
 // #18453
-func (s *DockerSuite) TestEventsContainerFilterBeforeCreate(c *check.C) {
+func (s *DockerSuite) TestEventsContainerFilterBeforeCreate(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	buf := &bytes.Buffer{}
 	buf := &bytes.Buffer{}
 	cmd := exec.Command(dockerBinary, "events", "-f", "container=foo", "--since=0")
 	cmd := exec.Command(dockerBinary, "events", "-f", "container=foo", "--since=0")
@@ -164,7 +164,7 @@ func (s *DockerSuite) TestEventsContainerFilterBeforeCreate(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestVolumeEvents(c *check.C) {
+func (s *DockerSuite) TestVolumeEvents(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -192,7 +192,7 @@ func (s *DockerSuite) TestVolumeEvents(c *check.C) {
 	assert.Equal(c, volumeEvents[4], "destroy")
 	assert.Equal(c, volumeEvents[4], "destroy")
 }
 }
 
 
-func (s *DockerSuite) TestNetworkEvents(c *check.C) {
+func (s *DockerSuite) TestNetworkEvents(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -219,7 +219,7 @@ func (s *DockerSuite) TestNetworkEvents(c *check.C) {
 	assert.Equal(c, netEvents[3], "destroy")
 	assert.Equal(c, netEvents[3], "destroy")
 }
 }
 
 
-func (s *DockerSuite) TestEventsContainerWithMultiNetwork(c *check.C) {
+func (s *DockerSuite) TestEventsContainerWithMultiNetwork(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	// Observe create/connect network actions
 	// Observe create/connect network actions
@@ -247,7 +247,7 @@ func (s *DockerSuite) TestEventsContainerWithMultiNetwork(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "test-event-network-local-2"))
 	assert.Assert(c, strings.Contains(out, "test-event-network-local-2"))
 }
 }
 
 
-func (s *DockerSuite) TestEventsStreaming(c *check.C) {
+func (s *DockerSuite) TestEventsStreaming(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	observer, err := newEventObserver(c)
 	observer, err := newEventObserver(c)
@@ -301,7 +301,7 @@ func (s *DockerSuite) TestEventsStreaming(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestEventsImageUntagDelete(c *check.C) {
+func (s *DockerSuite) TestEventsImageUntagDelete(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	observer, err := newEventObserver(c)
 	observer, err := newEventObserver(c)
@@ -340,7 +340,7 @@ func (s *DockerSuite) TestEventsImageUntagDelete(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterVolumeAndNetworkType(c *check.C) {
+func (s *DockerSuite) TestEventsFilterVolumeAndNetworkType(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -359,7 +359,7 @@ func (s *DockerSuite) TestEventsFilterVolumeAndNetworkType(c *check.C) {
 	assert.Equal(c, networkActions[0], "create")
 	assert.Equal(c, networkActions[0], "create")
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterVolumeID(c *check.C) {
+func (s *DockerSuite) TestEventsFilterVolumeID(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -374,7 +374,7 @@ func (s *DockerSuite) TestEventsFilterVolumeID(c *check.C) {
 	assert.Assert(c, strings.Contains(events[0], "driver=local"))
 	assert.Assert(c, strings.Contains(events[0], "driver=local"))
 }
 }
 
 
-func (s *DockerSuite) TestEventsFilterNetworkID(c *check.C) {
+func (s *DockerSuite) TestEventsFilterNetworkID(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	since := daemonUnixTime(c)
 	since := daemonUnixTime(c)
@@ -387,7 +387,7 @@ func (s *DockerSuite) TestEventsFilterNetworkID(c *check.C) {
 	assert.Assert(c, strings.Contains(events[0], "type=bridge"))
 	assert.Assert(c, strings.Contains(events[0], "type=bridge"))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonEvents(c *testing.T) {
 
 
 	// daemon config file
 	// daemon config file
 	configFilePath := "test.json"
 	configFilePath := "test.json"
@@ -455,7 +455,7 @@ func (s *DockerDaemonSuite) TestDaemonEvents(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonEventsWithFilters(c *testing.T) {
 
 
 	// daemon config file
 	// daemon config file
 	configFilePath := "test.json"
 	configFilePath := "test.json"

+ 25 - 25
integration-cli/docker_cli_exec_test.go

@@ -11,18 +11,18 @@ import (
 	"sort"
 	"sort"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestExec(c *check.C) {
+func (s *DockerSuite) TestExec(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
 	out, _ := dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
 	assert.NilError(c, waitRun(strings.TrimSpace(out)))
 	assert.NilError(c, waitRun(strings.TrimSpace(out)))
@@ -31,7 +31,7 @@ func (s *DockerSuite) TestExec(c *check.C) {
 	assert.Equal(c, strings.Trim(out, "\r\n"), "test")
 	assert.Equal(c, strings.Trim(out, "\r\n"), "test")
 }
 }
 
 
-func (s *DockerSuite) TestExecInteractive(c *check.C) {
+func (s *DockerSuite) TestExecInteractive(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
 	dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "sh", "-c", "echo test > /tmp/file && top")
 
 
@@ -67,7 +67,7 @@ func (s *DockerSuite) TestExecInteractive(c *check.C) {
 
 
 }
 }
 
 
-func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
+func (s *DockerSuite) TestExecAfterContainerRestart(c *testing.T) {
 	out := runSleepingContainer(c)
 	out := runSleepingContainer(c)
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(cleanedContainerID))
 	assert.NilError(c, waitRun(cleanedContainerID))
@@ -78,7 +78,7 @@ func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "hello")
 	assert.Equal(c, strings.TrimSpace(out), "hello")
 }
 }
 
 
-func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
+func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *testing.T) {
 	// TODO Windows CI: DockerDaemonSuite doesn't run on Windows, and requires a little work to get this ported.
 	// TODO Windows CI: DockerDaemonSuite doesn't run on Windows, and requires a little work to get this ported.
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
@@ -96,7 +96,7 @@ func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
 }
 }
 
 
 // Regression test for #9155, #9044
 // Regression test for #9155, #9044
-func (s *DockerSuite) TestExecEnv(c *check.C) {
+func (s *DockerSuite) TestExecEnv(c *testing.T) {
 	// TODO Windows CI: This one is interesting and may just end up being a feature
 	// TODO Windows CI: This one is interesting and may just end up being a feature
 	// difference between Windows and Linux. On Windows, the environment is passed
 	// difference between Windows and Linux. On Windows, the environment is passed
 	// into the process that is launched, not into the machine environment. Hence
 	// into the process that is launched, not into the machine environment. Hence
@@ -111,7 +111,7 @@ func (s *DockerSuite) TestExecEnv(c *check.C) {
 	assert.Check(c, strings.Contains(out, "HOME=/root"))
 	assert.Check(c, strings.Contains(out, "HOME=/root"))
 }
 }
 
 
-func (s *DockerSuite) TestExecSetEnv(c *check.C) {
+func (s *DockerSuite) TestExecSetEnv(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	runSleepingContainer(c, "-e", "HOME=/root", "-d", "--name", "testing")
 	runSleepingContainer(c, "-e", "HOME=/root", "-d", "--name", "testing")
 	assert.NilError(c, waitRun("testing"))
 	assert.NilError(c, waitRun("testing"))
@@ -122,14 +122,14 @@ func (s *DockerSuite) TestExecSetEnv(c *check.C) {
 	assert.Check(c, strings.Contains(out, "ABC=xyz"))
 	assert.Check(c, strings.Contains(out, "ABC=xyz"))
 }
 }
 
 
-func (s *DockerSuite) TestExecExitStatus(c *check.C) {
+func (s *DockerSuite) TestExecExitStatus(c *testing.T) {
 	runSleepingContainer(c, "-d", "--name", "top")
 	runSleepingContainer(c, "-d", "--name", "top")
 
 
 	result := icmd.RunCommand(dockerBinary, "exec", "top", "sh", "-c", "exit 23")
 	result := icmd.RunCommand(dockerBinary, "exec", "top", "sh", "-c", "exit 23")
 	result.Assert(c, icmd.Expected{ExitCode: 23, Error: "exit status 23"})
 	result.Assert(c, icmd.Expected{ExitCode: 23, Error: "exit status 23"})
 }
 }
 
 
-func (s *DockerSuite) TestExecPausedContainer(c *check.C) {
+func (s *DockerSuite) TestExecPausedContainer(c *testing.T) {
 	testRequires(c, IsPausable)
 	testRequires(c, IsPausable)
 
 
 	out := runSleepingContainer(c, "-d", "--name", "testing")
 	out := runSleepingContainer(c, "-d", "--name", "testing")
@@ -144,7 +144,7 @@ func (s *DockerSuite) TestExecPausedContainer(c *check.C) {
 }
 }
 
 
 // regression test for #9476
 // regression test for #9476
-func (s *DockerSuite) TestExecTTYCloseStdin(c *check.C) {
+func (s *DockerSuite) TestExecTTYCloseStdin(c *testing.T) {
 	// TODO Windows CI: This requires some work to port to Windows.
 	// TODO Windows CI: This requires some work to port to Windows.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "-it", "--name", "exec_tty_stdin", "busybox")
 	dockerCmd(c, "run", "-d", "-it", "--name", "exec_tty_stdin", "busybox")
@@ -165,7 +165,7 @@ func (s *DockerSuite) TestExecTTYCloseStdin(c *check.C) {
 	assert.Assert(c, !strings.Contains(out, "nsenter-exec"))
 	assert.Assert(c, !strings.Contains(out, "nsenter-exec"))
 }
 }
 
 
-func (s *DockerSuite) TestExecTTYWithoutStdin(c *check.C) {
+func (s *DockerSuite) TestExecTTYWithoutStdin(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "-ti", "busybox")
 	out, _ := dockerCmd(c, "run", "-d", "-ti", "busybox")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(id))
 	assert.NilError(c, waitRun(id))
@@ -202,7 +202,7 @@ func (s *DockerSuite) TestExecTTYWithoutStdin(c *check.C) {
 }
 }
 
 
 // FIXME(vdemeester) this should be a unit tests on cli/command/container package
 // FIXME(vdemeester) this should be a unit tests on cli/command/container package
-func (s *DockerSuite) TestExecParseError(c *check.C) {
+func (s *DockerSuite) TestExecParseError(c *testing.T) {
 	// TODO Windows CI: Requires some extra work. Consider copying the
 	// TODO Windows CI: Requires some extra work. Consider copying the
 	// runSleepingContainer helper to have an exec version.
 	// runSleepingContainer helper to have an exec version.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -216,7 +216,7 @@ func (s *DockerSuite) TestExecParseError(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestExecStopNotHanging(c *check.C) {
+func (s *DockerSuite) TestExecStopNotHanging(c *testing.T) {
 	// TODO Windows CI: Requires some extra work. Consider copying the
 	// TODO Windows CI: Requires some extra work. Consider copying the
 	// runSleepingContainer helper to have an exec version.
 	// runSleepingContainer helper to have an exec version.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -244,7 +244,7 @@ func (s *DockerSuite) TestExecStopNotHanging(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestExecCgroup(c *check.C) {
+func (s *DockerSuite) TestExecCgroup(c *testing.T) {
 	// Not applicable on Windows - using Linux specific functionality
 	// Not applicable on Windows - using Linux specific functionality
 	testRequires(c, NotUserNamespace)
 	testRequires(c, NotUserNamespace)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -297,7 +297,7 @@ func (s *DockerSuite) TestExecCgroup(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestExecInspectID(c *check.C) {
+func (s *DockerSuite) TestExecInspectID(c *testing.T) {
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
 	id := strings.TrimSuffix(out, "\n")
 	id := strings.TrimSuffix(out, "\n")
 
 
@@ -364,7 +364,7 @@ func (s *DockerSuite) TestExecInspectID(c *check.C) {
 	assert.ErrorContains(c, err, "No such exec instance")
 	assert.ErrorContains(c, err, "No such exec instance")
 }
 }
 
 
-func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {
+func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *testing.T) {
 	// Problematic on Windows as Windows does not support links
 	// Problematic on Windows as Windows does not support links
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	var out string
 	var out string
@@ -380,7 +380,7 @@ func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {
 	dockerCmd(c, "exec", "container2", "ping", "-c", "1", "alias1", "-W", "1")
 	dockerCmd(c, "exec", "container2", "ping", "-c", "1", "alias1", "-W", "1")
 }
 }
 
 
-func (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {
+func (s *DockerSuite) TestRunMutableNetworkFiles(c *testing.T) {
 	// Not applicable on Windows to Windows CI.
 	// Not applicable on Windows to Windows CI.
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	for _, fn := range []string{"resolv.conf", "hosts"} {
 	for _, fn := range []string{"resolv.conf", "hosts"} {
@@ -421,7 +421,7 @@ func (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestExecWithUser(c *check.C) {
+func (s *DockerSuite) TestExecWithUser(c *testing.T) {
 	// TODO Windows CI: This may be fixable in the future once Windows
 	// TODO Windows CI: This may be fixable in the future once Windows
 	// supports users
 	// supports users
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -434,7 +434,7 @@ func (s *DockerSuite) TestExecWithUser(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "uid=0(root) gid=0(root)"), "exec with user by id expected daemon user got %s", out)
 	assert.Assert(c, strings.Contains(out, "uid=0(root) gid=0(root)"), "exec with user by id expected daemon user got %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestExecWithPrivileged(c *check.C) {
+func (s *DockerSuite) TestExecWithPrivileged(c *testing.T) {
 	// Not applicable on Windows
 	// Not applicable on Windows
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	// Start main loop which attempts mknod repeatedly
 	// Start main loop which attempts mknod repeatedly
@@ -464,7 +464,7 @@ func (s *DockerSuite) TestExecWithPrivileged(c *check.C) {
 	assert.Assert(c, !strings.Contains(result.Combined(), "Success"))
 	assert.Assert(c, !strings.Contains(result.Combined(), "Success"))
 }
 }
 
 
-func (s *DockerSuite) TestExecWithImageUser(c *check.C) {
+func (s *DockerSuite) TestExecWithImageUser(c *testing.T) {
 	// Not applicable on Windows
 	// Not applicable on Windows
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "testbuilduser"
 	name := "testbuilduser"
@@ -477,7 +477,7 @@ func (s *DockerSuite) TestExecWithImageUser(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "dockerio"), "exec with user by id expected dockerio user got %s", out)
 	assert.Assert(c, strings.Contains(out, "dockerio"), "exec with user by id expected dockerio user got %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
+func (s *DockerSuite) TestExecOnReadonlyContainer(c *testing.T) {
 	// Windows does not support read-only
 	// Windows does not support read-only
 	// --read-only + userns has remount issues
 	// --read-only + userns has remount issues
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
@@ -485,7 +485,7 @@ func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
 	dockerCmd(c, "exec", "parent", "true")
 	dockerCmd(c, "exec", "parent", "true")
 }
 }
 
 
-func (s *DockerSuite) TestExecUlimits(c *check.C) {
+func (s *DockerSuite) TestExecUlimits(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "testexeculimits"
 	name := "testexeculimits"
 	runSleepingContainer(c, "-d", "--ulimit", "nofile=511:511", "--name", name)
 	runSleepingContainer(c, "-d", "--ulimit", "nofile=511:511", "--name", name)
@@ -497,7 +497,7 @@ func (s *DockerSuite) TestExecUlimits(c *check.C) {
 }
 }
 
 
 // #15750
 // #15750
-func (s *DockerSuite) TestExecStartFails(c *check.C) {
+func (s *DockerSuite) TestExecStartFails(c *testing.T) {
 	// TODO Windows CI. This test should be portable. Figure out why it fails
 	// TODO Windows CI. This test should be portable. Figure out why it fails
 	// currently.
 	// currently.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -511,7 +511,7 @@ func (s *DockerSuite) TestExecStartFails(c *check.C) {
 }
 }
 
 
 // Fix regression in https://github.com/docker/docker/pull/26461#issuecomment-250287297
 // Fix regression in https://github.com/docker/docker/pull/26461#issuecomment-250287297
-func (s *DockerSuite) TestExecWindowsPathNotWiped(c *check.C) {
+func (s *DockerSuite) TestExecWindowsPathNotWiped(c *testing.T) {
 	testRequires(c, DaemonIsWindows)
 	testRequires(c, DaemonIsWindows)
 	out, _ := dockerCmd(c, "run", "-d", "--name", "testing", minimalBaseImage(), "powershell", "start-sleep", "60")
 	out, _ := dockerCmd(c, "run", "-d", "--name", "testing", minimalBaseImage(), "powershell", "start-sleep", "60")
 	assert.NilError(c, waitRun(strings.TrimSpace(out)))
 	assert.NilError(c, waitRun(strings.TrimSpace(out)))
@@ -521,7 +521,7 @@ func (s *DockerSuite) TestExecWindowsPathNotWiped(c *check.C) {
 	assert.Assert(c, strings.Contains(out, `windowspowershell\v1.0`))
 	assert.Assert(c, strings.Contains(out, `windowspowershell\v1.0`))
 }
 }
 
 
-func (s *DockerSuite) TestExecEnvLinksHost(c *check.C) {
+func (s *DockerSuite) TestExecEnvLinksHost(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	runSleepingContainer(c, "-d", "--name", "foo")
 	runSleepingContainer(c, "-d", "--name", "foo")
 	runSleepingContainer(c, "-d", "--link", "foo:db", "--hostname", "myhost", "--name", "bar")
 	runSleepingContainer(c, "-d", "--link", "foo:db", "--hostname", "myhost", "--name", "bar")

+ 5 - 5
integration-cli/docker_cli_exec_unix_test.go

@@ -7,15 +7,15 @@ import (
 	"io"
 	"io"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/creack/pty"
 	"github.com/creack/pty"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // regression test for #12546
 // regression test for #12546
-func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
+func (s *DockerSuite) TestExecInteractiveStdinClose(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "/bin/cat")
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "/bin/cat")
 	contID := strings.TrimSpace(out)
 	contID := strings.TrimSpace(out)
@@ -44,7 +44,7 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestExecTTY(c *check.C) {
+func (s *DockerSuite) TestExecTTY(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	dockerCmd(c, "run", "-d", "--name=test", "busybox", "sh", "-c", "echo hello > /foo && top")
 	dockerCmd(c, "run", "-d", "--name=test", "busybox", "sh", "-c", "echo hello > /foo && top")
 
 
@@ -74,7 +74,7 @@ func (s *DockerSuite) TestExecTTY(c *check.C) {
 }
 }
 
 
 // Test the TERM env var is set when -t is provided on exec
 // Test the TERM env var is set when -t is provided on exec
-func (s *DockerSuite) TestExecWithTERM(c *check.C) {
+func (s *DockerSuite) TestExecWithTERM(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	out, _ := dockerCmd(c, "run", "-id", "busybox", "/bin/cat")
 	out, _ := dockerCmd(c, "run", "-id", "busybox", "/bin/cat")
 	contID := strings.TrimSpace(out)
 	contID := strings.TrimSpace(out)
@@ -86,7 +86,7 @@ func (s *DockerSuite) TestExecWithTERM(c *check.C) {
 
 
 // Test that the TERM env var is not set on exec when -t is not provided, even if it was set
 // Test that the TERM env var is not set on exec when -t is not provided, even if it was set
 // on run
 // on run
-func (s *DockerSuite) TestExecWithNoTERM(c *check.C) {
+func (s *DockerSuite) TestExecWithNoTERM(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "/bin/cat")
 	out, _ := dockerCmd(c, "run", "-itd", "busybox", "/bin/cat")
 	contID := strings.TrimSpace(out)
 	contID := strings.TrimSpace(out)

+ 94 - 107
integration-cli/docker_cli_external_volume_driver_unix_test.go → integration-cli/docker_cli_external_volume_driver_test.go

@@ -1,5 +1,3 @@
-// +build !windows
-
 package main
 package main
 
 
 import (
 import (
@@ -13,26 +11,19 @@ import (
 	"os/exec"
 	"os/exec"
 	"path/filepath"
 	"path/filepath"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/volume"
 	"github.com/docker/docker/volume"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 const volumePluginName = "test-external-volume-driver"
 const volumePluginName = "test-external-volume-driver"
 
 
-func init() {
-	check.Suite(&DockerExternalVolumeSuite{
-		ds: &DockerSuite{},
-	})
-}
-
 type eventCounter struct {
 type eventCounter struct {
 	activations int
 	activations int
 	creations   int
 	creations   int
@@ -51,20 +42,20 @@ type DockerExternalVolumeSuite struct {
 	*volumePlugin
 	*volumePlugin
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) {
+func (s *DockerExternalVolumeSuite) SetUpTest(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.ec = &eventCounter{}
 	s.ec = &eventCounter{}
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TearDownTest(c *check.C) {
+func (s *DockerExternalVolumeSuite) TearDownTest(c *testing.T) {
 	if s.d != nil {
 	if s.d != nil {
 		s.d.Stop(c)
 		s.d.Stop(c)
 		s.ds.TearDownTest(c)
 		s.ds.TearDownTest(c)
 	}
 	}
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) SetUpSuite(c *check.C) {
+func (s *DockerExternalVolumeSuite) SetUpSuite(c *testing.T) {
 	s.volumePlugin = newVolumePlugin(c, volumePluginName)
 	s.volumePlugin = newVolumePlugin(c, volumePluginName)
 }
 }
 
 
@@ -86,7 +77,7 @@ func (p *volumePlugin) Close() {
 	p.Server.Close()
 	p.Server.Close()
 }
 }
 
 
-func newVolumePlugin(c *check.C, name string) *volumePlugin {
+func newVolumePlugin(c *testing.T, name string) *volumePlugin {
 	mux := http.NewServeMux()
 	mux := http.NewServeMux()
 	s := &volumePlugin{Server: httptest.NewServer(mux), ec: &eventCounter{}, vols: make(map[string]vol)}
 	s := &volumePlugin{Server: httptest.NewServer(mux), ec: &eventCounter{}, vols: make(map[string]vol)}
 
 
@@ -276,62 +267,59 @@ func newVolumePlugin(c *check.C, name string) *volumePlugin {
 	return s
 	return s
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TearDownSuite(c *check.C) {
+func (s *DockerExternalVolumeSuite) TearDownSuite(c *testing.T) {
 	s.volumePlugin.Close()
 	s.volumePlugin.Close()
 
 
 	err := os.RemoveAll("/etc/docker/plugins")
 	err := os.RemoveAll("/etc/docker/plugins")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestVolumeCLICreateOptionConflict(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestVolumeCLICreateOptionConflict(c *testing.T) {
 	dockerCmd(c, "volume", "create", "test")
 	dockerCmd(c, "volume", "create", "test")
 
 
 	out, _, err := dockerCmdWithError("volume", "create", "test", "--driver", volumePluginName)
 	out, _, err := dockerCmdWithError("volume", "create", "test", "--driver", volumePluginName)
-	c.Assert(err, check.NotNil, check.Commentf("volume create exception name already in use with another driver"))
-	c.Assert(out, checker.Contains, "must be unique")
-
+	assert.Assert(c, err != nil, "volume create exception name already in use with another driver")
+	assert.Assert(c, strings.Contains(out, "must be unique"))
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Driver }}", "test")
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Driver }}", "test")
 	_, _, err = dockerCmdWithError("volume", "create", "test", "--driver", strings.TrimSpace(out))
 	_, _, err = dockerCmdWithError("volume", "create", "test", "--driver", strings.TrimSpace(out))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamed(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamed(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
 	out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
-	c.Assert(out, checker.Contains, s.Server.URL)
-
+	assert.Assert(c, strings.Contains(out, s.Server.URL))
 	_, err = s.d.Cmd("volume", "rm", "external-volume-test")
 	_, err = s.d.Cmd("volume", "rm", "external-volume-test")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	p := hostVolumePath("external-volume-test")
 	p := hostVolumePath("external-volume-test")
 	_, err = os.Lstat(p)
 	_, err = os.Lstat(p)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(os.IsNotExist(err), checker.True, check.Commentf("Expected volume path in host to not exist: %s, %v\n", p, err))
+	assert.Assert(c, os.IsNotExist(err), "Expected volume path in host to not exist: %s, %v\n", p, err)
 
 
-	c.Assert(s.ec.activations, checker.Equals, 1)
-	c.Assert(s.ec.creations, checker.Equals, 1)
-	c.Assert(s.ec.removals, checker.Equals, 1)
-	c.Assert(s.ec.mounts, checker.Equals, 1)
-	c.Assert(s.ec.unmounts, checker.Equals, 1)
+	assert.Equal(c, s.ec.activations, 1)
+	assert.Equal(c, s.ec.creations, 1)
+	assert.Equal(c, s.ec.removals, 1)
+	assert.Equal(c, s.ec.mounts, 1)
+	assert.Equal(c, s.ec.unmounts, 1)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
 	out, err := s.d.Cmd("run", "--rm", "--name", "test-data", "-v", "/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
-	c.Assert(out, checker.Contains, s.Server.URL)
-
-	c.Assert(s.ec.activations, checker.Equals, 1)
-	c.Assert(s.ec.creations, checker.Equals, 1)
-	c.Assert(s.ec.removals, checker.Equals, 1)
-	c.Assert(s.ec.mounts, checker.Equals, 1)
-	c.Assert(s.ec.unmounts, checker.Equals, 1)
+	assert.Assert(c, strings.Contains(out, s.Server.URL))
+	assert.Equal(c, s.ec.activations, 1)
+	assert.Equal(c, s.ec.creations, 1)
+	assert.Equal(c, s.ec.removals, 1)
+	assert.Equal(c, s.ec.mounts, 1)
+	assert.Equal(c, s.ec.unmounts, 1)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	out, err := s.d.Cmd("run", "--name", "vol-test1", "-v", "/foo", "--volume-driver", volumePluginName, "busybox:latest")
 	out, err := s.d.Cmd("run", "--name", "vol-test1", "-v", "/foo", "--volume-driver", volumePluginName, "busybox:latest")
@@ -343,14 +331,14 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *check
 	out, err = s.d.Cmd("rm", "-fv", "vol-test1")
 	out, err = s.d.Cmd("rm", "-fv", "vol-test1")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
-	c.Assert(s.ec.activations, checker.Equals, 1)
-	c.Assert(s.ec.creations, checker.Equals, 1)
-	c.Assert(s.ec.removals, checker.Equals, 1)
-	c.Assert(s.ec.mounts, checker.Equals, 2)
-	c.Assert(s.ec.unmounts, checker.Equals, 2)
+	assert.Equal(c, s.ec.activations, 1)
+	assert.Equal(c, s.ec.creations, 1)
+	assert.Equal(c, s.ec.removals, 1)
+	assert.Equal(c, s.ec.mounts, 2)
+	assert.Equal(c, s.ec.unmounts, 2)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	out, err := s.d.Cmd("run", "--name", "vol-test1", "-v", "/foo", "--volume-driver", volumePluginName, "busybox:latest")
 	out, err := s.d.Cmd("run", "--name", "vol-test1", "-v", "/foo", "--volume-driver", volumePluginName, "busybox:latest")
@@ -359,11 +347,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *c
 	out, err = s.d.Cmd("rm", "-fv", "vol-test1")
 	out, err = s.d.Cmd("rm", "-fv", "vol-test1")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
-	c.Assert(s.ec.activations, checker.Equals, 1)
-	c.Assert(s.ec.creations, checker.Equals, 1)
-	c.Assert(s.ec.removals, checker.Equals, 1)
-	c.Assert(s.ec.mounts, checker.Equals, 1)
-	c.Assert(s.ec.unmounts, checker.Equals, 1)
+	assert.Equal(c, s.ec.activations, 1)
+	assert.Equal(c, s.ec.creations, 1)
+	assert.Equal(c, s.ec.removals, 1)
+	assert.Equal(c, s.ec.mounts, 1)
+	assert.Equal(c, s.ec.unmounts, 1)
 }
 }
 
 
 func hostVolumePath(name string) string {
 func hostVolumePath(name string) string {
@@ -371,7 +359,7 @@ func hostVolumePath(name string) string {
 }
 }
 
 
 // Make sure a request to use a down driver doesn't block other requests
 // Make sure a request to use a down driver doesn't block other requests
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *testing.T) {
 	specPath := "/etc/docker/plugins/down-driver.spec"
 	specPath := "/etc/docker/plugins/down-driver.spec"
 	err := ioutil.WriteFile(specPath, []byte("tcp://127.0.0.7:9999"), 0644)
 	err := ioutil.WriteFile(specPath, []byte("tcp://127.0.0.7:9999"), 0644)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -382,10 +370,10 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *
 	cmd1 := exec.Command(dockerBinary, "volume", "create", "-d", "down-driver")
 	cmd1 := exec.Command(dockerBinary, "volume", "create", "-d", "down-driver")
 	cmd2 := exec.Command(dockerBinary, "volume", "create")
 	cmd2 := exec.Command(dockerBinary, "volume", "create")
 
 
-	c.Assert(cmd1.Start(), checker.IsNil)
+	assert.Assert(c, cmd1.Start() == nil)
 	defer cmd1.Process.Kill()
 	defer cmd1.Process.Kill()
 	time.Sleep(100 * time.Millisecond) // ensure API has been called
 	time.Sleep(100 * time.Millisecond) // ensure API has been called
-	c.Assert(cmd2.Start(), checker.IsNil)
+	assert.Assert(c, cmd2.Start() == nil)
 
 
 	go func() {
 	go func() {
 		cmd1.Wait()
 		cmd1.Wait()
@@ -407,7 +395,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverLookupNotBlocked(c *
 	}
 	}
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyExists(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyExists(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 	driverName := "test-external-volume-driver-retry"
 	driverName := "test-external-volume-driver-retry"
 
 
@@ -437,14 +425,14 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyE
 	_, err := s.d.Cmd("volume", "rm", "external-volume-test")
 	_, err := s.d.Cmd("volume", "rm", "external-volume-test")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
-	c.Assert(p.ec.activations, checker.Equals, 1)
-	c.Assert(p.ec.creations, checker.Equals, 1)
-	c.Assert(p.ec.removals, checker.Equals, 1)
-	c.Assert(p.ec.mounts, checker.Equals, 1)
-	c.Assert(p.ec.unmounts, checker.Equals, 1)
+	assert.Equal(c, p.ec.activations, 1)
+	assert.Equal(c, p.ec.creations, 1)
+	assert.Equal(c, p.ec.removals, 1)
+	assert.Equal(c, p.ec.mounts, 1)
+	assert.Equal(c, p.ec.unmounts, 1)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c *testing.T) {
 	dockerCmd(c, "volume", "create", "-d", volumePluginName, "foo")
 	dockerCmd(c, "volume", "create", "-d", volumePluginName, "foo")
 	dockerCmd(c, "run", "-d", "--name", "testing", "-v", "foo:/bar", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "testing", "-v", "foo:/bar", "busybox", "top")
 
 
@@ -453,31 +441,31 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c
 		Driver string
 		Driver string
 	}
 	}
 	out := inspectFieldJSON(c, "testing", "Mounts")
 	out := inspectFieldJSON(c, "testing", "Mounts")
-	c.Assert(json.NewDecoder(strings.NewReader(out)).Decode(&mounts), checker.IsNil)
-	c.Assert(len(mounts), checker.Equals, 1, check.Commentf("%s", out))
-	c.Assert(mounts[0].Name, checker.Equals, "foo")
-	c.Assert(mounts[0].Driver, checker.Equals, volumePluginName)
+	assert.Assert(c, json.NewDecoder(strings.NewReader(out)).Decode(&mounts) == nil)
+	assert.Equal(c, len(mounts), 1, fmt.Sprintf("%s", out))
+	assert.Equal(c, mounts[0].Name, "foo")
+	assert.Equal(c, mounts[0].Driver, volumePluginName)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverList(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverList(c *testing.T) {
 	dockerCmd(c, "volume", "create", "-d", volumePluginName, "abc3")
 	dockerCmd(c, "volume", "create", "-d", volumePluginName, "abc3")
 	out, _ := dockerCmd(c, "volume", "ls")
 	out, _ := dockerCmd(c, "volume", "ls")
 	ls := strings.Split(strings.TrimSpace(out), "\n")
 	ls := strings.Split(strings.TrimSpace(out), "\n")
-	c.Assert(len(ls), check.Equals, 2, check.Commentf("\n%s", out))
+	assert.Equal(c, len(ls), 2, fmt.Sprintf("\n%s", out))
 
 
 	vol := strings.Fields(ls[len(ls)-1])
 	vol := strings.Fields(ls[len(ls)-1])
-	c.Assert(len(vol), check.Equals, 2, check.Commentf("%v", vol))
-	c.Assert(vol[0], check.Equals, volumePluginName)
-	c.Assert(vol[1], check.Equals, "abc3")
+	assert.Equal(c, len(vol), 2, fmt.Sprintf("%v", vol))
+	assert.Equal(c, vol[0], volumePluginName)
+	assert.Equal(c, vol[1], "abc3")
 
 
-	c.Assert(s.ec.lists, check.Equals, 1)
+	assert.Equal(c, s.ec.lists, 1)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *testing.T) {
 	out, _, err := dockerCmdWithError("volume", "inspect", "dummy")
 	out, _, err := dockerCmdWithError("volume", "inspect", "dummy")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
-	c.Assert(out, checker.Contains, "No such volume")
-	c.Assert(s.ec.gets, check.Equals, 1)
+	assert.Assert(c, strings.Contains(out, "No such volume"))
+	assert.Equal(c, s.ec.gets, 1)
 
 
 	dockerCmd(c, "volume", "create", "test", "-d", volumePluginName)
 	dockerCmd(c, "volume", "create", "test", "-d", volumePluginName)
 	out, _ = dockerCmd(c, "volume", "inspect", "test")
 	out, _ = dockerCmd(c, "volume", "inspect", "test")
@@ -487,26 +475,26 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *check.C) {
 	}
 	}
 	var st []vol
 	var st []vol
 
 
-	c.Assert(json.Unmarshal([]byte(out), &st), checker.IsNil)
-	c.Assert(st, checker.HasLen, 1)
-	c.Assert(st[0].Status, checker.HasLen, 1, check.Commentf("%v", st[0]))
-	c.Assert(st[0].Status["Hello"], checker.Equals, "world", check.Commentf("%v", st[0].Status))
+	assert.Assert(c, json.Unmarshal([]byte(out), &st) == nil)
+	assert.Equal(c, len(st), 1)
+	assert.Equal(c, len(st[0].Status), 1, fmt.Sprintf("%v", st[0]))
+	assert.Equal(c, st[0].Status["Hello"], "world", fmt.Sprintf("%v", st[0].Status))
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverWithDaemonRestart(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverWithDaemonRestart(c *testing.T) {
 	dockerCmd(c, "volume", "create", "-d", volumePluginName, "abc1")
 	dockerCmd(c, "volume", "create", "-d", volumePluginName, "abc1")
 	s.d.Restart(c)
 	s.d.Restart(c)
 
 
 	dockerCmd(c, "run", "--name=test", "-v", "abc1:/foo", "busybox", "true")
 	dockerCmd(c, "run", "--name=test", "-v", "abc1:/foo", "busybox", "true")
 	var mounts []types.MountPoint
 	var mounts []types.MountPoint
 	inspectFieldAndUnmarshall(c, "test", "Mounts", &mounts)
 	inspectFieldAndUnmarshall(c, "test", "Mounts", &mounts)
-	c.Assert(mounts, checker.HasLen, 1)
-	c.Assert(mounts[0].Driver, checker.Equals, volumePluginName)
+	assert.Equal(c, len(mounts), 1)
+	assert.Equal(c, mounts[0].Driver, volumePluginName)
 }
 }
 
 
 // Ensures that the daemon handles when the plugin responds to a `Get` request with a null volume and a null error.
 // Ensures that the daemon handles when the plugin responds to a `Get` request with a null volume and a null error.
 // Prior the daemon would panic in this scenario.
 // Prior the daemon would panic in this scenario.
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGetEmptyResponse(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGetEmptyResponse(c *testing.T) {
 	s.d.Start(c)
 	s.d.Start(c)
 
 
 	out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, "abc2", "--opt", "ninja=1")
 	out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, "abc2", "--opt", "ninja=1")
@@ -514,27 +502,27 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGetEmptyResponse(c *
 
 
 	out, err = s.d.Cmd("volume", "inspect", "abc2")
 	out, err = s.d.Cmd("volume", "inspect", "abc2")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
-	c.Assert(out, checker.Contains, "No such volume")
+	assert.Assert(c, strings.Contains(out, "No such volume"))
 }
 }
 
 
 // Ensure only cached paths are used in volume list to prevent N+1 calls to `VolumeDriver.Path`
 // Ensure only cached paths are used in volume list to prevent N+1 calls to `VolumeDriver.Path`
 //
 //
 // TODO(@cpuguy83): This test is testing internal implementation. In all the cases here, there may not even be a path
 // TODO(@cpuguy83): This test is testing internal implementation. In all the cases here, there may not even be a path
 // 	available because the volume is not even mounted. Consider removing this test.
 // 	available because the volume is not even mounted. Consider removing this test.
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverPathCalls(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverPathCalls(c *testing.T) {
 	s.d.Start(c)
 	s.d.Start(c)
-	c.Assert(s.ec.paths, checker.Equals, 0)
+	assert.Equal(c, s.ec.paths, 0)
 
 
 	out, err := s.d.Cmd("volume", "create", "test", "--driver=test-external-volume-driver")
 	out, err := s.d.Cmd("volume", "create", "test", "--driver=test-external-volume-driver")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
-	c.Assert(s.ec.paths, checker.Equals, 0)
+	assert.Equal(c, s.ec.paths, 0)
 
 
 	out, err = s.d.Cmd("volume", "ls")
 	out, err = s.d.Cmd("volume", "ls")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
-	c.Assert(s.ec.paths, checker.Equals, 0)
+	assert.Equal(c, s.ec.paths, 0)
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverMountID(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverMountID(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	out, err := s.d.Cmd("run", "--rm", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
 	out, err := s.d.Cmd("run", "--rm", "-v", "external-volume-test:/tmp/external-volume-test", "--volume-driver", volumePluginName, "busybox:latest", "cat", "/tmp/external-volume-test/test")
@@ -543,21 +531,21 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverMountID(c *check.C)
 }
 }
 
 
 // Check that VolumeDriver.Capabilities gets called, and only called once
 // Check that VolumeDriver.Capabilities gets called, and only called once
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverCapabilities(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverCapabilities(c *testing.T) {
 	s.d.Start(c)
 	s.d.Start(c)
-	c.Assert(s.ec.caps, checker.Equals, 0)
+	assert.Equal(c, s.ec.caps, 0)
 
 
 	for i := 0; i < 3; i++ {
 	for i := 0; i < 3; i++ {
 		out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, fmt.Sprintf("test%d", i))
 		out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, fmt.Sprintf("test%d", i))
 		assert.NilError(c, err, out)
 		assert.NilError(c, err, out)
-		c.Assert(s.ec.caps, checker.Equals, 1)
+		assert.Equal(c, s.ec.caps, 1)
 		out, err = s.d.Cmd("volume", "inspect", "--format={{.Scope}}", fmt.Sprintf("test%d", i))
 		out, err = s.d.Cmd("volume", "inspect", "--format={{.Scope}}", fmt.Sprintf("test%d", i))
 		assert.NilError(c, err)
 		assert.NilError(c, err)
 		assert.Equal(c, strings.TrimSpace(out), volume.GlobalScope)
 		assert.Equal(c, strings.TrimSpace(out), volume.GlobalScope)
 	}
 	}
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *testing.T) {
 	driverName := stringid.GenerateRandomID()
 	driverName := stringid.GenerateRandomID()
 	p := newVolumePlugin(c, driverName)
 	p := newVolumePlugin(c, driverName)
 	defer p.Close()
 	defer p.Close()
@@ -569,8 +557,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c
 
 
 	out, err = s.d.Cmd("volume", "create", "-d", "local", "--name", "test")
 	out, err = s.d.Cmd("volume", "create", "-d", "local", "--name", "test")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
-	c.Assert(out, checker.Contains, "must be unique")
-
+	assert.Assert(c, strings.Contains(out, "must be unique"))
 	// simulate out of band volume deletion on plugin level
 	// simulate out of band volume deletion on plugin level
 	delete(p.vols, "test")
 	delete(p.vols, "test")
 
 
@@ -583,11 +570,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c
 	var vs []types.Volume
 	var vs []types.Volume
 	err = json.Unmarshal([]byte(out), &vs)
 	err = json.Unmarshal([]byte(out), &vs)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(vs, checker.HasLen, 1)
-	c.Assert(vs[0].Driver, checker.Equals, driverName)
-	c.Assert(vs[0].Options, checker.NotNil)
-	c.Assert(vs[0].Options["foo"], checker.Equals, "bar")
-	c.Assert(vs[0].Driver, checker.Equals, driverName)
+	assert.Equal(c, len(vs), 1)
+	assert.Equal(c, vs[0].Driver, driverName)
+	assert.Assert(c, vs[0].Options != nil)
+	assert.Equal(c, vs[0].Options["foo"], "bar")
+	assert.Equal(c, vs[0].Driver, driverName)
 
 
 	// simulate out of band volume deletion on plugin level
 	// simulate out of band volume deletion on plugin level
 	delete(p.vols, "test")
 	delete(p.vols, "test")
@@ -601,32 +588,32 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *c
 	vs = nil
 	vs = nil
 	err = json.Unmarshal([]byte(out), &vs)
 	err = json.Unmarshal([]byte(out), &vs)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(vs, checker.HasLen, 1)
-	c.Assert(vs[0].Options, checker.HasLen, 0)
-	c.Assert(vs[0].Driver, checker.Equals, "local")
+	assert.Equal(c, len(vs), 1)
+	assert.Equal(c, len(vs[0].Options), 0)
+	assert.Equal(c, vs[0].Driver, "local")
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnMountFail(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnMountFail(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 	s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--opt=invalidOption=1", "--name=testumount")
 	s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--opt=invalidOption=1", "--name=testumount")
 
 
 	out, _ := s.d.Cmd("run", "-v", "testumount:/foo", "busybox", "true")
 	out, _ := s.d.Cmd("run", "-v", "testumount:/foo", "busybox", "true")
-	c.Assert(s.ec.unmounts, checker.Equals, 0, check.Commentf("%s", out))
+	assert.Equal(c, s.ec.unmounts, 0, fmt.Sprintf("%s", out))
 	out, _ = s.d.Cmd("run", "-w", "/foo", "-v", "testumount:/foo", "busybox", "true")
 	out, _ = s.d.Cmd("run", "-w", "/foo", "-v", "testumount:/foo", "busybox", "true")
-	c.Assert(s.ec.unmounts, checker.Equals, 0, check.Commentf("%s", out))
+	assert.Equal(c, s.ec.unmounts, 0, fmt.Sprintf("%s", out))
 }
 }
 
 
-func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnCp(c *check.C) {
+func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnCp(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 	s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--name=test")
 	s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--name=test")
 
 
 	out, _ := s.d.Cmd("run", "-d", "--name=test", "-v", "test:/foo", "busybox", "/bin/sh", "-c", "touch /test && top")
 	out, _ := s.d.Cmd("run", "-d", "--name=test", "-v", "test:/foo", "busybox", "/bin/sh", "-c", "touch /test && top")
-	c.Assert(s.ec.mounts, checker.Equals, 1, check.Commentf("%s", out))
+	assert.Equal(c, s.ec.mounts, 1, fmt.Sprintf("%s", out))
 
 
 	out, _ = s.d.Cmd("cp", "test:/test", "/tmp/test")
 	out, _ = s.d.Cmd("cp", "test:/test", "/tmp/test")
-	c.Assert(s.ec.mounts, checker.Equals, 2, check.Commentf("%s", out))
-	c.Assert(s.ec.unmounts, checker.Equals, 1, check.Commentf("%s", out))
+	assert.Equal(c, s.ec.mounts, 2, fmt.Sprintf("%s", out))
+	assert.Equal(c, s.ec.unmounts, 1, fmt.Sprintf("%s", out))
 
 
 	out, _ = s.d.Cmd("kill", "test")
 	out, _ = s.d.Cmd("kill", "test")
-	c.Assert(s.ec.unmounts, checker.Equals, 2, check.Commentf("%s", out))
+	assert.Equal(c, s.ec.unmounts, 2, fmt.Sprintf("%s", out))
 }
 }

+ 23 - 23
integration-cli/docker_cli_health_test.go

@@ -4,15 +4,15 @@ import (
 	"encoding/json"
 	"encoding/json"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
+	"gotest.tools/assert"
 )
 )
 
 
-func waitForHealthStatus(c *check.C, name string, prev string, expected string) {
+func waitForHealthStatus(c *testing.T, name string, prev string, expected string) {
 	prev = prev + "\n"
 	prev = prev + "\n"
 	expected = expected + "\n"
 	expected = expected + "\n"
 	for {
 	for {
@@ -20,7 +20,7 @@ func waitForHealthStatus(c *check.C, name string, prev string, expected string)
 		if out == expected {
 		if out == expected {
 			return
 			return
 		}
 		}
-		c.Check(out, checker.Equals, prev)
+		assert.Equal(c, out, prev)
 		if out != prev {
 		if out != prev {
 			return
 			return
 		}
 		}
@@ -28,15 +28,15 @@ func waitForHealthStatus(c *check.C, name string, prev string, expected string)
 	}
 	}
 }
 }
 
 
-func getHealth(c *check.C, name string) *types.Health {
+func getHealth(c *testing.T, name string) *types.Health {
 	out, _ := dockerCmd(c, "inspect", "--format={{json .State.Health}}", name)
 	out, _ := dockerCmd(c, "inspect", "--format={{json .State.Health}}", name)
 	var health types.Health
 	var health types.Health
 	err := json.Unmarshal([]byte(out), &health)
 	err := json.Unmarshal([]byte(out), &health)
-	c.Check(err, checker.Equals, nil)
+	assert.Equal(c, err, nil)
 	return &health
 	return &health
 }
 }
 
 
-func (s *DockerSuite) TestHealth(c *check.C) {
+func (s *DockerSuite) TestHealth(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 
 
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
@@ -54,12 +54,12 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 	cid, _ := dockerCmd(c, "create", "--name", name, imageName)
 	cid, _ := dockerCmd(c, "create", "--name", name, imageName)
 	out, _ := dockerCmd(c, "ps", "-a", "--format={{.ID}} {{.Status}}")
 	out, _ := dockerCmd(c, "ps", "-a", "--format={{.ID}} {{.Status}}")
 	out = RemoveOutputForExistingElements(out, existingContainers)
 	out = RemoveOutputForExistingElements(out, existingContainers)
-	c.Check(out, checker.Equals, cid[:12]+" Created\n")
+	assert.Equal(c, out, cid[:12]+" Created\n")
 
 
 	// Inspect the options
 	// Inspect the options
 	out, _ = dockerCmd(c, "inspect",
 	out, _ = dockerCmd(c, "inspect",
 		"--format=timeout={{.Config.Healthcheck.Timeout}} interval={{.Config.Healthcheck.Interval}} retries={{.Config.Healthcheck.Retries}} test={{.Config.Healthcheck.Test}}", name)
 		"--format=timeout={{.Config.Healthcheck.Timeout}} interval={{.Config.Healthcheck.Interval}} retries={{.Config.Healthcheck.Retries}} test={{.Config.Healthcheck.Test}}", name)
-	c.Check(out, checker.Equals, "timeout=30s interval=1s retries=0 test=[CMD-SHELL cat /status]\n")
+	assert.Equal(c, out, "timeout=30s interval=1s retries=0 test=[CMD-SHELL cat /status]\n")
 
 
 	// Start
 	// Start
 	dockerCmd(c, "start", name)
 	dockerCmd(c, "start", name)
@@ -71,7 +71,7 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 
 
 	// Inspect the status
 	// Inspect the status
 	out, _ = dockerCmd(c, "inspect", "--format={{.State.Health.Status}}", name)
 	out, _ = dockerCmd(c, "inspect", "--format={{.State.Health.Status}}", name)
-	c.Check(out, checker.Equals, "unhealthy\n")
+	assert.Equal(c, out, "unhealthy\n")
 
 
 	// Make it healthy again
 	// Make it healthy again
 	dockerCmd(c, "exec", name, "touch", "/status")
 	dockerCmd(c, "exec", name, "touch", "/status")
@@ -83,7 +83,7 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 	// Disable the check from the CLI
 	// Disable the check from the CLI
 	dockerCmd(c, "create", "--name=noh", "--no-healthcheck", imageName)
 	dockerCmd(c, "create", "--name=noh", "--no-healthcheck", imageName)
 	out, _ = dockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "noh")
 	out, _ = dockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "noh")
-	c.Check(out, checker.Equals, "[NONE]\n")
+	assert.Equal(c, out, "[NONE]\n")
 	dockerCmd(c, "rm", "noh")
 	dockerCmd(c, "rm", "noh")
 
 
 	// Disable the check with a new build
 	// Disable the check with a new build
@@ -91,7 +91,7 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 		HEALTHCHECK NONE`))
 		HEALTHCHECK NONE`))
 
 
 	out, _ = dockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "no_healthcheck")
 	out, _ = dockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "no_healthcheck")
-	c.Check(out, checker.Equals, "[NONE]\n")
+	assert.Equal(c, out, "[NONE]\n")
 
 
 	// Enable the checks from the CLI
 	// Enable the checks from the CLI
 	_, _ = dockerCmd(c, "run", "-d", "--name=fatal_healthcheck",
 	_, _ = dockerCmd(c, "run", "-d", "--name=fatal_healthcheck",
@@ -101,11 +101,11 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 		"no_healthcheck")
 		"no_healthcheck")
 	waitForHealthStatus(c, "fatal_healthcheck", "starting", "healthy")
 	waitForHealthStatus(c, "fatal_healthcheck", "starting", "healthy")
 	health := getHealth(c, "fatal_healthcheck")
 	health := getHealth(c, "fatal_healthcheck")
-	c.Check(health.Status, checker.Equals, "healthy")
-	c.Check(health.FailingStreak, checker.Equals, 0)
+	assert.Equal(c, health.Status, "healthy")
+	assert.Equal(c, health.FailingStreak, 0)
 	last := health.Log[len(health.Log)-1]
 	last := health.Log[len(health.Log)-1]
-	c.Check(last.ExitCode, checker.Equals, 0)
-	c.Check(last.Output, checker.Equals, "OK\n")
+	assert.Equal(c, last.ExitCode, 0)
+	assert.Equal(c, last.Output, "OK\n")
 
 
 	// Fail the check
 	// Fail the check
 	dockerCmd(c, "exec", "fatal_healthcheck", "rm", "/status")
 	dockerCmd(c, "exec", "fatal_healthcheck", "rm", "/status")
@@ -113,8 +113,8 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 
 
 	failsStr, _ := dockerCmd(c, "inspect", "--format={{.State.Health.FailingStreak}}", "fatal_healthcheck")
 	failsStr, _ := dockerCmd(c, "inspect", "--format={{.State.Health.FailingStreak}}", "fatal_healthcheck")
 	fails, err := strconv.Atoi(strings.TrimSpace(failsStr))
 	fails, err := strconv.Atoi(strings.TrimSpace(failsStr))
-	c.Check(err, check.IsNil)
-	c.Check(fails >= 3, checker.Equals, true)
+	assert.Assert(c, err == nil)
+	assert.Equal(c, fails >= 3, true)
 	dockerCmd(c, "rm", "-f", "fatal_healthcheck")
 	dockerCmd(c, "rm", "-f", "fatal_healthcheck")
 
 
 	// Check timeout
 	// Check timeout
@@ -125,9 +125,9 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 	waitForHealthStatus(c, "test", "starting", "unhealthy")
 	waitForHealthStatus(c, "test", "starting", "unhealthy")
 	health = getHealth(c, "test")
 	health = getHealth(c, "test")
 	last = health.Log[len(health.Log)-1]
 	last = health.Log[len(health.Log)-1]
-	c.Check(health.Status, checker.Equals, "unhealthy")
-	c.Check(last.ExitCode, checker.Equals, -1)
-	c.Check(last.Output, checker.Equals, "Health check exceeded timeout (1s)")
+	assert.Equal(c, health.Status, "unhealthy")
+	assert.Equal(c, last.ExitCode, -1)
+	assert.Equal(c, last.Output, "Health check exceeded timeout (1s)")
 	dockerCmd(c, "rm", "-f", "test")
 	dockerCmd(c, "rm", "-f", "test")
 
 
 	// Check JSON-format
 	// Check JSON-format
@@ -139,12 +139,12 @@ func (s *DockerSuite) TestHealth(c *check.C) {
 		  CMD ["cat", "/my status"]`))
 		  CMD ["cat", "/my status"]`))
 	out, _ = dockerCmd(c, "inspect",
 	out, _ = dockerCmd(c, "inspect",
 		"--format={{.Config.Healthcheck.Test}}", imageName)
 		"--format={{.Config.Healthcheck.Test}}", imageName)
-	c.Check(out, checker.Equals, "[CMD cat /my status]\n")
+	assert.Equal(c, out, "[CMD cat /my status]\n")
 
 
 }
 }
 
 
 // GitHub #33021
 // GitHub #33021
-func (s *DockerSuite) TestUnsetEnvVarHealthCheck(c *check.C) {
+func (s *DockerSuite) TestUnsetEnvVarHealthCheck(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 
 
 	imageName := "testhealth"
 	imageName := "testhealth"

+ 15 - 13
integration-cli/docker_cli_history_test.go

@@ -5,15 +5,16 @@ import (
 	"regexp"
 	"regexp"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
+	"gotest.tools/assert"
+	"gotest.tools/assert/cmp"
 )
 )
 
 
 // This is a heisen-test.  Because the created timestamp of images and the behavior of
 // This is a heisen-test.  Because the created timestamp of images and the behavior of
 // sort is not predictable it doesn't always fail.
 // sort is not predictable it doesn't always fail.
-func (s *DockerSuite) TestBuildHistory(c *check.C) {
+func (s *DockerSuite) TestBuildHistory(c *testing.T) {
 	name := "testbuildhistory"
 	name := "testbuildhistory"
 	buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+`
 	buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+`
 LABEL label.A="A"
 LABEL label.A="A"
@@ -50,21 +51,21 @@ LABEL label.Z="Z"`))
 	for i := 0; i < 26; i++ {
 	for i := 0; i < 26; i++ {
 		echoValue := fmt.Sprintf("LABEL label.%s=%s", expectedValues[i], expectedValues[i])
 		echoValue := fmt.Sprintf("LABEL label.%s=%s", expectedValues[i], expectedValues[i])
 		actualValue := actualValues[i]
 		actualValue := actualValues[i]
-		c.Assert(actualValue, checker.Contains, echoValue)
+		assert.Assert(c, strings.Contains(actualValue, echoValue))
 	}
 	}
 
 
 }
 }
 
 
-func (s *DockerSuite) TestHistoryExistentImage(c *check.C) {
+func (s *DockerSuite) TestHistoryExistentImage(c *testing.T) {
 	dockerCmd(c, "history", "busybox")
 	dockerCmd(c, "history", "busybox")
 }
 }
 
 
-func (s *DockerSuite) TestHistoryNonExistentImage(c *check.C) {
+func (s *DockerSuite) TestHistoryNonExistentImage(c *testing.T) {
 	_, _, err := dockerCmdWithError("history", "testHistoryNonExistentImage")
 	_, _, err := dockerCmdWithError("history", "testHistoryNonExistentImage")
-	c.Assert(err, checker.NotNil, check.Commentf("history on a non-existent image should fail."))
+	assert.Assert(c, err != nil, "history on a non-existent image should fail.")
 }
 }
 
 
-func (s *DockerSuite) TestHistoryImageWithComment(c *check.C) {
+func (s *DockerSuite) TestHistoryImageWithComment(c *testing.T) {
 	name := "testhistoryimagewithcomment"
 	name := "testhistoryimagewithcomment"
 
 
 	// make an image through docker commit <container id> [ -m messages ]
 	// make an image through docker commit <container id> [ -m messages ]
@@ -80,10 +81,10 @@ func (s *DockerSuite) TestHistoryImageWithComment(c *check.C) {
 	out, _ := dockerCmd(c, "history", name)
 	out, _ := dockerCmd(c, "history", name)
 	outputTabs := strings.Fields(strings.Split(out, "\n")[1])
 	outputTabs := strings.Fields(strings.Split(out, "\n")[1])
 	actualValue := outputTabs[len(outputTabs)-1]
 	actualValue := outputTabs[len(outputTabs)-1]
-	c.Assert(actualValue, checker.Contains, comment)
+	assert.Assert(c, strings.Contains(actualValue, comment))
 }
 }
 
 
-func (s *DockerSuite) TestHistoryHumanOptionFalse(c *check.C) {
+func (s *DockerSuite) TestHistoryHumanOptionFalse(c *testing.T) {
 	out, _ := dockerCmd(c, "history", "--human=false", "busybox")
 	out, _ := dockerCmd(c, "history", "--human=false", "busybox")
 	lines := strings.Split(out, "\n")
 	lines := strings.Split(out, "\n")
 	sizeColumnRegex, _ := regexp.Compile("SIZE +")
 	sizeColumnRegex, _ := regexp.Compile("SIZE +")
@@ -97,11 +98,11 @@ func (s *DockerSuite) TestHistoryHumanOptionFalse(c *check.C) {
 		sizeString := lines[i][startIndex:endIndex]
 		sizeString := lines[i][startIndex:endIndex]
 
 
 		_, err := strconv.Atoi(strings.TrimSpace(sizeString))
 		_, err := strconv.Atoi(strings.TrimSpace(sizeString))
-		c.Assert(err, checker.IsNil, check.Commentf("The size '%s' was not an Integer", sizeString))
+		assert.Assert(c, err == nil, "The size '%s' was not an Integer", sizeString)
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestHistoryHumanOptionTrue(c *check.C) {
+func (s *DockerSuite) TestHistoryHumanOptionTrue(c *testing.T) {
 	out, _ := dockerCmd(c, "history", "--human=true", "busybox")
 	out, _ := dockerCmd(c, "history", "--human=true", "busybox")
 	lines := strings.Split(out, "\n")
 	lines := strings.Split(out, "\n")
 	sizeColumnRegex, _ := regexp.Compile("SIZE +")
 	sizeColumnRegex, _ := regexp.Compile("SIZE +")
@@ -114,6 +115,7 @@ func (s *DockerSuite) TestHistoryHumanOptionTrue(c *check.C) {
 			endIndex = len(lines[i])
 			endIndex = len(lines[i])
 		}
 		}
 		sizeString := lines[i][startIndex:endIndex]
 		sizeString := lines[i][startIndex:endIndex]
-		c.Assert(strings.TrimSpace(sizeString), checker.Matches, humanSizeRegexRaw, check.Commentf("The size '%s' was not in human format", sizeString))
+		assert.Assert(c, cmp.Regexp("^"+humanSizeRegexRaw+"$",
+			strings.TrimSpace(sizeString)), fmt.Sprintf("The size '%s' was not in human format", sizeString))
 	}
 	}
 }
 }

+ 56 - 60
integration-cli/docker_cli_images_test.go

@@ -8,47 +8,45 @@ import (
 	"reflect"
 	"reflect"
 	"sort"
 	"sort"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/stringid"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestImagesEnsureImageIsListed(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureImageIsListed(c *testing.T) {
 	imagesOut, _ := dockerCmd(c, "images")
 	imagesOut, _ := dockerCmd(c, "images")
-	c.Assert(imagesOut, checker.Contains, "busybox")
+	assert.Assert(c, strings.Contains(imagesOut, "busybox"))
 }
 }
 
 
-func (s *DockerSuite) TestImagesEnsureImageWithTagIsListed(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureImageWithTagIsListed(c *testing.T) {
 	name := "imagewithtag"
 	name := "imagewithtag"
 	dockerCmd(c, "tag", "busybox", name+":v1")
 	dockerCmd(c, "tag", "busybox", name+":v1")
 	dockerCmd(c, "tag", "busybox", name+":v1v1")
 	dockerCmd(c, "tag", "busybox", name+":v1v1")
 	dockerCmd(c, "tag", "busybox", name+":v2")
 	dockerCmd(c, "tag", "busybox", name+":v2")
 
 
 	imagesOut, _ := dockerCmd(c, "images", name+":v1")
 	imagesOut, _ := dockerCmd(c, "images", name+":v1")
-	c.Assert(imagesOut, checker.Contains, name)
-	c.Assert(imagesOut, checker.Contains, "v1")
-	c.Assert(imagesOut, checker.Not(checker.Contains), "v2")
-	c.Assert(imagesOut, checker.Not(checker.Contains), "v1v1")
-
+	assert.Assert(c, strings.Contains(imagesOut, name))
+	assert.Assert(c, strings.Contains(imagesOut, "v1"))
+	assert.Assert(c, !strings.Contains(imagesOut, "v2"))
+	assert.Assert(c, !strings.Contains(imagesOut, "v1v1"))
 	imagesOut, _ = dockerCmd(c, "images", name)
 	imagesOut, _ = dockerCmd(c, "images", name)
-	c.Assert(imagesOut, checker.Contains, name)
-	c.Assert(imagesOut, checker.Contains, "v1")
-	c.Assert(imagesOut, checker.Contains, "v1v1")
-	c.Assert(imagesOut, checker.Contains, "v2")
+	assert.Assert(c, strings.Contains(imagesOut, name))
+	assert.Assert(c, strings.Contains(imagesOut, "v1"))
+	assert.Assert(c, strings.Contains(imagesOut, "v1v1"))
+	assert.Assert(c, strings.Contains(imagesOut, "v2"))
 }
 }
 
 
-func (s *DockerSuite) TestImagesEnsureImageWithBadTagIsNotListed(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureImageWithBadTagIsNotListed(c *testing.T) {
 	imagesOut, _ := dockerCmd(c, "images", "busybox:nonexistent")
 	imagesOut, _ := dockerCmd(c, "images", "busybox:nonexistent")
-	c.Assert(imagesOut, checker.Not(checker.Contains), "busybox")
+	assert.Assert(c, !strings.Contains(imagesOut, "busybox"))
 }
 }
 
 
-func (s *DockerSuite) TestImagesOrderedByCreationDate(c *check.C) {
+func (s *DockerSuite) TestImagesOrderedByCreationDate(c *testing.T) {
 	buildImageSuccessfully(c, "order:test_a", build.WithDockerfile(`FROM busybox
 	buildImageSuccessfully(c, "order:test_a", build.WithDockerfile(`FROM busybox
                 MAINTAINER dockerio1`))
                 MAINTAINER dockerio1`))
 	id1 := getIDByName(c, "order:test_a")
 	id1 := getIDByName(c, "order:test_a")
@@ -63,18 +61,18 @@ func (s *DockerSuite) TestImagesOrderedByCreationDate(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "images", "-q", "--no-trunc")
 	out, _ := dockerCmd(c, "images", "-q", "--no-trunc")
 	imgs := strings.Split(out, "\n")
 	imgs := strings.Split(out, "\n")
-	c.Assert(imgs[0], checker.Equals, id3, check.Commentf("First image must be %s, got %s", id3, imgs[0]))
-	c.Assert(imgs[1], checker.Equals, id2, check.Commentf("First image must be %s, got %s", id2, imgs[1]))
-	c.Assert(imgs[2], checker.Equals, id1, check.Commentf("First image must be %s, got %s", id1, imgs[2]))
+	assert.Equal(c, imgs[0], id3, fmt.Sprintf("First image must be %s, got %s", id3, imgs[0]))
+	assert.Equal(c, imgs[1], id2, fmt.Sprintf("First image must be %s, got %s", id2, imgs[1]))
+	assert.Equal(c, imgs[2], id1, fmt.Sprintf("First image must be %s, got %s", id1, imgs[2]))
 }
 }
 
 
-func (s *DockerSuite) TestImagesErrorWithInvalidFilterNameTest(c *check.C) {
+func (s *DockerSuite) TestImagesErrorWithInvalidFilterNameTest(c *testing.T) {
 	out, _, err := dockerCmdWithError("images", "-f", "FOO=123")
 	out, _, err := dockerCmdWithError("images", "-f", "FOO=123")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Invalid filter")
+	assert.Assert(c, strings.Contains(out, "Invalid filter"))
 }
 }
 
 
-func (s *DockerSuite) TestImagesFilterLabelMatch(c *check.C) {
+func (s *DockerSuite) TestImagesFilterLabelMatch(c *testing.T) {
 	imageName1 := "images_filter_test1"
 	imageName1 := "images_filter_test1"
 	imageName2 := "images_filter_test2"
 	imageName2 := "images_filter_test2"
 	imageName3 := "images_filter_test3"
 	imageName3 := "images_filter_test3"
@@ -92,9 +90,11 @@ func (s *DockerSuite) TestImagesFilterLabelMatch(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match")
 	out, _ := dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match")
 	out = strings.TrimSpace(out)
 	out = strings.TrimSpace(out)
-	c.Assert(out, check.Matches, fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image1ID))
-	c.Assert(out, check.Matches, fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image2ID))
-	c.Assert(out, check.Not(check.Matches), fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image3ID))
+	assert.Assert(c, is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image1ID), out))
+
+	assert.Assert(c, is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image2ID), out))
+
+	assert.Assert(c, !is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image3ID), out)().Success())
 
 
 	out, _ = dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match=me too")
 	out, _ = dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match=me too")
 	out = strings.TrimSpace(out)
 	out = strings.TrimSpace(out)
@@ -102,7 +102,7 @@ func (s *DockerSuite) TestImagesFilterLabelMatch(c *check.C) {
 }
 }
 
 
 // Regression : #15659
 // Regression : #15659
-func (s *DockerSuite) TestCommitWithFilterLabel(c *check.C) {
+func (s *DockerSuite) TestCommitWithFilterLabel(c *testing.T) {
 	// Create a container
 	// Create a container
 	dockerCmd(c, "run", "--name", "bar", "busybox", "/bin/sh")
 	dockerCmd(c, "run", "--name", "bar", "busybox", "/bin/sh")
 	// Commit with labels "using changes"
 	// Commit with labels "using changes"
@@ -114,7 +114,7 @@ func (s *DockerSuite) TestCommitWithFilterLabel(c *check.C) {
 	assert.Equal(c, out, imageID)
 	assert.Equal(c, out, imageID)
 }
 }
 
 
-func (s *DockerSuite) TestImagesFilterSinceAndBefore(c *check.C) {
+func (s *DockerSuite) TestImagesFilterSinceAndBefore(c *testing.T) {
 	buildImageSuccessfully(c, "image:1", build.WithDockerfile(`FROM `+minimalBaseImage()+`
 	buildImageSuccessfully(c, "image:1", build.WithDockerfile(`FROM `+minimalBaseImage()+`
 LABEL number=1`))
 LABEL number=1`))
 	imageID1 := getIDByName(c, "image:1")
 	imageID1 := getIDByName(c, "image:1")
@@ -128,34 +128,34 @@ LABEL number=3`))
 	expected := []string{imageID3, imageID2}
 	expected := []string{imageID3, imageID2}
 
 
 	out, _ := dockerCmd(c, "images", "-f", "since=image:1", "image")
 	out, _ := dockerCmd(c, "images", "-f", "since=image:1", "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	out, _ = dockerCmd(c, "images", "-f", "since="+imageID1, "image")
 	out, _ = dockerCmd(c, "images", "-f", "since="+imageID1, "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	expected = []string{imageID3}
 	expected = []string{imageID3}
 
 
 	out, _ = dockerCmd(c, "images", "-f", "since=image:2", "image")
 	out, _ = dockerCmd(c, "images", "-f", "since=image:2", "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	out, _ = dockerCmd(c, "images", "-f", "since="+imageID2, "image")
 	out, _ = dockerCmd(c, "images", "-f", "since="+imageID2, "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	expected = []string{imageID2, imageID1}
 	expected = []string{imageID2, imageID1}
 
 
 	out, _ = dockerCmd(c, "images", "-f", "before=image:3", "image")
 	out, _ = dockerCmd(c, "images", "-f", "before=image:3", "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	out, _ = dockerCmd(c, "images", "-f", "before="+imageID3, "image")
 	out, _ = dockerCmd(c, "images", "-f", "before="+imageID3, "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	expected = []string{imageID1}
 	expected = []string{imageID1}
 
 
 	out, _ = dockerCmd(c, "images", "-f", "before=image:2", "image")
 	out, _ = dockerCmd(c, "images", "-f", "before=image:2", "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
 
 
 	out, _ = dockerCmd(c, "images", "-f", "before="+imageID2, "image")
 	out, _ = dockerCmd(c, "images", "-f", "before="+imageID2, "image")
-	c.Assert(assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
+	assert.Equal(c, assertImageList(out, expected), true, fmt.Sprintf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out))
 }
 }
 
 
 func assertImageList(out string, expected []string) bool {
 func assertImageList(out string, expected []string) bool {
@@ -184,7 +184,7 @@ func assertImageList(out string, expected []string) bool {
 }
 }
 
 
 // FIXME(vdemeester) should be a unit test on `docker image ls`
 // FIXME(vdemeester) should be a unit test on `docker image ls`
-func (s *DockerSuite) TestImagesFilterSpaceTrimCase(c *check.C) {
+func (s *DockerSuite) TestImagesFilterSpaceTrimCase(c *testing.T) {
 	imageName := "images_filter_test"
 	imageName := "images_filter_test"
 	// Build a image and fail to build so that we have dangling images ?
 	// Build a image and fail to build so that we have dangling images ?
 	buildImage(imageName, build.WithDockerfile(`FROM busybox
 	buildImage(imageName, build.WithDockerfile(`FROM busybox
@@ -224,7 +224,7 @@ func (s *DockerSuite) TestImagesFilterSpaceTrimCase(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// create container 1
 	// create container 1
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
@@ -239,26 +239,24 @@ func (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *check.C) {
 
 
 	out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=true")
 	out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=true")
 	// Expect one dangling image
 	// Expect one dangling image
-	c.Assert(strings.Count(out, imageID), checker.Equals, 1)
+	assert.Equal(c, strings.Count(out, imageID), 1)
 
 
 	out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=false")
 	out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=false")
 	//dangling=false would not include dangling images
 	//dangling=false would not include dangling images
-	c.Assert(out, checker.Not(checker.Contains), imageID)
-
+	assert.Assert(c, !strings.Contains(out, imageID))
 	out, _ = dockerCmd(c, "images")
 	out, _ = dockerCmd(c, "images")
 	//docker images still include dangling images
 	//docker images still include dangling images
-	c.Assert(out, checker.Contains, imageID)
-
+	assert.Assert(c, strings.Contains(out, imageID))
 }
 }
 
 
 // FIXME(vdemeester) should be a unit test for `docker image ls`
 // FIXME(vdemeester) should be a unit test for `docker image ls`
-func (s *DockerSuite) TestImagesWithIncorrectFilter(c *check.C) {
+func (s *DockerSuite) TestImagesWithIncorrectFilter(c *testing.T) {
 	out, _, err := dockerCmdWithError("images", "-f", "dangling=invalid")
 	out, _, err := dockerCmdWithError("images", "-f", "dangling=invalid")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Invalid filter")
+	assert.Assert(c, strings.Contains(out, "Invalid filter"))
 }
 }
 
 
-func (s *DockerSuite) TestImagesEnsureOnlyHeadsImagesShown(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureOnlyHeadsImagesShown(c *testing.T) {
 	dockerfile := `
 	dockerfile := `
         FROM busybox
         FROM busybox
         MAINTAINER docker
         MAINTAINER docker
@@ -276,12 +274,12 @@ func (s *DockerSuite) TestImagesEnsureOnlyHeadsImagesShown(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "images")
 	out, _ := dockerCmd(c, "images")
 	// images shouldn't show non-heads images
 	// images shouldn't show non-heads images
-	c.Assert(out, checker.Not(checker.Contains), intermediate)
+	assert.Assert(c, !strings.Contains(out, intermediate))
 	// images should contain final built images
 	// images should contain final built images
-	c.Assert(out, checker.Contains, stringid.TruncateID(id))
+	assert.Assert(c, strings.Contains(out, stringid.TruncateID(id)))
 }
 }
 
 
-func (s *DockerSuite) TestImagesEnsureImagesFromScratchShown(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureImagesFromScratchShown(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // Windows does not support FROM scratch
 	testRequires(c, DaemonIsLinux) // Windows does not support FROM scratch
 	dockerfile := `
 	dockerfile := `
         FROM scratch
         FROM scratch
@@ -293,12 +291,12 @@ func (s *DockerSuite) TestImagesEnsureImagesFromScratchShown(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "images")
 	out, _ := dockerCmd(c, "images")
 	// images should contain images built from scratch
 	// images should contain images built from scratch
-	c.Assert(out, checker.Contains, stringid.TruncateID(id))
+	assert.Assert(c, strings.Contains(out, stringid.TruncateID(id)))
 }
 }
 
 
 // For W2W - equivalent to TestImagesEnsureImagesFromScratchShown but Windows
 // For W2W - equivalent to TestImagesEnsureImagesFromScratchShown but Windows
 // doesn't support from scratch
 // doesn't support from scratch
-func (s *DockerSuite) TestImagesEnsureImagesFromBusyboxShown(c *check.C) {
+func (s *DockerSuite) TestImagesEnsureImagesFromBusyboxShown(c *testing.T) {
 	dockerfile := `
 	dockerfile := `
         FROM busybox
         FROM busybox
         MAINTAINER docker`
         MAINTAINER docker`
@@ -309,24 +307,22 @@ func (s *DockerSuite) TestImagesEnsureImagesFromBusyboxShown(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "images")
 	out, _ := dockerCmd(c, "images")
 	// images should contain images built from busybox
 	// images should contain images built from busybox
-	c.Assert(out, checker.Contains, stringid.TruncateID(id))
+	assert.Assert(c, strings.Contains(out, stringid.TruncateID(id)))
 }
 }
 
 
 // #18181
 // #18181
-func (s *DockerSuite) TestImagesFilterNameWithPort(c *check.C) {
+func (s *DockerSuite) TestImagesFilterNameWithPort(c *testing.T) {
 	tag := "a.b.c.d:5000/hello"
 	tag := "a.b.c.d:5000/hello"
 	dockerCmd(c, "tag", "busybox", tag)
 	dockerCmd(c, "tag", "busybox", tag)
 	out, _ := dockerCmd(c, "images", tag)
 	out, _ := dockerCmd(c, "images", tag)
-	c.Assert(out, checker.Contains, tag)
-
+	assert.Assert(c, strings.Contains(out, tag))
 	out, _ = dockerCmd(c, "images", tag+":latest")
 	out, _ = dockerCmd(c, "images", tag+":latest")
-	c.Assert(out, checker.Contains, tag)
-
+	assert.Assert(c, strings.Contains(out, tag))
 	out, _ = dockerCmd(c, "images", tag+":no-such-tag")
 	out, _ = dockerCmd(c, "images", tag+":no-such-tag")
-	c.Assert(out, checker.Not(checker.Contains), tag)
+	assert.Assert(c, !strings.Contains(out, tag))
 }
 }
 
 
-func (s *DockerSuite) TestImagesFormat(c *check.C) {
+func (s *DockerSuite) TestImagesFormat(c *testing.T) {
 	// testRequires(c, DaemonIsLinux)
 	// testRequires(c, DaemonIsLinux)
 	tag := "myimage"
 	tag := "myimage"
 	dockerCmd(c, "tag", "busybox", tag+":v1")
 	dockerCmd(c, "tag", "busybox", tag+":v1")
@@ -342,7 +338,7 @@ func (s *DockerSuite) TestImagesFormat(c *check.C) {
 }
 }
 
 
 // ImagesDefaultFormatAndQuiet
 // ImagesDefaultFormatAndQuiet
-func (s *DockerSuite) TestImagesFormatDefaultFormat(c *check.C) {
+func (s *DockerSuite) TestImagesFormatDefaultFormat(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	// create container 1
 	// create container 1

+ 17 - 18
integration-cli/docker_cli_import_test.go

@@ -8,15 +8,14 @@ import (
 	"os/exec"
 	"os/exec"
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestImportDisplay(c *check.C) {
+func (s *DockerSuite) TestImportDisplay(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -34,9 +33,9 @@ func (s *DockerSuite) TestImportDisplay(c *check.C) {
 	assert.Equal(c, out, "", "command output should've been nothing.")
 	assert.Equal(c, out, "", "command output should've been nothing.")
 }
 }
 
 
-func (s *DockerSuite) TestImportBadURL(c *check.C) {
+func (s *DockerSuite) TestImportBadURL(c *testing.T) {
 	out, _, err := dockerCmdWithError("import", "http://nourl/bad")
 	out, _, err := dockerCmdWithError("import", "http://nourl/bad")
-	c.Assert(err, checker.NotNil, check.Commentf("import was supposed to fail but didn't"))
+	assert.Assert(c, err != nil, "import was supposed to fail but didn't")
 	// Depending on your system you can get either of these errors
 	// Depending on your system you can get either of these errors
 	if !strings.Contains(out, "dial tcp") &&
 	if !strings.Contains(out, "dial tcp") &&
 		!strings.Contains(out, "ApplyLayer exit status 1 stdout:  stderr: archive/tar: invalid tar header") &&
 		!strings.Contains(out, "ApplyLayer exit status 1 stdout:  stderr: archive/tar: invalid tar header") &&
@@ -45,12 +44,12 @@ func (s *DockerSuite) TestImportBadURL(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestImportFile(c *check.C) {
+func (s *DockerSuite) TestImportFile(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 
 
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary file"))
+	assert.Assert(c, err == nil, "failed to create temporary file")
 	defer os.Remove(temporaryFile.Name())
 	defer os.Remove(temporaryFile.Name())
 
 
 	icmd.RunCmd(icmd.Cmd{
 	icmd.RunCmd(icmd.Cmd{
@@ -66,12 +65,12 @@ func (s *DockerSuite) TestImportFile(c *check.C) {
 	assert.Equal(c, out, "", "command output should've been nothing.")
 	assert.Equal(c, out, "", "command output should've been nothing.")
 }
 }
 
 
-func (s *DockerSuite) TestImportGzipped(c *check.C) {
+func (s *DockerSuite) TestImportGzipped(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 
 
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary file"))
+	assert.Assert(c, err == nil, "failed to create temporary file")
 	defer os.Remove(temporaryFile.Name())
 	defer os.Remove(temporaryFile.Name())
 
 
 	w := gzip.NewWriter(temporaryFile)
 	w := gzip.NewWriter(temporaryFile)
@@ -79,7 +78,7 @@ func (s *DockerSuite) TestImportGzipped(c *check.C) {
 		Command: []string{dockerBinary, "export", "test-import"},
 		Command: []string{dockerBinary, "export", "test-import"},
 		Stdout:  w,
 		Stdout:  w,
 	}).Assert(c, icmd.Success)
 	}).Assert(c, icmd.Success)
-	c.Assert(w.Close(), checker.IsNil, check.Commentf("failed to close gzip writer"))
+	assert.Assert(c, w.Close() == nil, "failed to close gzip writer")
 	temporaryFile.Close()
 	temporaryFile.Close()
 	out, _ := dockerCmd(c, "import", temporaryFile.Name())
 	out, _ := dockerCmd(c, "import", temporaryFile.Name())
 	assert.Assert(c, strings.Count(out, "\n") == 1, "display is expected 1 '\\n' but didn't")
 	assert.Assert(c, strings.Count(out, "\n") == 1, "display is expected 1 '\\n' but didn't")
@@ -89,12 +88,12 @@ func (s *DockerSuite) TestImportGzipped(c *check.C) {
 	assert.Equal(c, out, "", "command output should've been nothing.")
 	assert.Equal(c, out, "", "command output should've been nothing.")
 }
 }
 
 
-func (s *DockerSuite) TestImportFileWithMessage(c *check.C) {
+func (s *DockerSuite) TestImportFileWithMessage(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 	dockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 
 
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary file"))
+	assert.Assert(c, err == nil, "failed to create temporary file")
 	defer os.Remove(temporaryFile.Name())
 	defer os.Remove(temporaryFile.Name())
 
 
 	icmd.RunCmd(icmd.Cmd{
 	icmd.RunCmd(icmd.Cmd{
@@ -110,27 +109,27 @@ func (s *DockerSuite) TestImportFileWithMessage(c *check.C) {
 	out, _ = dockerCmd(c, "history", image)
 	out, _ = dockerCmd(c, "history", image)
 	split := strings.Split(out, "\n")
 	split := strings.Split(out, "\n")
 
 
-	c.Assert(split, checker.HasLen, 3, check.Commentf("expected 3 lines from image history"))
+	assert.Equal(c, len(split), 3, "expected 3 lines from image history")
 	r := regexp.MustCompile("[\\s]{2,}")
 	r := regexp.MustCompile("[\\s]{2,}")
 	split = r.Split(split[1], -1)
 	split = r.Split(split[1], -1)
 
 
-	c.Assert(message, checker.Equals, split[3], check.Commentf("didn't get expected value in commit message"))
+	assert.Equal(c, message, split[3], "didn't get expected value in commit message")
 
 
 	out, _ = dockerCmd(c, "run", "--rm", image, "true")
 	out, _ = dockerCmd(c, "run", "--rm", image, "true")
 	assert.Equal(c, out, "", "command output should've been nothing")
 	assert.Equal(c, out, "", "command output should've been nothing")
 }
 }
 
 
-func (s *DockerSuite) TestImportFileNonExistentFile(c *check.C) {
+func (s *DockerSuite) TestImportFileNonExistentFile(c *testing.T) {
 	_, _, err := dockerCmdWithError("import", "example.com/myImage.tar")
 	_, _, err := dockerCmdWithError("import", "example.com/myImage.tar")
-	c.Assert(err, checker.NotNil, check.Commentf("import non-existing file must failed"))
+	assert.Assert(c, err != nil, "import non-existing file must failed")
 }
 }
 
 
-func (s *DockerSuite) TestImportWithQuotedChanges(c *check.C) {
+func (s *DockerSuite) TestImportWithQuotedChanges(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	cli.DockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 	cli.DockerCmd(c, "run", "--name", "test-import", "busybox", "true")
 
 
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
 	temporaryFile, err := ioutil.TempFile("", "exportImportTest")
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary file"))
+	assert.Assert(c, err == nil, "failed to create temporary file")
 	defer os.Remove(temporaryFile.Name())
 	defer os.Remove(temporaryFile.Name())
 
 
 	cli.Docker(cli.Args("export", "test-import"), cli.WithStdout(bufio.NewWriter(temporaryFile))).Assert(c, icmd.Success)
 	cli.Docker(cli.Args("export", "test-import"), cli.WithStdout(bufio.NewWriter(temporaryFile))).Assert(c, icmd.Success)

+ 44 - 45
integration-cli/docker_cli_info_test.go

@@ -5,16 +5,15 @@ import (
 	"fmt"
 	"fmt"
 	"net"
 	"net"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // ensure docker info succeeds
 // ensure docker info succeeds
-func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
+func (s *DockerSuite) TestInfoEnsureSucceeds(c *testing.T) {
 	out, _ := dockerCmd(c, "info")
 	out, _ := dockerCmd(c, "info")
 
 
 	// always shown fields
 	// always shown fields
@@ -53,14 +52,14 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
 	}
 	}
 
 
 	for _, linePrefix := range stringsToCheck {
 	for _, linePrefix := range stringsToCheck {
-		c.Assert(out, checker.Contains, linePrefix, check.Commentf("couldn't find string %v in output", linePrefix))
+		assert.Assert(c, strings.Contains(out, linePrefix), "couldn't find string %v in output", linePrefix)
 	}
 	}
 }
 }
 
 
 // TestInfoFormat tests `docker info --format`
 // TestInfoFormat tests `docker info --format`
-func (s *DockerSuite) TestInfoFormat(c *check.C) {
+func (s *DockerSuite) TestInfoFormat(c *testing.T) {
 	out, status := dockerCmd(c, "info", "--format", "{{json .}}")
 	out, status := dockerCmd(c, "info", "--format", "{{json .}}")
-	c.Assert(status, checker.Equals, 0)
+	assert.Equal(c, status, 0)
 	var m map[string]interface{}
 	var m map[string]interface{}
 	err := json.Unmarshal([]byte(out), &m)
 	err := json.Unmarshal([]byte(out), &m)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -70,7 +69,7 @@ func (s *DockerSuite) TestInfoFormat(c *check.C) {
 
 
 // TestInfoDiscoveryBackend verifies that a daemon run with `--cluster-advertise` and
 // TestInfoDiscoveryBackend verifies that a daemon run with `--cluster-advertise` and
 // `--cluster-store` properly show the backend's endpoint in info output.
 // `--cluster-store` properly show the backend's endpoint in info output.
-func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
+func (s *DockerSuite) TestInfoDiscoveryBackend(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
@@ -81,13 +80,13 @@ func (s *DockerSuite) TestInfoDiscoveryBackend(c *check.C) {
 
 
 	out, err := d.Cmd("info")
 	out, err := d.Cmd("info")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, fmt.Sprintf("Cluster Store: %s\n", discoveryBackend))
-	c.Assert(out, checker.Contains, fmt.Sprintf("Cluster Advertise: %s\n", discoveryAdvertise))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Cluster Store: %s\n", discoveryBackend)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Cluster Advertise: %s\n", discoveryAdvertise)))
 }
 }
 
 
 // TestInfoDiscoveryInvalidAdvertise verifies that a daemon run with
 // TestInfoDiscoveryInvalidAdvertise verifies that a daemon run with
 // an invalid `--cluster-advertise` configuration
 // an invalid `--cluster-advertise` configuration
-func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
+func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
@@ -104,7 +103,7 @@ func (s *DockerSuite) TestInfoDiscoveryInvalidAdvertise(c *check.C) {
 
 
 // TestInfoDiscoveryAdvertiseInterfaceName verifies that a daemon run with `--cluster-advertise`
 // TestInfoDiscoveryAdvertiseInterfaceName verifies that a daemon run with `--cluster-advertise`
 // configured with interface name properly show the advertise ip-address in info output.
 // configured with interface name properly show the advertise ip-address in info output.
-func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *check.C) {
+func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, Network, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, Network, DaemonIsLinux)
 
 
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
@@ -124,24 +123,24 @@ func (s *DockerSuite) TestInfoDiscoveryAdvertiseInterfaceName(c *check.C) {
 
 
 	out, err := d.Cmd("info")
 	out, err := d.Cmd("info")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, fmt.Sprintf("Cluster Store: %s\n", discoveryBackend))
-	c.Assert(out, checker.Contains, fmt.Sprintf("Cluster Advertise: %s:2375\n", ip.String()))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Cluster Store: %s\n", discoveryBackend)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Cluster Advertise: %s:2375\n", ip.String())))
 }
 }
 
 
-func (s *DockerSuite) TestInfoDisplaysRunningContainers(c *check.C) {
+func (s *DockerSuite) TestInfoDisplaysRunningContainers(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	existing := existingContainerStates(c)
 	existing := existingContainerStates(c)
 
 
 	dockerCmd(c, "run", "-d", "busybox", "top")
 	dockerCmd(c, "run", "-d", "busybox", "top")
 	out, _ := dockerCmd(c, "info")
 	out, _ := dockerCmd(c, "info")
-	c.Assert(out, checker.Contains, fmt.Sprintf("Containers: %d\n", existing["Containers"]+1))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Running: %d\n", existing["ContainersRunning"]+1))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Paused: %d\n", existing["ContainersPaused"]))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Stopped: %d\n", existing["ContainersStopped"]))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Containers: %d\n", existing["Containers"]+1)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Running: %d\n", existing["ContainersRunning"]+1)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Paused: %d\n", existing["ContainersPaused"])))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Stopped: %d\n", existing["ContainersStopped"])))
 }
 }
 
 
-func (s *DockerSuite) TestInfoDisplaysPausedContainers(c *check.C) {
+func (s *DockerSuite) TestInfoDisplaysPausedContainers(c *testing.T) {
 	testRequires(c, IsPausable)
 	testRequires(c, IsPausable)
 
 
 	existing := existingContainerStates(c)
 	existing := existingContainerStates(c)
@@ -152,13 +151,13 @@ func (s *DockerSuite) TestInfoDisplaysPausedContainers(c *check.C) {
 	dockerCmd(c, "pause", cleanedContainerID)
 	dockerCmd(c, "pause", cleanedContainerID)
 
 
 	out, _ = dockerCmd(c, "info")
 	out, _ = dockerCmd(c, "info")
-	c.Assert(out, checker.Contains, fmt.Sprintf("Containers: %d\n", existing["Containers"]+1))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Running: %d\n", existing["ContainersRunning"]))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Paused: %d\n", existing["ContainersPaused"]+1))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Stopped: %d\n", existing["ContainersStopped"]))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Containers: %d\n", existing["Containers"]+1)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Running: %d\n", existing["ContainersRunning"])))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Paused: %d\n", existing["ContainersPaused"]+1)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Stopped: %d\n", existing["ContainersStopped"])))
 }
 }
 
 
-func (s *DockerSuite) TestInfoDisplaysStoppedContainers(c *check.C) {
+func (s *DockerSuite) TestInfoDisplaysStoppedContainers(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	existing := existingContainerStates(c)
 	existing := existingContainerStates(c)
@@ -169,13 +168,13 @@ func (s *DockerSuite) TestInfoDisplaysStoppedContainers(c *check.C) {
 	dockerCmd(c, "stop", cleanedContainerID)
 	dockerCmd(c, "stop", cleanedContainerID)
 
 
 	out, _ = dockerCmd(c, "info")
 	out, _ = dockerCmd(c, "info")
-	c.Assert(out, checker.Contains, fmt.Sprintf("Containers: %d\n", existing["Containers"]+1))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Running: %d\n", existing["ContainersRunning"]))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Paused: %d\n", existing["ContainersPaused"]))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" Stopped: %d\n", existing["ContainersStopped"]+1))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Containers: %d\n", existing["Containers"]+1)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Running: %d\n", existing["ContainersRunning"])))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Paused: %d\n", existing["ContainersPaused"])))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" Stopped: %d\n", existing["ContainersStopped"]+1)))
 }
 }
 
 
-func (s *DockerSuite) TestInfoDebug(c *check.C) {
+func (s *DockerSuite) TestInfoDebug(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	d := daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
@@ -184,16 +183,16 @@ func (s *DockerSuite) TestInfoDebug(c *check.C) {
 
 
 	out, err := d.Cmd("--debug", "info")
 	out, err := d.Cmd("--debug", "info")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, "Debug Mode (client): true\n")
-	c.Assert(out, checker.Contains, "Debug Mode (server): true\n")
-	c.Assert(out, checker.Contains, "File Descriptors")
-	c.Assert(out, checker.Contains, "Goroutines")
-	c.Assert(out, checker.Contains, "System Time")
-	c.Assert(out, checker.Contains, "EventsListeners")
-	c.Assert(out, checker.Contains, "Docker Root Dir")
+	assert.Assert(c, strings.Contains(out, "Debug Mode (client): true\n"))
+	assert.Assert(c, strings.Contains(out, "Debug Mode (server): true\n"))
+	assert.Assert(c, strings.Contains(out, "File Descriptors"))
+	assert.Assert(c, strings.Contains(out, "Goroutines"))
+	assert.Assert(c, strings.Contains(out, "System Time"))
+	assert.Assert(c, strings.Contains(out, "EventsListeners"))
+	assert.Assert(c, strings.Contains(out, "Docker Root Dir"))
 }
 }
 
 
-func (s *DockerSuite) TestInsecureRegistries(c *check.C) {
+func (s *DockerSuite) TestInsecureRegistries(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	registryCIDR := "192.168.1.0/24"
 	registryCIDR := "192.168.1.0/24"
@@ -205,12 +204,12 @@ func (s *DockerSuite) TestInsecureRegistries(c *check.C) {
 
 
 	out, err := d.Cmd("info")
 	out, err := d.Cmd("info")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, "Insecure Registries:\n")
-	c.Assert(out, checker.Contains, fmt.Sprintf(" %s\n", registryHost))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" %s\n", registryCIDR))
+	assert.Assert(c, strings.Contains(out, "Insecure Registries:\n"))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" %s\n", registryHost)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" %s\n", registryCIDR)))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestRegistryMirrors(c *check.C) {
+func (s *DockerDaemonSuite) TestRegistryMirrors(c *testing.T) {
 
 
 	registryMirror1 := "https://192.168.1.2"
 	registryMirror1 := "https://192.168.1.2"
 	registryMirror2 := "http://registry.mirror.com:5000"
 	registryMirror2 := "http://registry.mirror.com:5000"
@@ -219,12 +218,12 @@ func (s *DockerDaemonSuite) TestRegistryMirrors(c *check.C) {
 
 
 	out, err := s.d.Cmd("info")
 	out, err := s.d.Cmd("info")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, "Registry Mirrors:\n")
-	c.Assert(out, checker.Contains, fmt.Sprintf(" %s", registryMirror1))
-	c.Assert(out, checker.Contains, fmt.Sprintf(" %s", registryMirror2))
+	assert.Assert(c, strings.Contains(out, "Registry Mirrors:\n"))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" %s", registryMirror1)))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf(" %s", registryMirror2)))
 }
 }
 
 
-func existingContainerStates(c *check.C) map[string]int {
+func existingContainerStates(c *testing.T) map[string]int {
 	out, _ := dockerCmd(c, "info", "--format", "{{json .}}")
 	out, _ := dockerCmd(c, "info", "--format", "{{json .}}")
 	var m map[string]interface{}
 	var m map[string]interface{}
 	err := json.Unmarshal([]byte(out), &m)
 	err := json.Unmarshal([]byte(out), &m)

+ 6 - 4
integration-cli/docker_cli_info_unix_test.go

@@ -3,13 +3,15 @@
 package main
 package main
 
 
 import (
 import (
-	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
+	"strings"
+	"testing"
+
+	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestInfoSecurityOptions(c *check.C) {
+func (s *DockerSuite) TestInfoSecurityOptions(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, Apparmor, DaemonIsLinux)
 
 
 	out, _ := dockerCmd(c, "info")
 	out, _ := dockerCmd(c, "info")
-	c.Assert(out, checker.Contains, "Security Options:\n apparmor\n seccomp\n  Profile: default\n")
+	assert.Assert(c, strings.Contains(out, "Security Options:\n apparmor\n seccomp\n  Profile: default\n"))
 }
 }

+ 92 - 94
integration-cli/docker_cli_inspect_test.go

@@ -6,23 +6,22 @@ import (
 	"os"
 	"os"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/container"
-	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func checkValidGraphDriver(c *check.C, name string) {
+func checkValidGraphDriver(c *testing.T, name string) {
 	if name != "devicemapper" && name != "overlay" && name != "vfs" && name != "zfs" && name != "btrfs" && name != "aufs" {
 	if name != "devicemapper" && name != "overlay" && name != "vfs" && name != "zfs" && name != "btrfs" && name != "aufs" {
 		c.Fatalf("%v is not a valid graph driver name", name)
 		c.Fatalf("%v is not a valid graph driver name", name)
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestInspectImage(c *check.C) {
+func (s *DockerSuite) TestInspectImage(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	imageTest := "emptyfs"
 	imageTest := "emptyfs"
 	// It is important that this ID remain stable. If a code change causes
 	// It is important that this ID remain stable. If a code change causes
@@ -33,16 +32,16 @@ func (s *DockerSuite) TestInspectImage(c *check.C) {
 	imageTestID := "sha256:11f64303f0f7ffdc71f001788132bca5346831939a956e3e975c93267d89a16d"
 	imageTestID := "sha256:11f64303f0f7ffdc71f001788132bca5346831939a956e3e975c93267d89a16d"
 	id := inspectField(c, imageTest, "Id")
 	id := inspectField(c, imageTest, "Id")
 
 
-	c.Assert(id, checker.Equals, imageTestID)
+	assert.Equal(c, id, imageTestID)
 }
 }
 
 
-func (s *DockerSuite) TestInspectInt64(c *check.C) {
+func (s *DockerSuite) TestInspectInt64(c *testing.T) {
 	dockerCmd(c, "run", "-d", "-m=300M", "--name", "inspectTest", "busybox", "true")
 	dockerCmd(c, "run", "-d", "-m=300M", "--name", "inspectTest", "busybox", "true")
 	inspectOut := inspectField(c, "inspectTest", "HostConfig.Memory")
 	inspectOut := inspectField(c, "inspectTest", "HostConfig.Memory")
-	c.Assert(inspectOut, checker.Equals, "314572800")
+	assert.Equal(c, inspectOut, "314572800")
 }
 }
 
 
-func (s *DockerSuite) TestInspectDefault(c *check.C) {
+func (s *DockerSuite) TestInspectDefault(c *testing.T) {
 	//Both the container and image are named busybox. docker inspect will fetch the container JSON.
 	//Both the container and image are named busybox. docker inspect will fetch the container JSON.
 	//If the container JSON is not available, it will go for the image JSON.
 	//If the container JSON is not available, it will go for the image JSON.
 
 
@@ -50,35 +49,35 @@ func (s *DockerSuite) TestInspectDefault(c *check.C) {
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
 
 
 	inspectOut := inspectField(c, "busybox", "Id")
 	inspectOut := inspectField(c, "busybox", "Id")
-	c.Assert(strings.TrimSpace(inspectOut), checker.Equals, containerID)
+	assert.Equal(c, strings.TrimSpace(inspectOut), containerID)
 }
 }
 
 
-func (s *DockerSuite) TestInspectStatus(c *check.C) {
+func (s *DockerSuite) TestInspectStatus(c *testing.T) {
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
 	out = strings.TrimSpace(out)
 	out = strings.TrimSpace(out)
 
 
 	inspectOut := inspectField(c, out, "State.Status")
 	inspectOut := inspectField(c, out, "State.Status")
-	c.Assert(inspectOut, checker.Equals, "running")
+	assert.Equal(c, inspectOut, "running")
 
 
 	// Windows does not support pause/unpause on Windows Server Containers.
 	// Windows does not support pause/unpause on Windows Server Containers.
 	// (RS1 does for Hyper-V Containers, but production CI is not setup for that)
 	// (RS1 does for Hyper-V Containers, but production CI is not setup for that)
 	if testEnv.OSType != "windows" {
 	if testEnv.OSType != "windows" {
 		dockerCmd(c, "pause", out)
 		dockerCmd(c, "pause", out)
 		inspectOut = inspectField(c, out, "State.Status")
 		inspectOut = inspectField(c, out, "State.Status")
-		c.Assert(inspectOut, checker.Equals, "paused")
+		assert.Equal(c, inspectOut, "paused")
 
 
 		dockerCmd(c, "unpause", out)
 		dockerCmd(c, "unpause", out)
 		inspectOut = inspectField(c, out, "State.Status")
 		inspectOut = inspectField(c, out, "State.Status")
-		c.Assert(inspectOut, checker.Equals, "running")
+		assert.Equal(c, inspectOut, "running")
 	}
 	}
 
 
 	dockerCmd(c, "stop", out)
 	dockerCmd(c, "stop", out)
 	inspectOut = inspectField(c, out, "State.Status")
 	inspectOut = inspectField(c, out, "State.Status")
-	c.Assert(inspectOut, checker.Equals, "exited")
+	assert.Equal(c, inspectOut, "exited")
 
 
 }
 }
 
 
-func (s *DockerSuite) TestInspectTypeFlagContainer(c *check.C) {
+func (s *DockerSuite) TestInspectTypeFlagContainer(c *testing.T) {
 	//Both the container and image are named busybox. docker inspect will fetch container
 	//Both the container and image are named busybox. docker inspect will fetch container
 	//JSON State.Running field. If the field is true, it's a container.
 	//JSON State.Running field. If the field is true, it's a container.
 	runSleepingContainer(c, "--name=busybox", "-d")
 	runSleepingContainer(c, "--name=busybox", "-d")
@@ -88,7 +87,7 @@ func (s *DockerSuite) TestInspectTypeFlagContainer(c *check.C) {
 	assert.Equal(c, out, "true\n") // not a container JSON
 	assert.Equal(c, out, "true\n") // not a container JSON
 }
 }
 
 
-func (s *DockerSuite) TestInspectTypeFlagWithNoContainer(c *check.C) {
+func (s *DockerSuite) TestInspectTypeFlagWithNoContainer(c *testing.T) {
 	//Run this test on an image named busybox. docker inspect will try to fetch container
 	//Run this test on an image named busybox. docker inspect will try to fetch container
 	//JSON. Since there is no container named busybox and --type=container, docker inspect will
 	//JSON. Since there is no container named busybox and --type=container, docker inspect will
 	//not try to get the image JSON. It will throw an error.
 	//not try to get the image JSON. It will throw an error.
@@ -100,7 +99,7 @@ func (s *DockerSuite) TestInspectTypeFlagWithNoContainer(c *check.C) {
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 }
 }
 
 
-func (s *DockerSuite) TestInspectTypeFlagWithImage(c *check.C) {
+func (s *DockerSuite) TestInspectTypeFlagWithImage(c *testing.T) {
 	//Both the container and image are named busybox. docker inspect will fetch image
 	//Both the container and image are named busybox. docker inspect will fetch image
 	//JSON as --type=image. if there is no image with name busybox, docker inspect
 	//JSON as --type=image. if there is no image with name busybox, docker inspect
 	//will throw an error.
 	//will throw an error.
@@ -108,38 +107,39 @@ func (s *DockerSuite) TestInspectTypeFlagWithImage(c *check.C) {
 	dockerCmd(c, "run", "--name=busybox", "-d", "busybox", "true")
 	dockerCmd(c, "run", "--name=busybox", "-d", "busybox", "true")
 
 
 	out, _ := dockerCmd(c, "inspect", "--type=image", "busybox")
 	out, _ := dockerCmd(c, "inspect", "--type=image", "busybox")
-	c.Assert(out, checker.Not(checker.Contains), "State") // not an image JSON
+	// not an image JSON
+	assert.Assert(c, !strings.Contains(out, "State"))
 }
 }
 
 
-func (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *check.C) {
+func (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *testing.T) {
 	//Both the container and image are named busybox. docker inspect will fail
 	//Both the container and image are named busybox. docker inspect will fail
 	//as --type=foobar is not a valid value for the flag.
 	//as --type=foobar is not a valid value for the flag.
 
 
 	dockerCmd(c, "run", "--name=busybox", "-d", "busybox", "true")
 	dockerCmd(c, "run", "--name=busybox", "-d", "busybox", "true")
 
 
 	out, exitCode, err := dockerCmdWithError("inspect", "--type=foobar", "busybox")
 	out, exitCode, err := dockerCmdWithError("inspect", "--type=foobar", "busybox")
-	c.Assert(err, checker.NotNil, check.Commentf("%s", exitCode))
-	c.Assert(exitCode, checker.Equals, 1, check.Commentf("%s", err))
-	c.Assert(out, checker.Contains, "not a valid value for --type")
+	assert.Assert(c, err != nil, "%d", exitCode)
+	assert.Equal(c, exitCode, 1, fmt.Sprintf("%s", err))
+	assert.Assert(c, strings.Contains(out, "not a valid value for --type"))
 }
 }
 
 
-func (s *DockerSuite) TestInspectImageFilterInt(c *check.C) {
+func (s *DockerSuite) TestInspectImageFilterInt(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	imageTest := "emptyfs"
 	imageTest := "emptyfs"
 	out := inspectField(c, imageTest, "Size")
 	out := inspectField(c, imageTest, "Size")
 
 
 	size, err := strconv.Atoi(out)
 	size, err := strconv.Atoi(out)
-	c.Assert(err, checker.IsNil, check.Commentf("failed to inspect size of the image: %s, %v", out, err))
+	assert.Assert(c, err == nil, "failed to inspect size of the image: %s, %v", out, err)
 
 
 	//now see if the size turns out to be the same
 	//now see if the size turns out to be the same
 	formatStr := fmt.Sprintf("--format={{eq .Size %d}}", size)
 	formatStr := fmt.Sprintf("--format={{eq .Size %d}}", size)
 	out, _ = dockerCmd(c, "inspect", formatStr, imageTest)
 	out, _ = dockerCmd(c, "inspect", formatStr, imageTest)
 	result, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
 	result, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(result, checker.Equals, true)
+	assert.Equal(c, result, true)
 }
 }
 
 
-func (s *DockerSuite) TestInspectContainerFilterInt(c *check.C) {
+func (s *DockerSuite) TestInspectContainerFilterInt(c *testing.T) {
 	result := icmd.RunCmd(icmd.Cmd{
 	result := icmd.RunCmd(icmd.Cmd{
 		Command: []string{dockerBinary, "run", "-i", "-a", "stdin", "busybox", "cat"},
 		Command: []string{dockerBinary, "run", "-i", "-a", "stdin", "busybox", "cat"},
 		Stdin:   strings.NewReader("blahblah"),
 		Stdin:   strings.NewReader("blahblah"),
@@ -151,17 +151,17 @@ func (s *DockerSuite) TestInspectContainerFilterInt(c *check.C) {
 	out = inspectField(c, id, "State.ExitCode")
 	out = inspectField(c, id, "State.ExitCode")
 
 
 	exitCode, err := strconv.Atoi(out)
 	exitCode, err := strconv.Atoi(out)
-	c.Assert(err, checker.IsNil, check.Commentf("failed to inspect exitcode of the container: %s, %v", out, err))
+	assert.Assert(c, err == nil, "failed to inspect exitcode of the container: %s, %v", out, err)
 
 
 	//now get the exit code to verify
 	//now get the exit code to verify
 	formatStr := fmt.Sprintf("--format={{eq .State.ExitCode %d}}", exitCode)
 	formatStr := fmt.Sprintf("--format={{eq .State.ExitCode %d}}", exitCode)
 	out, _ = dockerCmd(c, "inspect", formatStr, id)
 	out, _ = dockerCmd(c, "inspect", formatStr, id)
 	inspectResult, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
 	inspectResult, err := strconv.ParseBool(strings.TrimSuffix(out, "\n"))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(inspectResult, checker.Equals, true)
+	assert.Equal(c, inspectResult, true)
 }
 }
 
 
-func (s *DockerSuite) TestInspectImageGraphDriver(c *check.C) {
+func (s *DockerSuite) TestInspectImageGraphDriver(c *testing.T) {
 	testRequires(c, DaemonIsLinux, Devicemapper)
 	testRequires(c, DaemonIsLinux, Devicemapper)
 	imageTest := "emptyfs"
 	imageTest := "emptyfs"
 	name := inspectField(c, imageTest, "GraphDriver.Name")
 	name := inspectField(c, imageTest, "GraphDriver.Name")
@@ -171,15 +171,15 @@ func (s *DockerSuite) TestInspectImageGraphDriver(c *check.C) {
 	deviceID := inspectField(c, imageTest, "GraphDriver.Data.DeviceId")
 	deviceID := inspectField(c, imageTest, "GraphDriver.Data.DeviceId")
 
 
 	_, err := strconv.Atoi(deviceID)
 	_, err := strconv.Atoi(deviceID)
-	c.Assert(err, checker.IsNil, check.Commentf("failed to inspect DeviceId of the image: %s, %v", deviceID, err))
+	assert.Assert(c, err == nil, "failed to inspect DeviceId of the image: %s, %v", deviceID, err)
 
 
 	deviceSize := inspectField(c, imageTest, "GraphDriver.Data.DeviceSize")
 	deviceSize := inspectField(c, imageTest, "GraphDriver.Data.DeviceSize")
 
 
 	_, err = strconv.ParseUint(deviceSize, 10, 64)
 	_, err = strconv.ParseUint(deviceSize, 10, 64)
-	c.Assert(err, checker.IsNil, check.Commentf("failed to inspect DeviceSize of the image: %s, %v", deviceSize, err))
+	assert.Assert(c, err == nil, "failed to inspect DeviceSize of the image: %s, %v", deviceSize, err)
 }
 }
 
 
-func (s *DockerSuite) TestInspectContainerGraphDriver(c *check.C) {
+func (s *DockerSuite) TestInspectContainerGraphDriver(c *testing.T) {
 	testRequires(c, DaemonIsLinux, Devicemapper)
 	testRequires(c, DaemonIsLinux, Devicemapper)
 
 
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
@@ -193,18 +193,18 @@ func (s *DockerSuite) TestInspectContainerGraphDriver(c *check.C) {
 
 
 	deviceID := inspectField(c, out, "GraphDriver.Data.DeviceId")
 	deviceID := inspectField(c, out, "GraphDriver.Data.DeviceId")
 
 
-	c.Assert(imageDeviceID, checker.Not(checker.Equals), deviceID)
+	assert.Assert(c, imageDeviceID != deviceID)
 
 
 	_, err := strconv.Atoi(deviceID)
 	_, err := strconv.Atoi(deviceID)
-	c.Assert(err, checker.IsNil, check.Commentf("failed to inspect DeviceId of the image: %s, %v", deviceID, err))
+	assert.Assert(c, err == nil, "failed to inspect DeviceId of the image: %s, %v", deviceID, err)
 
 
 	deviceSize := inspectField(c, out, "GraphDriver.Data.DeviceSize")
 	deviceSize := inspectField(c, out, "GraphDriver.Data.DeviceSize")
 
 
 	_, err = strconv.ParseUint(deviceSize, 10, 64)
 	_, err = strconv.ParseUint(deviceSize, 10, 64)
-	c.Assert(err, checker.IsNil, check.Commentf("failed to inspect DeviceSize of the image: %s, %v", deviceSize, err))
+	assert.Assert(c, err == nil, "failed to inspect DeviceSize of the image: %s, %v", deviceSize, err)
 }
 }
 
 
-func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) {
+func (s *DockerSuite) TestInspectBindMountPoint(c *testing.T) {
 	modifier := ",z"
 	modifier := ",z"
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	if testEnv.OSType == "windows" {
 	if testEnv.OSType == "windows" {
@@ -222,21 +222,21 @@ func (s *DockerSuite) TestInspectBindMountPoint(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	// check that there is only one mountpoint
 	// check that there is only one mountpoint
-	c.Assert(mp, check.HasLen, 1)
+	assert.Equal(c, len(mp), 1)
 
 
 	m := mp[0]
 	m := mp[0]
 
 
-	c.Assert(m.Name, checker.Equals, "")
-	c.Assert(m.Driver, checker.Equals, "")
-	c.Assert(m.Source, checker.Equals, prefix+slash+"data")
-	c.Assert(m.Destination, checker.Equals, prefix+slash+"data")
+	assert.Equal(c, m.Name, "")
+	assert.Equal(c, m.Driver, "")
+	assert.Equal(c, m.Source, prefix+slash+"data")
+	assert.Equal(c, m.Destination, prefix+slash+"data")
 	if testEnv.OSType != "windows" { // Windows does not set mode
 	if testEnv.OSType != "windows" { // Windows does not set mode
-		c.Assert(m.Mode, checker.Equals, "ro"+modifier)
+		assert.Equal(c, m.Mode, "ro"+modifier)
 	}
 	}
-	c.Assert(m.RW, checker.Equals, false)
+	assert.Equal(c, m.RW, false)
 }
 }
 
 
-func (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) {
+func (s *DockerSuite) TestInspectNamedMountPoint(c *testing.T) {
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 
 
 	dockerCmd(c, "run", "-d", "--name", "test", "-v", "data:"+prefix+slash+"data", "busybox", "cat")
 	dockerCmd(c, "run", "-d", "--name", "test", "-v", "data:"+prefix+slash+"data", "busybox", "cat")
@@ -248,19 +248,19 @@ func (s *DockerSuite) TestInspectNamedMountPoint(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	// check that there is only one mountpoint
 	// check that there is only one mountpoint
-	c.Assert(mp, checker.HasLen, 1)
+	assert.Equal(c, len(mp), 1)
 
 
 	m := mp[0]
 	m := mp[0]
 
 
-	c.Assert(m.Name, checker.Equals, "data")
-	c.Assert(m.Driver, checker.Equals, "local")
-	c.Assert(m.Source, checker.Not(checker.Equals), "")
-	c.Assert(m.Destination, checker.Equals, prefix+slash+"data")
-	c.Assert(m.RW, checker.Equals, true)
+	assert.Equal(c, m.Name, "data")
+	assert.Equal(c, m.Driver, "local")
+	assert.Assert(c, m.Source != "")
+	assert.Equal(c, m.Destination, prefix+slash+"data")
+	assert.Equal(c, m.RW, true)
 }
 }
 
 
 // #14947
 // #14947
-func (s *DockerSuite) TestInspectTimesAsRFC3339Nano(c *check.C) {
+func (s *DockerSuite) TestInspectTimesAsRFC3339Nano(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	startedAt := inspectField(c, id, "State.StartedAt")
 	startedAt := inspectField(c, id, "State.StartedAt")
@@ -281,20 +281,20 @@ func (s *DockerSuite) TestInspectTimesAsRFC3339Nano(c *check.C) {
 }
 }
 
 
 // #15633
 // #15633
-func (s *DockerSuite) TestInspectLogConfigNoType(c *check.C) {
+func (s *DockerSuite) TestInspectLogConfigNoType(c *testing.T) {
 	dockerCmd(c, "create", "--name=test", "--log-opt", "max-file=42", "busybox")
 	dockerCmd(c, "create", "--name=test", "--log-opt", "max-file=42", "busybox")
 	var logConfig container.LogConfig
 	var logConfig container.LogConfig
 
 
 	out := inspectFieldJSON(c, "test", "HostConfig.LogConfig")
 	out := inspectFieldJSON(c, "test", "HostConfig.LogConfig")
 
 
 	err := json.NewDecoder(strings.NewReader(out)).Decode(&logConfig)
 	err := json.NewDecoder(strings.NewReader(out)).Decode(&logConfig)
-	c.Assert(err, checker.IsNil, check.Commentf("%v", out))
+	assert.Assert(c, err == nil, "%v", out)
 
 
-	c.Assert(logConfig.Type, checker.Equals, "json-file")
-	c.Assert(logConfig.Config["max-file"], checker.Equals, "42", check.Commentf("%v", logConfig))
+	assert.Equal(c, logConfig.Type, "json-file")
+	assert.Equal(c, logConfig.Config["max-file"], "42", fmt.Sprintf("%v", logConfig))
 }
 }
 
 
-func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *check.C) {
+func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *testing.T) {
 
 
 	//Both the container and image are named busybox. docker inspect will fetch container
 	//Both the container and image are named busybox. docker inspect will fetch container
 	//JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.
 	//JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.
@@ -303,35 +303,34 @@ func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *check.C) {
 
 
 	formatStr := "--format={{.SizeRw}},{{.SizeRootFs}}"
 	formatStr := "--format={{.SizeRw}},{{.SizeRootFs}}"
 	out, _ := dockerCmd(c, "inspect", "--type=container", formatStr, "busybox")
 	out, _ := dockerCmd(c, "inspect", "--type=container", formatStr, "busybox")
-	c.Assert(strings.TrimSpace(out), check.Equals, "<nil>,<nil>", check.Commentf("Expected not to display size info: %s", out))
+	assert.Equal(c, strings.TrimSpace(out), "<nil>,<nil>", fmt.Sprintf("Expected not to display size info: %s", out))
 }
 }
 
 
-func (s *DockerSuite) TestInspectSizeFlagContainer(c *check.C) {
+func (s *DockerSuite) TestInspectSizeFlagContainer(c *testing.T) {
 	runSleepingContainer(c, "--name=busybox", "-d")
 	runSleepingContainer(c, "--name=busybox", "-d")
 
 
 	formatStr := "--format='{{.SizeRw}},{{.SizeRootFs}}'"
 	formatStr := "--format='{{.SizeRw}},{{.SizeRootFs}}'"
 	out, _ := dockerCmd(c, "inspect", "-s", "--type=container", formatStr, "busybox")
 	out, _ := dockerCmd(c, "inspect", "-s", "--type=container", formatStr, "busybox")
 	sz := strings.Split(out, ",")
 	sz := strings.Split(out, ",")
 
 
-	c.Assert(strings.TrimSpace(sz[0]), check.Not(check.Equals), "<nil>")
-	c.Assert(strings.TrimSpace(sz[1]), check.Not(check.Equals), "<nil>")
+	assert.Assert(c, strings.TrimSpace(sz[0]) != "<nil>")
+	assert.Assert(c, strings.TrimSpace(sz[1]) != "<nil>")
 }
 }
 
 
-func (s *DockerSuite) TestInspectTemplateError(c *check.C) {
+func (s *DockerSuite) TestInspectTemplateError(c *testing.T) {
 	// Template parsing error for both the container and image.
 	// Template parsing error for both the container and image.
 
 
 	runSleepingContainer(c, "--name=container1", "-d")
 	runSleepingContainer(c, "--name=container1", "-d")
 
 
 	out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='Format container: {{.ThisDoesNotExist}}'", "container1")
 	out, _, err := dockerCmdWithError("inspect", "--type=container", "--format='Format container: {{.ThisDoesNotExist}}'", "container1")
-	c.Assert(err, check.Not(check.IsNil))
-	c.Assert(out, checker.Contains, "Template parsing error")
-
+	assert.Assert(c, err != nil)
+	assert.Assert(c, strings.Contains(out, "Template parsing error"))
 	out, _, err = dockerCmdWithError("inspect", "--type=image", "--format='Format container: {{.ThisDoesNotExist}}'", "busybox")
 	out, _, err = dockerCmdWithError("inspect", "--type=image", "--format='Format container: {{.ThisDoesNotExist}}'", "busybox")
-	c.Assert(err, check.Not(check.IsNil))
-	c.Assert(out, checker.Contains, "Template parsing error")
+	assert.Assert(c, err != nil)
+	assert.Assert(c, strings.Contains(out, "Template parsing error"))
 }
 }
 
 
-func (s *DockerSuite) TestInspectJSONFields(c *check.C) {
+func (s *DockerSuite) TestInspectJSONFields(c *testing.T) {
 	runSleepingContainer(c, "--name=busybox", "-d")
 	runSleepingContainer(c, "--name=busybox", "-d")
 	out, _, err := dockerCmdWithError("inspect", "--type=container", "--format={{.HostConfig.Dns}}", "busybox")
 	out, _, err := dockerCmdWithError("inspect", "--type=container", "--format={{.HostConfig.Dns}}", "busybox")
 
 
@@ -339,68 +338,67 @@ func (s *DockerSuite) TestInspectJSONFields(c *check.C) {
 	assert.Equal(c, out, "[]\n")
 	assert.Equal(c, out, "[]\n")
 }
 }
 
 
-func (s *DockerSuite) TestInspectByPrefix(c *check.C) {
+func (s *DockerSuite) TestInspectByPrefix(c *testing.T) {
 	id := inspectField(c, "busybox", "Id")
 	id := inspectField(c, "busybox", "Id")
 	assert.Assert(c, strings.HasPrefix(id, "sha256:"))
 	assert.Assert(c, strings.HasPrefix(id, "sha256:"))
 
 
 	id2 := inspectField(c, id[:12], "Id")
 	id2 := inspectField(c, id[:12], "Id")
-	c.Assert(id, checker.Equals, id2)
+	assert.Equal(c, id, id2)
 
 
 	id3 := inspectField(c, strings.TrimPrefix(id, "sha256:")[:12], "Id")
 	id3 := inspectField(c, strings.TrimPrefix(id, "sha256:")[:12], "Id")
-	c.Assert(id, checker.Equals, id3)
+	assert.Equal(c, id, id3)
 }
 }
 
 
-func (s *DockerSuite) TestInspectStopWhenNotFound(c *check.C) {
+func (s *DockerSuite) TestInspectStopWhenNotFound(c *testing.T) {
 	runSleepingContainer(c, "--name=busybox1", "-d")
 	runSleepingContainer(c, "--name=busybox1", "-d")
 	runSleepingContainer(c, "--name=busybox2", "-d")
 	runSleepingContainer(c, "--name=busybox2", "-d")
 	result := dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "busybox1", "busybox2", "missing")
 	result := dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "busybox1", "busybox2", "missing")
 
 
-	c.Assert(result.Error, checker.Not(check.IsNil))
-	c.Assert(result.Stdout(), checker.Contains, "busybox1")
-	c.Assert(result.Stdout(), checker.Contains, "busybox2")
-	c.Assert(result.Stderr(), checker.Contains, "Error: No such container: missing")
-
+	assert.Assert(c, result.Error != nil)
+	assert.Assert(c, strings.Contains(result.Stdout(), "busybox1"))
+	assert.Assert(c, strings.Contains(result.Stdout(), "busybox2"))
+	assert.Assert(c, strings.Contains(result.Stderr(), "Error: No such container: missing"))
 	// test inspect would not fast fail
 	// test inspect would not fast fail
 	result = dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "missing", "busybox1", "busybox2")
 	result = dockerCmdWithResult("inspect", "--type=container", "--format='{{.Name}}'", "missing", "busybox1", "busybox2")
 
 
-	c.Assert(result.Error, checker.Not(check.IsNil))
-	c.Assert(result.Stdout(), checker.Contains, "busybox1")
-	c.Assert(result.Stdout(), checker.Contains, "busybox2")
-	c.Assert(result.Stderr(), checker.Contains, "Error: No such container: missing")
+	assert.Assert(c, result.Error != nil)
+	assert.Assert(c, strings.Contains(result.Stdout(), "busybox1"))
+	assert.Assert(c, strings.Contains(result.Stdout(), "busybox2"))
+	assert.Assert(c, strings.Contains(result.Stderr(), "Error: No such container: missing"))
 }
 }
 
 
-func (s *DockerSuite) TestInspectHistory(c *check.C) {
+func (s *DockerSuite) TestInspectHistory(c *testing.T) {
 	dockerCmd(c, "run", "--name=testcont", "busybox", "echo", "hello")
 	dockerCmd(c, "run", "--name=testcont", "busybox", "echo", "hello")
 	dockerCmd(c, "commit", "-m", "test comment", "testcont", "testimg")
 	dockerCmd(c, "commit", "-m", "test comment", "testcont", "testimg")
 	out, _, err := dockerCmdWithError("inspect", "--format='{{.Comment}}'", "testimg")
 	out, _, err := dockerCmdWithError("inspect", "--format='{{.Comment}}'", "testimg")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, "test comment")
+	assert.Assert(c, strings.Contains(out, "test comment"))
 }
 }
 
 
-func (s *DockerSuite) TestInspectContainerNetworkDefault(c *check.C) {
+func (s *DockerSuite) TestInspectContainerNetworkDefault(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	contName := "test1"
 	contName := "test1"
 	dockerCmd(c, "run", "--name", contName, "-d", "busybox", "top")
 	dockerCmd(c, "run", "--name", contName, "-d", "busybox", "top")
 	netOut, _ := dockerCmd(c, "network", "inspect", "--format={{.ID}}", "bridge")
 	netOut, _ := dockerCmd(c, "network", "inspect", "--format={{.ID}}", "bridge")
 	out := inspectField(c, contName, "NetworkSettings.Networks")
 	out := inspectField(c, contName, "NetworkSettings.Networks")
-	c.Assert(out, checker.Contains, "bridge")
+	assert.Assert(c, strings.Contains(out, "bridge"))
 	out = inspectField(c, contName, "NetworkSettings.Networks.bridge.NetworkID")
 	out = inspectField(c, contName, "NetworkSettings.Networks.bridge.NetworkID")
 	assert.Equal(c, strings.TrimSpace(out), strings.TrimSpace(netOut))
 	assert.Equal(c, strings.TrimSpace(out), strings.TrimSpace(netOut))
 }
 }
 
 
-func (s *DockerSuite) TestInspectContainerNetworkCustom(c *check.C) {
+func (s *DockerSuite) TestInspectContainerNetworkCustom(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	netOut, _ := dockerCmd(c, "network", "create", "net1")
 	netOut, _ := dockerCmd(c, "network", "create", "net1")
 	dockerCmd(c, "run", "--name=container1", "--net=net1", "-d", "busybox", "top")
 	dockerCmd(c, "run", "--name=container1", "--net=net1", "-d", "busybox", "top")
 	out := inspectField(c, "container1", "NetworkSettings.Networks")
 	out := inspectField(c, "container1", "NetworkSettings.Networks")
-	c.Assert(out, checker.Contains, "net1")
+	assert.Assert(c, strings.Contains(out, "net1"))
 	out = inspectField(c, "container1", "NetworkSettings.Networks.net1.NetworkID")
 	out = inspectField(c, "container1", "NetworkSettings.Networks.net1.NetworkID")
 	assert.Equal(c, strings.TrimSpace(out), strings.TrimSpace(netOut))
 	assert.Equal(c, strings.TrimSpace(out), strings.TrimSpace(netOut))
 }
 }
 
 
-func (s *DockerSuite) TestInspectRootFS(c *check.C) {
+func (s *DockerSuite) TestInspectRootFS(c *testing.T) {
 	out, _, err := dockerCmdWithError("inspect", "busybox")
 	out, _, err := dockerCmdWithError("inspect", "busybox")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
@@ -410,17 +408,17 @@ func (s *DockerSuite) TestInspectRootFS(c *check.C) {
 	assert.Assert(c, len(imageJSON[0].RootFS.Layers) >= 1)
 	assert.Assert(c, len(imageJSON[0].RootFS.Layers) >= 1)
 }
 }
 
 
-func (s *DockerSuite) TestInspectAmpersand(c *check.C) {
+func (s *DockerSuite) TestInspectAmpersand(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	name := "test"
 	name := "test"
 	out, _ := dockerCmd(c, "run", "--name", name, "--env", `TEST_ENV="soanni&rtr"`, "busybox", "env")
 	out, _ := dockerCmd(c, "run", "--name", name, "--env", `TEST_ENV="soanni&rtr"`, "busybox", "env")
-	c.Assert(out, checker.Contains, `soanni&rtr`)
+	assert.Assert(c, strings.Contains(out, `soanni&rtr`))
 	out, _ = dockerCmd(c, "inspect", name)
 	out, _ = dockerCmd(c, "inspect", name)
-	c.Assert(out, checker.Contains, `soanni&rtr`)
+	assert.Assert(c, strings.Contains(out, `soanni&rtr`))
 }
 }
 
 
-func (s *DockerSuite) TestInspectPlugin(c *check.C) {
+func (s *DockerSuite) TestInspectPlugin(c *testing.T) {
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -447,14 +445,14 @@ func (s *DockerSuite) TestInspectPlugin(c *check.C) {
 
 
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, pNameWithTag)
+	assert.Assert(c, strings.Contains(out, pNameWithTag))
 }
 }
 
 
 // Test case for 29185
 // Test case for 29185
-func (s *DockerSuite) TestInspectUnknownObject(c *check.C) {
+func (s *DockerSuite) TestInspectUnknownObject(c *testing.T) {
 	// This test should work on both Windows and Linux
 	// This test should work on both Windows and Linux
 	out, _, err := dockerCmdWithError("inspect", "foobar")
 	out, _, err := dockerCmdWithError("inspect", "foobar")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Error: No such object: foobar")
+	assert.Assert(c, strings.Contains(out, "Error: No such object: foobar"))
 	assert.ErrorContains(c, err, "Error: No such object: foobar")
 	assert.ErrorContains(c, err, "Error: No such object: foobar")
 }
 }

+ 36 - 36
integration-cli/docker_cli_links_test.go

@@ -6,35 +6,35 @@ import (
 	"regexp"
 	"regexp"
 	"sort"
 	"sort"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/runconfig"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
+	"gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestLinksPingUnlinkedContainers(c *check.C) {
+func (s *DockerSuite) TestLinksPingUnlinkedContainers(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	_, exitCode, err := dockerCmdWithError("run", "--rm", "busybox", "sh", "-c", "ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1")
 	_, exitCode, err := dockerCmdWithError("run", "--rm", "busybox", "sh", "-c", "ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1")
 
 
 	// run ping failed with error
 	// run ping failed with error
-	c.Assert(exitCode, checker.Equals, 1, check.Commentf("error: %v", err))
+	assert.Equal(c, exitCode, 1, fmt.Sprintf("error: %v", err))
 }
 }
 
 
 // Test for appropriate error when calling --link with an invalid target container
 // Test for appropriate error when calling --link with an invalid target container
-func (s *DockerSuite) TestLinksInvalidContainerTarget(c *check.C) {
+func (s *DockerSuite) TestLinksInvalidContainerTarget(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _, err := dockerCmdWithError("run", "--link", "bogus:alias", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--link", "bogus:alias", "busybox", "true")
 
 
 	// an invalid container target should produce an error
 	// an invalid container target should produce an error
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 	// an invalid container target should produce an error
 	// an invalid container target should produce an error
 	// note: convert the output to lowercase first as the error string
 	// note: convert the output to lowercase first as the error string
 	// capitalization was changed after API version 1.32
 	// capitalization was changed after API version 1.32
-	c.Assert(strings.ToLower(out), checker.Contains, "could not get container")
+	assert.Assert(c, strings.Contains(strings.ToLower(out), "could not get container"))
 }
 }
 
 
-func (s *DockerSuite) TestLinksPingLinkedContainers(c *check.C) {
+func (s *DockerSuite) TestLinksPingLinkedContainers(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// Test with the three different ways of specifying the default network on Linux
 	// Test with the three different ways of specifying the default network on Linux
 	testLinkPingOnNetwork(c, "")
 	testLinkPingOnNetwork(c, "")
@@ -42,7 +42,7 @@ func (s *DockerSuite) TestLinksPingLinkedContainers(c *check.C) {
 	testLinkPingOnNetwork(c, "bridge")
 	testLinkPingOnNetwork(c, "bridge")
 }
 }
 
 
-func testLinkPingOnNetwork(c *check.C, network string) {
+func testLinkPingOnNetwork(c *testing.T, network string) {
 	var postArgs []string
 	var postArgs []string
 	if network != "" {
 	if network != "" {
 		postArgs = append(postArgs, []string{"--net", network}...)
 		postArgs = append(postArgs, []string{"--net", network}...)
@@ -78,7 +78,7 @@ func testLinkPingOnNetwork(c *check.C, network string) {
 	dockerCmd(c, "rm", "-f", "container2")
 	dockerCmd(c, "rm", "-f", "container2")
 }
 }
 
 
-func (s *DockerSuite) TestLinksPingLinkedContainersAfterRename(c *check.C) {
+func (s *DockerSuite) TestLinksPingLinkedContainersAfterRename(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
 	idA := strings.TrimSpace(out)
 	idA := strings.TrimSpace(out)
@@ -91,7 +91,7 @@ func (s *DockerSuite) TestLinksPingLinkedContainersAfterRename(c *check.C) {
 
 
 }
 }
 
 
-func (s *DockerSuite) TestLinksInspectLinksStarted(c *check.C) {
+func (s *DockerSuite) TestLinksInspectLinksStarted(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "container2", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "container2", "busybox", "top")
@@ -110,7 +110,7 @@ func (s *DockerSuite) TestLinksInspectLinksStarted(c *check.C) {
 	assert.DeepEqual(c, result, expected)
 	assert.DeepEqual(c, result, expected)
 }
 }
 
 
-func (s *DockerSuite) TestLinksInspectLinksStopped(c *check.C) {
+func (s *DockerSuite) TestLinksInspectLinksStopped(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "container1", "busybox", "top")
@@ -130,7 +130,7 @@ func (s *DockerSuite) TestLinksInspectLinksStopped(c *check.C) {
 	assert.DeepEqual(c, result, expected)
 	assert.DeepEqual(c, result, expected)
 }
 }
 
 
-func (s *DockerSuite) TestLinksNotStartedParentNotFail(c *check.C) {
+func (s *DockerSuite) TestLinksNotStartedParentNotFail(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "create", "--name=first", "busybox", "top")
 	dockerCmd(c, "create", "--name=first", "busybox", "top")
 	dockerCmd(c, "create", "--name=second", "--link=first:first", "busybox", "top")
 	dockerCmd(c, "create", "--name=second", "--link=first:first", "busybox", "top")
@@ -138,7 +138,7 @@ func (s *DockerSuite) TestLinksNotStartedParentNotFail(c *check.C) {
 
 
 }
 }
 
 
-func (s *DockerSuite) TestLinksHostsFilesInject(c *check.C) {
+func (s *DockerSuite) TestLinksHostsFilesInject(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 
 
@@ -148,15 +148,15 @@ func (s *DockerSuite) TestLinksHostsFilesInject(c *check.C) {
 	out, _ = dockerCmd(c, "run", "-itd", "--name", "two", "--link", "one:onetwo", "busybox", "top")
 	out, _ = dockerCmd(c, "run", "-itd", "--name", "two", "--link", "one:onetwo", "busybox", "top")
 	idTwo := strings.TrimSpace(out)
 	idTwo := strings.TrimSpace(out)
 
 
-	c.Assert(waitRun(idTwo), checker.IsNil)
+	assert.Assert(c, waitRun(idTwo) == nil)
 
 
 	readContainerFileWithExec(c, idOne, "/etc/hosts")
 	readContainerFileWithExec(c, idOne, "/etc/hosts")
 	contentTwo := readContainerFileWithExec(c, idTwo, "/etc/hosts")
 	contentTwo := readContainerFileWithExec(c, idTwo, "/etc/hosts")
 	// Host is not present in updated hosts file
 	// Host is not present in updated hosts file
-	c.Assert(string(contentTwo), checker.Contains, "onetwo")
+	assert.Assert(c, strings.Contains(string(contentTwo), "onetwo"))
 }
 }
 
 
-func (s *DockerSuite) TestLinksUpdateOnRestart(c *check.C) {
+func (s *DockerSuite) TestLinksUpdateOnRestart(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon)
 	testRequires(c, testEnv.IsLocalDaemon)
 	dockerCmd(c, "run", "-d", "--name", "one", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name", "one", "busybox", "top")
@@ -169,70 +169,70 @@ func (s *DockerSuite) TestLinksUpdateOnRestart(c *check.C) {
 	getIP := func(hosts []byte, hostname string) string {
 	getIP := func(hosts []byte, hostname string) string {
 		re := regexp.MustCompile(fmt.Sprintf(`(\S*)\t%s`, regexp.QuoteMeta(hostname)))
 		re := regexp.MustCompile(fmt.Sprintf(`(\S*)\t%s`, regexp.QuoteMeta(hostname)))
 		matches := re.FindSubmatch(hosts)
 		matches := re.FindSubmatch(hosts)
-		c.Assert(matches, checker.NotNil, check.Commentf("Hostname %s have no matches in hosts", hostname))
+		assert.Assert(c, matches != nil, "Hostname %s have no matches in hosts", hostname)
 		return string(matches[1])
 		return string(matches[1])
 	}
 	}
 	ip := getIP(content, "one")
 	ip := getIP(content, "one")
-	c.Assert(ip, checker.Equals, realIP)
+	assert.Equal(c, ip, realIP)
 
 
 	ip = getIP(content, "onetwo")
 	ip = getIP(content, "onetwo")
-	c.Assert(ip, checker.Equals, realIP)
+	assert.Equal(c, ip, realIP)
 
 
 	dockerCmd(c, "restart", "one")
 	dockerCmd(c, "restart", "one")
 	realIP = inspectField(c, "one", "NetworkSettings.Networks.bridge.IPAddress")
 	realIP = inspectField(c, "one", "NetworkSettings.Networks.bridge.IPAddress")
 
 
 	content = readContainerFileWithExec(c, id, "/etc/hosts")
 	content = readContainerFileWithExec(c, id, "/etc/hosts")
 	ip = getIP(content, "one")
 	ip = getIP(content, "one")
-	c.Assert(ip, checker.Equals, realIP)
+	assert.Equal(c, ip, realIP)
 
 
 	ip = getIP(content, "onetwo")
 	ip = getIP(content, "onetwo")
-	c.Assert(ip, checker.Equals, realIP)
+	assert.Equal(c, ip, realIP)
 }
 }
 
 
-func (s *DockerSuite) TestLinksEnvs(c *check.C) {
+func (s *DockerSuite) TestLinksEnvs(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "-e", "e1=", "-e", "e2=v2", "-e", "e3=v3=v3", "--name=first", "busybox", "top")
 	dockerCmd(c, "run", "-d", "-e", "e1=", "-e", "e2=v2", "-e", "e3=v3=v3", "--name=first", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "--name=second", "--link=first:first", "busybox", "env")
 	out, _ := dockerCmd(c, "run", "--name=second", "--link=first:first", "busybox", "env")
-	c.Assert(out, checker.Contains, "FIRST_ENV_e1=\n")
-	c.Assert(out, checker.Contains, "FIRST_ENV_e2=v2")
-	c.Assert(out, checker.Contains, "FIRST_ENV_e3=v3=v3")
+	assert.Assert(c, strings.Contains(out, "FIRST_ENV_e1=\n"))
+	assert.Assert(c, strings.Contains(out, "FIRST_ENV_e2=v2"))
+	assert.Assert(c, strings.Contains(out, "FIRST_ENV_e3=v3=v3"))
 }
 }
 
 
-func (s *DockerSuite) TestLinkShortDefinition(c *check.C) {
+func (s *DockerSuite) TestLinkShortDefinition(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "--name", "shortlinkdef", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "--name", "shortlinkdef", "busybox", "top")
 
 
 	cid := strings.TrimSpace(out)
 	cid := strings.TrimSpace(out)
-	c.Assert(waitRun(cid), checker.IsNil)
+	assert.Assert(c, waitRun(cid) == nil)
 
 
 	out, _ = dockerCmd(c, "run", "-d", "--name", "link2", "--link", "shortlinkdef", "busybox", "top")
 	out, _ = dockerCmd(c, "run", "-d", "--name", "link2", "--link", "shortlinkdef", "busybox", "top")
 
 
 	cid2 := strings.TrimSpace(out)
 	cid2 := strings.TrimSpace(out)
-	c.Assert(waitRun(cid2), checker.IsNil)
+	assert.Assert(c, waitRun(cid2) == nil)
 
 
 	links := inspectFieldJSON(c, cid2, "HostConfig.Links")
 	links := inspectFieldJSON(c, cid2, "HostConfig.Links")
-	c.Assert(links, checker.Equals, "[\"/shortlinkdef:/link2/shortlinkdef\"]")
+	assert.Equal(c, links, "[\"/shortlinkdef:/link2/shortlinkdef\"]")
 }
 }
 
 
-func (s *DockerSuite) TestLinksNetworkHostContainer(c *check.C) {
+func (s *DockerSuite) TestLinksNetworkHostContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	dockerCmd(c, "run", "-d", "--net", "host", "--name", "host_container", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--net", "host", "--name", "host_container", "busybox", "top")
 	out, _, err := dockerCmdWithError("run", "--name", "should_fail", "--link", "host_container:tester", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--name", "should_fail", "--link", "host_container:tester", "busybox", "true")
 
 
 	// Running container linking to a container with --net host should have failed
 	// Running container linking to a container with --net host should have failed
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 	// Running container linking to a container with --net host should have failed
 	// Running container linking to a container with --net host should have failed
-	c.Assert(out, checker.Contains, runconfig.ErrConflictHostNetworkAndLinks.Error())
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictHostNetworkAndLinks.Error()))
 }
 }
 
 
-func (s *DockerSuite) TestLinksEtcHostsRegularFile(c *check.C) {
+func (s *DockerSuite) TestLinksEtcHostsRegularFile(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
 	out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
 	// /etc/hosts should be a regular file
 	// /etc/hosts should be a regular file
-	c.Assert(out, checker.Matches, "^-.+\n")
+	assert.Assert(c, cmp.Regexp("^-.+\n$", out))
 }
 }
 
 
-func (s *DockerSuite) TestLinksMultipleWithSameName(c *check.C) {
+func (s *DockerSuite) TestLinksMultipleWithSameName(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "--name=upstream-a", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name=upstream-a", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name=upstream-b", "busybox", "top")
 	dockerCmd(c, "run", "-d", "--name=upstream-b", "busybox", "top")

+ 3 - 3
integration-cli/docker_cli_login_test.go

@@ -4,12 +4,12 @@ import (
 	"bytes"
 	"bytes"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestLoginWithoutTTY(c *check.C) {
+func (s *DockerSuite) TestLoginWithoutTTY(c *testing.T) {
 	cmd := exec.Command(dockerBinary, "login")
 	cmd := exec.Command(dockerBinary, "login")
 
 
 	// Send to stdin so the process does not get the TTY
 	// Send to stdin so the process does not get the TTY
@@ -20,7 +20,7 @@ func (s *DockerSuite) TestLoginWithoutTTY(c *check.C) {
 	assert.ErrorContains(c, err, "") //"Expected non nil err when logging in & TTY not available"
 	assert.ErrorContains(c, err, "") //"Expected non nil err when logging in & TTY not available"
 }
 }
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) TestLoginToPrivateRegistry(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TestLoginToPrivateRegistry(c *testing.T) {
 	// wrong credentials
 	// wrong credentials
 	out, _, err := dockerCmdWithError("login", "-u", s.reg.Username(), "-p", "WRONGPASSWORD", privateRegistryURL)
 	out, _, err := dockerCmdWithError("login", "-u", s.reg.Username(), "-p", "WRONGPASSWORD", privateRegistryURL)
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)

+ 3 - 3
integration-cli/docker_cli_logout_test.go

@@ -8,12 +8,12 @@ import (
 	"os/exec"
 	"os/exec"
 	"path/filepath"
 	"path/filepath"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithExternalAuth(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithExternalAuth(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	osPath := os.Getenv("PATH")
 	osPath := os.Getenv("PATH")
@@ -65,7 +65,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithExternalAuth(c *check.C)
 }
 }
 
 
 // #23100
 // #23100
-func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithWrongHostnamesStored(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TestLogoutWithWrongHostnamesStored(c *testing.T) {
 	osPath := os.Getenv("PATH")
 	osPath := os.Getenv("PATH")
 	defer os.Setenv("PATH", osPath)
 	defer os.Setenv("PATH", osPath)
 
 

+ 2 - 3
integration-cli/docker_cli_logs_bench_test.go

@@ -3,12 +3,11 @@ package main
 import (
 import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
-
-	"github.com/go-check/check"
 )
 )
 
 
-func (s *DockerSuite) BenchmarkLogsCLIRotateFollow(c *check.C) {
+func (s *DockerSuite) BenchmarkLogsCLIRotateFollow(c *testing.B) {
 	out, _ := dockerCmd(c, "run", "-d", "--log-opt", "max-size=1b", "--log-opt", "max-file=10", "busybox", "sh", "-c", "while true; do usleep 50000; echo hello; done")
 	out, _ := dockerCmd(c, "run", "-d", "--log-opt", "max-size=1b", "--log-opt", "max-file=10", "busybox", "sh", "-c", "while true; do usleep 50000; echo hello; done")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	ch := make(chan error, 1)
 	ch := make(chan error, 1)

+ 17 - 17
integration-cli/docker_cli_logs_test.go

@@ -6,31 +6,31 @@ import (
 	"os/exec"
 	"os/exec"
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/pkg/jsonmessage"
 	"github.com/docker/docker/pkg/jsonmessage"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 // This used to work, it test a log of PageSize-1 (gh#4851)
 // This used to work, it test a log of PageSize-1 (gh#4851)
-func (s *DockerSuite) TestLogsContainerSmallerThanPage(c *check.C) {
+func (s *DockerSuite) TestLogsContainerSmallerThanPage(c *testing.T) {
 	testLogsContainerPagination(c, 32767)
 	testLogsContainerPagination(c, 32767)
 }
 }
 
 
 // Regression test: When going over the PageSize, it used to panic (gh#4851)
 // Regression test: When going over the PageSize, it used to panic (gh#4851)
-func (s *DockerSuite) TestLogsContainerBiggerThanPage(c *check.C) {
+func (s *DockerSuite) TestLogsContainerBiggerThanPage(c *testing.T) {
 	testLogsContainerPagination(c, 32768)
 	testLogsContainerPagination(c, 32768)
 }
 }
 
 
 // Regression test: When going much over the PageSize, it used to block (gh#4851)
 // Regression test: When going much over the PageSize, it used to block (gh#4851)
-func (s *DockerSuite) TestLogsContainerMuchBiggerThanPage(c *check.C) {
+func (s *DockerSuite) TestLogsContainerMuchBiggerThanPage(c *testing.T) {
 	testLogsContainerPagination(c, 33000)
 	testLogsContainerPagination(c, 33000)
 }
 }
 
 
-func testLogsContainerPagination(c *check.C, testLen int) {
+func testLogsContainerPagination(c *testing.T, testLen int) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("for i in $(seq 1 %d); do echo -n = >> a.a; done; echo >> a.a; cat a.a", testLen))
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("for i in $(seq 1 %d); do echo -n = >> a.a; done; echo >> a.a; cat a.a", testLen))
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	dockerCmd(c, "wait", id)
 	dockerCmd(c, "wait", id)
@@ -38,7 +38,7 @@ func testLogsContainerPagination(c *check.C, testLen int) {
 	assert.Equal(c, len(out), testLen+1)
 	assert.Equal(c, len(out), testLen+1)
 }
 }
 
 
-func (s *DockerSuite) TestLogsTimestamps(c *check.C) {
+func (s *DockerSuite) TestLogsTimestamps(c *testing.T) {
 	testLen := 100
 	testLen := 100
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("for i in $(seq 1 %d); do echo = >> a.a; done; cat a.a", testLen))
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("for i in $(seq 1 %d); do echo = >> a.a; done; cat a.a", testLen))
 
 
@@ -63,7 +63,7 @@ func (s *DockerSuite) TestLogsTimestamps(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsSeparateStderr(c *check.C) {
+func (s *DockerSuite) TestLogsSeparateStderr(c *testing.T) {
 	msg := "stderr_log"
 	msg := "stderr_log"
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("echo %s 1>&2", msg)).Combined()
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("echo %s 1>&2", msg)).Combined()
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -74,7 +74,7 @@ func (s *DockerSuite) TestLogsSeparateStderr(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestLogsStderrInStdout(c *check.C) {
+func (s *DockerSuite) TestLogsStderrInStdout(c *testing.T) {
 	// TODO Windows: Needs investigation why this fails. Obtained string includes
 	// TODO Windows: Needs investigation why this fails. Obtained string includes
 	// a bunch of ANSI escape sequences before the "stderr_log" message.
 	// a bunch of ANSI escape sequences before the "stderr_log" message.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -89,7 +89,7 @@ func (s *DockerSuite) TestLogsStderrInStdout(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestLogsTail(c *check.C) {
+func (s *DockerSuite) TestLogsTail(c *testing.T) {
 	testLen := 100
 	testLen := 100
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("for i in $(seq 1 %d); do echo =; done;", testLen)).Combined()
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "sh", "-c", fmt.Sprintf("for i in $(seq 1 %d); do echo =; done;", testLen)).Combined()
 
 
@@ -121,7 +121,7 @@ func (s *DockerSuite) TestLogsTail(c *check.C) {
 	assert.Equal(c, len(lines), testLen+1)
 	assert.Equal(c, len(lines), testLen+1)
 }
 }
 
 
-func (s *DockerSuite) TestLogsFollowStopped(c *check.C) {
+func (s *DockerSuite) TestLogsFollowStopped(c *testing.T) {
 	dockerCmd(c, "run", "--name=test", "busybox", "echo", "hello")
 	dockerCmd(c, "run", "--name=test", "busybox", "echo", "hello")
 	id := getIDByName(c, "test")
 	id := getIDByName(c, "test")
 
 
@@ -142,7 +142,7 @@ func (s *DockerSuite) TestLogsFollowStopped(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsSince(c *check.C) {
+func (s *DockerSuite) TestLogsSince(c *testing.T) {
 	name := "testlogssince"
 	name := "testlogssince"
 	dockerCmd(c, "run", "--name="+name, "busybox", "/bin/sh", "-c", "for i in $(seq 1 3); do sleep 2; echo log$i; done")
 	dockerCmd(c, "run", "--name="+name, "busybox", "/bin/sh", "-c", "for i in $(seq 1 3); do sleep 2; echo log$i; done")
 	out, _ := dockerCmd(c, "logs", "-t", name)
 	out, _ := dockerCmd(c, "logs", "-t", name)
@@ -177,7 +177,7 @@ func (s *DockerSuite) TestLogsSince(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsSinceFutureFollow(c *check.C) {
+func (s *DockerSuite) TestLogsSinceFutureFollow(c *testing.T) {
 	// TODO Windows TP5 - Figure out why this test is so flakey. Disabled for now.
 	// TODO Windows TP5 - Figure out why this test is so flakey. Disabled for now.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "testlogssincefuturefollow"
 	name := "testlogssincefuturefollow"
@@ -211,7 +211,7 @@ func (s *DockerSuite) TestLogsSinceFutureFollow(c *check.C) {
 }
 }
 
 
 // Regression test for #8832
 // Regression test for #8832
-func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {
+func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *testing.T) {
 	// TODO Windows: Fix this test for TP5.
 	// TODO Windows: Fix this test for TP5.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	expected := 150000
 	expected := 150000
@@ -269,7 +269,7 @@ func ConsumeWithSpeed(reader io.Reader, chunkSize int, interval time.Duration, s
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) {
+func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "while true; do echo hello; sleep 2; done")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "while true; do echo hello; sleep 2; done")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(id))
 	assert.NilError(c, waitRun(id))
@@ -297,7 +297,7 @@ func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) {
 	assert.NilError(c, waitForGoroutines(nroutines))
 	assert.NilError(c, waitForGoroutines(nroutines))
 }
 }
 
 
-func (s *DockerSuite) TestLogsFollowGoroutinesNoOutput(c *check.C) {
+func (s *DockerSuite) TestLogsFollowGoroutinesNoOutput(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "while true; do sleep 2; done")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "while true; do sleep 2; done")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 	assert.NilError(c, waitRun(id))
 	assert.NilError(c, waitRun(id))
@@ -315,14 +315,14 @@ func (s *DockerSuite) TestLogsFollowGoroutinesNoOutput(c *check.C) {
 	assert.NilError(c, waitForGoroutines(nroutines))
 	assert.NilError(c, waitForGoroutines(nroutines))
 }
 }
 
 
-func (s *DockerSuite) TestLogsCLIContainerNotFound(c *check.C) {
+func (s *DockerSuite) TestLogsCLIContainerNotFound(c *testing.T) {
 	name := "testlogsnocontainer"
 	name := "testlogsnocontainer"
 	out, _, _ := dockerCmdWithError("logs", name)
 	out, _, _ := dockerCmdWithError("logs", name)
 	message := fmt.Sprintf("No such container: %s\n", name)
 	message := fmt.Sprintf("No such container: %s\n", name)
 	assert.Assert(c, strings.Contains(out, message))
 	assert.Assert(c, strings.Contains(out, message))
 }
 }
 
 
-func (s *DockerSuite) TestLogsWithDetails(c *check.C) {
+func (s *DockerSuite) TestLogsWithDetails(c *testing.T) {
 	dockerCmd(c, "run", "--name=test", "--label", "foo=bar", "-e", "baz=qux", "--log-opt", "labels=foo", "--log-opt", "env=baz", "busybox", "echo", "hello")
 	dockerCmd(c, "run", "--name=test", "--label", "foo=bar", "-e", "baz=qux", "--log-opt", "labels=foo", "--log-opt", "env=baz", "busybox", "echo", "hello")
 	out, _ := dockerCmd(c, "logs", "--details", "--timestamps", "test")
 	out, _ := dockerCmd(c, "logs", "--details", "--timestamps", "test")
 
 

+ 26 - 36
integration-cli/docker_cli_netmode_test.go

@@ -2,10 +2,10 @@ package main
 
 
 import (
 import (
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/runconfig"
 	"github.com/docker/docker/runconfig"
-	"github.com/go-check/check"
+	"gotest.tools/assert"
 )
 )
 
 
 // GH14530. Validates combinations of --net= with other options
 // GH14530. Validates combinations of --net= with other options
@@ -17,80 +17,70 @@ const stringCheckPS = "PID   USER"
 // DockerCmdWithFail executes a docker command that is supposed to fail and returns
 // DockerCmdWithFail executes a docker command that is supposed to fail and returns
 // the output, the exit code. If the command returns a Nil error, it will fail and
 // the output, the exit code. If the command returns a Nil error, it will fail and
 // stop the tests.
 // stop the tests.
-func dockerCmdWithFail(c *check.C, args ...string) (string, int) {
+func dockerCmdWithFail(c *testing.T, args ...string) (string, int) {
 	out, status, err := dockerCmdWithError(args...)
 	out, status, err := dockerCmdWithError(args...)
-	c.Assert(err, check.NotNil, check.Commentf("%v", out))
+	assert.Assert(c, err != nil, "%v", out)
 	return out, status
 	return out, status
 }
 }
 
 
-func (s *DockerSuite) TestNetHostnameWithNetHost(c *check.C) {
+func (s *DockerSuite) TestNetHostnameWithNetHost(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 
 
 	out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ps")
 	out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ps")
-	c.Assert(out, checker.Contains, stringCheckPS)
+	assert.Assert(c, strings.Contains(out, stringCheckPS))
 }
 }
 
 
-func (s *DockerSuite) TestNetHostname(c *check.C) {
+func (s *DockerSuite) TestNetHostname(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	out, _ := dockerCmd(c, "run", "-h=name", "busybox", "ps")
 	out, _ := dockerCmd(c, "run", "-h=name", "busybox", "ps")
-	c.Assert(out, checker.Contains, stringCheckPS)
-
+	assert.Assert(c, strings.Contains(out, stringCheckPS))
 	out, _ = dockerCmd(c, "run", "-h=name", "--net=bridge", "busybox", "ps")
 	out, _ = dockerCmd(c, "run", "-h=name", "--net=bridge", "busybox", "ps")
-	c.Assert(out, checker.Contains, stringCheckPS)
-
+	assert.Assert(c, strings.Contains(out, stringCheckPS))
 	out, _ = dockerCmd(c, "run", "-h=name", "--net=none", "busybox", "ps")
 	out, _ = dockerCmd(c, "run", "-h=name", "--net=none", "busybox", "ps")
-	c.Assert(out, checker.Contains, stringCheckPS)
-
+	assert.Assert(c, strings.Contains(out, stringCheckPS))
 	out, _ = dockerCmdWithFail(c, "run", "-h=name", "--net=container:other", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "-h=name", "--net=container:other", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictNetworkHostname.Error())
-
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkHostname.Error()))
 	out, _ = dockerCmdWithFail(c, "run", "--net=container", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=container", "busybox", "ps")
-	c.Assert(out, checker.Contains, "invalid container format container:<name|id>")
-
+	assert.Assert(c, strings.Contains(out, "invalid container format container:<name|id>"))
 	out, _ = dockerCmdWithFail(c, "run", "--net=weird", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=weird", "busybox", "ps")
-	c.Assert(strings.ToLower(out), checker.Contains, "not found")
+	assert.Assert(c, strings.Contains(strings.ToLower(out), "not found"))
 }
 }
 
 
-func (s *DockerSuite) TestConflictContainerNetworkAndLinks(c *check.C) {
+func (s *DockerSuite) TestConflictContainerNetworkAndLinks(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	out, _ := dockerCmdWithFail(c, "run", "--net=container:other", "--link=zip:zap", "busybox", "ps")
 	out, _ := dockerCmdWithFail(c, "run", "--net=container:other", "--link=zip:zap", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictContainerNetworkAndLinks.Error())
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictContainerNetworkAndLinks.Error()))
 }
 }
 
 
-func (s *DockerSuite) TestConflictContainerNetworkHostAndLinks(c *check.C) {
+func (s *DockerSuite) TestConflictContainerNetworkHostAndLinks(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 
 
 	out, _ := dockerCmdWithFail(c, "run", "--net=host", "--link=zip:zap", "busybox", "ps")
 	out, _ := dockerCmdWithFail(c, "run", "--net=host", "--link=zip:zap", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictHostNetworkAndLinks.Error())
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictHostNetworkAndLinks.Error()))
 }
 }
 
 
-func (s *DockerSuite) TestConflictNetworkModeNetHostAndOptions(c *check.C) {
+func (s *DockerSuite) TestConflictNetworkModeNetHostAndOptions(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 
 
 	out, _ := dockerCmdWithFail(c, "run", "--net=host", "--mac-address=92:d0:c6:0a:29:33", "busybox", "ps")
 	out, _ := dockerCmdWithFail(c, "run", "--net=host", "--mac-address=92:d0:c6:0a:29:33", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictContainerNetworkAndMac.Error())
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictContainerNetworkAndMac.Error()))
 }
 }
 
 
-func (s *DockerSuite) TestConflictNetworkModeAndOptions(c *check.C) {
+func (s *DockerSuite) TestConflictNetworkModeAndOptions(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	out, _ := dockerCmdWithFail(c, "run", "--net=container:other", "--dns=8.8.8.8", "busybox", "ps")
 	out, _ := dockerCmdWithFail(c, "run", "--net=container:other", "--dns=8.8.8.8", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictNetworkAndDNS.Error())
-
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkAndDNS.Error()))
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "--add-host=name:8.8.8.8", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "--add-host=name:8.8.8.8", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictNetworkHosts.Error())
-
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkHosts.Error()))
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "--mac-address=92:d0:c6:0a:29:33", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "--mac-address=92:d0:c6:0a:29:33", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictContainerNetworkAndMac.Error())
-
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictContainerNetworkAndMac.Error()))
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "-P", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "-P", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictNetworkPublishPorts.Error())
-
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()))
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "-p", "8080", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "-p", "8080", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictNetworkPublishPorts.Error())
-
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkPublishPorts.Error()))
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "--expose", "8000-9000", "busybox", "ps")
 	out, _ = dockerCmdWithFail(c, "run", "--net=container:other", "--expose", "8000-9000", "busybox", "ps")
-	c.Assert(out, checker.Contains, runconfig.ErrConflictNetworkExposePorts.Error())
+	assert.Assert(c, strings.Contains(out, runconfig.ErrConflictNetworkExposePorts.Error()))
 }
 }

+ 13 - 0
integration-cli/docker_cli_network_test.go

@@ -0,0 +1,13 @@
+package main
+
+import (
+	"net/http/httptest"
+
+	"github.com/docker/docker/integration-cli/daemon"
+)
+
+type DockerNetworkSuite struct {
+	server *httptest.Server
+	ds     *DockerSuite
+	d      *daemon.Daemon
+}

File diff suppressed because it is too large
+ 179 - 217
integration-cli/docker_cli_network_unix_test.go


+ 3 - 3
integration-cli/docker_cli_plugins_logdriver_test.go

@@ -3,13 +3,13 @@ package main
 import (
 import (
 	"context"
 	"context"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestPluginLogDriver(c *check.C) {
+func (s *DockerSuite) TestPluginLogDriver(c *testing.T) {
 	testRequires(c, IsAmd64, DaemonIsLinux)
 	testRequires(c, IsAmd64, DaemonIsLinux)
 
 
 	pluginName := "cpuguy83/docker-logdriver-test:latest"
 	pluginName := "cpuguy83/docker-logdriver-test:latest"
@@ -29,7 +29,7 @@ func (s *DockerSuite) TestPluginLogDriver(c *check.C) {
 }
 }
 
 
 // Make sure log drivers are listed in info, and v2 plugins are not.
 // Make sure log drivers are listed in info, and v2 plugins are not.
-func (s *DockerSuite) TestPluginLogDriverInfoList(c *check.C) {
+func (s *DockerSuite) TestPluginLogDriverInfoList(c *testing.T) {
 	testRequires(c, IsAmd64, DaemonIsLinux)
 	testRequires(c, IsAmd64, DaemonIsLinux)
 	pluginName := "cpuguy83/docker-logdriver-test"
 	pluginName := "cpuguy83/docker-logdriver-test"
 
 

+ 73 - 103
integration-cli/docker_cli_plugins_test.go

@@ -9,14 +9,13 @@ import (
 	"path"
 	"path"
 	"path/filepath"
 	"path/filepath"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/internal/test/fixtures/plugin"
 	"github.com/docker/docker/internal/test/fixtures/plugin"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -29,52 +28,48 @@ var (
 	npNameWithTag     = npName + ":" + pTag
 	npNameWithTag     = npName + ":" + pTag
 )
 )
 
 
-func (ps *DockerPluginSuite) TestPluginBasicOps(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginBasicOps(c *testing.T) {
 	plugin := ps.getPluginRepoWithTag()
 	plugin := ps.getPluginRepoWithTag()
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", plugin)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", plugin)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, err := dockerCmdWithError("plugin", "ls")
 	out, _, err := dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, plugin)
-	c.Assert(out, checker.Contains, "true")
-
+	assert.Assert(c, strings.Contains(out, plugin))
+	assert.Assert(c, strings.Contains(out, "true"))
 	id, _, err := dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", plugin)
 	id, _, err := dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", plugin)
 	id = strings.TrimSpace(id)
 	id = strings.TrimSpace(id)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, err = dockerCmdWithError("plugin", "remove", plugin)
 	out, _, err = dockerCmdWithError("plugin", "remove", plugin)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "is enabled")
-
+	assert.Assert(c, strings.Contains(out, "is enabled"))
 	_, _, err = dockerCmdWithError("plugin", "disable", plugin)
 	_, _, err = dockerCmdWithError("plugin", "disable", plugin)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, err = dockerCmdWithError("plugin", "remove", plugin)
 	out, _, err = dockerCmdWithError("plugin", "remove", plugin)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, plugin)
-
+	assert.Assert(c, strings.Contains(out, plugin))
 	_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id))
 	_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id))
 	if !os.IsNotExist(err) {
 	if !os.IsNotExist(err) {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginForceRemove(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginForceRemove(c *testing.T) {
 	pNameWithTag := ps.getPluginRepoWithTag()
 	pNameWithTag := ps.getPluginRepoWithTag()
 
 
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, _ := dockerCmdWithError("plugin", "remove", pNameWithTag)
 	out, _, _ := dockerCmdWithError("plugin", "remove", pNameWithTag)
-	c.Assert(out, checker.Contains, "is enabled")
-
+	assert.Assert(c, strings.Contains(out, "is enabled"))
 	out, _, err = dockerCmdWithError("plugin", "remove", "--force", pNameWithTag)
 	out, _, err = dockerCmdWithError("plugin", "remove", "--force", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, pNameWithTag)
+	assert.Assert(c, strings.Contains(out, pNameWithTag))
 }
 }
 
 
-func (s *DockerSuite) TestPluginActive(c *check.C) {
+func (s *DockerSuite) TestPluginActive(c *testing.T) {
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 
 
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
@@ -84,8 +79,7 @@ func (s *DockerSuite) TestPluginActive(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, _ := dockerCmdWithError("plugin", "disable", pNameWithTag)
 	out, _, _ := dockerCmdWithError("plugin", "disable", pNameWithTag)
-	c.Assert(out, checker.Contains, "in use")
-
+	assert.Assert(c, strings.Contains(out, "in use"))
 	_, _, err = dockerCmdWithError("volume", "rm", "testvol1")
 	_, _, err = dockerCmdWithError("volume", "rm", "testvol1")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
@@ -94,10 +88,10 @@ func (s *DockerSuite) TestPluginActive(c *check.C) {
 
 
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, pNameWithTag)
+	assert.Assert(c, strings.Contains(out, pNameWithTag))
 }
 }
 
 
-func (s *DockerSuite) TestPluginActiveNetwork(c *check.C) {
+func (s *DockerSuite) TestPluginActiveNetwork(c *testing.T) {
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", npNameWithTag)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", npNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -108,56 +102,49 @@ func (s *DockerSuite) TestPluginActiveNetwork(c *check.C) {
 	nID := strings.TrimSpace(out)
 	nID := strings.TrimSpace(out)
 
 
 	out, _, _ = dockerCmdWithError("plugin", "remove", npNameWithTag)
 	out, _, _ = dockerCmdWithError("plugin", "remove", npNameWithTag)
-	c.Assert(out, checker.Contains, "is in use")
-
+	assert.Assert(c, strings.Contains(out, "is in use"))
 	_, _, err = dockerCmdWithError("network", "rm", nID)
 	_, _, err = dockerCmdWithError("network", "rm", nID)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, _ = dockerCmdWithError("plugin", "remove", npNameWithTag)
 	out, _, _ = dockerCmdWithError("plugin", "remove", npNameWithTag)
-	c.Assert(out, checker.Contains, "is enabled")
-
+	assert.Assert(c, strings.Contains(out, "is enabled"))
 	_, _, err = dockerCmdWithError("plugin", "disable", npNameWithTag)
 	_, _, err = dockerCmdWithError("plugin", "disable", npNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, err = dockerCmdWithError("plugin", "remove", npNameWithTag)
 	out, _, err = dockerCmdWithError("plugin", "remove", npNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, npNameWithTag)
+	assert.Assert(c, strings.Contains(out, npNameWithTag))
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginInstallDisable(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginInstallDisable(c *testing.T) {
 	pName := ps.getPluginRepoWithTag()
 	pName := ps.getPluginRepoWithTag()
 
 
 	out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
 	out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, "false")
-
+	assert.Assert(c, strings.Contains(out, "false"))
 	out, _, err = dockerCmdWithError("plugin", "enable", pName)
 	out, _, err = dockerCmdWithError("plugin", "enable", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 	out, _, err = dockerCmdWithError("plugin", "disable", pName)
 	out, _, err = dockerCmdWithError("plugin", "disable", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 	out, _, err = dockerCmdWithError("plugin", "remove", pName)
 	out, _, err = dockerCmdWithError("plugin", "remove", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 }
 }
 
 
-func (s *DockerSuite) TestPluginInstallDisableVolumeLs(c *check.C) {
+func (s *DockerSuite) TestPluginInstallDisableVolumeLs(c *testing.T) {
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	testRequires(c, DaemonIsLinux, IsAmd64, Network)
 	out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
 	out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", "--disable", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 	dockerCmd(c, "volume", "ls")
 	dockerCmd(c, "volume", "ls")
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginSet(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginSet(c *testing.T) {
 	client := testEnv.APIClient()
 	client := testEnv.APIClient()
 
 
 	name := "test"
 	name := "test"
@@ -180,35 +167,31 @@ func (ps *DockerPluginSuite) TestPluginSet(c *check.C) {
 			{Name: "pdev2", Settable: []string{"path"}}, // Device without Path is invalid.
 			{Name: "pdev2", Settable: []string{"path"}}, // Device without Path is invalid.
 		}
 		}
 	})
 	})
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create test plugin"))
+	assert.Assert(c, err == nil, "failed to create test plugin")
 
 
 	env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", name)
 	env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", name)
-	c.Assert(strings.TrimSpace(env), checker.Equals, "[DEBUG=0]")
+	assert.Equal(c, strings.TrimSpace(env), "[DEBUG=0]")
 
 
 	dockerCmd(c, "plugin", "set", name, "DEBUG=1")
 	dockerCmd(c, "plugin", "set", name, "DEBUG=1")
 
 
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", name)
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", name)
-	c.Assert(strings.TrimSpace(env), checker.Equals, "[DEBUG=1]")
+	assert.Equal(c, strings.TrimSpace(env), "[DEBUG=1]")
 
 
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}", name)
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}", name)
-	c.Assert(strings.TrimSpace(env), checker.Contains, mntSrc)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(env), mntSrc))
 	dockerCmd(c, "plugin", "set", name, "pmount1.source=bar")
 	dockerCmd(c, "plugin", "set", name, "pmount1.source=bar")
 
 
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}", name)
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}", name)
-	c.Assert(strings.TrimSpace(env), checker.Contains, "bar")
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(env), "bar"))
 	out, _, err := dockerCmdWithError("plugin", "set", name, "pmount2.source=bar2")
 	out, _, err := dockerCmdWithError("plugin", "set", name, "pmount2.source=bar2")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Plugin config has no mount source")
-
+	assert.Assert(c, strings.Contains(out, "Plugin config has no mount source"))
 	out, _, err = dockerCmdWithError("plugin", "set", name, "pdev2.path=/dev/bar2")
 	out, _, err = dockerCmdWithError("plugin", "set", name, "pdev2.path=/dev/bar2")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Plugin config has no device path")
-
+	assert.Assert(c, strings.Contains(out, "Plugin config has no device path"))
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginInstallArgs(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginInstallArgs(c *testing.T) {
 	pName := path.Join(ps.registryHost(), "plugin", "testplugininstallwithargs")
 	pName := path.Join(ps.registryHost(), "plugin", "testplugininstallwithargs")
 	ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
 	ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
 	defer cancel()
 	defer cancel()
@@ -218,13 +201,12 @@ func (ps *DockerPluginSuite) TestPluginInstallArgs(c *check.C) {
 	})
 	})
 
 
 	out, _ := dockerCmd(c, "plugin", "install", "--grant-all-permissions", "--disable", pName, "DEBUG=1")
 	out, _ := dockerCmd(c, "plugin", "install", "--grant-all-permissions", "--disable", pName, "DEBUG=1")
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 	env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", pName)
 	env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", pName)
-	c.Assert(strings.TrimSpace(env), checker.Equals, "[DEBUG=1]")
+	assert.Equal(c, strings.TrimSpace(env), "[DEBUG=1]")
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginInstallImage(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginInstallImage(c *testing.T) {
 	testRequires(c, IsAmd64)
 	testRequires(c, IsAmd64)
 
 
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
@@ -235,32 +217,29 @@ func (ps *DockerPluginSuite) TestPluginInstallImage(c *check.C) {
 
 
 	out, _, err := dockerCmdWithError("plugin", "install", repoName)
 	out, _, err := dockerCmdWithError("plugin", "install", repoName)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, `Encountered remote "application/vnd.docker.container.image.v1+json"(image) when fetching`)
+	assert.Assert(c, strings.Contains(out, `Encountered remote "application/vnd.docker.container.image.v1+json"(image) when fetching`))
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginEnableDisableNegative(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginEnableDisableNegative(c *testing.T) {
 	pName := ps.getPluginRepoWithTag()
 	pName := ps.getPluginRepoWithTag()
 
 
 	out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pName)
 	out, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, pName)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), pName))
 	out, _, err = dockerCmdWithError("plugin", "enable", pName)
 	out, _, err = dockerCmdWithError("plugin", "enable", pName)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(strings.TrimSpace(out), checker.Contains, "already enabled")
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "already enabled"))
 	_, _, err = dockerCmdWithError("plugin", "disable", pName)
 	_, _, err = dockerCmdWithError("plugin", "disable", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _, err = dockerCmdWithError("plugin", "disable", pName)
 	out, _, err = dockerCmdWithError("plugin", "disable", pName)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(strings.TrimSpace(out), checker.Contains, "already disabled")
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "already disabled"))
 	_, _, err = dockerCmdWithError("plugin", "remove", pName)
 	_, _, err = dockerCmdWithError("plugin", "remove", pName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginCreate(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginCreate(c *testing.T) {
 	name := "foo/bar-driver"
 	name := "foo/bar-driver"
 	temp, err := ioutil.TempDir("", "foo")
 	temp, err := ioutil.TempDir("", "foo")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -275,24 +254,21 @@ func (ps *DockerPluginSuite) TestPluginCreate(c *check.C) {
 
 
 	out, _, err := dockerCmdWithError("plugin", "create", name, temp)
 	out, _, err := dockerCmdWithError("plugin", "create", name, temp)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, name)
-
+	assert.Assert(c, strings.Contains(out, name))
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, name)
-
+	assert.Assert(c, strings.Contains(out, name))
 	out, _, err = dockerCmdWithError("plugin", "create", name, temp)
 	out, _, err = dockerCmdWithError("plugin", "create", name, temp)
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "already exist")
-
+	assert.Assert(c, strings.Contains(out, "already exist"))
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, name)
+	assert.Assert(c, strings.Contains(out, name))
 	// The output will consists of one HEADER line and one line of foo/bar-driver
 	// The output will consists of one HEADER line and one line of foo/bar-driver
-	c.Assert(len(strings.Split(strings.TrimSpace(out), "\n")), checker.Equals, 2)
+	assert.Equal(c, len(strings.Split(strings.TrimSpace(out), "\n")), 2)
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginInspect(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginInspect(c *testing.T) {
 	pNameWithTag := ps.getPluginRepoWithTag()
 	pNameWithTag := ps.getPluginRepoWithTag()
 
 
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
 	_, _, err := dockerCmdWithError("plugin", "install", "--grant-all-permissions", pNameWithTag)
@@ -300,9 +276,8 @@ func (ps *DockerPluginSuite) TestPluginInspect(c *check.C) {
 
 
 	out, _, err := dockerCmdWithError("plugin", "ls")
 	out, _, err := dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, pNameWithTag)
-	c.Assert(out, checker.Contains, "true")
-
+	assert.Assert(c, strings.Contains(out, pNameWithTag))
+	assert.Assert(c, strings.Contains(out, "true"))
 	// Find the ID first
 	// Find the ID first
 	out, _, err = dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", pNameWithTag)
 	out, _, err = dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -334,25 +309,24 @@ func (ps *DockerPluginSuite) TestPluginInspect(c *check.C) {
 
 
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
 	out, _, err = dockerCmdWithError("plugin", "remove", pNameWithTag)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, pNameWithTag)
-
+	assert.Assert(c, strings.Contains(out, pNameWithTag))
 	// After remove nothing should be found
 	// After remove nothing should be found
 	_, _, err = dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", id[:5])
 	_, _, err = dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", id[:5])
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 }
 }
 
 
 // Test case for https://github.com/docker/docker/pull/29186#discussion_r91277345
 // Test case for https://github.com/docker/docker/pull/29186#discussion_r91277345
-func (s *DockerSuite) TestPluginInspectOnWindows(c *check.C) {
+func (s *DockerSuite) TestPluginInspectOnWindows(c *testing.T) {
 	// This test should work on Windows only
 	// This test should work on Windows only
 	testRequires(c, DaemonIsWindows)
 	testRequires(c, DaemonIsWindows)
 
 
 	out, _, err := dockerCmdWithError("plugin", "inspect", "foobar")
 	out, _, err := dockerCmdWithError("plugin", "inspect", "foobar")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "plugins are not supported on this platform")
+	assert.Assert(c, strings.Contains(out, "plugins are not supported on this platform"))
 	assert.ErrorContains(c, err, "plugins are not supported on this platform")
 	assert.ErrorContains(c, err, "plugins are not supported on this platform")
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginIDPrefix(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginIDPrefix(c *testing.T) {
 	name := "test"
 	name := "test"
 	client := testEnv.APIClient()
 	client := testEnv.APIClient()
 
 
@@ -363,7 +337,7 @@ func (ps *DockerPluginSuite) TestPluginIDPrefix(c *check.C) {
 	})
 	})
 	cancel()
 	cancel()
 
 
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create test plugin"))
+	assert.Assert(c, err == nil, "failed to create test plugin")
 
 
 	// Find ID first
 	// Find ID first
 	id, _, err := dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", name)
 	id, _, err := dockerCmdWithError("plugin", "inspect", "-f", "{{.Id}}", name)
@@ -373,43 +347,40 @@ func (ps *DockerPluginSuite) TestPluginIDPrefix(c *check.C) {
 	// List current state
 	// List current state
 	out, _, err := dockerCmdWithError("plugin", "ls")
 	out, _, err := dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, name)
-	c.Assert(out, checker.Contains, "false")
-
+	assert.Assert(c, strings.Contains(out, name))
+	assert.Assert(c, strings.Contains(out, "false"))
 	env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", id[:5])
 	env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", id[:5])
-	c.Assert(strings.TrimSpace(env), checker.Equals, "[DEBUG=0]")
+	assert.Equal(c, strings.TrimSpace(env), "[DEBUG=0]")
 
 
 	dockerCmd(c, "plugin", "set", id[:5], "DEBUG=1")
 	dockerCmd(c, "plugin", "set", id[:5], "DEBUG=1")
 
 
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", id[:5])
 	env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", id[:5])
-	c.Assert(strings.TrimSpace(env), checker.Equals, "[DEBUG=1]")
+	assert.Equal(c, strings.TrimSpace(env), "[DEBUG=1]")
 
 
 	// Enable
 	// Enable
 	_, _, err = dockerCmdWithError("plugin", "enable", id[:5])
 	_, _, err = dockerCmdWithError("plugin", "enable", id[:5])
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, name)
-	c.Assert(out, checker.Contains, "true")
-
+	assert.Assert(c, strings.Contains(out, name))
+	assert.Assert(c, strings.Contains(out, "true"))
 	// Disable
 	// Disable
 	_, _, err = dockerCmdWithError("plugin", "disable", id[:5])
 	_, _, err = dockerCmdWithError("plugin", "disable", id[:5])
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Contains, name)
-	c.Assert(out, checker.Contains, "false")
-
+	assert.Assert(c, strings.Contains(out, name))
+	assert.Assert(c, strings.Contains(out, "false"))
 	// Remove
 	// Remove
 	_, _, err = dockerCmdWithError("plugin", "remove", id[:5])
 	_, _, err = dockerCmdWithError("plugin", "remove", id[:5])
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	// List returns none
 	// List returns none
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	out, _, err = dockerCmdWithError("plugin", "ls")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(out, checker.Not(checker.Contains), name)
+	assert.Assert(c, !strings.Contains(out, name))
 }
 }
 
 
-func (ps *DockerPluginSuite) TestPluginListDefaultFormat(c *check.C) {
+func (ps *DockerPluginSuite) TestPluginListDefaultFormat(c *testing.T) {
 	config, err := ioutil.TempDir("", "config-file-")
 	config, err := ioutil.TempDir("", "config-file-")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer os.RemoveAll(config)
 	defer os.RemoveAll(config)
@@ -425,7 +396,7 @@ func (ps *DockerPluginSuite) TestPluginListDefaultFormat(c *check.C) {
 	err = plugin.Create(ctx, client, name, func(cfg *plugin.Config) {
 	err = plugin.Create(ctx, client, name, func(cfg *plugin.Config) {
 		cfg.Description = "test plugin"
 		cfg.Description = "test plugin"
 	})
 	})
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create test plugin"))
+	assert.Assert(c, err == nil, "failed to create test plugin")
 
 
 	out, _ := dockerCmd(c, "plugin", "inspect", "--format", "{{.ID}}", name)
 	out, _ := dockerCmd(c, "plugin", "inspect", "--format", "{{.ID}}", name)
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -437,10 +408,10 @@ description: test plugin
 enabled: false`, id, name)
 enabled: false`, id, name)
 
 
 	out, _ = dockerCmd(c, "--config", config, "plugin", "ls", "--no-trunc")
 	out, _ = dockerCmd(c, "--config", config, "plugin", "ls", "--no-trunc")
-	c.Assert(strings.TrimSpace(out), checker.Contains, expectedOutput)
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), expectedOutput))
 }
 }
 
 
-func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
+func (s *DockerSuite) TestPluginUpgrade(c *testing.T) {
 	testRequires(c, DaemonIsLinux, Network, testEnv.IsLocalDaemon, IsAmd64, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, Network, testEnv.IsLocalDaemon, IsAmd64, NotUserNamespace)
 	plugin := "cpuguy83/docker-volume-driver-plugin-local:latest"
 	plugin := "cpuguy83/docker-volume-driver-plugin-local:latest"
 	pluginV2 := "cpuguy83/docker-volume-driver-plugin-local:v2"
 	pluginV2 := "cpuguy83/docker-volume-driver-plugin-local:v2"
@@ -451,14 +422,13 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
 
 
 	out, _, err := dockerCmdWithError("plugin", "upgrade", "--grant-all-permissions", plugin, pluginV2)
 	out, _, err := dockerCmdWithError("plugin", "upgrade", "--grant-all-permissions", plugin, pluginV2)
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
-	c.Assert(out, checker.Contains, "disabled before upgrading")
-
+	assert.Assert(c, strings.Contains(out, "disabled before upgrading"))
 	out, _ = dockerCmd(c, "plugin", "inspect", "--format={{.ID}}", plugin)
 	out, _ = dockerCmd(c, "plugin", "inspect", "--format={{.ID}}", plugin)
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
 	// make sure "v2" does not exists
 	// make sure "v2" does not exists
 	_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2"))
 	_, err = os.Stat(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "plugins", id, "rootfs", "v2"))
-	c.Assert(os.IsNotExist(err), checker.True, check.Commentf("%s", out))
+	assert.Assert(c, os.IsNotExist(err), "%s", out)
 
 
 	dockerCmd(c, "plugin", "disable", "-f", plugin)
 	dockerCmd(c, "plugin", "disable", "-f", plugin)
 	dockerCmd(c, "plugin", "upgrade", "--grant-all-permissions", "--skip-remote-check", plugin, pluginV2)
 	dockerCmd(c, "plugin", "upgrade", "--grant-all-permissions", "--skip-remote-check", plugin, pluginV2)
@@ -472,7 +442,7 @@ func (s *DockerSuite) TestPluginUpgrade(c *check.C) {
 	dockerCmd(c, "run", "--rm", "-v", "bananas:/apple", "busybox", "sh", "-c", "ls -lh /apple/core")
 	dockerCmd(c, "run", "--rm", "-v", "bananas:/apple", "busybox", "sh", "-c", "ls -lh /apple/core")
 }
 }
 
 
-func (s *DockerSuite) TestPluginMetricsCollector(c *check.C) {
+func (s *DockerSuite) TestPluginMetricsCollector(c *testing.T) {
 	testRequires(c, DaemonIsLinux, Network, testEnv.IsLocalDaemon, IsAmd64)
 	testRequires(c, DaemonIsLinux, Network, testEnv.IsLocalDaemon, IsAmd64)
 	d := daemon.New(c, dockerBinary, dockerdBinary)
 	d := daemon.New(c, dockerBinary, dockerdBinary)
 	d.Start(c)
 	d.Start(c)
@@ -480,7 +450,7 @@ func (s *DockerSuite) TestPluginMetricsCollector(c *check.C) {
 
 
 	name := "cpuguy83/docker-metrics-plugin-test:latest"
 	name := "cpuguy83/docker-metrics-plugin-test:latest"
 	r := cli.Docker(cli.Args("plugin", "install", "--grant-all-permissions", name), cli.Daemon(d))
 	r := cli.Docker(cli.Args("plugin", "install", "--grant-all-permissions", name), cli.Daemon(d))
-	c.Assert(r.Error, checker.IsNil, check.Commentf(r.Combined()))
+	assert.Assert(c, r.Error == nil, r.Combined())
 
 
 	// plugin lisens on localhost:19393 and proxies the metrics
 	// plugin lisens on localhost:19393 and proxies the metrics
 	resp, err := http.Get("http://localhost:19393/metrics")
 	resp, err := http.Get("http://localhost:19393/metrics")
@@ -490,5 +460,5 @@ func (s *DockerSuite) TestPluginMetricsCollector(c *check.C) {
 	b, err := ioutil.ReadAll(resp.Body)
 	b, err := ioutil.ReadAll(resp.Body)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	// check that a known metric is there... don't expect this metric to change over time.. probably safe
 	// check that a known metric is there... don't expect this metric to change over time.. probably safe
-	c.Assert(string(b), checker.Contains, "container_actions")
+	assert.Assert(c, strings.Contains(string(b), "container_actions"))
 }
 }

+ 28 - 35
integration-cli/docker_cli_port_test.go

@@ -7,13 +7,12 @@ import (
 	"sort"
 	"sort"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestPortList(c *check.C) {
+func (s *DockerSuite) TestPortList(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// one port
 	// one port
 	out, _ := dockerCmd(c, "run", "-d", "-p", "9876:80", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "-p", "9876:80", "busybox", "top")
@@ -105,7 +104,7 @@ func (s *DockerSuite) TestPortList(c *check.C) {
 			"-p", "9090-9092:80",
 			"-p", "9090-9092:80",
 			"busybox", "top")
 			"busybox", "top")
 		// Exhausted port range did not return an error
 		// Exhausted port range did not return an error
-		c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+		assert.Assert(c, err != nil, "out: %s", out)
 
 
 		for i := 0; i < 3; i++ {
 		for i := 0; i < 3; i++ {
 			dockerCmd(c, "rm", "-f", IDs[i])
 			dockerCmd(c, "rm", "-f", IDs[i])
@@ -121,7 +120,7 @@ func (s *DockerSuite) TestPortList(c *check.C) {
 			"-p", invalidRange,
 			"-p", invalidRange,
 			"busybox", "top")
 			"busybox", "top")
 		// Port range should have returned an error
 		// Port range should have returned an error
-		c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+		assert.Assert(c, err != nil, "out: %s", out)
 	}
 	}
 
 
 	// test host range:container range spec.
 	// test host range:container range spec.
@@ -157,7 +156,7 @@ func (s *DockerSuite) TestPortList(c *check.C) {
 	dockerCmd(c, "rm", "-f", ID)
 	dockerCmd(c, "rm", "-f", ID)
 }
 }
 
 
-func assertPortList(c *check.C, out string, expected []string) error {
+func assertPortList(c *testing.T, out string, expected []string) error {
 	lines := strings.Split(strings.Trim(out, "\n "), "\n")
 	lines := strings.Split(strings.Trim(out, "\n "), "\n")
 	if len(lines) != len(expected) {
 	if len(lines) != len(expected) {
 		return fmt.Errorf("different size lists %s, %d, %d", out, len(lines), len(expected))
 		return fmt.Errorf("different size lists %s, %d, %d", out, len(lines), len(expected))
@@ -174,7 +173,7 @@ func assertPortList(c *check.C, out string, expected []string) error {
 	return nil
 	return nil
 }
 }
 
 
-func assertPortRange(c *check.C, out string, expectedTcp, expectedUdp []int) error {
+func assertPortRange(c *testing.T, out string, expectedTcp, expectedUdp []int) error {
 	lines := strings.Split(strings.Trim(out, "\n "), "\n")
 	lines := strings.Split(strings.Trim(out, "\n "), "\n")
 
 
 	var validTcp, validUdp bool
 	var validTcp, validUdp bool
@@ -206,11 +205,11 @@ func assertPortRange(c *check.C, out string, expectedTcp, expectedUdp []int) err
 	return nil
 	return nil
 }
 }
 
 
-func stopRemoveContainer(id string, c *check.C) {
+func stopRemoveContainer(id string, c *testing.T) {
 	dockerCmd(c, "rm", "-f", id)
 	dockerCmd(c, "rm", "-f", id)
 }
 }
 
 
-func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {
+func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// Run busybox with command line expose (equivalent to EXPOSE in image's Dockerfile) for the following ports
 	// Run busybox with command line expose (equivalent to EXPOSE in image's Dockerfile) for the following ports
 	port1 := 80
 	port1 := 80
@@ -224,10 +223,9 @@ func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {
 	unpPort2 := fmt.Sprintf("%d/tcp", port2)
 	unpPort2 := fmt.Sprintf("%d/tcp", port2)
 	out, _ := dockerCmd(c, "ps", "-n=1")
 	out, _ := dockerCmd(c, "ps", "-n=1")
 	// Missing unpublished ports in docker ps output
 	// Missing unpublished ports in docker ps output
-	c.Assert(out, checker.Contains, unpPort1)
+	assert.Assert(c, strings.Contains(out, unpPort1))
 	// Missing unpublished ports in docker ps output
 	// Missing unpublished ports in docker ps output
-	c.Assert(out, checker.Contains, unpPort2)
-
+	assert.Assert(c, strings.Contains(out, unpPort2))
 	// Run the container forcing to publish the exposed ports
 	// Run the container forcing to publish the exposed ports
 	dockerCmd(c, "run", "-d", "-P", expose1, expose2, "busybox", "sleep", "5")
 	dockerCmd(c, "run", "-d", "-P", expose1, expose2, "busybox", "sleep", "5")
 
 
@@ -236,9 +234,9 @@ func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {
 	expBndRegx2 := regexp.MustCompile(`0.0.0.0:\d\d\d\d\d->` + unpPort2)
 	expBndRegx2 := regexp.MustCompile(`0.0.0.0:\d\d\d\d\d->` + unpPort2)
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	// Cannot find expected port binding port (0.0.0.0:xxxxx->unpPort1) in docker ps output
 	// Cannot find expected port binding port (0.0.0.0:xxxxx->unpPort1) in docker ps output
-	c.Assert(expBndRegx1.MatchString(out), checker.Equals, true, check.Commentf("out: %s; unpPort1: %s", out, unpPort1))
+	assert.Equal(c, expBndRegx1.MatchString(out), true, fmt.Sprintf("out: %s; unpPort1: %s", out, unpPort1))
 	// Cannot find expected port binding port (0.0.0.0:xxxxx->unpPort2) in docker ps output
 	// Cannot find expected port binding port (0.0.0.0:xxxxx->unpPort2) in docker ps output
-	c.Assert(expBndRegx2.MatchString(out), checker.Equals, true, check.Commentf("out: %s; unpPort2: %s", out, unpPort2))
+	assert.Equal(c, expBndRegx2.MatchString(out), true, fmt.Sprintf("out: %s; unpPort2: %s", out, unpPort2))
 
 
 	// Run the container specifying explicit port bindings for the exposed ports
 	// Run the container specifying explicit port bindings for the exposed ports
 	offset := 10000
 	offset := 10000
@@ -252,10 +250,9 @@ func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {
 	expBnd2 := fmt.Sprintf("0.0.0.0:%d->%s", offset+port2, unpPort2)
 	expBnd2 := fmt.Sprintf("0.0.0.0:%d->%s", offset+port2, unpPort2)
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	// Cannot find expected port binding (expBnd1) in docker ps output
 	// Cannot find expected port binding (expBnd1) in docker ps output
-	c.Assert(out, checker.Contains, expBnd1)
+	assert.Assert(c, strings.Contains(out, expBnd1))
 	// Cannot find expected port binding (expBnd2) in docker ps output
 	// Cannot find expected port binding (expBnd2) in docker ps output
-	c.Assert(out, checker.Contains, expBnd2)
-
+	assert.Assert(c, strings.Contains(out, expBnd2))
 	// Remove container now otherwise it will interfere with next test
 	// Remove container now otherwise it will interfere with next test
 	stopRemoveContainer(id, c)
 	stopRemoveContainer(id, c)
 
 
@@ -266,9 +263,9 @@ func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {
 	// Check docker ps o/p for last created container reports the specified port mappings
 	// Check docker ps o/p for last created container reports the specified port mappings
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	// Cannot find expected port binding (expBnd1) in docker ps output
 	// Cannot find expected port binding (expBnd1) in docker ps output
-	c.Assert(out, checker.Contains, expBnd1)
+	assert.Assert(c, strings.Contains(out, expBnd1))
 	// Cannot find expected port binding (expBnd2) in docker ps output
 	// Cannot find expected port binding (expBnd2) in docker ps output
-	c.Assert(out, checker.Contains, expBnd2)
+	assert.Assert(c, strings.Contains(out, expBnd2))
 	// Remove container now otherwise it will interfere with next test
 	// Remove container now otherwise it will interfere with next test
 	stopRemoveContainer(id, c)
 	stopRemoveContainer(id, c)
 
 
@@ -278,12 +275,12 @@ func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *check.C) {
 	// Check docker ps o/p for last created container reports the specified unpublished port and port mapping
 	// Check docker ps o/p for last created container reports the specified unpublished port and port mapping
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	out, _ = dockerCmd(c, "ps", "-n=1")
 	// Missing unpublished exposed ports (unpPort1) in docker ps output
 	// Missing unpublished exposed ports (unpPort1) in docker ps output
-	c.Assert(out, checker.Contains, unpPort1)
+	assert.Assert(c, strings.Contains(out, unpPort1))
 	// Missing port binding (expBnd2) in docker ps output
 	// Missing port binding (expBnd2) in docker ps output
-	c.Assert(out, checker.Contains, expBnd2)
+	assert.Assert(c, strings.Contains(out, expBnd2))
 }
 }
 
 
-func (s *DockerSuite) TestPortHostBinding(c *check.C) {
+func (s *DockerSuite) TestPortHostBinding(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	out, _ := dockerCmd(c, "run", "-d", "-p", "9876:80", "busybox",
 	out, _ := dockerCmd(c, "run", "-d", "-p", "9876:80", "busybox",
 		"nc", "-l", "-p", "80")
 		"nc", "-l", "-p", "80")
@@ -302,10 +299,10 @@ func (s *DockerSuite) TestPortHostBinding(c *check.C) {
 
 
 	out, _, err = dockerCmdWithError("run", "--net=host", "busybox", "nc", "localhost", "9876")
 	out, _, err = dockerCmdWithError("run", "--net=host", "busybox", "nc", "localhost", "9876")
 	// Port is still bound after the Container is removed
 	// Port is still bound after the Container is removed
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestPortExposeHostBinding(c *check.C) {
+func (s *DockerSuite) TestPortExposeHostBinding(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	out, _ := dockerCmd(c, "run", "-d", "-P", "--expose", "80", "busybox",
 	out, _ := dockerCmd(c, "run", "-d", "-P", "--expose", "80", "busybox",
 		"nc", "-l", "-p", "80")
 		"nc", "-l", "-p", "80")
@@ -314,7 +311,7 @@ func (s *DockerSuite) TestPortExposeHostBinding(c *check.C) {
 	out, _ = dockerCmd(c, "port", firstID, "80")
 	out, _ = dockerCmd(c, "port", firstID, "80")
 
 
 	_, exposedPort, err := net.SplitHostPort(out)
 	_, exposedPort, err := net.SplitHostPort(out)
-	c.Assert(err, checker.IsNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err == nil, "out: %s", out)
 
 
 	dockerCmd(c, "run", "--net=host", "busybox",
 	dockerCmd(c, "run", "--net=host", "busybox",
 		"nc", "localhost", strings.TrimSpace(exposedPort))
 		"nc", "localhost", strings.TrimSpace(exposedPort))
@@ -324,29 +321,25 @@ func (s *DockerSuite) TestPortExposeHostBinding(c *check.C) {
 	out, _, err = dockerCmdWithError("run", "--net=host", "busybox",
 	out, _, err = dockerCmdWithError("run", "--net=host", "busybox",
 		"nc", "localhost", strings.TrimSpace(exposedPort))
 		"nc", "localhost", strings.TrimSpace(exposedPort))
 	// Port is still bound after the Container is removed
 	// Port is still bound after the Container is removed
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestPortBindingOnSandbox(c *check.C) {
+func (s *DockerSuite) TestPortBindingOnSandbox(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	dockerCmd(c, "network", "create", "--internal", "-d", "bridge", "internal-net")
 	dockerCmd(c, "network", "create", "--internal", "-d", "bridge", "internal-net")
 	nr := getNetworkResource(c, "internal-net")
 	nr := getNetworkResource(c, "internal-net")
-	c.Assert(nr.Internal, checker.Equals, true)
+	assert.Equal(c, nr.Internal, true)
 
 
 	dockerCmd(c, "run", "--net", "internal-net", "-d", "--name", "c1",
 	dockerCmd(c, "run", "--net", "internal-net", "-d", "--name", "c1",
 		"-p", "8080:8080", "busybox", "nc", "-l", "-p", "8080")
 		"-p", "8080:8080", "busybox", "nc", "-l", "-p", "8080")
-	c.Assert(waitRun("c1"), check.IsNil)
+	assert.Assert(c, waitRun("c1") == nil)
 
 
 	_, _, err := dockerCmdWithError("run", "--net=host", "busybox", "nc", "localhost", "8080")
 	_, _, err := dockerCmdWithError("run", "--net=host", "busybox", "nc", "localhost", "8080")
-	c.Assert(err, check.NotNil,
-		check.Commentf("Port mapping on internal network is expected to fail"))
-
+	assert.Assert(c, err != nil, "Port mapping on internal network is expected to fail")
 	// Connect container to another normal bridge network
 	// Connect container to another normal bridge network
 	dockerCmd(c, "network", "create", "-d", "bridge", "foo-net")
 	dockerCmd(c, "network", "create", "-d", "bridge", "foo-net")
 	dockerCmd(c, "network", "connect", "foo-net", "c1")
 	dockerCmd(c, "network", "connect", "foo-net", "c1")
 
 
 	_, _, err = dockerCmdWithError("run", "--net=host", "busybox", "nc", "localhost", "8080")
 	_, _, err = dockerCmdWithError("run", "--net=host", "busybox", "nc", "localhost", "8080")
-	c.Assert(err, check.IsNil,
-		check.Commentf("Port mapping on the new network is expected to succeed"))
-
+	assert.Assert(c, err == nil, "Port mapping on the new network is expected to succeed")
 }
 }

+ 3 - 3
integration-cli/docker_cli_proxy_test.go

@@ -3,13 +3,13 @@ package main
 import (
 import (
 	"net"
 	"net"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *check.C) {
+func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 
 
 	icmd.RunCmd(icmd.Cmd{
 	icmd.RunCmd(icmd.Cmd{
@@ -20,7 +20,7 @@ func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *check.C) {
 
 
 // Can't use localhost here since go has a special case to not use proxy if connecting to localhost
 // Can't use localhost here since go has a special case to not use proxy if connecting to localhost
 // See https://golang.org/pkg/net/http/#ProxyFromEnvironment
 // See https://golang.org/pkg/net/http/#ProxyFromEnvironment
-func (s *DockerDaemonSuite) TestCLIProxyProxyTCPSock(c *check.C) {
+func (s *DockerDaemonSuite) TestCLIProxyProxyTCPSock(c *testing.T) {
 	// get the IP to use to connect since we can't use localhost
 	// get the IP to use to connect since we can't use localhost
 	addrs, err := net.InterfaceAddrs()
 	addrs, err := net.InterfaceAddrs()
 	assert.NilError(c, err)
 	assert.NilError(c, err)

+ 81 - 102
integration-cli/docker_cli_prune_unix_test.go

@@ -8,39 +8,41 @@ import (
 	"path/filepath"
 	"path/filepath"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
+	"gotest.tools/poll"
 )
 )
 
 
-func pruneNetworkAndVerify(c *check.C, d *daemon.Daemon, kept, pruned []string) {
+func pruneNetworkAndVerify(c *testing.T, d *daemon.Daemon, kept, pruned []string) {
 	_, err := d.Cmd("network", "prune", "--force")
 	_, err := d.Cmd("network", "prune", "--force")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	for _, s := range kept {
 	for _, s := range kept {
-		waitAndAssert(c, defaultReconciliationTimeout, func(*check.C) (interface{}, check.CommentInterface) {
+		poll.WaitOn(c, pollCheck(c, func(*testing.T) (interface{}, string) {
 			out, err := d.Cmd("network", "ls", "--format", "{{.Name}}")
 			out, err := d.Cmd("network", "ls", "--format", "{{.Name}}")
 			assert.NilError(c, err)
 			assert.NilError(c, err)
-			return out, nil
-		}, checker.Contains, s)
+			return out, ""
+		}, checker.Contains(s)), poll.WithTimeout(defaultReconciliationTimeout))
+
 	}
 	}
 
 
 	for _, s := range pruned {
 	for _, s := range pruned {
-		waitAndAssert(c, defaultReconciliationTimeout, func(*check.C) (interface{}, check.CommentInterface) {
+		poll.WaitOn(c, pollCheck(c, func(*testing.T) (interface{}, string) {
 			out, err := d.Cmd("network", "ls", "--format", "{{.Name}}")
 			out, err := d.Cmd("network", "ls", "--format", "{{.Name}}")
 			assert.NilError(c, err)
 			assert.NilError(c, err)
-			return out, nil
-		}, checker.Not(checker.Contains), s)
+			return out, ""
+		}, checker.Not(checker.Contains(s))), poll.WithTimeout(defaultReconciliationTimeout))
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestPruneNetwork(c *check.C) {
+func (s *DockerSwarmSuite) TestPruneNetwork(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 	_, err := d.Cmd("network", "create", "n1") // used by container (testprune)
 	_, err := d.Cmd("network", "create", "n1") // used by container (testprune)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -64,7 +66,7 @@ func (s *DockerSwarmSuite) TestPruneNetwork(c *check.C) {
 		"busybox", "top")
 		"busybox", "top")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	assert.Assert(c, strings.TrimSpace(out) != "")
 	assert.Assert(c, strings.TrimSpace(out) != "")
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, replicas+1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(replicas+1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// prune and verify
 	// prune and verify
 	pruneNetworkAndVerify(c, d, []string{"n1", "n3"}, []string{"n2", "n4"})
 	pruneNetworkAndVerify(c, d, []string{"n1", "n3"}, []string{"n2", "n4"})
@@ -74,12 +76,12 @@ func (s *DockerSwarmSuite) TestPruneNetwork(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	_, err = d.Cmd("service", "rm", serviceName)
 	_, err = d.Cmd("service", "rm", serviceName)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 0)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(0)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	pruneNetworkAndVerify(c, d, []string{}, []string{"n1", "n3"})
 	pruneNetworkAndVerify(c, d, []string{}, []string{"n1", "n3"})
 }
 }
 
 
-func (s *DockerDaemonSuite) TestPruneImageDangling(c *check.C) {
+func (s *DockerDaemonSuite) TestPruneImageDangling(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	result := cli.BuildCmd(c, "test", cli.Daemon(s.d),
 	result := cli.BuildCmd(c, "test", cli.Daemon(s.d),
@@ -92,26 +94,22 @@ func (s *DockerDaemonSuite) TestPruneImageDangling(c *check.C) {
 
 
 	out, err := s.d.Cmd("images", "-q", "--no-trunc")
 	out, err := s.d.Cmd("images", "-q", "--no-trunc")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id))
 	out, err = s.d.Cmd("image", "prune", "--force")
 	out, err = s.d.Cmd("image", "prune", "--force")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id))
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id))
 	out, err = s.d.Cmd("image", "prune", "--force", "--all")
 	out, err = s.d.Cmd("image", "prune", "--force", "--all")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id))
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id))
 }
 }
 
 
-func (s *DockerSuite) TestPruneContainerUntil(c *check.C) {
+func (s *DockerSuite) TestPruneContainerUntil(c *testing.T) {
 	out := cli.DockerCmd(c, "run", "-d", "busybox").Combined()
 	out := cli.DockerCmd(c, "run", "-d", "busybox").Combined()
 	id1 := strings.TrimSpace(out)
 	id1 := strings.TrimSpace(out)
 	cli.WaitExited(c, id1, 5*time.Second)
 	cli.WaitExited(c, id1, 5*time.Second)
@@ -123,15 +121,14 @@ func (s *DockerSuite) TestPruneContainerUntil(c *check.C) {
 	cli.WaitExited(c, id2, 5*time.Second)
 	cli.WaitExited(c, id2, 5*time.Second)
 
 
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "until="+until).Combined()
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "until="+until).Combined()
-	c.Assert(strings.TrimSpace(out), checker.Contains, id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
 }
 }
 
 
-func (s *DockerSuite) TestPruneContainerLabel(c *check.C) {
+func (s *DockerSuite) TestPruneContainerLabel(c *testing.T) {
 	out := cli.DockerCmd(c, "run", "-d", "--label", "foo", "busybox").Combined()
 	out := cli.DockerCmd(c, "run", "-d", "--label", "foo", "busybox").Combined()
 	id1 := strings.TrimSpace(out)
 	id1 := strings.TrimSpace(out)
 	cli.WaitExited(c, id1, 5*time.Second)
 	cli.WaitExited(c, id1, 5*time.Second)
@@ -158,53 +155,47 @@ func (s *DockerSuite) TestPruneContainerLabel(c *check.C) {
 
 
 	// With config.json only, prune based on label=foobar
 	// With config.json only, prune based on label=foobar
 	out = cli.DockerCmd(c, "--config", d, "container", "prune", "--force").Combined()
 	out = cli.DockerCmd(c, "--config", d, "container", "prune", "--force").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id3)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id4)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id4))
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "label=foo").Combined()
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "label=foo").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Contains, id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id3)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id3)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id3))
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "label!=bar").Combined()
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "label!=bar").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id3)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id3))
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id3)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
 	// With config.json label=foobar and CLI label!=foobar, CLI label!=foobar supersede
 	// With config.json label=foobar and CLI label!=foobar, CLI label!=foobar supersede
 	out = cli.DockerCmd(c, "--config", d, "container", "prune", "--force", "--filter", "label!=foobar").Combined()
 	out = cli.DockerCmd(c, "--config", d, "container", "prune", "--force", "--filter", "label!=foobar").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
 }
 }
 
 
-func (s *DockerSuite) TestPruneVolumeLabel(c *check.C) {
+func (s *DockerSuite) TestPruneVolumeLabel(c *testing.T) {
 	out, _ := dockerCmd(c, "volume", "create", "--label", "foo")
 	out, _ := dockerCmd(c, "volume", "create", "--label", "foo")
 	id1 := strings.TrimSpace(out)
 	id1 := strings.TrimSpace(out)
-	c.Assert(id1, checker.Not(checker.Equals), "")
+	assert.Assert(c, id1 != "")
 
 
 	out, _ = dockerCmd(c, "volume", "create", "--label", "bar")
 	out, _ = dockerCmd(c, "volume", "create", "--label", "bar")
 	id2 := strings.TrimSpace(out)
 	id2 := strings.TrimSpace(out)
-	c.Assert(id2, checker.Not(checker.Equals), "")
+	assert.Assert(c, id2 != "")
 
 
 	out, _ = dockerCmd(c, "volume", "create")
 	out, _ = dockerCmd(c, "volume", "create")
 	id3 := strings.TrimSpace(out)
 	id3 := strings.TrimSpace(out)
-	c.Assert(id3, checker.Not(checker.Equals), "")
+	assert.Assert(c, id3 != "")
 
 
 	out, _ = dockerCmd(c, "volume", "create", "--label", "foobar")
 	out, _ = dockerCmd(c, "volume", "create", "--label", "foobar")
 	id4 := strings.TrimSpace(out)
 	id4 := strings.TrimSpace(out)
-	c.Assert(id4, checker.Not(checker.Equals), "")
+	assert.Assert(c, id4 != "")
 
 
 	// Add a config file of label=foobar, that will have no impact if cli is label!=foobar
 	// Add a config file of label=foobar, that will have no impact if cli is label!=foobar
 	config := `{"pruneFilters": ["label=foobar"]}`
 	config := `{"pruneFilters": ["label=foobar"]}`
@@ -216,59 +207,51 @@ func (s *DockerSuite) TestPruneVolumeLabel(c *check.C) {
 
 
 	// With config.json only, prune based on label=foobar
 	// With config.json only, prune based on label=foobar
 	out, _ = dockerCmd(c, "--config", d, "volume", "prune", "--force")
 	out, _ = dockerCmd(c, "--config", d, "volume", "prune", "--force")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id3)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id4)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id4))
 	out, _ = dockerCmd(c, "volume", "prune", "--force", "--filter", "label=foo")
 	out, _ = dockerCmd(c, "volume", "prune", "--force", "--filter", "label=foo")
-	c.Assert(strings.TrimSpace(out), checker.Contains, id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id3)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id3)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id3))
 	out, _ = dockerCmd(c, "volume", "prune", "--force", "--filter", "label!=bar")
 	out, _ = dockerCmd(c, "volume", "prune", "--force", "--filter", "label!=bar")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id3)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id3))
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id3)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
 	// With config.json label=foobar and CLI label!=foobar, CLI label!=foobar supersede
 	// With config.json label=foobar and CLI label!=foobar, CLI label!=foobar supersede
 	out, _ = dockerCmd(c, "--config", d, "volume", "prune", "--force", "--filter", "label!=foobar")
 	out, _ = dockerCmd(c, "--config", d, "volume", "prune", "--force", "--filter", "label!=foobar")
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
 }
 }
 
 
-func (s *DockerSuite) TestPruneNetworkLabel(c *check.C) {
+func (s *DockerSuite) TestPruneNetworkLabel(c *testing.T) {
 	dockerCmd(c, "network", "create", "--label", "foo", "n1")
 	dockerCmd(c, "network", "create", "--label", "foo", "n1")
 	dockerCmd(c, "network", "create", "--label", "bar", "n2")
 	dockerCmd(c, "network", "create", "--label", "bar", "n2")
 	dockerCmd(c, "network", "create", "n3")
 	dockerCmd(c, "network", "create", "n3")
 
 
 	out, _ := dockerCmd(c, "network", "prune", "--force", "--filter", "label=foo")
 	out, _ := dockerCmd(c, "network", "prune", "--force", "--filter", "label=foo")
-	c.Assert(strings.TrimSpace(out), checker.Contains, "n1")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), "n2")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), "n3")
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "n1"))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n2"))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n3"))
 	out, _ = dockerCmd(c, "network", "prune", "--force", "--filter", "label!=bar")
 	out, _ = dockerCmd(c, "network", "prune", "--force", "--filter", "label!=bar")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), "n1")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), "n2")
-	c.Assert(strings.TrimSpace(out), checker.Contains, "n3")
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n1"))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n2"))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "n3"))
 	out, _ = dockerCmd(c, "network", "prune", "--force")
 	out, _ = dockerCmd(c, "network", "prune", "--force")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), "n1")
-	c.Assert(strings.TrimSpace(out), checker.Contains, "n2")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), "n3")
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n1"))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "n2"))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n3"))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestPruneImageLabel(c *check.C) {
+func (s *DockerDaemonSuite) TestPruneImageLabel(c *testing.T) {
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
 
 
 	result := cli.BuildCmd(c, "test1", cli.Daemon(s.d),
 	result := cli.BuildCmd(c, "test1", cli.Daemon(s.d),
@@ -280,8 +263,7 @@ func (s *DockerDaemonSuite) TestPruneImageLabel(c *check.C) {
 	id1 := strings.TrimSpace(result.Combined())
 	id1 := strings.TrimSpace(result.Combined())
 	out, err := s.d.Cmd("images", "-q", "--no-trunc")
 	out, err := s.d.Cmd("images", "-q", "--no-trunc")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id1)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id1))
 	result = cli.BuildCmd(c, "test2", cli.Daemon(s.d),
 	result = cli.BuildCmd(c, "test2", cli.Daemon(s.d),
 		build.WithDockerfile(`FROM busybox
 		build.WithDockerfile(`FROM busybox
                  LABEL bar=foo`),
                  LABEL bar=foo`),
@@ -291,20 +273,17 @@ func (s *DockerDaemonSuite) TestPruneImageLabel(c *check.C) {
 	id2 := strings.TrimSpace(result.Combined())
 	id2 := strings.TrimSpace(result.Combined())
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label=foo=bar")
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label=foo=bar")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label!=bar=foo")
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label!=bar=foo")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id2)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label=bar=foo")
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label=bar=foo")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), id1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
 }
 }

+ 115 - 117
integration-cli/docker_cli_ps_test.go

@@ -5,20 +5,20 @@ import (
 	"sort"
 	"sort"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/stringid"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
+	"gotest.tools/skip"
 )
 )
 
 
-func (s *DockerSuite) TestPsListContainersBase(c *check.C) {
+func (s *DockerSuite) TestPsListContainersBase(c *testing.T) {
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
 
 
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
@@ -35,89 +35,89 @@ func (s *DockerSuite) TestPsListContainersBase(c *check.C) {
 	fourthID := strings.TrimSpace(out)
 	fourthID := strings.TrimSpace(out)
 
 
 	// make sure the second is running
 	// make sure the second is running
-	c.Assert(waitRun(secondID), checker.IsNil)
+	assert.Assert(c, waitRun(secondID) == nil)
 
 
 	// make sure third one is not running
 	// make sure third one is not running
 	dockerCmd(c, "wait", thirdID)
 	dockerCmd(c, "wait", thirdID)
 
 
 	// make sure the forth is running
 	// make sure the forth is running
-	c.Assert(waitRun(fourthID), checker.IsNil)
+	assert.Assert(c, waitRun(fourthID) == nil)
 
 
 	// all
 	// all
 	out, _ = dockerCmd(c, "ps", "-a")
 	out, _ = dockerCmd(c, "ps", "-a")
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, thirdID, secondID, firstID}), checker.Equals, true, check.Commentf("ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, thirdID, secondID, firstID}), true, fmt.Sprintf("ALL: Container list is not in the correct order: \n%s", out))
 
 
 	// running
 	// running
 	out, _ = dockerCmd(c, "ps")
 	out, _ = dockerCmd(c, "ps")
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, secondID, firstID}), checker.Equals, true, check.Commentf("RUNNING: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, secondID, firstID}), true, fmt.Sprintf("RUNNING: Container list is not in the correct order: \n%s", out))
 
 
 	// limit
 	// limit
 	out, _ = dockerCmd(c, "ps", "-n=2", "-a")
 	out, _ = dockerCmd(c, "ps", "-n=2", "-a")
 	expected := []string{fourthID, thirdID}
 	expected := []string{fourthID, thirdID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("LIMIT & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("LIMIT & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-n=2")
 	out, _ = dockerCmd(c, "ps", "-n=2")
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("LIMIT: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("LIMIT: Container list is not in the correct order: \n%s", out))
 
 
 	// filter since
 	// filter since
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-a")
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-a")
 	expected = []string{fourthID, thirdID, secondID}
 	expected = []string{fourthID, thirdID, secondID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID)
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID)
 	expected = []string{fourthID, secondID}
 	expected = []string{fourthID, secondID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "since="+thirdID)
 	out, _ = dockerCmd(c, "ps", "-f", "since="+thirdID)
 	expected = []string{fourthID}
 	expected = []string{fourthID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter: Container list is not in the correct order: \n%s", out))
 
 
 	// filter before
 	// filter before
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-a")
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-a")
 	expected = []string{thirdID, secondID, firstID}
 	expected = []string{thirdID, secondID, firstID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("BEFORE filter & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID)
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID)
 	expected = []string{secondID, firstID}
 	expected = []string{secondID, firstID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("BEFORE filter: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "before="+thirdID)
 	out, _ = dockerCmd(c, "ps", "-f", "before="+thirdID)
 	expected = []string{secondID, firstID}
 	expected = []string{secondID, firstID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter: Container list is not in the correct order: \n%s", out))
 
 
 	// filter since & before
 	// filter since & before
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-a")
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-a")
 	expected = []string{thirdID, secondID}
 	expected = []string{thirdID, secondID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, BEFORE filter & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID)
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID)
 	expected = []string{secondID}
 	expected = []string{secondID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, BEFORE filter: Container list is not in the correct order: \n%s", out))
 
 
 	// filter since & limit
 	// filter since & limit
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-n=2", "-a")
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-n=2", "-a")
 	expected = []string{fourthID, thirdID}
 	expected = []string{fourthID, thirdID}
 
 
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-n=2")
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-n=2")
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, LIMIT: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, LIMIT: Container list is not in the correct order: \n%s", out))
 
 
 	// filter before & limit
 	// filter before & limit
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-n=1", "-a")
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-n=1", "-a")
 	expected = []string{thirdID}
 	expected = []string{thirdID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-n=1")
 	out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-n=1")
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out))
 
 
 	// filter since & filter before & limit
 	// filter since & filter before & limit
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1", "-a")
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1", "-a")
 	expected = []string{thirdID}
 	expected = []string{thirdID}
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out))
 
 
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1")
 	out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1")
-	c.Assert(assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out))
+	assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, fmt.Sprintf("SINCE filter, BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out))
 
 
 }
 }
 
 
@@ -139,7 +139,7 @@ func assertContainerList(out string, expected []string) bool {
 	return true
 	return true
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersSize(c *check.C) {
+func (s *DockerSuite) TestPsListContainersSize(c *testing.T) {
 	// Problematic on Windows as it doesn't report the size correctly @swernli
 	// Problematic on Windows as it doesn't report the size correctly @swernli
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "-d", "busybox")
 	dockerCmd(c, "run", "-d", "busybox")
@@ -173,13 +173,13 @@ func (s *DockerSuite) TestPsListContainersSize(c *check.C) {
 	sizeIndex := strings.Index(lines[0], "SIZE")
 	sizeIndex := strings.Index(lines[0], "SIZE")
 	idIndex := strings.Index(lines[0], "CONTAINER ID")
 	idIndex := strings.Index(lines[0], "CONTAINER ID")
 	foundID := lines[1][idIndex : idIndex+12]
 	foundID := lines[1][idIndex : idIndex+12]
-	c.Assert(foundID, checker.Equals, id[:12], check.Commentf("Expected id %s, got %s", id[:12], foundID))
+	assert.Equal(c, foundID, id[:12], fmt.Sprintf("Expected id %s, got %s", id[:12], foundID))
 	expectedSize := fmt.Sprintf("%dB", 2+baseBytes)
 	expectedSize := fmt.Sprintf("%dB", 2+baseBytes)
 	foundSize := lines[1][sizeIndex:]
 	foundSize := lines[1][sizeIndex:]
-	c.Assert(foundSize, checker.Contains, expectedSize, check.Commentf("Expected size %q, got %q", expectedSize, foundSize))
+	assert.Assert(c, strings.Contains(foundSize, expectedSize), "Expected size %q, got %q", expectedSize, foundSize)
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterStatus(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterStatus(c *testing.T) {
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
 
 
 	// start exited container
 	// start exited container
@@ -196,11 +196,11 @@ func (s *DockerSuite) TestPsListContainersFilterStatus(c *check.C) {
 	// filter containers by exited
 	// filter containers by exited
 	out = cli.DockerCmd(c, "ps", "--no-trunc", "-q", "--filter=status=exited").Combined()
 	out = cli.DockerCmd(c, "ps", "--no-trunc", "-q", "--filter=status=exited").Combined()
 	containerOut := strings.TrimSpace(out)
 	containerOut := strings.TrimSpace(out)
-	c.Assert(RemoveOutputForExistingElements(containerOut, existingContainers), checker.Equals, firstID)
+	assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), firstID)
 
 
 	out = cli.DockerCmd(c, "ps", "-a", "--no-trunc", "-q", "--filter=status=running").Combined()
 	out = cli.DockerCmd(c, "ps", "-a", "--no-trunc", "-q", "--filter=status=running").Combined()
 	containerOut = strings.TrimSpace(out)
 	containerOut = strings.TrimSpace(out)
-	c.Assert(RemoveOutputForExistingElements(containerOut, existingContainers), checker.Equals, secondID)
+	assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), secondID)
 
 
 	result := cli.Docker(cli.Args("ps", "-a", "-q", "--filter=status=rubbish"), cli.WithTimeout(time.Second*60))
 	result := cli.Docker(cli.Args("ps", "-a", "-q", "--filter=status=rubbish"), cli.WithTimeout(time.Second*60))
 	err := "Invalid filter 'status=rubbish'"
 	err := "Invalid filter 'status=rubbish'"
@@ -222,11 +222,11 @@ func (s *DockerSuite) TestPsListContainersFilterStatus(c *check.C) {
 
 
 		out = cli.DockerCmd(c, "ps", "--no-trunc", "-q", "--filter=status=paused").Combined()
 		out = cli.DockerCmd(c, "ps", "--no-trunc", "-q", "--filter=status=paused").Combined()
 		containerOut = strings.TrimSpace(out)
 		containerOut = strings.TrimSpace(out)
-		c.Assert(RemoveOutputForExistingElements(containerOut, existingContainers), checker.Equals, pausedID)
+		assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), pausedID)
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterHealth(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterHealth(c *testing.T) {
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
 	// Test legacy no health check
 	// Test legacy no health check
 	out := runSleepingContainer(c, "--name=none_legacy")
 	out := runSleepingContainer(c, "--name=none_legacy")
@@ -236,7 +236,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *check.C) {
 
 
 	out = cli.DockerCmd(c, "ps", "-q", "-l", "--no-trunc", "--filter=health=none").Combined()
 	out = cli.DockerCmd(c, "ps", "-q", "-l", "--no-trunc", "--filter=health=none").Combined()
 	containerOut := strings.TrimSpace(out)
 	containerOut := strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, containerID, check.Commentf("Expected id %s, got %s for legacy none filter, output: %q", containerID, containerOut, out))
+	assert.Equal(c, containerOut, containerID, fmt.Sprintf("Expected id %s, got %s for legacy none filter, output: %q", containerID, containerOut, out))
 
 
 	// Test no health check specified explicitly
 	// Test no health check specified explicitly
 	out = runSleepingContainer(c, "--name=none", "--no-healthcheck")
 	out = runSleepingContainer(c, "--name=none", "--no-healthcheck")
@@ -246,7 +246,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *check.C) {
 
 
 	out = cli.DockerCmd(c, "ps", "-q", "-l", "--no-trunc", "--filter=health=none").Combined()
 	out = cli.DockerCmd(c, "ps", "-q", "-l", "--no-trunc", "--filter=health=none").Combined()
 	containerOut = strings.TrimSpace(out)
 	containerOut = strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, containerID, check.Commentf("Expected id %s, got %s for none filter, output: %q", containerID, containerOut, out))
+	assert.Equal(c, containerOut, containerID, fmt.Sprintf("Expected id %s, got %s for none filter, output: %q", containerID, containerOut, out))
 
 
 	// Test failing health check
 	// Test failing health check
 	out = runSleepingContainer(c, "--name=failing_container", "--health-cmd=exit 1", "--health-interval=1s")
 	out = runSleepingContainer(c, "--name=failing_container", "--health-cmd=exit 1", "--health-interval=1s")
@@ -256,7 +256,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *check.C) {
 
 
 	out = cli.DockerCmd(c, "ps", "-q", "--no-trunc", "--filter=health=unhealthy").Combined()
 	out = cli.DockerCmd(c, "ps", "-q", "--no-trunc", "--filter=health=unhealthy").Combined()
 	containerOut = strings.TrimSpace(out)
 	containerOut = strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, containerID, check.Commentf("Expected containerID %s, got %s for unhealthy filter, output: %q", containerID, containerOut, out))
+	assert.Equal(c, containerOut, containerID, fmt.Sprintf("Expected containerID %s, got %s for unhealthy filter, output: %q", containerID, containerOut, out))
 
 
 	// Check passing healthcheck
 	// Check passing healthcheck
 	out = runSleepingContainer(c, "--name=passing_container", "--health-cmd=exit 0", "--health-interval=1s")
 	out = runSleepingContainer(c, "--name=passing_container", "--health-cmd=exit 0", "--health-interval=1s")
@@ -266,10 +266,10 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *check.C) {
 
 
 	out = cli.DockerCmd(c, "ps", "-q", "--no-trunc", "--filter=health=healthy").Combined()
 	out = cli.DockerCmd(c, "ps", "-q", "--no-trunc", "--filter=health=healthy").Combined()
 	containerOut = strings.TrimSpace(RemoveOutputForExistingElements(out, existingContainers))
 	containerOut = strings.TrimSpace(RemoveOutputForExistingElements(out, existingContainers))
-	c.Assert(containerOut, checker.Equals, containerID, check.Commentf("Expected containerID %s, got %s for healthy filter, output: %q", containerID, containerOut, out))
+	assert.Equal(c, containerOut, containerID, fmt.Sprintf("Expected containerID %s, got %s for healthy filter, output: %q", containerID, containerOut, out))
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterID(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterID(c *testing.T) {
 	// start container
 	// start container
 	out, _ := dockerCmd(c, "run", "-d", "busybox")
 	out, _ := dockerCmd(c, "run", "-d", "busybox")
 	firstID := strings.TrimSpace(out)
 	firstID := strings.TrimSpace(out)
@@ -280,10 +280,10 @@ func (s *DockerSuite) TestPsListContainersFilterID(c *check.C) {
 	// filter containers by id
 	// filter containers by id
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--filter=id="+firstID)
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--filter=id="+firstID)
 	containerOut := strings.TrimSpace(out)
 	containerOut := strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, firstID[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out))
+	assert.Equal(c, containerOut, firstID[:12], fmt.Sprintf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out))
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterName(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterName(c *testing.T) {
 	// start container
 	// start container
 	dockerCmd(c, "run", "--name=a_name_to_match", "busybox")
 	dockerCmd(c, "run", "--name=a_name_to_match", "busybox")
 	id := getIDByName(c, "a_name_to_match")
 	id := getIDByName(c, "a_name_to_match")
@@ -294,7 +294,7 @@ func (s *DockerSuite) TestPsListContainersFilterName(c *check.C) {
 	// filter containers by name
 	// filter containers by name
 	out, _ := dockerCmd(c, "ps", "-a", "-q", "--filter=name=a_name_to_match")
 	out, _ := dockerCmd(c, "ps", "-a", "-q", "--filter=name=a_name_to_match")
 	containerOut := strings.TrimSpace(out)
 	containerOut := strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, id[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", id[:12], containerOut, out))
+	assert.Equal(c, containerOut, id[:12], fmt.Sprintf("Expected id %s, got %s for exited filter, output: %q", id[:12], containerOut, out))
 }
 }
 
 
 // Test for the ancestor filter for ps.
 // Test for the ancestor filter for ps.
@@ -305,7 +305,7 @@ func (s *DockerSuite) TestPsListContainersFilterName(c *check.C) {
 // - Create an image based on the previous image (images_ps_filter_test2)
 // - Create an image based on the previous image (images_ps_filter_test2)
 // - Run containers for each of those image (busybox, images_ps_filter_test1, images_ps_filter_test2)
 // - Run containers for each of those image (busybox, images_ps_filter_test1, images_ps_filter_test2)
 // - Filter them out :P
 // - Filter them out :P
-func (s *DockerSuite) TestPsListContainersFilterAncestorImage(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterAncestorImage(c *testing.T) {
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
 
 
 	// Build images
 	// Build images
@@ -378,7 +378,7 @@ func (s *DockerSuite) TestPsListContainersFilterAncestorImage(c *check.C) {
 	checkPsAncestorFilterOutput(c, RemoveOutputForExistingElements(out, existingContainers), imageName2+","+imageName1Tagged, []string{fourthID, fifthID})
 	checkPsAncestorFilterOutput(c, RemoveOutputForExistingElements(out, existingContainers), imageName2+","+imageName1Tagged, []string{fourthID, fifthID})
 }
 }
 
 
-func checkPsAncestorFilterOutput(c *check.C, out string, filterName string, expectedIDs []string) {
+func checkPsAncestorFilterOutput(c *testing.T, out string, filterName string, expectedIDs []string) {
 	var actualIDs []string
 	var actualIDs []string
 	if out != "" {
 	if out != "" {
 		actualIDs = strings.Split(out[:len(out)-1], "\n")
 		actualIDs = strings.Split(out[:len(out)-1], "\n")
@@ -386,7 +386,7 @@ func checkPsAncestorFilterOutput(c *check.C, out string, filterName string, expe
 	sort.Strings(actualIDs)
 	sort.Strings(actualIDs)
 	sort.Strings(expectedIDs)
 	sort.Strings(expectedIDs)
 
 
-	c.Assert(actualIDs, checker.HasLen, len(expectedIDs), check.Commentf("Expected filtered container(s) for %s ancestor filter to be %v:%v, got %v:%v", filterName, len(expectedIDs), expectedIDs, len(actualIDs), actualIDs))
+	assert.Equal(c, len(actualIDs), len(expectedIDs), fmt.Sprintf("Expected filtered container(s) for %s ancestor filter to be %v:%v, got %v:%v", filterName, len(expectedIDs), expectedIDs, len(actualIDs), actualIDs))
 	if len(expectedIDs) > 0 {
 	if len(expectedIDs) > 0 {
 		same := true
 		same := true
 		for i := range expectedIDs {
 		for i := range expectedIDs {
@@ -396,11 +396,11 @@ func checkPsAncestorFilterOutput(c *check.C, out string, filterName string, expe
 				break
 				break
 			}
 			}
 		}
 		}
-		c.Assert(same, checker.Equals, true, check.Commentf("Expected filtered container(s) for %s ancestor filter to be %v, got %v", filterName, expectedIDs, actualIDs))
+		assert.Equal(c, same, true, fmt.Sprintf("Expected filtered container(s) for %s ancestor filter to be %v, got %v", filterName, expectedIDs, actualIDs))
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterLabel(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterLabel(c *testing.T) {
 	// start container
 	// start container
 	dockerCmd(c, "run", "--name=first", "-l", "match=me", "-l", "second=tag", "busybox")
 	dockerCmd(c, "run", "--name=first", "-l", "match=me", "-l", "second=tag", "busybox")
 	firstID := getIDByName(c, "first")
 	firstID := getIDByName(c, "first")
@@ -416,55 +416,58 @@ func (s *DockerSuite) TestPsListContainersFilterLabel(c *check.C) {
 	// filter containers by exact match
 	// filter containers by exact match
 	out, _ := dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me")
 	out, _ := dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me")
 	containerOut := strings.TrimSpace(out)
 	containerOut := strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out))
+	assert.Equal(c, containerOut, firstID, fmt.Sprintf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out))
 
 
 	// filter containers by two labels
 	// filter containers by two labels
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag")
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag")
 	containerOut = strings.TrimSpace(out)
 	containerOut = strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out))
+	assert.Equal(c, containerOut, firstID, fmt.Sprintf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out))
 
 
 	// filter containers by two labels, but expect not found because of AND behavior
 	// filter containers by two labels, but expect not found because of AND behavior
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag-no")
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag-no")
 	containerOut = strings.TrimSpace(out)
 	containerOut = strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Equals, "", check.Commentf("Expected nothing, got %s for exited filter, output: %q", containerOut, out))
+	assert.Equal(c, containerOut, "", fmt.Sprintf("Expected nothing, got %s for exited filter, output: %q", containerOut, out))
 
 
 	// filter containers by exact key
 	// filter containers by exact key
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match")
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match")
 	containerOut = strings.TrimSpace(out)
 	containerOut = strings.TrimSpace(out)
-	c.Assert(containerOut, checker.Contains, firstID)
-	c.Assert(containerOut, checker.Contains, secondID)
-	c.Assert(containerOut, checker.Not(checker.Contains), thirdID)
+	assert.Assert(c, strings.Contains(containerOut, firstID))
+	assert.Assert(c, strings.Contains(containerOut, secondID))
+	assert.Assert(c, !strings.Contains(containerOut, thirdID))
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterExited(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterExited(c *testing.T) {
+	// TODO Flaky on  Windows CI [both RS1 and RS5]
+	// On slower machines the container may not have exited
+	// yet when we filter below by exit status/exit value.
+	skip.If(c, DaemonIsWindows(), "FLAKY on Windows, see #20819")
 	runSleepingContainer(c, "--name=sleep")
 	runSleepingContainer(c, "--name=sleep")
 
 
 	firstZero, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	firstZero, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	secondZero, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 	secondZero, _ := dockerCmd(c, "run", "-d", "busybox", "true")
 
 
 	out, _, err := dockerCmdWithError("run", "--name", "nonzero1", "busybox", "false")
 	out, _, err := dockerCmdWithError("run", "--name", "nonzero1", "busybox", "false")
-	c.Assert(err, checker.NotNil, check.Commentf("Should fail.", out, err))
+	assert.Assert(c, err != nil, "Should fail. out: %s", out)
 	firstNonZero := getIDByName(c, "nonzero1")
 	firstNonZero := getIDByName(c, "nonzero1")
 
 
 	out, _, err = dockerCmdWithError("run", "--name", "nonzero2", "busybox", "false")
 	out, _, err = dockerCmdWithError("run", "--name", "nonzero2", "busybox", "false")
-	c.Assert(err, checker.NotNil, check.Commentf("Should fail.", out, err))
+	assert.Assert(c, err != nil, "Should fail. out: %s", out)
 	secondNonZero := getIDByName(c, "nonzero2")
 	secondNonZero := getIDByName(c, "nonzero2")
 
 
 	// filter containers by exited=0
 	// filter containers by exited=0
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=0")
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=0")
-	c.Assert(out, checker.Contains, strings.TrimSpace(firstZero))
-	c.Assert(out, checker.Contains, strings.TrimSpace(secondZero))
-	c.Assert(out, checker.Not(checker.Contains), strings.TrimSpace(firstNonZero))
-	c.Assert(out, checker.Not(checker.Contains), strings.TrimSpace(secondNonZero))
-
+	assert.Assert(c, strings.Contains(out, strings.TrimSpace(firstZero)))
+	assert.Assert(c, strings.Contains(out, strings.TrimSpace(secondZero)))
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(firstNonZero)))
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(secondNonZero)))
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=1")
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=1")
-	c.Assert(out, checker.Contains, strings.TrimSpace(firstNonZero))
-	c.Assert(out, checker.Contains, strings.TrimSpace(secondNonZero))
-	c.Assert(out, checker.Not(checker.Contains), strings.TrimSpace(firstZero))
-	c.Assert(out, checker.Not(checker.Contains), strings.TrimSpace(secondZero))
+	assert.Assert(c, strings.Contains(out, strings.TrimSpace(firstNonZero)))
+	assert.Assert(c, strings.Contains(out, strings.TrimSpace(secondNonZero)))
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(firstZero)))
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(secondZero)))
 }
 }
 
 
-func (s *DockerSuite) TestPsRightTagName(c *check.C) {
+func (s *DockerSuite) TestPsRightTagName(c *testing.T) {
 	// TODO Investigate further why this fails on Windows to Windows CI
 	// TODO Investigate further why this fails on Windows to Windows CI
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -499,18 +502,18 @@ func (s *DockerSuite) TestPsRightTagName(c *check.C) {
 		f := strings.Fields(line)
 		f := strings.Fields(line)
 		switch f[0] {
 		switch f[0] {
 		case id1:
 		case id1:
-			c.Assert(f[1], checker.Equals, "busybox", check.Commentf("Expected %s tag for id %s, got %s", "busybox", id1, f[1]))
+			assert.Equal(c, f[1], "busybox", fmt.Sprintf("Expected %s tag for id %s, got %s", "busybox", id1, f[1]))
 		case id2:
 		case id2:
-			c.Assert(f[1], checker.Equals, tag, check.Commentf("Expected %s tag for id %s, got %s", tag, id2, f[1]))
+			assert.Equal(c, f[1], tag, fmt.Sprintf("Expected %s tag for id %s, got %s", tag, id2, f[1]))
 		case id3:
 		case id3:
-			c.Assert(f[1], checker.Equals, imageID, check.Commentf("Expected %s imageID for id %s, got %s", tag, id3, f[1]))
+			assert.Equal(c, f[1], imageID, fmt.Sprintf("Expected %s imageID for id %s, got %s", tag, id3, f[1]))
 		default:
 		default:
 			c.Fatalf("Unexpected id %s, expected %s and %s and %s", f[0], id1, id2, id3)
 			c.Fatalf("Unexpected id %s, expected %s and %s and %s", f[0], id1, id2, id3)
 		}
 		}
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterCreated(c *testing.T) {
 	// create a container
 	// create a container
 	out, _ := dockerCmd(c, "create", "busybox")
 	out, _ := dockerCmd(c, "create", "busybox")
 	cID := strings.TrimSpace(out)
 	cID := strings.TrimSpace(out)
@@ -518,8 +521,7 @@ func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) {
 
 
 	// Make sure it DOESN'T show up w/o a '-a' for normal 'ps'
 	// Make sure it DOESN'T show up w/o a '-a' for normal 'ps'
 	out, _ = dockerCmd(c, "ps", "-q")
 	out, _ = dockerCmd(c, "ps", "-q")
-	c.Assert(out, checker.Not(checker.Contains), shortCID, check.Commentf("Should have not seen '%s' in ps output:\n%s", shortCID, out))
-
+	assert.Assert(c, !strings.Contains(out, shortCID), "Should have not seen '%s' in ps output:\n%s", shortCID, out)
 	// Make sure it DOES show up as 'Created' for 'ps -a'
 	// Make sure it DOES show up as 'Created' for 'ps -a'
 	out, _ = dockerCmd(c, "ps", "-a")
 	out, _ = dockerCmd(c, "ps", "-a")
 
 
@@ -529,10 +531,10 @@ func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) {
 			continue
 			continue
 		}
 		}
 		hits++
 		hits++
-		c.Assert(line, checker.Contains, "Created", check.Commentf("Missing 'Created' on '%s'", line))
+		assert.Assert(c, strings.Contains(line, "Created"), "Missing 'Created' on '%s'", line)
 	}
 	}
 
 
-	c.Assert(hits, checker.Equals, 1, check.Commentf("Should have seen '%s' in ps -a output once:%d\n%s", shortCID, hits, out))
+	assert.Equal(c, hits, 1, fmt.Sprintf("Should have seen '%s' in ps -a output once:%d\n%s", shortCID, hits, out))
 
 
 	// filter containers by 'create' - note, no -a needed
 	// filter containers by 'create' - note, no -a needed
 	out, _ = dockerCmd(c, "ps", "-q", "-f", "status=created")
 	out, _ = dockerCmd(c, "ps", "-q", "-f", "status=created")
@@ -541,7 +543,7 @@ func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) {
 }
 }
 
 
 // Test for GitHub issue #12595
 // Test for GitHub issue #12595
-func (s *DockerSuite) TestPsImageIDAfterUpdate(c *check.C) {
+func (s *DockerSuite) TestPsImageIDAfterUpdate(c *testing.T) {
 	// TODO: Investigate why this fails on Windows to Windows CI further.
 	// TODO: Investigate why this fails on Windows to Windows CI further.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	originalImageName := "busybox:TestPsImageIDAfterUpdate-original"
 	originalImageName := "busybox:TestPsImageIDAfterUpdate-original"
@@ -564,11 +566,11 @@ func (s *DockerSuite) TestPsImageIDAfterUpdate(c *check.C) {
 	lines = RemoveLinesForExistingElements(lines, existingContainers)
 	lines = RemoveLinesForExistingElements(lines, existingContainers)
 	// skip header
 	// skip header
 	lines = lines[1:]
 	lines = lines[1:]
-	c.Assert(len(lines), checker.Equals, 1)
+	assert.Equal(c, len(lines), 1)
 
 
 	for _, line := range lines {
 	for _, line := range lines {
 		f := strings.Fields(line)
 		f := strings.Fields(line)
-		c.Assert(f[1], checker.Equals, originalImageName)
+		assert.Equal(c, f[1], originalImageName)
 	}
 	}
 
 
 	icmd.RunCommand(dockerBinary, "commit", containerID, updatedImageName).Assert(c, icmd.Success)
 	icmd.RunCommand(dockerBinary, "commit", containerID, updatedImageName).Assert(c, icmd.Success)
@@ -581,34 +583,34 @@ func (s *DockerSuite) TestPsImageIDAfterUpdate(c *check.C) {
 	lines = RemoveLinesForExistingElements(lines, existingContainers)
 	lines = RemoveLinesForExistingElements(lines, existingContainers)
 	// skip header
 	// skip header
 	lines = lines[1:]
 	lines = lines[1:]
-	c.Assert(len(lines), checker.Equals, 1)
+	assert.Equal(c, len(lines), 1)
 
 
 	for _, line := range lines {
 	for _, line := range lines {
 		f := strings.Fields(line)
 		f := strings.Fields(line)
-		c.Assert(f[1], checker.Equals, originalImageID)
+		assert.Equal(c, f[1], originalImageID)
 	}
 	}
 
 
 }
 }
 
 
-func (s *DockerSuite) TestPsNotShowPortsOfStoppedContainer(c *check.C) {
+func (s *DockerSuite) TestPsNotShowPortsOfStoppedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "--name=foo", "-d", "-p", "5000:5000", "busybox", "top")
 	dockerCmd(c, "run", "--name=foo", "-d", "-p", "5000:5000", "busybox", "top")
-	c.Assert(waitRun("foo"), checker.IsNil)
+	assert.Assert(c, waitRun("foo") == nil)
 	out, _ := dockerCmd(c, "ps")
 	out, _ := dockerCmd(c, "ps")
 	lines := strings.Split(strings.TrimSpace(string(out)), "\n")
 	lines := strings.Split(strings.TrimSpace(string(out)), "\n")
 	expected := "0.0.0.0:5000->5000/tcp"
 	expected := "0.0.0.0:5000->5000/tcp"
 	fields := strings.Fields(lines[1])
 	fields := strings.Fields(lines[1])
-	c.Assert(fields[len(fields)-2], checker.Equals, expected, check.Commentf("Expected: %v, got: %v", expected, fields[len(fields)-2]))
+	assert.Equal(c, fields[len(fields)-2], expected, fmt.Sprintf("Expected: %v, got: %v", expected, fields[len(fields)-2]))
 
 
 	dockerCmd(c, "kill", "foo")
 	dockerCmd(c, "kill", "foo")
 	dockerCmd(c, "wait", "foo")
 	dockerCmd(c, "wait", "foo")
 	out, _ = dockerCmd(c, "ps", "-l")
 	out, _ = dockerCmd(c, "ps", "-l")
 	lines = strings.Split(strings.TrimSpace(string(out)), "\n")
 	lines = strings.Split(strings.TrimSpace(string(out)), "\n")
 	fields = strings.Fields(lines[1])
 	fields = strings.Fields(lines[1])
-	c.Assert(fields[len(fields)-2], checker.Not(checker.Equals), expected, check.Commentf("Should not got %v", expected))
+	assert.Assert(c, fields[len(fields)-2] != expected, "Should not got %v", expected)
 }
 }
 
 
-func (s *DockerSuite) TestPsShowMounts(c *check.C) {
+func (s *DockerSuite) TestPsShowMounts(c *testing.T) {
 	existingContainers := ExistingContainerNames(c)
 	existingContainers := ExistingContainerNames(c)
 
 
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
@@ -618,9 +620,9 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 	dockerCmd(c, "volume", "create", "ps-volume-test")
 	dockerCmd(c, "volume", "create", "ps-volume-test")
 	// volume mount containers
 	// volume mount containers
 	runSleepingContainer(c, "--name=volume-test-1", "--volume", "ps-volume-test:"+mp)
 	runSleepingContainer(c, "--name=volume-test-1", "--volume", "ps-volume-test:"+mp)
-	c.Assert(waitRun("volume-test-1"), checker.IsNil)
+	assert.Assert(c, waitRun("volume-test-1") == nil)
 	runSleepingContainer(c, "--name=volume-test-2", "--volume", mp)
 	runSleepingContainer(c, "--name=volume-test-2", "--volume", mp)
-	c.Assert(waitRun("volume-test-2"), checker.IsNil)
+	assert.Assert(c, waitRun("volume-test-2") == nil)
 	// bind mount container
 	// bind mount container
 	var bindMountSource string
 	var bindMountSource string
 	var bindMountDestination string
 	var bindMountDestination string
@@ -632,7 +634,7 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 		bindMountDestination = "/t"
 		bindMountDestination = "/t"
 	}
 	}
 	runSleepingContainer(c, "--name=bind-mount-test", "-v", bindMountSource+":"+bindMountDestination)
 	runSleepingContainer(c, "--name=bind-mount-test", "-v", bindMountSource+":"+bindMountDestination)
-	c.Assert(waitRun("bind-mount-test"), checker.IsNil)
+	assert.Assert(c, waitRun("bind-mount-test") == nil)
 
 
 	out, _ := dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}")
 	out, _ := dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}")
 
 
@@ -642,8 +644,8 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 
 
 	fields := strings.Fields(lines[0])
 	fields := strings.Fields(lines[0])
 	assert.Equal(c, len(fields), 2)
 	assert.Equal(c, len(fields), 2)
-	c.Assert(fields[0], checker.Equals, "bind-mount-test")
-	c.Assert(fields[1], checker.Equals, bindMountSource)
+	assert.Equal(c, fields[0], "bind-mount-test")
+	assert.Equal(c, fields[1], bindMountSource)
 
 
 	fields = strings.Fields(lines[1])
 	fields = strings.Fields(lines[1])
 	assert.Equal(c, len(fields), 2)
 	assert.Equal(c, len(fields), 2)
@@ -651,7 +653,7 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 	anonymousVolumeID := fields[1]
 	anonymousVolumeID := fields[1]
 
 
 	fields = strings.Fields(lines[2])
 	fields = strings.Fields(lines[2])
-	c.Assert(fields[1], checker.Equals, "ps-volume-test")
+	assert.Equal(c, fields[1], "ps-volume-test")
 
 
 	// filter by volume name
 	// filter by volume name
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume=ps-volume-test")
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume=ps-volume-test")
@@ -661,11 +663,11 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 	assert.Equal(c, len(lines), 1)
 	assert.Equal(c, len(lines), 1)
 
 
 	fields = strings.Fields(lines[0])
 	fields = strings.Fields(lines[0])
-	c.Assert(fields[1], checker.Equals, "ps-volume-test")
+	assert.Equal(c, fields[1], "ps-volume-test")
 
 
 	// empty results filtering by unknown volume
 	// empty results filtering by unknown volume
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume=this-volume-should-not-exist")
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume=this-volume-should-not-exist")
-	c.Assert(strings.TrimSpace(string(out)), checker.HasLen, 0)
+	assert.Equal(c, len(strings.TrimSpace(string(out))), 0)
 
 
 	// filter by mount destination
 	// filter by mount destination
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+mp)
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+mp)
@@ -675,9 +677,9 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 	assert.Equal(c, len(lines), 2)
 	assert.Equal(c, len(lines), 2)
 
 
 	fields = strings.Fields(lines[0])
 	fields = strings.Fields(lines[0])
-	c.Assert(fields[1], checker.Equals, anonymousVolumeID)
+	assert.Equal(c, fields[1], anonymousVolumeID)
 	fields = strings.Fields(lines[1])
 	fields = strings.Fields(lines[1])
-	c.Assert(fields[1], checker.Equals, "ps-volume-test")
+	assert.Equal(c, fields[1], "ps-volume-test")
 
 
 	// filter by bind mount source
 	// filter by bind mount source
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+bindMountSource)
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+bindMountSource)
@@ -688,8 +690,8 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 
 
 	fields = strings.Fields(lines[0])
 	fields = strings.Fields(lines[0])
 	assert.Equal(c, len(fields), 2)
 	assert.Equal(c, len(fields), 2)
-	c.Assert(fields[0], checker.Equals, "bind-mount-test")
-	c.Assert(fields[1], checker.Equals, bindMountSource)
+	assert.Equal(c, fields[0], "bind-mount-test")
+	assert.Equal(c, fields[1], bindMountSource)
 
 
 	// filter by bind mount destination
 	// filter by bind mount destination
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+bindMountDestination)
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+bindMountDestination)
@@ -700,15 +702,15 @@ func (s *DockerSuite) TestPsShowMounts(c *check.C) {
 
 
 	fields = strings.Fields(lines[0])
 	fields = strings.Fields(lines[0])
 	assert.Equal(c, len(fields), 2)
 	assert.Equal(c, len(fields), 2)
-	c.Assert(fields[0], checker.Equals, "bind-mount-test")
-	c.Assert(fields[1], checker.Equals, bindMountSource)
+	assert.Equal(c, fields[0], "bind-mount-test")
+	assert.Equal(c, fields[1], bindMountSource)
 
 
 	// empty results filtering by unknown mount point
 	// empty results filtering by unknown mount point
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+prefix+slash+"this-path-was-never-mounted")
 	out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+prefix+slash+"this-path-was-never-mounted")
-	c.Assert(strings.TrimSpace(string(out)), checker.HasLen, 0)
+	assert.Equal(c, len(strings.TrimSpace(string(out))), 0)
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterNetwork(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterNetwork(c *testing.T) {
 	existing := ExistingContainerIDs(c)
 	existing := ExistingContainerIDs(c)
 
 
 	// TODO default network on Windows is not called "bridge", and creating a
 	// TODO default network on Windows is not called "bridge", and creating a
@@ -743,8 +745,7 @@ func (s *DockerSuite) TestPsListContainersFilterNetwork(c *check.C) {
 	assert.Equal(c, len(RemoveLinesForExistingElements(lines, existing)), 1)
 	assert.Equal(c, len(RemoveLinesForExistingElements(lines, existing)), 1)
 
 
 	// Making sure onbridgenetwork is on the output
 	// Making sure onbridgenetwork is on the output
-	c.Assert(containerOut, checker.Contains, "onbridgenetwork", check.Commentf("Missing the container on network\n"))
-
+	assert.Assert(c, strings.Contains(containerOut, "onbridgenetwork"), "Missing the container on network\n")
 	// Filter docker ps on networks bridge and none
 	// Filter docker ps on networks bridge and none
 	out, _ = dockerCmd(c, "ps", "--filter", "network=bridge", "--filter", "network=none")
 	out, _ = dockerCmd(c, "ps", "--filter", "network=bridge", "--filter", "network=none")
 	containerOut = strings.TrimSpace(string(out))
 	containerOut = strings.TrimSpace(string(out))
@@ -758,9 +759,8 @@ func (s *DockerSuite) TestPsListContainersFilterNetwork(c *check.C) {
 	assert.Equal(c, len(RemoveLinesForExistingElements(lines, existing)), 2)
 	assert.Equal(c, len(RemoveLinesForExistingElements(lines, existing)), 2)
 
 
 	// Making sure onbridgenetwork and onnonenetwork is on the output
 	// Making sure onbridgenetwork and onnonenetwork is on the output
-	c.Assert(containerOut, checker.Contains, "onnonenetwork", check.Commentf("Missing the container on none network\n"))
-	c.Assert(containerOut, checker.Contains, "onbridgenetwork", check.Commentf("Missing the container on bridge network\n"))
-
+	assert.Assert(c, strings.Contains(containerOut, "onnonenetwork"), "Missing the container on none network\n")
+	assert.Assert(c, strings.Contains(containerOut, "onbridgenetwork"), "Missing the container on bridge network\n")
 	nwID, _ := dockerCmd(c, "network", "inspect", "--format", "{{.ID}}", "bridge")
 	nwID, _ := dockerCmd(c, "network", "inspect", "--format", "{{.ID}}", "bridge")
 
 
 	// Filter by network ID
 	// Filter by network ID
@@ -784,11 +784,10 @@ func (s *DockerSuite) TestPsListContainersFilterNetwork(c *check.C) {
 	assert.Equal(c, len(RemoveLinesForExistingElements(lines, existing)), 1)
 	assert.Equal(c, len(RemoveLinesForExistingElements(lines, existing)), 1)
 
 
 	// Making sure onbridgenetwork is on the output
 	// Making sure onbridgenetwork is on the output
-	c.Assert(containerOut, checker.Contains, "onbridgenetwork", check.Commentf("Missing the container on network\n"))
-
+	assert.Assert(c, strings.Contains(containerOut, "onbridgenetwork"), "Missing the container on network\n")
 }
 }
 
 
-func (s *DockerSuite) TestPsByOrder(c *check.C) {
+func (s *DockerSuite) TestPsByOrder(c *testing.T) {
 	out := runSleepingContainer(c, "--name", "xyz-abc")
 	out := runSleepingContainer(c, "--name", "xyz-abc")
 	container1 := strings.TrimSpace(out)
 	container1 := strings.TrimSpace(out)
 
 
@@ -807,7 +806,7 @@ func (s *DockerSuite) TestPsByOrder(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), fmt.Sprintf("%s\n%s", container2, container1))
 	assert.Equal(c, strings.TrimSpace(out), fmt.Sprintf("%s\n%s", container2, container1))
 }
 }
 
 
-func (s *DockerSuite) TestPsListContainersFilterPorts(c *check.C) {
+func (s *DockerSuite) TestPsListContainersFilterPorts(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	existingContainers := ExistingContainerIDs(c)
 	existingContainers := ExistingContainerIDs(c)
 
 
@@ -818,32 +817,31 @@ func (s *DockerSuite) TestPsListContainersFilterPorts(c *check.C) {
 	id2 := strings.TrimSpace(out)
 	id2 := strings.TrimSpace(out)
 
 
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q")
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Contains, id1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, id2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), id2))
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "publish=80-8080/udp")
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "publish=80-8080/udp")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id2)
+	assert.Assert(c, strings.TrimSpace(out) != id1)
+	assert.Assert(c, strings.TrimSpace(out) != id2)
 
 
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "expose=8081")
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "expose=8081")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id2)
+	assert.Assert(c, strings.TrimSpace(out) != id1)
+	assert.Assert(c, strings.TrimSpace(out) != id2)
 
 
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "publish=80-81")
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "publish=80-81")
 	assert.Equal(c, strings.TrimSpace(out), id1)
 	assert.Equal(c, strings.TrimSpace(out), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id2)
+	assert.Assert(c, strings.TrimSpace(out) != id2)
 
 
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "expose=80/tcp")
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "expose=80/tcp")
 	assert.Equal(c, strings.TrimSpace(out), id1)
 	assert.Equal(c, strings.TrimSpace(out), id1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id2)
+	assert.Assert(c, strings.TrimSpace(out) != id2)
 
 
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "expose=8080/tcp")
 	out, _ = dockerCmd(c, "ps", "--no-trunc", "-q", "--filter", "expose=8080/tcp")
 	out = RemoveOutputForExistingElements(out, existingContainers)
 	out = RemoveOutputForExistingElements(out, existingContainers)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Equals), id1)
+	assert.Assert(c, strings.TrimSpace(out) != id1)
 	assert.Equal(c, strings.TrimSpace(out), id2)
 	assert.Equal(c, strings.TrimSpace(out), id2)
 }
 }
 
 
-func (s *DockerSuite) TestPsNotShowLinknamesOfDeletedContainer(c *check.C) {
+func (s *DockerSuite) TestPsNotShowLinknamesOfDeletedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux, MinimumAPIVersion("1.31"))
 	testRequires(c, DaemonIsLinux, MinimumAPIVersion("1.31"))
 	existingContainers := ExistingContainerNames(c)
 	existingContainers := ExistingContainerNames(c)
 
 

+ 30 - 34
integration-cli/docker_cli_pull_local_test.go

@@ -8,14 +8,13 @@ import (
 	"path/filepath"
 	"path/filepath"
 	"runtime"
 	"runtime"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/distribution"
 	"github.com/docker/distribution"
 	"github.com/docker/distribution/manifest"
 	"github.com/docker/distribution/manifest"
 	"github.com/docker/distribution/manifest/manifestlist"
 	"github.com/docker/distribution/manifest/manifestlist"
 	"github.com/docker/distribution/manifest/schema2"
 	"github.com/docker/distribution/manifest/schema2"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"github.com/opencontainers/go-digest"
 	"github.com/opencontainers/go-digest"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
@@ -25,7 +24,7 @@ import (
 // tags for the same image) are not also pulled down.
 // tags for the same image) are not also pulled down.
 //
 //
 // Ref: docker/docker#8141
 // Ref: docker/docker#8141
-func testPullImageWithAliases(c *check.C) {
+func testPullImageWithAliases(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 
 
 	var repos []string
 	var repos []string
@@ -52,16 +51,16 @@ func testPullImageWithAliases(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullImageWithAliases(c *check.C) {
+func (s *DockerRegistrySuite) TestPullImageWithAliases(c *testing.T) {
 	testPullImageWithAliases(c)
 	testPullImageWithAliases(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPullImageWithAliases(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullImageWithAliases(c *testing.T) {
 	testPullImageWithAliases(c)
 	testPullImageWithAliases(c)
 }
 }
 
 
 // testConcurrentPullWholeRepo pulls the same repo concurrently.
 // testConcurrentPullWholeRepo pulls the same repo concurrently.
-func testConcurrentPullWholeRepo(c *check.C) {
+func testConcurrentPullWholeRepo(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 
 
 	var repos []string
 	var repos []string
@@ -108,16 +107,16 @@ func testConcurrentPullWholeRepo(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) testConcurrentPullWholeRepo(c *check.C) {
+func (s *DockerRegistrySuite) testConcurrentPullWholeRepo(c *testing.T) {
 	testConcurrentPullWholeRepo(c)
 	testConcurrentPullWholeRepo(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) testConcurrentPullWholeRepo(c *check.C) {
+func (s *DockerSchema1RegistrySuite) testConcurrentPullWholeRepo(c *testing.T) {
 	testConcurrentPullWholeRepo(c)
 	testConcurrentPullWholeRepo(c)
 }
 }
 
 
 // testConcurrentFailingPull tries a concurrent pull that doesn't succeed.
 // testConcurrentFailingPull tries a concurrent pull that doesn't succeed.
-func testConcurrentFailingPull(c *check.C) {
+func testConcurrentFailingPull(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 
 
 	// Run multiple pulls concurrently
 	// Run multiple pulls concurrently
@@ -139,17 +138,17 @@ func testConcurrentFailingPull(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) testConcurrentFailingPull(c *check.C) {
+func (s *DockerRegistrySuite) testConcurrentFailingPull(c *testing.T) {
 	testConcurrentFailingPull(c)
 	testConcurrentFailingPull(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) testConcurrentFailingPull(c *check.C) {
+func (s *DockerSchema1RegistrySuite) testConcurrentFailingPull(c *testing.T) {
 	testConcurrentFailingPull(c)
 	testConcurrentFailingPull(c)
 }
 }
 
 
 // testConcurrentPullMultipleTags pulls multiple tags from the same repo
 // testConcurrentPullMultipleTags pulls multiple tags from the same repo
 // concurrently.
 // concurrently.
-func testConcurrentPullMultipleTags(c *check.C) {
+func testConcurrentPullMultipleTags(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 
 
 	var repos []string
 	var repos []string
@@ -195,17 +194,17 @@ func testConcurrentPullMultipleTags(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(c *check.C) {
+func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(c *testing.T) {
 	testConcurrentPullMultipleTags(c)
 	testConcurrentPullMultipleTags(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestConcurrentPullMultipleTags(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestConcurrentPullMultipleTags(c *testing.T) {
 	testConcurrentPullMultipleTags(c)
 	testConcurrentPullMultipleTags(c)
 }
 }
 
 
 // testPullIDStability verifies that pushing an image and pulling it back
 // testPullIDStability verifies that pushing an image and pulling it back
 // preserves the image ID.
 // preserves the image ID.
-func testPullIDStability(c *check.C) {
+func testPullIDStability(c *testing.T) {
 	derivedImage := privateRegistryURL + "/dockercli/id-stability"
 	derivedImage := privateRegistryURL + "/dockercli/id-stability"
 	baseImage := "busybox"
 	baseImage := "busybox"
 
 
@@ -256,16 +255,16 @@ func testPullIDStability(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullIDStability(c *check.C) {
+func (s *DockerRegistrySuite) TestPullIDStability(c *testing.T) {
 	testPullIDStability(c)
 	testPullIDStability(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPullIDStability(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullIDStability(c *testing.T) {
 	testPullIDStability(c)
 	testPullIDStability(c)
 }
 }
 
 
 // #21213
 // #21213
-func testPullNoLayers(c *check.C) {
+func testPullNoLayers(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/scratch", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/scratch", privateRegistryURL)
 
 
 	buildImageSuccessfully(c, repoName, build.WithDockerfile(`
 	buildImageSuccessfully(c, repoName, build.WithDockerfile(`
@@ -276,15 +275,15 @@ func testPullNoLayers(c *check.C) {
 	dockerCmd(c, "pull", repoName)
 	dockerCmd(c, "pull", repoName)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullNoLayers(c *check.C) {
+func (s *DockerRegistrySuite) TestPullNoLayers(c *testing.T) {
 	testPullNoLayers(c)
 	testPullNoLayers(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPullNoLayers(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPullNoLayers(c *testing.T) {
 	testPullNoLayers(c)
 	testPullNoLayers(c)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPullManifestList(c *check.C) {
+func (s *DockerRegistrySuite) TestPullManifestList(c *testing.T) {
 	testRequires(c, NotArm)
 	testRequires(c, NotArm)
 	pushDigest, err := setupImage(c)
 	pushDigest, err := setupImage(c)
 	assert.NilError(c, err, "error setting up image")
 	assert.NilError(c, err, "error setting up image")
@@ -340,10 +339,10 @@ func (s *DockerRegistrySuite) TestPullManifestList(c *check.C) {
 	// Add to revision store
 	// Add to revision store
 	revisionDir := filepath.Join(registryV2Path, "repositories", remoteRepoName, "_manifests", "revisions", "sha256", hexDigest)
 	revisionDir := filepath.Join(registryV2Path, "repositories", remoteRepoName, "_manifests", "revisions", "sha256", hexDigest)
 	err = os.Mkdir(revisionDir, 0755)
 	err = os.Mkdir(revisionDir, 0755)
-	c.Assert(err, checker.IsNil, check.Commentf("error creating revision dir"))
+	assert.Assert(c, err == nil, "error creating revision dir")
 	revisionPath := filepath.Join(revisionDir, "link")
 	revisionPath := filepath.Join(revisionDir, "link")
 	err = ioutil.WriteFile(revisionPath, []byte(manifestListDigest.String()), 0644)
 	err = ioutil.WriteFile(revisionPath, []byte(manifestListDigest.String()), 0644)
-	c.Assert(err, checker.IsNil, check.Commentf("error writing revision link"))
+	assert.Assert(c, err == nil, "error writing revision link")
 
 
 	// Update tag
 	// Update tag
 	tagPath := filepath.Join(registryV2Path, "repositories", remoteRepoName, "_manifests", "tags", "latest", "current", "link")
 	tagPath := filepath.Join(registryV2Path, "repositories", remoteRepoName, "_manifests", "tags", "latest", "current", "link")
@@ -355,7 +354,7 @@ func (s *DockerRegistrySuite) TestPullManifestList(c *check.C) {
 
 
 	// The pull output includes "Digest: <digest>", so find that
 	// The pull output includes "Digest: <digest>", so find that
 	matches := digestRegex.FindStringSubmatch(out)
 	matches := digestRegex.FindStringSubmatch(out)
-	c.Assert(matches, checker.HasLen, 2, check.Commentf("unable to parse digest from pull output: %s", out))
+	assert.Equal(c, len(matches), 2, fmt.Sprintf("unable to parse digest from pull output: %s", out))
 	pullDigest := matches[1]
 	pullDigest := matches[1]
 
 
 	// Make sure the pushed and pull digests match
 	// Make sure the pushed and pull digests match
@@ -368,7 +367,7 @@ func (s *DockerRegistrySuite) TestPullManifestList(c *check.C) {
 }
 }
 
 
 // #23100
 // #23100
-func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuthLoginWithScheme(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuthLoginWithScheme(c *testing.T) {
 	osPath := os.Getenv("PATH")
 	osPath := os.Getenv("PATH")
 	defer os.Setenv("PATH", osPath)
 	defer os.Setenv("PATH", osPath)
 
 
@@ -395,8 +394,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuthLoginWithSchem
 
 
 	b, err := ioutil.ReadFile(configPath)
 	b, err := ioutil.ReadFile(configPath)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(string(b), checker.Not(checker.Contains), "\"auth\":")
-
+	assert.Assert(c, !strings.Contains(string(b), "\"auth\":"))
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
 	dockerCmd(c, "--config", tmp, "push", repoName)
 	dockerCmd(c, "--config", tmp, "push", repoName)
 
 
@@ -413,7 +411,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuthLoginWithSchem
 	dockerCmd(c, "--config", tmp, "logout", "https://"+privateRegistryURL)
 	dockerCmd(c, "--config", tmp, "logout", "https://"+privateRegistryURL)
 }
 }
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuth(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuth(c *testing.T) {
 	osPath := os.Getenv("PATH")
 	osPath := os.Getenv("PATH")
 	defer os.Setenv("PATH", osPath)
 	defer os.Setenv("PATH", osPath)
 
 
@@ -440,8 +438,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuth(c *check.C) {
 
 
 	b, err := ioutil.ReadFile(configPath)
 	b, err := ioutil.ReadFile(configPath)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(string(b), checker.Not(checker.Contains), "\"auth\":")
-
+	assert.Assert(c, !strings.Contains(string(b), "\"auth\":"))
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
 	dockerCmd(c, "--config", tmp, "push", repoName)
 	dockerCmd(c, "--config", tmp, "push", repoName)
 
 
@@ -449,7 +446,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuth(c *check.C) {
 }
 }
 
 
 // TestRunImplicitPullWithNoTag should pull implicitly only the default tag (latest)
 // TestRunImplicitPullWithNoTag should pull implicitly only the default tag (latest)
-func (s *DockerRegistrySuite) TestRunImplicitPullWithNoTag(c *check.C) {
+func (s *DockerRegistrySuite) TestRunImplicitPullWithNoTag(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	repo := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repo := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoTag1 := fmt.Sprintf("%v:latest", repo)
 	repoTag1 := fmt.Sprintf("%v:latest", repo)
@@ -462,10 +459,9 @@ func (s *DockerRegistrySuite) TestRunImplicitPullWithNoTag(c *check.C) {
 	dockerCmd(c, "rmi", repoTag2)
 	dockerCmd(c, "rmi", repoTag2)
 
 
 	out, _ := dockerCmd(c, "run", repo)
 	out, _ := dockerCmd(c, "run", repo)
-	c.Assert(out, checker.Contains, fmt.Sprintf("Unable to find image '%s:latest' locally", repo))
-
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Unable to find image '%s:latest' locally", repo)))
 	// There should be only one line for repo, the one with repo:latest
 	// There should be only one line for repo, the one with repo:latest
 	outImageCmd, _ := dockerCmd(c, "images", repo)
 	outImageCmd, _ := dockerCmd(c, "images", repo)
 	splitOutImageCmd := strings.Split(strings.TrimSpace(outImageCmd), "\n")
 	splitOutImageCmd := strings.Split(strings.TrimSpace(outImageCmd), "\n")
-	c.Assert(splitOutImageCmd, checker.HasLen, 2)
+	assert.Equal(c, len(splitOutImageCmd), 2)
 }
 }

+ 9 - 9
integration-cli/docker_cli_pull_test.go

@@ -5,9 +5,9 @@ import (
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/go-check/check"
 	"github.com/opencontainers/go-digest"
 	"github.com/opencontainers/go-digest"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
@@ -15,7 +15,7 @@ import (
 
 
 // TestPullFromCentralRegistry pulls an image from the central registry and verifies that the client
 // TestPullFromCentralRegistry pulls an image from the central registry and verifies that the client
 // prints all expected output.
 // prints all expected output.
-func (s *DockerHubPullSuite) TestPullFromCentralRegistry(c *check.C) {
+func (s *DockerHubPullSuite) TestPullFromCentralRegistry(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out := s.Cmd(c, "pull", "hello-world")
 	out := s.Cmd(c, "pull", "hello-world")
 	defer deleteImages("hello-world")
 	defer deleteImages("hello-world")
@@ -40,7 +40,7 @@ func (s *DockerHubPullSuite) TestPullFromCentralRegistry(c *check.C) {
 
 
 // TestPullNonExistingImage pulls non-existing images from the central registry, with different
 // TestPullNonExistingImage pulls non-existing images from the central registry, with different
 // combinations of implicit tag and library prefix.
 // combinations of implicit tag and library prefix.
-func (s *DockerHubPullSuite) TestPullNonExistingImage(c *check.C) {
+func (s *DockerHubPullSuite) TestPullNonExistingImage(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	type entry struct {
 	type entry struct {
@@ -115,7 +115,7 @@ func (s *DockerHubPullSuite) TestPullNonExistingImage(c *check.C) {
 // that pulling the same image with different combinations of implicit elements of the image
 // that pulling the same image with different combinations of implicit elements of the image
 // reference (tag, repository, central registry url, ...) doesn't trigger a new pull nor leads to
 // reference (tag, repository, central registry url, ...) doesn't trigger a new pull nor leads to
 // multiple images.
 // multiple images.
-func (s *DockerHubPullSuite) TestPullFromCentralRegistryImplicitRefParts(c *check.C) {
+func (s *DockerHubPullSuite) TestPullFromCentralRegistryImplicitRefParts(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	// Pull hello-world from v2
 	// Pull hello-world from v2
@@ -184,7 +184,7 @@ func (s *DockerHubPullSuite) TestPullFromCentralRegistryImplicitRefParts(c *chec
 }
 }
 
 
 // TestPullScratchNotAllowed verifies that pulling 'scratch' is rejected.
 // TestPullScratchNotAllowed verifies that pulling 'scratch' is rejected.
-func (s *DockerHubPullSuite) TestPullScratchNotAllowed(c *check.C) {
+func (s *DockerHubPullSuite) TestPullScratchNotAllowed(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, err := s.CmdWithError("pull", "scratch")
 	out, err := s.CmdWithError("pull", "scratch")
 	assert.ErrorContains(c, err, "", "expected pull of scratch to fail")
 	assert.ErrorContains(c, err, "", "expected pull of scratch to fail")
@@ -194,7 +194,7 @@ func (s *DockerHubPullSuite) TestPullScratchNotAllowed(c *check.C) {
 
 
 // TestPullAllTagsFromCentralRegistry pulls using `all-tags` for a given image and verifies that it
 // TestPullAllTagsFromCentralRegistry pulls using `all-tags` for a given image and verifies that it
 // results in more images than a naked pull.
 // results in more images than a naked pull.
-func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
+func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	s.Cmd(c, "pull", "dockercore/engine-pull-all-test-fixture")
 	s.Cmd(c, "pull", "dockercore/engine-pull-all-test-fixture")
 	outImageCmd := s.Cmd(c, "images", "dockercore/engine-pull-all-test-fixture")
 	outImageCmd := s.Cmd(c, "images", "dockercore/engine-pull-all-test-fixture")
@@ -238,7 +238,7 @@ func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
 // gets cancelled.
 // gets cancelled.
 //
 //
 // Ref: docker/docker#15589
 // Ref: docker/docker#15589
-func (s *DockerHubPullSuite) TestPullClientDisconnect(c *check.C) {
+func (s *DockerHubPullSuite) TestPullClientDisconnect(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	repoName := "hello-world:latest"
 	repoName := "hello-world:latest"
 
 
@@ -263,14 +263,14 @@ func (s *DockerHubPullSuite) TestPullClientDisconnect(c *check.C) {
 }
 }
 
 
 // Regression test for https://github.com/docker/docker/issues/26429
 // Regression test for https://github.com/docker/docker/issues/26429
-func (s *DockerSuite) TestPullLinuxImageFailsOnWindows(c *check.C) {
+func (s *DockerSuite) TestPullLinuxImageFailsOnWindows(c *testing.T) {
 	testRequires(c, DaemonIsWindows, Network)
 	testRequires(c, DaemonIsWindows, Network)
 	_, _, err := dockerCmdWithError("pull", "ubuntu")
 	_, _, err := dockerCmdWithError("pull", "ubuntu")
 	assert.ErrorContains(c, err, "no matching manifest for windows")
 	assert.ErrorContains(c, err, "no matching manifest for windows")
 }
 }
 
 
 // Regression test for https://github.com/docker/docker/issues/28892
 // Regression test for https://github.com/docker/docker/issues/28892
-func (s *DockerSuite) TestPullWindowsImageFailsOnLinux(c *check.C) {
+func (s *DockerSuite) TestPullWindowsImageFailsOnLinux(c *testing.T) {
 	testRequires(c, DaemonIsLinux, Network)
 	testRequires(c, DaemonIsLinux, Network)
 	_, _, err := dockerCmdWithError("pull", "mcr.microsoft.com/windows/servercore:ltsc2019")
 	_, _, err := dockerCmdWithError("pull", "mcr.microsoft.com/windows/servercore:ltsc2019")
 	assert.ErrorContains(c, err, "no matching manifest for linux")
 	assert.ErrorContains(c, err, "no matching manifest for linux")

+ 29 - 29
integration-cli/docker_cli_push_test.go

@@ -9,16 +9,16 @@ import (
 	"os"
 	"os"
 	"strings"
 	"strings"
 	"sync"
 	"sync"
+	"testing"
 
 
 	"github.com/docker/distribution/reference"
 	"github.com/docker/distribution/reference"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 // Pushing an image to a private registry.
 // Pushing an image to a private registry.
-func testPushBusyboxImage(c *check.C) {
+func testPushBusyboxImage(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	// tag the image to upload it to the private registry
 	// tag the image to upload it to the private registry
 	dockerCmd(c, "tag", "busybox", repoName)
 	dockerCmd(c, "tag", "busybox", repoName)
@@ -26,21 +26,21 @@ func testPushBusyboxImage(c *check.C) {
 	dockerCmd(c, "push", repoName)
 	dockerCmd(c, "push", repoName)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPushBusyboxImage(c *check.C) {
+func (s *DockerRegistrySuite) TestPushBusyboxImage(c *testing.T) {
 	testPushBusyboxImage(c)
 	testPushBusyboxImage(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPushBusyboxImage(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPushBusyboxImage(c *testing.T) {
 	testPushBusyboxImage(c)
 	testPushBusyboxImage(c)
 }
 }
 
 
 // pushing an image without a prefix should throw an error
 // pushing an image without a prefix should throw an error
-func (s *DockerSuite) TestPushUnprefixedRepo(c *check.C) {
+func (s *DockerSuite) TestPushUnprefixedRepo(c *testing.T) {
 	out, _, err := dockerCmdWithError("push", "busybox")
 	out, _, err := dockerCmdWithError("push", "busybox")
 	assert.ErrorContains(c, err, "", "pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
 	assert.ErrorContains(c, err, "", "pushing an unprefixed repo didn't result in a non-zero exit status: %s", out)
 }
 }
 
 
-func testPushUntagged(c *check.C) {
+func testPushUntagged(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	expected := "An image does not exist locally with the tag"
 	expected := "An image does not exist locally with the tag"
 
 
@@ -49,15 +49,15 @@ func testPushUntagged(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected), "pushing the image failed")
 	assert.Assert(c, strings.Contains(out, expected), "pushing the image failed")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPushUntagged(c *check.C) {
+func (s *DockerRegistrySuite) TestPushUntagged(c *testing.T) {
 	testPushUntagged(c)
 	testPushUntagged(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPushUntagged(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPushUntagged(c *testing.T) {
 	testPushUntagged(c)
 	testPushUntagged(c)
 }
 }
 
 
-func testPushBadTag(c *check.C) {
+func testPushBadTag(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox:latest", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox:latest", privateRegistryURL)
 	expected := "does not exist"
 	expected := "does not exist"
 
 
@@ -66,15 +66,15 @@ func testPushBadTag(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected), "pushing the image failed")
 	assert.Assert(c, strings.Contains(out, expected), "pushing the image failed")
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPushBadTag(c *check.C) {
+func (s *DockerRegistrySuite) TestPushBadTag(c *testing.T) {
 	testPushBadTag(c)
 	testPushBadTag(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPushBadTag(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPushBadTag(c *testing.T) {
 	testPushBadTag(c)
 	testPushBadTag(c)
 }
 }
 
 
-func testPushMultipleTags(c *check.C) {
+func testPushMultipleTags(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoTag1 := fmt.Sprintf("%v/dockercli/busybox:t1", privateRegistryURL)
 	repoTag1 := fmt.Sprintf("%v/dockercli/busybox:t1", privateRegistryURL)
 	repoTag2 := fmt.Sprintf("%v/dockercli/busybox:t2", privateRegistryURL)
 	repoTag2 := fmt.Sprintf("%v/dockercli/busybox:t2", privateRegistryURL)
@@ -111,15 +111,15 @@ func testPushMultipleTags(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPushMultipleTags(c *check.C) {
+func (s *DockerRegistrySuite) TestPushMultipleTags(c *testing.T) {
 	testPushMultipleTags(c)
 	testPushMultipleTags(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPushMultipleTags(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPushMultipleTags(c *testing.T) {
 	testPushMultipleTags(c)
 	testPushMultipleTags(c)
 }
 }
 
 
-func testPushEmptyLayer(c *check.C) {
+func testPushEmptyLayer(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/emptylayer", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/emptylayer", privateRegistryURL)
 	emptyTarball, err := ioutil.TempFile("", "empty_tarball")
 	emptyTarball, err := ioutil.TempFile("", "empty_tarball")
 	assert.NilError(c, err, "Unable to create test file")
 	assert.NilError(c, err, "Unable to create test file")
@@ -142,17 +142,17 @@ func testPushEmptyLayer(c *check.C) {
 	assert.NilError(c, err, "pushing the image to the private registry has failed: %s", out)
 	assert.NilError(c, err, "pushing the image to the private registry has failed: %s", out)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestPushEmptyLayer(c *check.C) {
+func (s *DockerRegistrySuite) TestPushEmptyLayer(c *testing.T) {
 	testPushEmptyLayer(c)
 	testPushEmptyLayer(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestPushEmptyLayer(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestPushEmptyLayer(c *testing.T) {
 	testPushEmptyLayer(c)
 	testPushEmptyLayer(c)
 }
 }
 
 
 // testConcurrentPush pushes multiple tags to the same repo
 // testConcurrentPush pushes multiple tags to the same repo
 // concurrently.
 // concurrently.
-func testConcurrentPush(c *check.C) {
+func testConcurrentPush(c *testing.T) {
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 
 
 	var repos []string
 	var repos []string
@@ -196,15 +196,15 @@ func testConcurrentPush(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerRegistrySuite) TestConcurrentPush(c *check.C) {
+func (s *DockerRegistrySuite) TestConcurrentPush(c *testing.T) {
 	testConcurrentPush(c)
 	testConcurrentPush(c)
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestConcurrentPush(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestConcurrentPush(c *testing.T) {
 	testConcurrentPush(c)
 	testConcurrentPush(c)
 }
 }
 
 
-func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *check.C) {
+func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
 	sourceRepoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	sourceRepoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	// tag the image to upload it to the private registry
 	// tag the image to upload it to the private registry
 	dockerCmd(c, "tag", "busybox", sourceRepoName)
 	dockerCmd(c, "tag", "busybox", sourceRepoName)
@@ -246,7 +246,7 @@ func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *check.C) {
 	assert.Equal(c, out4, "hello world")
 	assert.Equal(c, out4, "hello world")
 }
 }
 
 
-func (s *DockerSchema1RegistrySuite) TestCrossRepositoryLayerPushNotSupported(c *check.C) {
+func (s *DockerSchema1RegistrySuite) TestCrossRepositoryLayerPushNotSupported(c *testing.T) {
 	sourceRepoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	sourceRepoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
 	// tag the image to upload it to the private registry
 	// tag the image to upload it to the private registry
 	dockerCmd(c, "tag", "busybox", sourceRepoName)
 	dockerCmd(c, "tag", "busybox", sourceRepoName)
@@ -279,7 +279,7 @@ func (s *DockerSchema1RegistrySuite) TestCrossRepositoryLayerPushNotSupported(c
 	assert.Assert(c, out3 == "hello world")
 	assert.Assert(c, out3 == "hello world")
 }
 }
 
 
-func (s *DockerRegistryAuthHtpasswdSuite) TestPushNoCredentialsNoRetry(c *check.C) {
+func (s *DockerRegistryAuthHtpasswdSuite) TestPushNoCredentialsNoRetry(c *testing.T) {
 	repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
 	repoName := fmt.Sprintf("%s/busybox", privateRegistryURL)
 	dockerCmd(c, "tag", "busybox", repoName)
 	dockerCmd(c, "tag", "busybox", repoName)
 	out, _, err := dockerCmdWithError("push", repoName)
 	out, _, err := dockerCmdWithError("push", repoName)
@@ -289,7 +289,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPushNoCredentialsNoRetry(c *check.
 }
 }
 
 
 // This may be flaky but it's needed not to regress on unauthorized push, see #21054
 // This may be flaky but it's needed not to regress on unauthorized push, see #21054
-func (s *DockerSuite) TestPushToCentralRegistryUnauthorized(c *check.C) {
+func (s *DockerSuite) TestPushToCentralRegistryUnauthorized(c *testing.T) {
 	testRequires(c, Network)
 	testRequires(c, Network)
 	repoName := "test/busybox"
 	repoName := "test/busybox"
 	dockerCmd(c, "tag", "busybox", repoName)
 	dockerCmd(c, "tag", "busybox", repoName)
@@ -316,7 +316,7 @@ func getTestTokenService(status int, body string, retries int) *httptest.Server
 	}))
 	}))
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) TestPushTokenServiceUnauthResponse(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) TestPushTokenServiceUnauthResponse(c *testing.T) {
 	ts := getTestTokenService(http.StatusUnauthorized, `{"errors": [{"Code":"UNAUTHORIZED", "message": "a message", "detail": null}]}`, 0)
 	ts := getTestTokenService(http.StatusUnauthorized, `{"errors": [{"Code":"UNAUTHORIZED", "message": "a message", "detail": null}]}`, 0)
 	defer ts.Close()
 	defer ts.Close()
 	s.setupRegistryWithTokenService(c, ts.URL)
 	s.setupRegistryWithTokenService(c, ts.URL)
@@ -328,7 +328,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushTokenServiceUnauthResponse(c *che
 	assert.Assert(c, strings.Contains(out, "unauthorized: a message"))
 	assert.Assert(c, strings.Contains(out, "unauthorized: a message"))
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseUnauthorized(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseUnauthorized(c *testing.T) {
 	ts := getTestTokenService(http.StatusUnauthorized, `{"error": "unauthorized"}`, 0)
 	ts := getTestTokenService(http.StatusUnauthorized, `{"error": "unauthorized"}`, 0)
 	defer ts.Close()
 	defer ts.Close()
 	s.setupRegistryWithTokenService(c, ts.URL)
 	s.setupRegistryWithTokenService(c, ts.URL)
@@ -341,7 +341,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse
 	assert.Equal(c, split[len(split)-2], "unauthorized: authentication required")
 	assert.Equal(c, split[len(split)-2], "unauthorized: authentication required")
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseError(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseError(c *testing.T) {
 	ts := getTestTokenService(http.StatusTooManyRequests, `{"errors": [{"code":"TOOMANYREQUESTS","message":"out of tokens"}]}`, 3)
 	ts := getTestTokenService(http.StatusTooManyRequests, `{"errors": [{"code":"TOOMANYREQUESTS","message":"out of tokens"}]}`, 3)
 	defer ts.Close()
 	defer ts.Close()
 	s.setupRegistryWithTokenService(c, ts.URL)
 	s.setupRegistryWithTokenService(c, ts.URL)
@@ -356,7 +356,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse
 	assert.Equal(c, split[len(split)-2], "toomanyrequests: out of tokens")
 	assert.Equal(c, split[len(split)-2], "toomanyrequests: out of tokens")
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseUnparsable(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseUnparsable(c *testing.T) {
 	ts := getTestTokenService(http.StatusForbidden, `no way`, 0)
 	ts := getTestTokenService(http.StatusForbidden, `no way`, 0)
 	defer ts.Close()
 	defer ts.Close()
 	s.setupRegistryWithTokenService(c, ts.URL)
 	s.setupRegistryWithTokenService(c, ts.URL)
@@ -369,7 +369,7 @@ func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponse
 	assert.Assert(c, strings.Contains(split[len(split)-2], "error parsing HTTP 403 response body: "))
 	assert.Assert(c, strings.Contains(split[len(split)-2], "error parsing HTTP 403 response body: "))
 }
 }
 
 
-func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseNoToken(c *check.C) {
+func (s *DockerRegistryAuthTokenSuite) TestPushMisconfiguredTokenServiceResponseNoToken(c *testing.T) {
 	ts := getTestTokenService(http.StatusOK, `{"something": "wrong"}`, 0)
 	ts := getTestTokenService(http.StatusOK, `{"something": "wrong"}`, 0)
 	defer ts.Close()
 	defer ts.Close()
 	s.setupRegistryWithTokenService(c, ts.URL)
 	s.setupRegistryWithTokenService(c, ts.URL)

+ 3 - 3
integration-cli/docker_cli_registry_user_agent_test.go

@@ -6,9 +6,9 @@ import (
 	"net/http"
 	"net/http"
 	"os"
 	"os"
 	"regexp"
 	"regexp"
+	"testing"
 
 
 	"github.com/docker/docker/internal/test/registry"
 	"github.com/docker/docker/internal/test/registry"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -29,7 +29,7 @@ func unescapeBackslashSemicolonParens(s string) string {
 	return string(ret)
 	return string(ret)
 }
 }
 
 
-func regexpCheckUA(c *check.C, ua string) {
+func regexpCheckUA(c *testing.T, ua string) {
 	re := regexp.MustCompile("(?P<dockerUA>.+) UpstreamClient(?P<upstreamUA>.+)")
 	re := regexp.MustCompile("(?P<dockerUA>.+) UpstreamClient(?P<upstreamUA>.+)")
 	substrArr := re.FindStringSubmatch(ua)
 	substrArr := re.FindStringSubmatch(ua)
 
 
@@ -71,7 +71,7 @@ func registerUserAgentHandler(reg *registry.Mock, result *string) {
 // TestUserAgentPassThrough verifies that when an image is pulled from
 // TestUserAgentPassThrough verifies that when an image is pulled from
 // a registry, the registry should see a User-Agent string of the form
 // a registry, the registry should see a User-Agent string of the form
 // [docker engine UA] UpstreamClientSTREAM-CLIENT([client UA])
 // [docker engine UA] UpstreamClientSTREAM-CLIENT([client UA])
-func (s *DockerRegistrySuite) TestUserAgentPassThrough(c *check.C) {
+func (s *DockerRegistrySuite) TestUserAgentPassThrough(c *testing.T) {
 	var ua string
 	var ua string
 
 
 	reg, err := registry.NewMock(c)
 	reg, err := registry.NewMock(c)

+ 27 - 20
integration-cli/docker_cli_restart_test.go

@@ -4,15 +4,16 @@ import (
 	"os"
 	"os"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
+	"gotest.tools/poll"
 )
 )
 
 
-func (s *DockerSuite) TestRestartStoppedContainer(c *check.C) {
+func (s *DockerSuite) TestRestartStoppedContainer(c *testing.T) {
 	dockerCmd(c, "run", "--name=test", "busybox", "echo", "foobar")
 	dockerCmd(c, "run", "--name=test", "busybox", "echo", "foobar")
 	cleanedContainerID := getIDByName(c, "test")
 	cleanedContainerID := getIDByName(c, "test")
 
 
@@ -29,30 +30,30 @@ func (s *DockerSuite) TestRestartStoppedContainer(c *check.C) {
 	assert.Equal(c, out, "foobar\nfoobar\n")
 	assert.Equal(c, out, "foobar\nfoobar\n")
 }
 }
 
 
-func (s *DockerSuite) TestRestartRunningContainer(c *check.C) {
+func (s *DockerSuite) TestRestartRunningContainer(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", "echo foobar && sleep 30 && echo 'should not print this'")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "sh", "-c", "echo foobar && sleep 30 && echo 'should not print this'")
 
 
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
 
 
 	assert.NilError(c, waitRun(cleanedContainerID))
 	assert.NilError(c, waitRun(cleanedContainerID))
 
 
-	getLogs := func(c *check.C) (interface{}, check.CommentInterface) {
+	getLogs := func(c *testing.T) (interface{}, string) {
 		out, _ := dockerCmd(c, "logs", cleanedContainerID)
 		out, _ := dockerCmd(c, "logs", cleanedContainerID)
-		return out, nil
+		return out, ""
 	}
 	}
 
 
 	// Wait 10 seconds for the 'echo' to appear in the logs
 	// Wait 10 seconds for the 'echo' to appear in the logs
-	waitAndAssert(c, 10*time.Second, getLogs, checker.Equals, "foobar\n")
+	poll.WaitOn(c, pollCheck(c, getLogs, checker.Equals("foobar\n")), poll.WithTimeout(10*time.Second))
 
 
 	dockerCmd(c, "restart", "-t", "1", cleanedContainerID)
 	dockerCmd(c, "restart", "-t", "1", cleanedContainerID)
 	assert.NilError(c, waitRun(cleanedContainerID))
 	assert.NilError(c, waitRun(cleanedContainerID))
 
 
 	// Wait 10 seconds for first 'echo' appear (again) in the logs
 	// Wait 10 seconds for first 'echo' appear (again) in the logs
-	waitAndAssert(c, 10*time.Second, getLogs, checker.Equals, "foobar\nfoobar\n")
+	poll.WaitOn(c, pollCheck(c, getLogs, checker.Equals("foobar\nfoobar\n")), poll.WithTimeout(10*time.Second))
 }
 }
 
 
 // Test that restarting a container with a volume does not create a new volume on restart. Regression test for #819.
 // Test that restarting a container with a volume does not create a new volume on restart. Regression test for #819.
-func (s *DockerSuite) TestRestartWithVolumes(c *check.C) {
+func (s *DockerSuite) TestRestartWithVolumes(c *testing.T) {
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	out := runSleepingContainer(c, "-d", "-v", prefix+slash+"test")
 	out := runSleepingContainer(c, "-d", "-v", prefix+slash+"test")
 
 
@@ -77,7 +78,7 @@ func (s *DockerSuite) TestRestartWithVolumes(c *check.C) {
 	assert.Equal(c, source, sourceAfterRestart)
 	assert.Equal(c, source, sourceAfterRestart)
 }
 }
 
 
-func (s *DockerSuite) TestRestartDisconnectedContainer(c *check.C) {
+func (s *DockerSuite) TestRestartDisconnectedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace, NotArm)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace, NotArm)
 
 
 	// Run a container on the default bridge network
 	// Run a container on the default bridge network
@@ -94,7 +95,7 @@ func (s *DockerSuite) TestRestartDisconnectedContainer(c *check.C) {
 	assert.Assert(c, exitCode == 0, out)
 	assert.Assert(c, exitCode == 0, out)
 }
 }
 
 
-func (s *DockerSuite) TestRestartPolicyNO(c *check.C) {
+func (s *DockerSuite) TestRestartPolicyNO(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "--restart=no", "busybox")
 	out, _ := dockerCmd(c, "create", "--restart=no", "busybox")
 
 
 	id := strings.TrimSpace(string(out))
 	id := strings.TrimSpace(string(out))
@@ -102,7 +103,7 @@ func (s *DockerSuite) TestRestartPolicyNO(c *check.C) {
 	assert.Equal(c, name, "no")
 	assert.Equal(c, name, "no")
 }
 }
 
 
-func (s *DockerSuite) TestRestartPolicyAlways(c *check.C) {
+func (s *DockerSuite) TestRestartPolicyAlways(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "--restart=always", "busybox")
 	out, _ := dockerCmd(c, "create", "--restart=always", "busybox")
 
 
 	id := strings.TrimSpace(string(out))
 	id := strings.TrimSpace(string(out))
@@ -115,7 +116,7 @@ func (s *DockerSuite) TestRestartPolicyAlways(c *check.C) {
 	assert.Equal(c, MaximumRetryCount, "0")
 	assert.Equal(c, MaximumRetryCount, "0")
 }
 }
 
 
-func (s *DockerSuite) TestRestartPolicyOnFailure(c *check.C) {
+func (s *DockerSuite) TestRestartPolicyOnFailure(c *testing.T) {
 	out, _, err := dockerCmdWithError("create", "--restart=on-failure:-1", "busybox")
 	out, _, err := dockerCmdWithError("create", "--restart=on-failure:-1", "busybox")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 	assert.Assert(c, strings.Contains(out, "maximum retry count cannot be negative"))
 	assert.Assert(c, strings.Contains(out, "maximum retry count cannot be negative"))
@@ -150,7 +151,7 @@ func (s *DockerSuite) TestRestartPolicyOnFailure(c *check.C) {
 
 
 // a good container with --restart=on-failure:3
 // a good container with --restart=on-failure:3
 // MaximumRetryCount!=0; RestartCount=0
 // MaximumRetryCount!=0; RestartCount=0
-func (s *DockerSuite) TestRestartContainerwithGoodContainer(c *check.C) {
+func (s *DockerSuite) TestRestartContainerwithGoodContainer(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "true")
 	out, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "true")
 
 
 	id := strings.TrimSpace(string(out))
 	id := strings.TrimSpace(string(out))
@@ -164,11 +165,14 @@ func (s *DockerSuite) TestRestartContainerwithGoodContainer(c *check.C) {
 	assert.Equal(c, MaximumRetryCount, "3")
 	assert.Equal(c, MaximumRetryCount, "3")
 }
 }
 
 
-func (s *DockerSuite) TestRestartContainerSuccess(c *check.C) {
+func (s *DockerSuite) TestRestartContainerSuccess(c *testing.T) {
+	testRequires(c, testEnv.IsLocalDaemon)
 	// Skipped for Hyper-V isolated containers. Test is currently written
 	// Skipped for Hyper-V isolated containers. Test is currently written
 	// such that it assumes there is a host process to kill. In Hyper-V
 	// such that it assumes there is a host process to kill. In Hyper-V
 	// containers, the process is inside the utility VM, not on the host.
 	// containers, the process is inside the utility VM, not on the host.
-	testRequires(c, testEnv.IsLocalDaemon, IsolationIsProcess)
+	if DaemonIsWindows() {
+		testRequires(c, IsolationIsProcess)
+	}
 
 
 	out := runSleepingContainer(c, "-d", "--restart=always")
 	out := runSleepingContainer(c, "-d", "--restart=always")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -193,7 +197,7 @@ func (s *DockerSuite) TestRestartContainerSuccess(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerSuite) TestRestartWithPolicyUserDefinedNetwork(c *check.C) {
+func (s *DockerSuite) TestRestartWithPolicyUserDefinedNetwork(c *testing.T) {
 	// TODO Windows. This may be portable following HNS integration post TP5.
 	// TODO Windows. This may be portable following HNS integration post TP5.
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace, NotArm)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon, NotUserNamespace, NotArm)
 	dockerCmd(c, "network", "create", "-d", "bridge", "udNet")
 	dockerCmd(c, "network", "create", "-d", "bridge", "udNet")
@@ -237,11 +241,14 @@ func (s *DockerSuite) TestRestartWithPolicyUserDefinedNetwork(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerSuite) TestRestartPolicyAfterRestart(c *check.C) {
+func (s *DockerSuite) TestRestartPolicyAfterRestart(c *testing.T) {
+	testRequires(c, testEnv.IsLocalDaemon)
 	// Skipped for Hyper-V isolated containers. Test is currently written
 	// Skipped for Hyper-V isolated containers. Test is currently written
 	// such that it assumes there is a host process to kill. In Hyper-V
 	// such that it assumes there is a host process to kill. In Hyper-V
 	// containers, the process is inside the utility VM, not on the host.
 	// containers, the process is inside the utility VM, not on the host.
-	testRequires(c, testEnv.IsLocalDaemon, IsolationIsProcess)
+	if DaemonIsWindows() {
+		testRequires(c, IsolationIsProcess)
+	}
 
 
 	out := runSleepingContainer(c, "-d", "--restart=always")
 	out := runSleepingContainer(c, "-d", "--restart=always")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -270,7 +277,7 @@ func (s *DockerSuite) TestRestartPolicyAfterRestart(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerSuite) TestRestartContainerwithRestartPolicy(c *check.C) {
+func (s *DockerSuite) TestRestartContainerwithRestartPolicy(c *testing.T) {
 	out1, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "false")
 	out1, _ := dockerCmd(c, "run", "-d", "--restart=on-failure:3", "busybox", "false")
 	out2, _ := dockerCmd(c, "run", "-d", "--restart=always", "busybox", "false")
 	out2, _ := dockerCmd(c, "run", "-d", "--restart=always", "busybox", "false")
 
 
@@ -301,7 +308,7 @@ func (s *DockerSuite) TestRestartContainerwithRestartPolicy(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 }
 }
 
 
-func (s *DockerSuite) TestRestartAutoRemoveContainer(c *check.C) {
+func (s *DockerSuite) TestRestartAutoRemoveContainer(c *testing.T) {
 	out := runSleepingContainer(c, "--rm")
 	out := runSleepingContainer(c, "--rm")
 
 
 	id := strings.TrimSpace(string(out))
 	id := strings.TrimSpace(string(out))

+ 40 - 44
integration-cli/docker_cli_rmi_test.go

@@ -3,18 +3,17 @@ package main
 import (
 import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/stringid"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestRmiWithContainerFails(c *check.C) {
+func (s *DockerSuite) TestRmiWithContainerFails(c *testing.T) {
 	errSubstr := "is using it"
 	errSubstr := "is using it"
 
 
 	// create a container
 	// create a container
@@ -27,43 +26,42 @@ func (s *DockerSuite) TestRmiWithContainerFails(c *check.C) {
 	// Container is using image, should not be able to rmi
 	// Container is using image, should not be able to rmi
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	// Container is using image, error message should contain errSubstr
 	// Container is using image, error message should contain errSubstr
-	c.Assert(out, checker.Contains, errSubstr, check.Commentf("Container: %q", cleanedContainerID))
-
+	assert.Assert(c, strings.Contains(out, errSubstr), "Container: %q", cleanedContainerID)
 	// make sure it didn't delete the busybox name
 	// make sure it didn't delete the busybox name
 	images, _ := dockerCmd(c, "images")
 	images, _ := dockerCmd(c, "images")
 	// The name 'busybox' should not have been removed from images
 	// The name 'busybox' should not have been removed from images
-	c.Assert(images, checker.Contains, "busybox")
+	assert.Assert(c, strings.Contains(images, "busybox"))
 }
 }
 
 
-func (s *DockerSuite) TestRmiTag(c *check.C) {
+func (s *DockerSuite) TestRmiTag(c *testing.T) {
 	imagesBefore, _ := dockerCmd(c, "images", "-a")
 	imagesBefore, _ := dockerCmd(c, "images", "-a")
 	dockerCmd(c, "tag", "busybox", "utest:tag1")
 	dockerCmd(c, "tag", "busybox", "utest:tag1")
 	dockerCmd(c, "tag", "busybox", "utest/docker:tag2")
 	dockerCmd(c, "tag", "busybox", "utest/docker:tag2")
 	dockerCmd(c, "tag", "busybox", "utest:5000/docker:tag3")
 	dockerCmd(c, "tag", "busybox", "utest:5000/docker:tag3")
 	{
 	{
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
-		c.Assert(strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+3, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
+		assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+3, fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
 	}
 	}
 	dockerCmd(c, "rmi", "utest/docker:tag2")
 	dockerCmd(c, "rmi", "utest/docker:tag2")
 	{
 	{
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
-		c.Assert(strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+2, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
+		assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+2, fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
 	}
 	}
 	dockerCmd(c, "rmi", "utest:5000/docker:tag3")
 	dockerCmd(c, "rmi", "utest:5000/docker:tag3")
 	{
 	{
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
-		c.Assert(strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+1, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
+		assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+1, fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
 
 
 	}
 	}
 	dockerCmd(c, "rmi", "utest:tag1")
 	dockerCmd(c, "rmi", "utest:tag1")
 	{
 	{
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
 		imagesAfter, _ := dockerCmd(c, "images", "-a")
-		c.Assert(strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n"), check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
+		assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n"), fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
 
 
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestRmiImgIDMultipleTag(c *check.C) {
+func (s *DockerSuite) TestRmiImgIDMultipleTag(c *testing.T) {
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir '/busybox-one'").Combined()
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir '/busybox-one'").Combined()
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
 
 
@@ -81,7 +79,7 @@ func (s *DockerSuite) TestRmiImgIDMultipleTag(c *check.C) {
 
 
 	imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
 	imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
 	// tag busybox to create 2 more images with same imageID
 	// tag busybox to create 2 more images with same imageID
-	c.Assert(strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+2, check.Commentf("docker images shows: %q\n", imagesAfter))
+	assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+2, fmt.Sprintf("docker images shows: %q\n", imagesAfter))
 
 
 	imgID := inspectField(c, "busybox-one:tag1", "Id")
 	imgID := inspectField(c, "busybox-one:tag1", "Id")
 
 
@@ -101,10 +99,10 @@ func (s *DockerSuite) TestRmiImgIDMultipleTag(c *check.C) {
 
 
 	imagesAfter = cli.DockerCmd(c, "images", "-a").Combined()
 	imagesAfter = cli.DockerCmd(c, "images", "-a").Combined()
 	// rmi -f failed, image still exists
 	// rmi -f failed, image still exists
-	c.Assert(imagesAfter, checker.Not(checker.Contains), imgID[:12], check.Commentf("ImageID:%q; ImagesAfter: %q", imgID, imagesAfter))
+	assert.Assert(c, !strings.Contains(imagesAfter, imgID[:12]), "ImageID:%q; ImagesAfter: %q", imgID, imagesAfter)
 }
 }
 
 
-func (s *DockerSuite) TestRmiImgIDForce(c *check.C) {
+func (s *DockerSuite) TestRmiImgIDForce(c *testing.T) {
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir '/busybox-test'").Combined()
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "/bin/sh", "-c", "mkdir '/busybox-test'").Combined()
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
 
 
@@ -123,7 +121,7 @@ func (s *DockerSuite) TestRmiImgIDForce(c *check.C) {
 	cli.DockerCmd(c, "tag", "busybox-test", "utest:5000/docker:tag4")
 	cli.DockerCmd(c, "tag", "busybox-test", "utest:5000/docker:tag4")
 	{
 	{
 		imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
 		imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
-		c.Assert(strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+4, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
+		assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+4, fmt.Sprintf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter))
 	}
 	}
 	imgID := inspectField(c, "busybox-test", "Id")
 	imgID := inspectField(c, "busybox-test", "Id")
 
 
@@ -137,12 +135,12 @@ func (s *DockerSuite) TestRmiImgIDForce(c *check.C) {
 	{
 	{
 		imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
 		imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
 		// rmi failed, image still exists
 		// rmi failed, image still exists
-		c.Assert(imagesAfter, checker.Not(checker.Contains), imgID[:12])
+		assert.Assert(c, !strings.Contains(imagesAfter, imgID[:12]))
 	}
 	}
 }
 }
 
 
 // See https://github.com/docker/docker/issues/14116
 // See https://github.com/docker/docker/issues/14116
-func (s *DockerSuite) TestRmiImageIDForceWithRunningContainersAndMultipleTags(c *check.C) {
+func (s *DockerSuite) TestRmiImageIDForceWithRunningContainersAndMultipleTags(c *testing.T) {
 	dockerfile := "FROM busybox\nRUN echo test 14116\n"
 	dockerfile := "FROM busybox\nRUN echo test 14116\n"
 	buildImageSuccessfully(c, "test-14116", build.WithDockerfile(dockerfile))
 	buildImageSuccessfully(c, "test-14116", build.WithDockerfile(dockerfile))
 	imgID := getIDByName(c, "test-14116")
 	imgID := getIDByName(c, "test-14116")
@@ -154,10 +152,10 @@ func (s *DockerSuite) TestRmiImageIDForceWithRunningContainersAndMultipleTags(c
 	out, _, err := dockerCmdWithError("rmi", "-f", imgID)
 	out, _, err := dockerCmdWithError("rmi", "-f", imgID)
 	// rmi -f should not delete image with running containers
 	// rmi -f should not delete image with running containers
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "(cannot be forced) - image is being used by running container")
+	assert.Assert(c, strings.Contains(out, "(cannot be forced) - image is being used by running container"))
 }
 }
 
 
-func (s *DockerSuite) TestRmiTagWithExistingContainers(c *check.C) {
+func (s *DockerSuite) TestRmiTagWithExistingContainers(c *testing.T) {
 	container := "test-delete-tag"
 	container := "test-delete-tag"
 	newtag := "busybox:newtag"
 	newtag := "busybox:newtag"
 	bb := "busybox:latest"
 	bb := "busybox:latest"
@@ -166,10 +164,10 @@ func (s *DockerSuite) TestRmiTagWithExistingContainers(c *check.C) {
 	dockerCmd(c, "run", "--name", container, bb, "/bin/true")
 	dockerCmd(c, "run", "--name", container, bb, "/bin/true")
 
 
 	out, _ := dockerCmd(c, "rmi", newtag)
 	out, _ := dockerCmd(c, "rmi", newtag)
-	c.Assert(strings.Count(out, "Untagged: "), checker.Equals, 1)
+	assert.Equal(c, strings.Count(out, "Untagged: "), 1)
 }
 }
 
 
-func (s *DockerSuite) TestRmiForceWithExistingContainers(c *check.C) {
+func (s *DockerSuite) TestRmiForceWithExistingContainers(c *testing.T) {
 	image := "busybox-clone"
 	image := "busybox-clone"
 
 
 	icmd.RunCmd(icmd.Cmd{
 	icmd.RunCmd(icmd.Cmd{
@@ -183,7 +181,7 @@ MAINTAINER foo`),
 	dockerCmd(c, "rmi", "-f", image)
 	dockerCmd(c, "rmi", "-f", image)
 }
 }
 
 
-func (s *DockerSuite) TestRmiWithMultipleRepositories(c *check.C) {
+func (s *DockerSuite) TestRmiWithMultipleRepositories(c *testing.T) {
 	newRepo := "127.0.0.1:5000/busybox"
 	newRepo := "127.0.0.1:5000/busybox"
 	oldRepo := "busybox"
 	oldRepo := "busybox"
 	newTag := "busybox:test"
 	newTag := "busybox:test"
@@ -194,10 +192,10 @@ func (s *DockerSuite) TestRmiWithMultipleRepositories(c *check.C) {
 	dockerCmd(c, "commit", "test", newTag)
 	dockerCmd(c, "commit", "test", newTag)
 
 
 	out, _ := dockerCmd(c, "rmi", newTag)
 	out, _ := dockerCmd(c, "rmi", newTag)
-	c.Assert(out, checker.Contains, "Untagged: "+newTag)
+	assert.Assert(c, strings.Contains(out, "Untagged: "+newTag))
 }
 }
 
 
-func (s *DockerSuite) TestRmiForceWithMultipleRepositories(c *check.C) {
+func (s *DockerSuite) TestRmiForceWithMultipleRepositories(c *testing.T) {
 	imageName := "rmiimage"
 	imageName := "rmiimage"
 	tag1 := imageName + ":tag1"
 	tag1 := imageName + ":tag1"
 	tag2 := imageName + ":tag2"
 	tag2 := imageName + ":tag2"
@@ -207,25 +205,24 @@ func (s *DockerSuite) TestRmiForceWithMultipleRepositories(c *check.C) {
 	dockerCmd(c, "tag", tag1, tag2)
 	dockerCmd(c, "tag", tag1, tag2)
 
 
 	out, _ := dockerCmd(c, "rmi", "-f", tag2)
 	out, _ := dockerCmd(c, "rmi", "-f", tag2)
-	c.Assert(out, checker.Contains, "Untagged: "+tag2)
-	c.Assert(out, checker.Not(checker.Contains), "Untagged: "+tag1)
-
+	assert.Assert(c, strings.Contains(out, "Untagged: "+tag2))
+	assert.Assert(c, !strings.Contains(out, "Untagged: "+tag1))
 	// Check built image still exists
 	// Check built image still exists
 	images, _ := dockerCmd(c, "images", "-a")
 	images, _ := dockerCmd(c, "images", "-a")
-	c.Assert(images, checker.Contains, imageName, check.Commentf("Built image missing %q; Images: %q", imageName, images))
+	assert.Assert(c, strings.Contains(images, imageName), "Built image missing %q; Images: %q", imageName, images)
 }
 }
 
 
-func (s *DockerSuite) TestRmiBlank(c *check.C) {
+func (s *DockerSuite) TestRmiBlank(c *testing.T) {
 	out, _, err := dockerCmdWithError("rmi", " ")
 	out, _, err := dockerCmdWithError("rmi", " ")
 	// Should have failed to delete ' ' image
 	// Should have failed to delete ' ' image
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	// Wrong error message generated
 	// Wrong error message generated
-	c.Assert(out, checker.Not(checker.Contains), "no such id", check.Commentf("out: %s", out))
+	assert.Assert(c, !strings.Contains(out, "no such id"), "out: %s", out)
 	// Expected error message not generated
 	// Expected error message not generated
-	c.Assert(out, checker.Contains, "image name cannot be blank", check.Commentf("out: %s", out))
+	assert.Assert(c, strings.Contains(out, "image name cannot be blank"), "out: %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestRmiContainerImageNotFound(c *check.C) {
+func (s *DockerSuite) TestRmiContainerImageNotFound(c *testing.T) {
 	// Build 2 images for testing.
 	// Build 2 images for testing.
 	imageNames := []string{"test1", "test2"}
 	imageNames := []string{"test1", "test2"}
 	imageIds := make([]string, 2)
 	imageIds := make([]string, 2)
@@ -247,11 +244,11 @@ func (s *DockerSuite) TestRmiContainerImageNotFound(c *check.C) {
 	out, _, err := dockerCmdWithError("rmi", "-f", imageIds[0])
 	out, _, err := dockerCmdWithError("rmi", "-f", imageIds[0])
 	// The image of the running container should not be removed.
 	// The image of the running container should not be removed.
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "image is being used by running container", check.Commentf("out: %s", out))
+	assert.Assert(c, strings.Contains(out, "image is being used by running container"), "out: %s", out)
 }
 }
 
 
 // #13422
 // #13422
-func (s *DockerSuite) TestRmiUntagHistoryLayer(c *check.C) {
+func (s *DockerSuite) TestRmiUntagHistoryLayer(c *testing.T) {
 	image := "tmp1"
 	image := "tmp1"
 	// Build an image for testing.
 	// Build an image for testing.
 	dockerfile := `FROM busybox
 	dockerfile := `FROM busybox
@@ -274,7 +271,7 @@ RUN echo 2 #layer2
 	// See if the "tmp2" can be untagged.
 	// See if the "tmp2" can be untagged.
 	out, _ = dockerCmd(c, "rmi", newTag)
 	out, _ = dockerCmd(c, "rmi", newTag)
 	// Expected 1 untagged entry
 	// Expected 1 untagged entry
-	c.Assert(strings.Count(out, "Untagged: "), checker.Equals, 1, check.Commentf("out: %s", out))
+	assert.Equal(c, strings.Count(out, "Untagged: "), 1, fmt.Sprintf("out: %s", out))
 
 
 	// Now let's add the tag again and create a container based on it.
 	// Now let's add the tag again and create a container based on it.
 	dockerCmd(c, "tag", idToTag, newTag)
 	dockerCmd(c, "tag", idToTag, newTag)
@@ -286,16 +283,15 @@ RUN echo 2 #layer2
 	out, _, err := dockerCmdWithError("rmi", newTag)
 	out, _, err := dockerCmdWithError("rmi", newTag)
 	// should not be untagged without the -f flag
 	// should not be untagged without the -f flag
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, cid[:12])
-	c.Assert(out, checker.Contains, "(must force)")
-
+	assert.Assert(c, strings.Contains(out, cid[:12]))
+	assert.Assert(c, strings.Contains(out, "(must force)"))
 	// Add the -f flag and test again.
 	// Add the -f flag and test again.
 	out, _ = dockerCmd(c, "rmi", "-f", newTag)
 	out, _ = dockerCmd(c, "rmi", "-f", newTag)
 	// should be allowed to untag with the -f flag
 	// should be allowed to untag with the -f flag
-	c.Assert(out, checker.Contains, fmt.Sprintf("Untagged: %s:latest", newTag))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("Untagged: %s:latest", newTag)))
 }
 }
 
 
-func (*DockerSuite) TestRmiParentImageFail(c *check.C) {
+func (*DockerSuite) TestRmiParentImageFail(c *testing.T) {
 	buildImageSuccessfully(c, "test", build.WithDockerfile(`
 	buildImageSuccessfully(c, "test", build.WithDockerfile(`
 	FROM busybox
 	FROM busybox
 	RUN echo hello`))
 	RUN echo hello`))
@@ -308,7 +304,7 @@ func (*DockerSuite) TestRmiParentImageFail(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestRmiWithParentInUse(c *check.C) {
+func (s *DockerSuite) TestRmiWithParentInUse(c *testing.T) {
 	out, _ := dockerCmd(c, "create", "busybox")
 	out, _ := dockerCmd(c, "create", "busybox")
 	cID := strings.TrimSpace(out)
 	cID := strings.TrimSpace(out)
 
 
@@ -325,7 +321,7 @@ func (s *DockerSuite) TestRmiWithParentInUse(c *check.C) {
 }
 }
 
 
 // #18873
 // #18873
-func (s *DockerSuite) TestRmiByIDHardConflict(c *check.C) {
+func (s *DockerSuite) TestRmiByIDHardConflict(c *testing.T) {
 	dockerCmd(c, "create", "busybox")
 	dockerCmd(c, "create", "busybox")
 
 
 	imgID := inspectField(c, "busybox:latest", "Id")
 	imgID := inspectField(c, "busybox:latest", "Id")
@@ -335,5 +331,5 @@ func (s *DockerSuite) TestRmiByIDHardConflict(c *check.C) {
 
 
 	// check that tag was not removed
 	// check that tag was not removed
 	imgID2 := inspectField(c, "busybox:latest", "Id")
 	imgID2 := inspectField(c, "busybox:latest", "Id")
-	c.Assert(imgID, checker.Equals, imgID2)
+	assert.Equal(c, imgID, imgID2)
 }
 }

File diff suppressed because it is too large
+ 116 - 119
integration-cli/docker_cli_run_test.go


+ 127 - 135
integration-cli/docker_cli_run_unix_test.go

@@ -15,27 +15,26 @@ import (
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"syscall"
 	"syscall"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/creack/pty"
 	"github.com/creack/pty"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/pkg/homedir"
 	"github.com/docker/docker/pkg/homedir"
 	"github.com/docker/docker/pkg/mount"
 	"github.com/docker/docker/pkg/mount"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/parsers"
 	"github.com/docker/docker/pkg/sysinfo"
 	"github.com/docker/docker/pkg/sysinfo"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 // #6509
 // #6509
-func (s *DockerSuite) TestRunRedirectStdout(c *check.C) {
+func (s *DockerSuite) TestRunRedirectStdout(c *testing.T) {
 	checkRedirect := func(command string) {
 	checkRedirect := func(command string) {
 		_, tty, err := pty.Open()
 		_, tty, err := pty.Open()
-		c.Assert(err, checker.IsNil, check.Commentf("Could not open pty"))
+		assert.Assert(c, err == nil, "Could not open pty")
 		cmd := exec.Command("sh", "-c", command)
 		cmd := exec.Command("sh", "-c", command)
 		cmd.Stdin = tty
 		cmd.Stdin = tty
 		cmd.Stdout = tty
 		cmd.Stdout = tty
@@ -51,7 +50,7 @@ func (s *DockerSuite) TestRunRedirectStdout(c *check.C) {
 		case <-time.After(10 * time.Second):
 		case <-time.After(10 * time.Second):
 			c.Fatal("command timeout")
 			c.Fatal("command timeout")
 		case err := <-ch:
 		case err := <-ch:
-			c.Assert(err, checker.IsNil, check.Commentf("wait err"))
+			assert.Assert(c, err == nil, "wait err")
 		}
 		}
 	}
 	}
 
 
@@ -60,7 +59,7 @@ func (s *DockerSuite) TestRunRedirectStdout(c *check.C) {
 }
 }
 
 
 // Test recursive bind mount works by default
 // Test recursive bind mount works by default
-func (s *DockerSuite) TestRunWithVolumesIsRecursive(c *check.C) {
+func (s *DockerSuite) TestRunWithVolumesIsRecursive(c *testing.T) {
 	// /tmp gets permission denied
 	// /tmp gets permission denied
 	testRequires(c, NotUserNamespace, testEnv.IsLocalDaemon)
 	testRequires(c, NotUserNamespace, testEnv.IsLocalDaemon)
 	tmpDir, err := ioutil.TempDir("", "docker_recursive_mount_test")
 	tmpDir, err := ioutil.TempDir("", "docker_recursive_mount_test")
@@ -70,32 +69,31 @@ func (s *DockerSuite) TestRunWithVolumesIsRecursive(c *check.C) {
 
 
 	// Create a temporary tmpfs mount.
 	// Create a temporary tmpfs mount.
 	tmpfsDir := filepath.Join(tmpDir, "tmpfs")
 	tmpfsDir := filepath.Join(tmpDir, "tmpfs")
-	c.Assert(os.MkdirAll(tmpfsDir, 0777), checker.IsNil, check.Commentf("failed to mkdir at %s", tmpfsDir))
-	c.Assert(mount.Mount("tmpfs", tmpfsDir, "tmpfs", ""), checker.IsNil, check.Commentf("failed to create a tmpfs mount at %s", tmpfsDir))
+	assert.Assert(c, os.MkdirAll(tmpfsDir, 0777) == nil, "failed to mkdir at %s", tmpfsDir)
+	assert.Assert(c, mount.Mount("tmpfs", tmpfsDir, "tmpfs", "") == nil, "failed to create a tmpfs mount at %s", tmpfsDir)
 
 
 	f, err := ioutil.TempFile(tmpfsDir, "touch-me")
 	f, err := ioutil.TempFile(tmpfsDir, "touch-me")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer f.Close()
 	defer f.Close()
 
 
 	out, _ := dockerCmd(c, "run", "--name", "test-data", "--volume", fmt.Sprintf("%s:/tmp:ro", tmpDir), "busybox:latest", "ls", "/tmp/tmpfs")
 	out, _ := dockerCmd(c, "run", "--name", "test-data", "--volume", fmt.Sprintf("%s:/tmp:ro", tmpDir), "busybox:latest", "ls", "/tmp/tmpfs")
-	c.Assert(out, checker.Contains, filepath.Base(f.Name()), check.Commentf("Recursive bind mount test failed. Expected file not found"))
+	assert.Assert(c, strings.Contains(out, filepath.Base(f.Name())), "Recursive bind mount test failed. Expected file not found")
 }
 }
 
 
-func (s *DockerSuite) TestRunDeviceDirectory(c *check.C) {
+func (s *DockerSuite) TestRunDeviceDirectory(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace, NotArm)
 	testRequires(c, DaemonIsLinux, NotUserNamespace, NotArm)
 	if _, err := os.Stat("/dev/snd"); err != nil {
 	if _, err := os.Stat("/dev/snd"); err != nil {
 		c.Skip("Host does not have /dev/snd")
 		c.Skip("Host does not have /dev/snd")
 	}
 	}
 
 
 	out, _ := dockerCmd(c, "run", "--device", "/dev/snd:/dev/snd", "busybox", "sh", "-c", "ls /dev/snd/")
 	out, _ := dockerCmd(c, "run", "--device", "/dev/snd:/dev/snd", "busybox", "sh", "-c", "ls /dev/snd/")
-	c.Assert(strings.Trim(out, "\r\n"), checker.Contains, "timer", check.Commentf("expected output /dev/snd/timer"))
-
+	assert.Assert(c, strings.Contains(strings.Trim(out, "\r\n"), "timer"), "expected output /dev/snd/timer")
 	out, _ = dockerCmd(c, "run", "--device", "/dev/snd:/dev/othersnd", "busybox", "sh", "-c", "ls /dev/othersnd/")
 	out, _ = dockerCmd(c, "run", "--device", "/dev/snd:/dev/othersnd", "busybox", "sh", "-c", "ls /dev/othersnd/")
-	c.Assert(strings.Trim(out, "\r\n"), checker.Contains, "seq", check.Commentf("expected output /dev/othersnd/seq"))
+	assert.Assert(c, strings.Contains(strings.Trim(out, "\r\n"), "seq"), "expected output /dev/othersnd/seq")
 }
 }
 
 
 // TestRunAttachDetach checks attaching and detaching with the default escape sequence.
 // TestRunAttachDetach checks attaching and detaching with the default escape sequence.
-func (s *DockerSuite) TestRunAttachDetach(c *check.C) {
+func (s *DockerSuite) TestRunAttachDetach(c *testing.T) {
 	name := "attach-detach"
 	name := "attach-detach"
 
 
 	dockerCmd(c, "run", "--name", name, "-itd", "busybox", "cat")
 	dockerCmd(c, "run", "--name", name, "-itd", "busybox", "cat")
@@ -108,7 +106,7 @@ func (s *DockerSuite) TestRunAttachDetach(c *check.C) {
 	defer cpty.Close()
 	defer cpty.Close()
 	cmd.Stdin = tty
 	cmd.Stdin = tty
 	assert.NilError(c, cmd.Start())
 	assert.NilError(c, cmd.Start())
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	_, err = cpty.Write([]byte("hello\n"))
 	_, err = cpty.Write([]byte("hello\n"))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -137,16 +135,16 @@ func (s *DockerSuite) TestRunAttachDetach(c *check.C) {
 	}
 	}
 
 
 	running := inspectField(c, name, "State.Running")
 	running := inspectField(c, name, "State.Running")
-	c.Assert(running, checker.Equals, "true", check.Commentf("expected container to still be running"))
+	assert.Equal(c, running, "true", "expected container to still be running")
 
 
 	out, _ = dockerCmd(c, "events", "--since=0", "--until", daemonUnixTime(c), "-f", "container="+name)
 	out, _ = dockerCmd(c, "events", "--since=0", "--until", daemonUnixTime(c), "-f", "container="+name)
 	// attach and detach event should be monitored
 	// attach and detach event should be monitored
-	c.Assert(out, checker.Contains, "attach")
-	c.Assert(out, checker.Contains, "detach")
+	assert.Assert(c, strings.Contains(out, "attach"))
+	assert.Assert(c, strings.Contains(out, "detach"))
 }
 }
 
 
 // TestRunAttachDetachFromFlag checks attaching and detaching with the escape sequence specified via flags.
 // TestRunAttachDetachFromFlag checks attaching and detaching with the escape sequence specified via flags.
-func (s *DockerSuite) TestRunAttachDetachFromFlag(c *check.C) {
+func (s *DockerSuite) TestRunAttachDetachFromFlag(c *testing.T) {
 	name := "attach-detach"
 	name := "attach-detach"
 	keyCtrlA := []byte{1}
 	keyCtrlA := []byte{1}
 	keyA := []byte{97}
 	keyA := []byte{97}
@@ -167,7 +165,7 @@ func (s *DockerSuite) TestRunAttachDetachFromFlag(c *check.C) {
 	if err := cmd.Start(); err != nil {
 	if err := cmd.Start(); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	if _, err := cpty.Write([]byte("hello\n")); err != nil {
 	if _, err := cpty.Write([]byte("hello\n")); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
@@ -203,14 +201,14 @@ func (s *DockerSuite) TestRunAttachDetachFromFlag(c *check.C) {
 	}
 	}
 
 
 	running := inspectField(c, name, "State.Running")
 	running := inspectField(c, name, "State.Running")
-	c.Assert(running, checker.Equals, "true", check.Commentf("expected container to still be running"))
+	assert.Equal(c, running, "true", "expected container to still be running")
 }
 }
 
 
 // TestRunAttachDetachFromInvalidFlag checks attaching and detaching with the escape sequence specified via flags.
 // TestRunAttachDetachFromInvalidFlag checks attaching and detaching with the escape sequence specified via flags.
-func (s *DockerSuite) TestRunAttachDetachFromInvalidFlag(c *check.C) {
+func (s *DockerSuite) TestRunAttachDetachFromInvalidFlag(c *testing.T) {
 	name := "attach-detach"
 	name := "attach-detach"
 	dockerCmd(c, "run", "--name", name, "-itd", "busybox", "top")
 	dockerCmd(c, "run", "--name", name, "-itd", "busybox", "top")
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	// specify an invalid detach key, container will ignore it and use default
 	// specify an invalid detach key, container will ignore it and use default
 	cmd := exec.Command(dockerBinary, "attach", "--detach-keys=ctrl-A,a", name)
 	cmd := exec.Command(dockerBinary, "attach", "--detach-keys=ctrl-A,a", name)
@@ -240,7 +238,7 @@ func (s *DockerSuite) TestRunAttachDetachFromInvalidFlag(c *check.C) {
 }
 }
 
 
 // TestRunAttachDetachFromConfig checks attaching and detaching with the escape sequence specified via config file.
 // TestRunAttachDetachFromConfig checks attaching and detaching with the escape sequence specified via config file.
-func (s *DockerSuite) TestRunAttachDetachFromConfig(c *check.C) {
+func (s *DockerSuite) TestRunAttachDetachFromConfig(c *testing.T) {
 	keyCtrlA := []byte{1}
 	keyCtrlA := []byte{1}
 	keyA := []byte{97}
 	keyA := []byte{97}
 
 
@@ -283,7 +281,7 @@ func (s *DockerSuite) TestRunAttachDetachFromConfig(c *check.C) {
 	if err := cmd.Start(); err != nil {
 	if err := cmd.Start(); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	if _, err := cpty.Write([]byte("hello\n")); err != nil {
 	if _, err := cpty.Write([]byte("hello\n")); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
@@ -319,11 +317,11 @@ func (s *DockerSuite) TestRunAttachDetachFromConfig(c *check.C) {
 	}
 	}
 
 
 	running := inspectField(c, name, "State.Running")
 	running := inspectField(c, name, "State.Running")
-	c.Assert(running, checker.Equals, "true", check.Commentf("expected container to still be running"))
+	assert.Equal(c, running, "true", "expected container to still be running")
 }
 }
 
 
 // TestRunAttachDetachKeysOverrideConfig checks attaching and detaching with the detach flags, making sure it overrides config file
 // TestRunAttachDetachKeysOverrideConfig checks attaching and detaching with the detach flags, making sure it overrides config file
-func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *check.C) {
+func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *testing.T) {
 	keyCtrlA := []byte{1}
 	keyCtrlA := []byte{1}
 	keyA := []byte{97}
 	keyA := []byte{97}
 
 
@@ -366,7 +364,7 @@ func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *check.C) {
 	if err := cmd.Start(); err != nil {
 	if err := cmd.Start(); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	if _, err := cpty.Write([]byte("hello\n")); err != nil {
 	if _, err := cpty.Write([]byte("hello\n")); err != nil {
 		c.Fatal(err)
 		c.Fatal(err)
@@ -402,10 +400,10 @@ func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *check.C) {
 	}
 	}
 
 
 	running := inspectField(c, name, "State.Running")
 	running := inspectField(c, name, "State.Running")
-	c.Assert(running, checker.Equals, "true", check.Commentf("expected container to still be running"))
+	assert.Equal(c, running, "true", "expected container to still be running")
 }
 }
 
 
-func (s *DockerSuite) TestRunAttachInvalidDetachKeySequencePreserved(c *check.C) {
+func (s *DockerSuite) TestRunAttachInvalidDetachKeySequencePreserved(c *testing.T) {
 	name := "attach-detach"
 	name := "attach-detach"
 	keyA := []byte{97}
 	keyA := []byte{97}
 	keyB := []byte{98}
 	keyB := []byte{98}
@@ -427,7 +425,7 @@ func (s *DockerSuite) TestRunAttachInvalidDetachKeySequencePreserved(c *check.C)
 		c.Fatal(err)
 		c.Fatal(err)
 	}
 	}
 	go cmd.Wait()
 	go cmd.Wait()
-	c.Assert(waitRun(name), check.IsNil)
+	assert.Assert(c, waitRun(name) == nil)
 
 
 	// Invalid escape sequence aba, should print aba in output
 	// Invalid escape sequence aba, should print aba in output
 	if _, err := cpty.Write(keyA); err != nil {
 	if _, err := cpty.Write(keyA); err != nil {
@@ -456,7 +454,7 @@ func (s *DockerSuite) TestRunAttachInvalidDetachKeySequencePreserved(c *check.C)
 }
 }
 
 
 // "test" should be printed
 // "test" should be printed
-func (s *DockerSuite) TestRunWithCPUQuota(c *check.C) {
+func (s *DockerSuite) TestRunWithCPUQuota(c *testing.T) {
 	testRequires(c, cpuCfsQuota)
 	testRequires(c, cpuCfsQuota)
 
 
 	file := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
 	file := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
@@ -467,7 +465,7 @@ func (s *DockerSuite) TestRunWithCPUQuota(c *check.C) {
 	assert.Equal(c, out, "8000", "setting the CPU CFS quota failed")
 	assert.Equal(c, out, "8000", "setting the CPU CFS quota failed")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithCpuPeriod(c *check.C) {
+func (s *DockerSuite) TestRunWithCpuPeriod(c *testing.T) {
 	testRequires(c, cpuCfsPeriod)
 	testRequires(c, cpuCfsPeriod)
 
 
 	file := "/sys/fs/cgroup/cpu/cpu.cfs_period_us"
 	file := "/sys/fs/cgroup/cpu/cpu.cfs_period_us"
@@ -481,7 +479,7 @@ func (s *DockerSuite) TestRunWithCpuPeriod(c *check.C) {
 	assert.Equal(c, out, "50000", "setting the CPU CFS period failed")
 	assert.Equal(c, out, "50000", "setting the CPU CFS period failed")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidCpuPeriod(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidCpuPeriod(c *testing.T) {
 	testRequires(c, cpuCfsPeriod)
 	testRequires(c, cpuCfsPeriod)
 	out, _, err := dockerCmdWithError("run", "--cpu-period", "900", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--cpu-period", "900", "busybox", "true")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
@@ -497,7 +495,7 @@ func (s *DockerSuite) TestRunWithInvalidCpuPeriod(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) {
+func (s *DockerSuite) TestRunWithKernelMemory(c *testing.T) {
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 
 
 	file := "/sys/fs/cgroup/memory/memory.kmem.limit_in_bytes"
 	file := "/sys/fs/cgroup/memory/memory.kmem.limit_in_bytes"
@@ -510,7 +508,7 @@ func (s *DockerSuite) TestRunWithKernelMemory(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidKernelMemory(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidKernelMemory(c *testing.T) {
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 
 
 	out, _, err := dockerCmdWithError("run", "--kernel-memory", "2M", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--kernel-memory", "2M", "busybox", "true")
@@ -524,7 +522,7 @@ func (s *DockerSuite) TestRunWithInvalidKernelMemory(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunWithCPUShares(c *check.C) {
+func (s *DockerSuite) TestRunWithCPUShares(c *testing.T) {
 	testRequires(c, cpuShare)
 	testRequires(c, cpuShare)
 
 
 	file := "/sys/fs/cgroup/cpu/cpu.shares"
 	file := "/sys/fs/cgroup/cpu/cpu.shares"
@@ -536,7 +534,7 @@ func (s *DockerSuite) TestRunWithCPUShares(c *check.C) {
 }
 }
 
 
 // "test" should be printed
 // "test" should be printed
-func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) {
+func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *testing.T) {
 	testRequires(c, cpuShare)
 	testRequires(c, cpuShare)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	cli.DockerCmd(c, "run", "--cpu-shares", "1000", "-m", "32m", "busybox", "echo", "test").Assert(c, icmd.Expected{
 	cli.DockerCmd(c, "run", "--cpu-shares", "1000", "-m", "32m", "busybox", "echo", "test").Assert(c, icmd.Expected{
@@ -544,7 +542,7 @@ func (s *DockerSuite) TestRunEchoStdoutWithCPUSharesAndMemoryLimit(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestRunWithCpusetCpus(c *check.C) {
+func (s *DockerSuite) TestRunWithCpusetCpus(c *testing.T) {
 	testRequires(c, cgroupCpuset)
 	testRequires(c, cgroupCpuset)
 
 
 	file := "/sys/fs/cgroup/cpuset/cpuset.cpus"
 	file := "/sys/fs/cgroup/cpuset/cpuset.cpus"
@@ -555,7 +553,7 @@ func (s *DockerSuite) TestRunWithCpusetCpus(c *check.C) {
 	assert.Equal(c, out, "0")
 	assert.Equal(c, out, "0")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithCpusetMems(c *check.C) {
+func (s *DockerSuite) TestRunWithCpusetMems(c *testing.T) {
 	testRequires(c, cgroupCpuset)
 	testRequires(c, cgroupCpuset)
 
 
 	file := "/sys/fs/cgroup/cpuset/cpuset.mems"
 	file := "/sys/fs/cgroup/cpuset/cpuset.mems"
@@ -566,7 +564,7 @@ func (s *DockerSuite) TestRunWithCpusetMems(c *check.C) {
 	assert.Equal(c, out, "0")
 	assert.Equal(c, out, "0")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithBlkioWeight(c *check.C) {
+func (s *DockerSuite) TestRunWithBlkioWeight(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 
 
 	file := "/sys/fs/cgroup/blkio/blkio.weight"
 	file := "/sys/fs/cgroup/blkio/blkio.weight"
@@ -577,7 +575,7 @@ func (s *DockerSuite) TestRunWithBlkioWeight(c *check.C) {
 	assert.Equal(c, out, "300")
 	assert.Equal(c, out, "300")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidBlkioWeight(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidBlkioWeight(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 	out, _, err := dockerCmdWithError("run", "--blkio-weight", "5", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--blkio-weight", "5", "busybox", "true")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
@@ -585,37 +583,37 @@ func (s *DockerSuite) TestRunWithInvalidBlkioWeight(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidPathforBlkioWeightDevice(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidPathforBlkioWeightDevice(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 	out, _, err := dockerCmdWithError("run", "--blkio-weight-device", "/dev/sdX:100", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--blkio-weight-device", "/dev/sdX:100", "busybox", "true")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceReadBps(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceReadBps(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 	out, _, err := dockerCmdWithError("run", "--device-read-bps", "/dev/sdX:500", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--device-read-bps", "/dev/sdX:500", "busybox", "true")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteBps(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteBps(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 	out, _, err := dockerCmdWithError("run", "--device-write-bps", "/dev/sdX:500", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--device-write-bps", "/dev/sdX:500", "busybox", "true")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceReadIOps(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceReadIOps(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 	out, _, err := dockerCmdWithError("run", "--device-read-iops", "/dev/sdX:500", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--device-read-iops", "/dev/sdX:500", "busybox", "true")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 }
 }
 
 
-func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteIOps(c *check.C) {
+func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteIOps(c *testing.T) {
 	testRequires(c, blkioWeight)
 	testRequires(c, blkioWeight)
 	out, _, err := dockerCmdWithError("run", "--device-write-iops", "/dev/sdX:500", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--device-write-iops", "/dev/sdX:500", "busybox", "true")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 }
 }
 
 
-func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
+func (s *DockerSuite) TestRunOOMExitCode(c *testing.T) {
 	testRequires(c, memoryLimitSupport, swapMemorySupport, NotPpc64le)
 	testRequires(c, memoryLimitSupport, swapMemorySupport, NotPpc64le)
 	errChan := make(chan error)
 	errChan := make(chan error)
 	go func() {
 	go func() {
@@ -635,7 +633,7 @@ func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestRunWithMemoryLimit(c *check.C) {
+func (s *DockerSuite) TestRunWithMemoryLimit(c *testing.T) {
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 
 
 	file := "/sys/fs/cgroup/memory/memory.limit_in_bytes"
 	file := "/sys/fs/cgroup/memory/memory.limit_in_bytes"
@@ -651,14 +649,14 @@ func (s *DockerSuite) TestRunWithMemoryLimit(c *check.C) {
 // memory limit, this means the processes in the container can use
 // memory limit, this means the processes in the container can use
 // 16M memory and as much swap memory as they need (if the host
 // 16M memory and as much swap memory as they need (if the host
 // supports swap memory).
 // supports swap memory).
-func (s *DockerSuite) TestRunWithoutMemoryswapLimit(c *check.C) {
+func (s *DockerSuite) TestRunWithoutMemoryswapLimit(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, swapMemorySupport)
 	testRequires(c, swapMemorySupport)
 	dockerCmd(c, "run", "-m", "32m", "--memory-swap", "-1", "busybox", "true")
 	dockerCmd(c, "run", "-m", "32m", "--memory-swap", "-1", "busybox", "true")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithSwappiness(c *check.C) {
+func (s *DockerSuite) TestRunWithSwappiness(c *testing.T) {
 	testRequires(c, memorySwappinessSupport)
 	testRequires(c, memorySwappinessSupport)
 	file := "/sys/fs/cgroup/memory/memory.swappiness"
 	file := "/sys/fs/cgroup/memory/memory.swappiness"
 	out, _ := dockerCmd(c, "run", "--memory-swappiness", "0", "--name", "test", "busybox", "cat", file)
 	out, _ := dockerCmd(c, "run", "--memory-swappiness", "0", "--name", "test", "busybox", "cat", file)
@@ -668,19 +666,18 @@ func (s *DockerSuite) TestRunWithSwappiness(c *check.C) {
 	assert.Equal(c, out, "0")
 	assert.Equal(c, out, "0")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithSwappinessInvalid(c *check.C) {
+func (s *DockerSuite) TestRunWithSwappinessInvalid(c *testing.T) {
 	testRequires(c, memorySwappinessSupport)
 	testRequires(c, memorySwappinessSupport)
 	out, _, err := dockerCmdWithError("run", "--memory-swappiness", "101", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "--memory-swappiness", "101", "busybox", "true")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	expected := "Valid memory swappiness range is 0-100"
 	expected := "Valid memory swappiness range is 0-100"
-	c.Assert(out, checker.Contains, expected, check.Commentf("Expected output to contain %q, not %q", out, expected))
-
+	assert.Assert(c, strings.Contains(out, expected), "Expected output to contain %q, not %q", out, expected)
 	out, _, err = dockerCmdWithError("run", "--memory-swappiness", "-10", "busybox", "true")
 	out, _, err = dockerCmdWithError("run", "--memory-swappiness", "-10", "busybox", "true")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, expected, check.Commentf("Expected output to contain %q, not %q", out, expected))
+	assert.Assert(c, strings.Contains(out, expected), "Expected output to contain %q, not %q", out, expected)
 }
 }
 
 
-func (s *DockerSuite) TestRunWithMemoryReservation(c *check.C) {
+func (s *DockerSuite) TestRunWithMemoryReservation(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, memoryReservationSupport)
 	testRequires(c, testEnv.IsLocalDaemon, memoryReservationSupport)
 
 
 	file := "/sys/fs/cgroup/memory/memory.soft_limit_in_bytes"
 	file := "/sys/fs/cgroup/memory/memory.soft_limit_in_bytes"
@@ -691,33 +688,32 @@ func (s *DockerSuite) TestRunWithMemoryReservation(c *check.C) {
 	assert.Equal(c, out, "209715200")
 	assert.Equal(c, out, "209715200")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithMemoryReservationInvalid(c *check.C) {
+func (s *DockerSuite) TestRunWithMemoryReservationInvalid(c *testing.T) {
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, testEnv.IsLocalDaemon, memoryReservationSupport)
 	testRequires(c, testEnv.IsLocalDaemon, memoryReservationSupport)
 	out, _, err := dockerCmdWithError("run", "-m", "500M", "--memory-reservation", "800M", "busybox", "true")
 	out, _, err := dockerCmdWithError("run", "-m", "500M", "--memory-reservation", "800M", "busybox", "true")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	expected := "Minimum memory limit can not be less than memory reservation limit"
 	expected := "Minimum memory limit can not be less than memory reservation limit"
-	c.Assert(strings.TrimSpace(out), checker.Contains, expected, check.Commentf("run container should fail with invalid memory reservation"))
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), expected), "run container should fail with invalid memory reservation")
 	out, _, err = dockerCmdWithError("run", "--memory-reservation", "1k", "busybox", "true")
 	out, _, err = dockerCmdWithError("run", "--memory-reservation", "1k", "busybox", "true")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	expected = "Minimum memory reservation allowed is 4MB"
 	expected = "Minimum memory reservation allowed is 4MB"
-	c.Assert(strings.TrimSpace(out), checker.Contains, expected, check.Commentf("run container should fail with invalid memory reservation"))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), expected), "run container should fail with invalid memory reservation")
 }
 }
 
 
-func (s *DockerSuite) TestStopContainerSignal(c *check.C) {
+func (s *DockerSuite) TestStopContainerSignal(c *testing.T) {
 	out, _ := dockerCmd(c, "run", "--stop-signal", "SIGUSR1", "-d", "busybox", "/bin/sh", "-c", `trap 'echo "exit trapped"; exit 0' USR1; while true; do sleep 1; done`)
 	out, _ := dockerCmd(c, "run", "--stop-signal", "SIGUSR1", "-d", "busybox", "/bin/sh", "-c", `trap 'echo "exit trapped"; exit 0' USR1; while true; do sleep 1; done`)
 	containerID := strings.TrimSpace(out)
 	containerID := strings.TrimSpace(out)
 
 
-	c.Assert(waitRun(containerID), checker.IsNil)
+	assert.Assert(c, waitRun(containerID) == nil)
 
 
 	dockerCmd(c, "stop", containerID)
 	dockerCmd(c, "stop", containerID)
 	out, _ = dockerCmd(c, "logs", containerID)
 	out, _ = dockerCmd(c, "logs", containerID)
 
 
-	c.Assert(out, checker.Contains, "exit trapped", check.Commentf("Expected `exit trapped` in the log"))
+	assert.Assert(c, strings.Contains(out, "exit trapped"), "Expected `exit trapped` in the log")
 }
 }
 
 
-func (s *DockerSuite) TestRunSwapLessThanMemoryLimit(c *check.C) {
+func (s *DockerSuite) TestRunSwapLessThanMemoryLimit(c *testing.T) {
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, swapMemorySupport)
 	testRequires(c, swapMemorySupport)
 	out, _, err := dockerCmdWithError("run", "-m", "16m", "--memory-swap", "15m", "busybox", "echo", "test")
 	out, _, err := dockerCmdWithError("run", "-m", "16m", "--memory-swap", "15m", "busybox", "echo", "test")
@@ -727,7 +723,7 @@ func (s *DockerSuite) TestRunSwapLessThanMemoryLimit(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunInvalidCpusetCpusFlagValue(c *check.C) {
+func (s *DockerSuite) TestRunInvalidCpusetCpusFlagValue(c *testing.T) {
 	testRequires(c, cgroupCpuset, testEnv.IsLocalDaemon)
 	testRequires(c, cgroupCpuset, testEnv.IsLocalDaemon)
 
 
 	sysInfo := sysinfo.New(true)
 	sysInfo := sysinfo.New(true)
@@ -746,7 +742,7 @@ func (s *DockerSuite) TestRunInvalidCpusetCpusFlagValue(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunInvalidCpusetMemsFlagValue(c *check.C) {
+func (s *DockerSuite) TestRunInvalidCpusetMemsFlagValue(c *testing.T) {
 	testRequires(c, cgroupCpuset)
 	testRequires(c, cgroupCpuset)
 
 
 	sysInfo := sysinfo.New(true)
 	sysInfo := sysinfo.New(true)
@@ -765,7 +761,7 @@ func (s *DockerSuite) TestRunInvalidCpusetMemsFlagValue(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunInvalidCPUShares(c *check.C) {
+func (s *DockerSuite) TestRunInvalidCPUShares(c *testing.T) {
 	testRequires(c, cpuShare, DaemonIsLinux)
 	testRequires(c, cpuShare, DaemonIsLinux)
 	out, _, err := dockerCmdWithError("run", "--cpu-shares", "1", "busybox", "echo", "test")
 	out, _, err := dockerCmdWithError("run", "--cpu-shares", "1", "busybox", "echo", "test")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
@@ -783,7 +779,7 @@ func (s *DockerSuite) TestRunInvalidCPUShares(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestRunWithDefaultShmSize(c *check.C) {
+func (s *DockerSuite) TestRunWithDefaultShmSize(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	name := "shm-default"
 	name := "shm-default"
@@ -793,10 +789,10 @@ func (s *DockerSuite) TestRunWithDefaultShmSize(c *check.C) {
 		c.Fatalf("Expected shm of 64MB in mount command, got %v", out)
 		c.Fatalf("Expected shm of 64MB in mount command, got %v", out)
 	}
 	}
 	shmSize := inspectField(c, name, "HostConfig.ShmSize")
 	shmSize := inspectField(c, name, "HostConfig.ShmSize")
-	c.Assert(shmSize, check.Equals, "67108864")
+	assert.Equal(c, shmSize, "67108864")
 }
 }
 
 
-func (s *DockerSuite) TestRunWithShmSize(c *check.C) {
+func (s *DockerSuite) TestRunWithShmSize(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	name := "shm"
 	name := "shm"
@@ -806,18 +802,18 @@ func (s *DockerSuite) TestRunWithShmSize(c *check.C) {
 		c.Fatalf("Expected shm of 1GB in mount command, got %v", out)
 		c.Fatalf("Expected shm of 1GB in mount command, got %v", out)
 	}
 	}
 	shmSize := inspectField(c, name, "HostConfig.ShmSize")
 	shmSize := inspectField(c, name, "HostConfig.ShmSize")
-	c.Assert(shmSize, check.Equals, "1073741824")
+	assert.Equal(c, shmSize, "1073741824")
 }
 }
 
 
-func (s *DockerSuite) TestRunTmpfsMountsEnsureOrdered(c *check.C) {
+func (s *DockerSuite) TestRunTmpfsMountsEnsureOrdered(c *testing.T) {
 	tmpFile, err := ioutil.TempFile("", "test")
 	tmpFile, err := ioutil.TempFile("", "test")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	defer tmpFile.Close()
 	defer tmpFile.Close()
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/run", "-v", tmpFile.Name()+":/run/test", "busybox", "ls", "/run")
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/run", "-v", tmpFile.Name()+":/run/test", "busybox", "ls", "/run")
-	c.Assert(out, checker.Contains, "test")
+	assert.Assert(c, strings.Contains(out, "test"))
 }
 }
 
 
-func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) {
+func (s *DockerSuite) TestRunTmpfsMounts(c *testing.T) {
 	// TODO Windows (Post TP5): This test cannot run on a Windows daemon as
 	// TODO Windows (Post TP5): This test cannot run on a Windows daemon as
 	// Windows does not support tmpfs mounts.
 	// Windows does not support tmpfs mounts.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -838,7 +834,7 @@ func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestRunTmpfsMountsOverrideImageVolumes(c *check.C) {
+func (s *DockerSuite) TestRunTmpfsMountsOverrideImageVolumes(c *testing.T) {
 	name := "img-with-volumes"
 	name := "img-with-volumes"
 	buildImageSuccessfully(c, name, build.WithDockerfile(`
 	buildImageSuccessfully(c, name, build.WithDockerfile(`
     FROM busybox
     FROM busybox
@@ -846,37 +842,35 @@ func (s *DockerSuite) TestRunTmpfsMountsOverrideImageVolumes(c *check.C) {
     RUN touch /run/stuff
     RUN touch /run/stuff
     `))
     `))
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/run", name, "ls", "/run")
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/run", name, "ls", "/run")
-	c.Assert(out, checker.Not(checker.Contains), "stuff")
+	assert.Assert(c, !strings.Contains(out, "stuff"))
 }
 }
 
 
 // Test case for #22420
 // Test case for #22420
-func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *check.C) {
+func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	expectedOptions := []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
 	expectedOptions := []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/tmp", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/tmp", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	for _, option := range expectedOptions {
 	for _, option := range expectedOptions {
-		c.Assert(out, checker.Contains, option)
+		assert.Assert(c, strings.Contains(out, option))
 	}
 	}
-	c.Assert(out, checker.Not(checker.Contains), "size=")
-
+	assert.Assert(c, !strings.Contains(out, "size="))
 	expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
 	expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	for _, option := range expectedOptions {
 	for _, option := range expectedOptions {
-		c.Assert(out, checker.Contains, option)
+		assert.Assert(c, strings.Contains(out, option))
 	}
 	}
-	c.Assert(out, checker.Not(checker.Contains), "size=")
-
+	assert.Assert(c, !strings.Contains(out, "size="))
 	expectedOptions = []string{"rw", "nosuid", "nodev", "relatime", "size=8192k"}
 	expectedOptions = []string{"rw", "nosuid", "nodev", "relatime", "size=8192k"}
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,exec,size=8192k", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,exec,size=8192k", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	for _, option := range expectedOptions {
 	for _, option := range expectedOptions {
-		c.Assert(out, checker.Contains, option)
+		assert.Assert(c, strings.Contains(out, option))
 	}
 	}
 
 
 	expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime", "size=4096k"}
 	expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime", "size=4096k"}
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,size=8192k,exec,size=4096k,noexec", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,size=8192k,exec,size=4096k,noexec", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
 	for _, option := range expectedOptions {
 	for _, option := range expectedOptions {
-		c.Assert(out, checker.Contains, option)
+		assert.Assert(c, strings.Contains(out, option))
 	}
 	}
 
 
 	// We use debian:jessie as there is no findmnt in busybox. Also the output will be in the format of
 	// We use debian:jessie as there is no findmnt in busybox. Also the output will be in the format of
@@ -886,32 +880,32 @@ func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *check.C) {
 	expectedOptions = []string{"shared"}
 	expectedOptions = []string{"shared"}
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:shared", "debian:jessie", "findmnt", "-o", "TARGET,PROPAGATION", "/tmp")
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:shared", "debian:jessie", "findmnt", "-o", "TARGET,PROPAGATION", "/tmp")
 	for _, option := range expectedOptions {
 	for _, option := range expectedOptions {
-		c.Assert(out, checker.Contains, option)
+		assert.Assert(c, strings.Contains(out, option))
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestRunSysctls(c *check.C) {
+func (s *DockerSuite) TestRunSysctls(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	var err error
 	var err error
 
 
 	out, _ := dockerCmd(c, "run", "--sysctl", "net.ipv4.ip_forward=1", "--name", "test", "busybox", "cat", "/proc/sys/net/ipv4/ip_forward")
 	out, _ := dockerCmd(c, "run", "--sysctl", "net.ipv4.ip_forward=1", "--name", "test", "busybox", "cat", "/proc/sys/net/ipv4/ip_forward")
-	c.Assert(strings.TrimSpace(out), check.Equals, "1")
+	assert.Equal(c, strings.TrimSpace(out), "1")
 
 
 	out = inspectFieldJSON(c, "test", "HostConfig.Sysctls")
 	out = inspectFieldJSON(c, "test", "HostConfig.Sysctls")
 
 
 	sysctls := make(map[string]string)
 	sysctls := make(map[string]string)
 	err = json.Unmarshal([]byte(out), &sysctls)
 	err = json.Unmarshal([]byte(out), &sysctls)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(sysctls["net.ipv4.ip_forward"], check.Equals, "1")
+	assert.Equal(c, sysctls["net.ipv4.ip_forward"], "1")
 
 
 	out, _ = dockerCmd(c, "run", "--sysctl", "net.ipv4.ip_forward=0", "--name", "test1", "busybox", "cat", "/proc/sys/net/ipv4/ip_forward")
 	out, _ = dockerCmd(c, "run", "--sysctl", "net.ipv4.ip_forward=0", "--name", "test1", "busybox", "cat", "/proc/sys/net/ipv4/ip_forward")
-	c.Assert(strings.TrimSpace(out), check.Equals, "0")
+	assert.Equal(c, strings.TrimSpace(out), "0")
 
 
 	out = inspectFieldJSON(c, "test1", "HostConfig.Sysctls")
 	out = inspectFieldJSON(c, "test1", "HostConfig.Sysctls")
 
 
 	err = json.Unmarshal([]byte(out), &sysctls)
 	err = json.Unmarshal([]byte(out), &sysctls)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(sysctls["net.ipv4.ip_forward"], check.Equals, "0")
+	assert.Equal(c, sysctls["net.ipv4.ip_forward"], "0")
 
 
 	icmd.RunCommand(dockerBinary, "run", "--sysctl", "kernel.foobar=1", "--name", "test2",
 	icmd.RunCommand(dockerBinary, "run", "--sysctl", "kernel.foobar=1", "--name", "test2",
 		"busybox", "cat", "/proc/sys/kernel/foobar").Assert(c, icmd.Expected{
 		"busybox", "cat", "/proc/sys/kernel/foobar").Assert(c, icmd.Expected{
@@ -921,7 +915,7 @@ func (s *DockerSuite) TestRunSysctls(c *check.C) {
 }
 }
 
 
 // TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:jessie unshare' exits with operation not permitted.
 // TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:jessie unshare' exits with operation not permitted.
-func (s *DockerSuite) TestRunSeccompProfileDenyUnshare(c *check.C) {
+func (s *DockerSuite) TestRunSeccompProfileDenyUnshare(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor)
 	jsonData := `{
 	jsonData := `{
 	"defaultAction": "SCMP_ACT_ALLOW",
 	"defaultAction": "SCMP_ACT_ALLOW",
@@ -950,7 +944,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyUnshare(c *check.C) {
 }
 }
 
 
 // TestRunSeccompProfileDenyChmod checks that 'docker run --security-opt seccomp=/tmp/profile.json busybox chmod 400 /etc/hostname' exits with operation not permitted.
 // TestRunSeccompProfileDenyChmod checks that 'docker run --security-opt seccomp=/tmp/profile.json busybox chmod 400 /etc/hostname' exits with operation not permitted.
-func (s *DockerSuite) TestRunSeccompProfileDenyChmod(c *check.C) {
+func (s *DockerSuite) TestRunSeccompProfileDenyChmod(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 	jsonData := `{
 	jsonData := `{
 	"defaultAction": "SCMP_ACT_ALLOW",
 	"defaultAction": "SCMP_ACT_ALLOW",
@@ -985,7 +979,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyChmod(c *check.C) {
 
 
 // TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:jessie unshare --map-root-user --user sh -c whoami' with a specific profile to
 // TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:jessie unshare --map-root-user --user sh -c whoami' with a specific profile to
 // deny unshare of a userns exits with operation not permitted.
 // deny unshare of a userns exits with operation not permitted.
-func (s *DockerSuite) TestRunSeccompProfileDenyUnshareUserns(c *check.C) {
+func (s *DockerSuite) TestRunSeccompProfileDenyUnshareUserns(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor)
 	// from sched.h
 	// from sched.h
 	jsonData := fmt.Sprintf(`{
 	jsonData := fmt.Sprintf(`{
@@ -1023,7 +1017,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyUnshareUserns(c *check.C) {
 
 
 // TestRunSeccompProfileDenyCloneUserns checks that 'docker run syscall-test'
 // TestRunSeccompProfileDenyCloneUserns checks that 'docker run syscall-test'
 // with a the default seccomp profile exits with operation not permitted.
 // with a the default seccomp profile exits with operation not permitted.
-func (s *DockerSuite) TestRunSeccompProfileDenyCloneUserns(c *check.C) {
+func (s *DockerSuite) TestRunSeccompProfileDenyCloneUserns(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1035,7 +1029,7 @@ func (s *DockerSuite) TestRunSeccompProfileDenyCloneUserns(c *check.C) {
 
 
 // TestRunSeccompUnconfinedCloneUserns checks that
 // TestRunSeccompUnconfinedCloneUserns checks that
 // 'docker run --security-opt seccomp=unconfined syscall-test' allows creating a userns.
 // 'docker run --security-opt seccomp=unconfined syscall-test' allows creating a userns.
-func (s *DockerSuite) TestRunSeccompUnconfinedCloneUserns(c *check.C) {
+func (s *DockerSuite) TestRunSeccompUnconfinedCloneUserns(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace, unprivilegedUsernsClone)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace, unprivilegedUsernsClone)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1048,7 +1042,7 @@ func (s *DockerSuite) TestRunSeccompUnconfinedCloneUserns(c *check.C) {
 
 
 // TestRunSeccompAllowPrivCloneUserns checks that 'docker run --privileged syscall-test'
 // TestRunSeccompAllowPrivCloneUserns checks that 'docker run --privileged syscall-test'
 // allows creating a userns.
 // allows creating a userns.
-func (s *DockerSuite) TestRunSeccompAllowPrivCloneUserns(c *check.C) {
+func (s *DockerSuite) TestRunSeccompAllowPrivCloneUserns(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, UserNamespaceInKernel, NotUserNamespace)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1060,7 +1054,7 @@ func (s *DockerSuite) TestRunSeccompAllowPrivCloneUserns(c *check.C) {
 
 
 // TestRunSeccompProfileAllow32Bit checks that 32 bit code can run on x86_64
 // TestRunSeccompProfileAllow32Bit checks that 32 bit code can run on x86_64
 // with the default seccomp profile.
 // with the default seccomp profile.
-func (s *DockerSuite) TestRunSeccompProfileAllow32Bit(c *check.C) {
+func (s *DockerSuite) TestRunSeccompProfileAllow32Bit(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, IsAmd64)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, IsAmd64)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1068,14 +1062,14 @@ func (s *DockerSuite) TestRunSeccompProfileAllow32Bit(c *check.C) {
 }
 }
 
 
 // TestRunSeccompAllowSetrlimit checks that 'docker run debian:jessie ulimit -v 1048510' succeeds.
 // TestRunSeccompAllowSetrlimit checks that 'docker run debian:jessie ulimit -v 1048510' succeeds.
-func (s *DockerSuite) TestRunSeccompAllowSetrlimit(c *check.C) {
+func (s *DockerSuite) TestRunSeccompAllowSetrlimit(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 
 
 	// ulimit uses setrlimit, so we want to make sure we don't break it
 	// ulimit uses setrlimit, so we want to make sure we don't break it
 	icmd.RunCommand(dockerBinary, "run", "debian:jessie", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success)
 	icmd.RunCommand(dockerBinary, "run", "debian:jessie", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success)
 }
 }
 
 
-func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
+func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotUserNamespace)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotUserNamespace)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1105,7 +1099,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileAcct(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
+func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotUserNamespace)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotUserNamespace)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1142,7 +1136,7 @@ func (s *DockerSuite) TestRunSeccompDefaultProfileNS(c *check.C) {
 
 
 // TestRunNoNewPrivSetuid checks that --security-opt='no-new-privileges=true' prevents
 // TestRunNoNewPrivSetuid checks that --security-opt='no-new-privileges=true' prevents
 // effective uid transitions on executing setuid binaries.
 // effective uid transitions on executing setuid binaries.
-func (s *DockerSuite) TestRunNoNewPrivSetuid(c *check.C) {
+func (s *DockerSuite) TestRunNoNewPrivSetuid(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
 	ensureNNPTest(c)
 	ensureNNPTest(c)
 
 
@@ -1155,7 +1149,7 @@ func (s *DockerSuite) TestRunNoNewPrivSetuid(c *check.C) {
 
 
 // TestLegacyRunNoNewPrivSetuid checks that --security-opt=no-new-privileges prevents
 // TestLegacyRunNoNewPrivSetuid checks that --security-opt=no-new-privileges prevents
 // effective uid transitions on executing setuid binaries.
 // effective uid transitions on executing setuid binaries.
-func (s *DockerSuite) TestLegacyRunNoNewPrivSetuid(c *check.C) {
+func (s *DockerSuite) TestLegacyRunNoNewPrivSetuid(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
 	ensureNNPTest(c)
 	ensureNNPTest(c)
 
 
@@ -1166,7 +1160,7 @@ func (s *DockerSuite) TestLegacyRunNoNewPrivSetuid(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChown(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChown(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1184,7 +1178,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChown(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesDacOverride(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesDacOverride(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1197,7 +1191,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesDacOverride(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesFowner(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesFowner(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1213,7 +1207,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesFowner(c *check.C) {
 
 
 // TODO CAP_KILL
 // TODO CAP_KILL
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetuid(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetuid(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1231,7 +1225,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetuid(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetgid(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetgid(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1251,7 +1245,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesSetgid(c *check.C) {
 
 
 // TODO CAP_SETPCAP
 // TODO CAP_SETPCAP
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetBindService(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetBindService(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1269,7 +1263,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetBindService(c *check.C)
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetRaw(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetRaw(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1287,7 +1281,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesNetRaw(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChroot(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChroot(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1305,7 +1299,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesChroot(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestUserNoEffectiveCapabilitiesMknod(c *check.C) {
+func (s *DockerSuite) TestUserNoEffectiveCapabilitiesMknod(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, NotUserNamespace, testEnv.IsLocalDaemon)
 	ensureSyscallTest(c)
 	ensureSyscallTest(c)
 
 
@@ -1327,7 +1321,7 @@ func (s *DockerSuite) TestUserNoEffectiveCapabilitiesMknod(c *check.C) {
 // TODO CAP_AUDIT_WRITE
 // TODO CAP_AUDIT_WRITE
 // TODO CAP_SETFCAP
 // TODO CAP_SETFCAP
 
 
-func (s *DockerSuite) TestRunApparmorProcDirectory(c *check.C) {
+func (s *DockerSuite) TestRunApparmorProcDirectory(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, Apparmor)
 	testRequires(c, testEnv.IsLocalDaemon, Apparmor)
 
 
 	// running w seccomp unconfined tests the apparmor profile
 	// running w seccomp unconfined tests the apparmor profile
@@ -1346,7 +1340,7 @@ func (s *DockerSuite) TestRunApparmorProcDirectory(c *check.C) {
 
 
 // make sure the default profile can be successfully parsed (using unshare as it is
 // make sure the default profile can be successfully parsed (using unshare as it is
 // something which we know is blocked in the default profile)
 // something which we know is blocked in the default profile)
-func (s *DockerSuite) TestRunSeccompWithDefaultProfile(c *check.C) {
+func (s *DockerSuite) TestRunSeccompWithDefaultProfile(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 	testRequires(c, testEnv.IsLocalDaemon, seccompEnabled)
 
 
 	out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:jessie", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami")
 	out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:jessie", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami")
@@ -1355,7 +1349,7 @@ func (s *DockerSuite) TestRunSeccompWithDefaultProfile(c *check.C) {
 }
 }
 
 
 // TestRunDeviceSymlink checks run with device that follows symlink (#13840 and #22271)
 // TestRunDeviceSymlink checks run with device that follows symlink (#13840 and #22271)
-func (s *DockerSuite) TestRunDeviceSymlink(c *check.C) {
+func (s *DockerSuite) TestRunDeviceSymlink(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace, NotArm, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, NotUserNamespace, NotArm, testEnv.IsLocalDaemon)
 	if _, err := os.Stat("/dev/zero"); err != nil {
 	if _, err := os.Stat("/dev/zero"); err != nil {
 		c.Skip("Host does not have /dev/zero")
 		c.Skip("Host does not have /dev/zero")
@@ -1391,20 +1385,18 @@ func (s *DockerSuite) TestRunDeviceSymlink(c *check.C) {
 
 
 	// md5sum of 'dd if=/dev/zero bs=4K count=8' is bb7df04e1b0a2570657527a7e108ae23
 	// md5sum of 'dd if=/dev/zero bs=4K count=8' is bb7df04e1b0a2570657527a7e108ae23
 	out, _ := dockerCmd(c, "run", "--device", symZero+":/dev/symzero", "busybox", "sh", "-c", "dd if=/dev/symzero bs=4K count=8 | md5sum")
 	out, _ := dockerCmd(c, "run", "--device", symZero+":/dev/symzero", "busybox", "sh", "-c", "dd if=/dev/symzero bs=4K count=8 | md5sum")
-	c.Assert(strings.Trim(out, "\r\n"), checker.Contains, "bb7df04e1b0a2570657527a7e108ae23", check.Commentf("expected output bb7df04e1b0a2570657527a7e108ae23"))
-
+	assert.Assert(c, strings.Contains(strings.Trim(out, "\r\n"), "bb7df04e1b0a2570657527a7e108ae23"), "expected output bb7df04e1b0a2570657527a7e108ae23")
 	// symlink "tmpDir/file" to a file "tmpDir/temp" will result in an error as it is not a device.
 	// symlink "tmpDir/file" to a file "tmpDir/temp" will result in an error as it is not a device.
 	out, _, err = dockerCmdWithError("run", "--device", symFile+":/dev/symzero", "busybox", "sh", "-c", "dd if=/dev/symzero bs=4K count=8 | md5sum")
 	out, _, err = dockerCmdWithError("run", "--device", symFile+":/dev/symzero", "busybox", "sh", "-c", "dd if=/dev/symzero bs=4K count=8 | md5sum")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(strings.Trim(out, "\r\n"), checker.Contains, "not a device node", check.Commentf("expected output 'not a device node'"))
-
+	assert.Assert(c, strings.Contains(strings.Trim(out, "\r\n"), "not a device node"), "expected output 'not a device node'")
 	// md5sum of 'dd if=/dev/zero bs=4K count=8' is bb7df04e1b0a2570657527a7e108ae23 (this time check with relative path backed, see #22271)
 	// md5sum of 'dd if=/dev/zero bs=4K count=8' is bb7df04e1b0a2570657527a7e108ae23 (this time check with relative path backed, see #22271)
 	out, _ = dockerCmd(c, "run", "--device", "/dev/symzero:/dev/symzero", "busybox", "sh", "-c", "dd if=/dev/symzero bs=4K count=8 | md5sum")
 	out, _ = dockerCmd(c, "run", "--device", "/dev/symzero:/dev/symzero", "busybox", "sh", "-c", "dd if=/dev/symzero bs=4K count=8 | md5sum")
-	c.Assert(strings.Trim(out, "\r\n"), checker.Contains, "bb7df04e1b0a2570657527a7e108ae23", check.Commentf("expected output bb7df04e1b0a2570657527a7e108ae23"))
+	assert.Assert(c, strings.Contains(strings.Trim(out, "\r\n"), "bb7df04e1b0a2570657527a7e108ae23"), "expected output bb7df04e1b0a2570657527a7e108ae23")
 }
 }
 
 
 // TestRunPIDsLimit makes sure the pids cgroup is set with --pids-limit
 // TestRunPIDsLimit makes sure the pids cgroup is set with --pids-limit
-func (s *DockerSuite) TestRunPIDsLimit(c *check.C) {
+func (s *DockerSuite) TestRunPIDsLimit(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, pidsLimit)
 	testRequires(c, testEnv.IsLocalDaemon, pidsLimit)
 
 
 	file := "/sys/fs/cgroup/pids/pids.max"
 	file := "/sys/fs/cgroup/pids/pids.max"
@@ -1415,7 +1407,7 @@ func (s *DockerSuite) TestRunPIDsLimit(c *check.C) {
 	assert.Equal(c, out, "4", "setting the pids limit failed")
 	assert.Equal(c, out, "4", "setting the pids limit failed")
 }
 }
 
 
-func (s *DockerSuite) TestRunPrivilegedAllowedDevices(c *check.C) {
+func (s *DockerSuite) TestRunPrivilegedAllowedDevices(c *testing.T) {
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 
 
 	file := "/sys/fs/cgroup/devices/devices.list"
 	file := "/sys/fs/cgroup/devices/devices.list"
@@ -1424,7 +1416,7 @@ func (s *DockerSuite) TestRunPrivilegedAllowedDevices(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "a *:* rwm")
 	assert.Equal(c, strings.TrimSpace(out), "a *:* rwm")
 }
 }
 
 
-func (s *DockerSuite) TestRunUserDeviceAllowed(c *check.C) {
+func (s *DockerSuite) TestRunUserDeviceAllowed(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	fi, err := os.Stat("/dev/snd/timer")
 	fi, err := os.Stat("/dev/snd/timer")
@@ -1438,10 +1430,10 @@ func (s *DockerSuite) TestRunUserDeviceAllowed(c *check.C) {
 
 
 	file := "/sys/fs/cgroup/devices/devices.list"
 	file := "/sys/fs/cgroup/devices/devices.list"
 	out, _ := dockerCmd(c, "run", "--device", "/dev/snd/timer:w", "busybox", "cat", file)
 	out, _ := dockerCmd(c, "run", "--device", "/dev/snd/timer:w", "busybox", "cat", file)
-	c.Assert(out, checker.Contains, fmt.Sprintf("c %d:%d w", stat.Rdev/256, stat.Rdev%256))
+	assert.Assert(c, strings.Contains(out, fmt.Sprintf("c %d:%d w", stat.Rdev/256, stat.Rdev%256)))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) {
+func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *testing.T) {
 	testRequires(c, seccompEnabled)
 	testRequires(c, seccompEnabled)
 
 
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
@@ -1463,10 +1455,10 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNewFormat(c *check.C) {
 
 
 	out, err := s.d.Cmd("run", "--security-opt", "seccomp="+tmpFile.Name(), "busybox", "chmod", "777", ".")
 	out, err := s.d.Cmd("run", "--security-opt", "seccomp="+tmpFile.Name(), "busybox", "chmod", "777", ".")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Operation not permitted")
+	assert.Assert(c, strings.Contains(out, "Operation not permitted"))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) {
+func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *testing.T) {
 	testRequires(c, seccompEnabled)
 	testRequires(c, seccompEnabled)
 
 
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
@@ -1489,10 +1481,10 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoNameAndNames(c *check.C) {
 
 
 	out, err := s.d.Cmd("run", "--security-opt", "seccomp="+tmpFile.Name(), "busybox", "chmod", "777", ".")
 	out, err := s.d.Cmd("run", "--security-opt", "seccomp="+tmpFile.Name(), "busybox", "chmod", "777", ".")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "'name' and 'names' were specified in the seccomp profile, use either 'name' or 'names'")
+	assert.Assert(c, strings.Contains(out, "'name' and 'names' were specified in the seccomp profile, use either 'name' or 'names'"))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) {
+func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *testing.T) {
 	testRequires(c, seccompEnabled)
 	testRequires(c, seccompEnabled)
 
 
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
@@ -1526,10 +1518,10 @@ func (s *DockerDaemonSuite) TestRunSeccompJSONNoArchAndArchMap(c *check.C) {
 
 
 	out, err := s.d.Cmd("run", "--security-opt", "seccomp="+tmpFile.Name(), "busybox", "chmod", "777", ".")
 	out, err := s.d.Cmd("run", "--security-opt", "seccomp="+tmpFile.Name(), "busybox", "chmod", "777", ".")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "'architectures' and 'archMap' were specified in the seccomp profile, use either 'architectures' or 'archMap'")
+	assert.Assert(c, strings.Contains(out, "'architectures' and 'archMap' were specified in the seccomp profile, use either 'architectures' or 'archMap'"))
 }
 }
 
 
-func (s *DockerDaemonSuite) TestRunWithDaemonDefaultSeccompProfile(c *check.C) {
+func (s *DockerDaemonSuite) TestRunWithDaemonDefaultSeccompProfile(c *testing.T) {
 	testRequires(c, seccompEnabled)
 	testRequires(c, seccompEnabled)
 
 
 	s.d.StartWithBusybox(c)
 	s.d.StartWithBusybox(c)
@@ -1562,10 +1554,10 @@ func (s *DockerDaemonSuite) TestRunWithDaemonDefaultSeccompProfile(c *check.C) {
 
 
 	out, err := s.d.Cmd("run", "busybox", "chmod", "777", ".")
 	out, err := s.d.Cmd("run", "busybox", "chmod", "777", ".")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Operation not permitted")
+	assert.Assert(c, strings.Contains(out, "Operation not permitted"))
 }
 }
 
 
-func (s *DockerSuite) TestRunWithNanoCPUs(c *check.C) {
+func (s *DockerSuite) TestRunWithNanoCPUs(c *testing.T) {
 	testRequires(c, cpuCfsQuota, cpuCfsPeriod)
 	testRequires(c, cpuCfsQuota, cpuCfsPeriod)
 
 
 	file1 := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
 	file1 := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
@@ -1577,7 +1569,7 @@ func (s *DockerSuite) TestRunWithNanoCPUs(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	inspect, err := clt.ContainerInspect(context.Background(), "test")
 	inspect, err := clt.ContainerInspect(context.Background(), "test")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(inspect.HostConfig.NanoCPUs, checker.Equals, int64(500000000))
+	assert.Equal(c, inspect.HostConfig.NanoCPUs, int64(500000000))
 
 
 	out = inspectField(c, "test", "HostConfig.CpuQuota")
 	out = inspectField(c, "test", "HostConfig.CpuQuota")
 	assert.Equal(c, out, "0", "CPU CFS quota should be 0")
 	assert.Equal(c, out, "0", "CPU CFS quota should be 0")
@@ -1586,5 +1578,5 @@ func (s *DockerSuite) TestRunWithNanoCPUs(c *check.C) {
 
 
 	out, _, err = dockerCmdWithError("run", "--cpus", "0.5", "--cpu-quota", "50000", "--cpu-period", "100000", "busybox", "sh")
 	out, _, err = dockerCmdWithError("run", "--cpus", "0.5", "--cpu-quota", "50000", "--cpu-period", "100000", "busybox", "sh")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Conflicting options: Nano CPUs and CPU Period cannot both be set")
+	assert.Assert(c, strings.Contains(out, "Conflicting options: Nano CPUs and CPU Period cannot both be set"))
 }
 }

+ 27 - 29
integration-cli/docker_cli_save_load_test.go

@@ -13,11 +13,10 @@ import (
 	"regexp"
 	"regexp"
 	"sort"
 	"sort"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"github.com/opencontainers/go-digest"
 	"github.com/opencontainers/go-digest"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
@@ -25,7 +24,7 @@ import (
 )
 )
 
 
 // save a repo using gz compression and try to load it using stdout
 // save a repo using gz compression and try to load it using stdout
-func (s *DockerSuite) TestSaveXzAndLoadRepoStdout(c *check.C) {
+func (s *DockerSuite) TestSaveXzAndLoadRepoStdout(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "test-save-xz-and-load-repo-stdout"
 	name := "test-save-xz-and-load-repo-stdout"
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
@@ -54,7 +53,7 @@ func (s *DockerSuite) TestSaveXzAndLoadRepoStdout(c *check.C) {
 }
 }
 
 
 // save a repo using xz+gz compression and try to load it using stdout
 // save a repo using xz+gz compression and try to load it using stdout
-func (s *DockerSuite) TestSaveXzGzAndLoadRepoStdout(c *check.C) {
+func (s *DockerSuite) TestSaveXzGzAndLoadRepoStdout(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "test-save-xz-gz-and-load-repo-stdout"
 	name := "test-save-xz-gz-and-load-repo-stdout"
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
@@ -83,7 +82,7 @@ func (s *DockerSuite) TestSaveXzGzAndLoadRepoStdout(c *check.C) {
 	assert.ErrorContains(c, err, "", "the repo should not exist: %v", after)
 	assert.ErrorContains(c, err, "", "the repo should not exist: %v", after)
 }
 }
 
 
-func (s *DockerSuite) TestSaveSingleTag(c *check.C) {
+func (s *DockerSuite) TestSaveSingleTag(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	repoName := "foobar-save-single-tag-test"
 	repoName := "foobar-save-single-tag-test"
 	dockerCmd(c, "tag", "busybox:latest", fmt.Sprintf("%v:latest", repoName))
 	dockerCmd(c, "tag", "busybox:latest", fmt.Sprintf("%v:latest", repoName))
@@ -98,7 +97,7 @@ func (s *DockerSuite) TestSaveSingleTag(c *check.C) {
 	assert.NilError(c, err, "failed to save repo with image ID and 'repositories' file: %s, %v", out, err)
 	assert.NilError(c, err, "failed to save repo with image ID and 'repositories' file: %s, %v", out, err)
 }
 }
 
 
-func (s *DockerSuite) TestSaveCheckTimes(c *check.C) {
+func (s *DockerSuite) TestSaveCheckTimes(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	repoName := "busybox:latest"
 	repoName := "busybox:latest"
 	out, _ := dockerCmd(c, "inspect", repoName)
 	out, _ := dockerCmd(c, "inspect", repoName)
@@ -117,7 +116,7 @@ func (s *DockerSuite) TestSaveCheckTimes(c *check.C) {
 	assert.NilError(c, err, "failed to save repo with image ID and 'repositories' file: %s, %v", out, err)
 	assert.NilError(c, err, "failed to save repo with image ID and 'repositories' file: %s, %v", out, err)
 }
 }
 
 
-func (s *DockerSuite) TestSaveImageId(c *check.C) {
+func (s *DockerSuite) TestSaveImageId(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	repoName := "foobar-save-image-id-test"
 	repoName := "foobar-save-image-id-test"
 	dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v:latest", repoName))
 	dockerCmd(c, "tag", "emptyfs:latest", fmt.Sprintf("%v:latest", repoName))
@@ -129,21 +128,21 @@ func (s *DockerSuite) TestSaveImageId(c *check.C) {
 	cleanedShortImageID := strings.TrimSpace(out)
 	cleanedShortImageID := strings.TrimSpace(out)
 
 
 	// Make sure IDs are not empty
 	// Make sure IDs are not empty
-	c.Assert(cleanedLongImageID, checker.Not(check.Equals), "", check.Commentf("Id should not be empty."))
-	c.Assert(cleanedShortImageID, checker.Not(check.Equals), "", check.Commentf("Id should not be empty."))
+	assert.Assert(c, cleanedLongImageID != "", "Id should not be empty.")
+	assert.Assert(c, cleanedShortImageID != "", "Id should not be empty.")
 
 
 	saveCmd := exec.Command(dockerBinary, "save", cleanedShortImageID)
 	saveCmd := exec.Command(dockerBinary, "save", cleanedShortImageID)
 	tarCmd := exec.Command("tar", "t")
 	tarCmd := exec.Command("tar", "t")
 
 
 	var err error
 	var err error
 	tarCmd.Stdin, err = saveCmd.StdoutPipe()
 	tarCmd.Stdin, err = saveCmd.StdoutPipe()
-	c.Assert(err, checker.IsNil, check.Commentf("cannot set stdout pipe for tar: %v", err))
+	assert.Assert(c, err == nil, "cannot set stdout pipe for tar: %v", err)
 	grepCmd := exec.Command("grep", cleanedLongImageID)
 	grepCmd := exec.Command("grep", cleanedLongImageID)
 	grepCmd.Stdin, err = tarCmd.StdoutPipe()
 	grepCmd.Stdin, err = tarCmd.StdoutPipe()
-	c.Assert(err, checker.IsNil, check.Commentf("cannot set stdout pipe for grep: %v", err))
+	assert.Assert(c, err == nil, "cannot set stdout pipe for grep: %v", err)
 
 
-	c.Assert(tarCmd.Start(), checker.IsNil, check.Commentf("tar failed with error: %v", err))
-	c.Assert(saveCmd.Start(), checker.IsNil, check.Commentf("docker save failed with error: %v", err))
+	assert.Assert(c, tarCmd.Start() == nil, "tar failed with error: %v", err)
+	assert.Assert(c, saveCmd.Start() == nil, "docker save failed with error: %v", err)
 	defer func() {
 	defer func() {
 		saveCmd.Wait()
 		saveCmd.Wait()
 		tarCmd.Wait()
 		tarCmd.Wait()
@@ -152,11 +151,11 @@ func (s *DockerSuite) TestSaveImageId(c *check.C) {
 
 
 	out, _, err = runCommandWithOutput(grepCmd)
 	out, _, err = runCommandWithOutput(grepCmd)
 
 
-	c.Assert(err, checker.IsNil, check.Commentf("failed to save repo with image ID: %s, %v", out, err))
+	assert.Assert(c, err == nil, "failed to save repo with image ID: %s, %v", out, err)
 }
 }
 
 
 // save a repo and try to load it using flags
 // save a repo and try to load it using flags
-func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {
+func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "test-save-and-load-repo-flags"
 	name := "test-save-and-load-repo-flags"
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
@@ -177,7 +176,7 @@ func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {
 	assert.Equal(c, before, after, "inspect is not the same after a save / load")
 	assert.Equal(c, before, after, "inspect is not the same after a save / load")
 }
 }
 
 
-func (s *DockerSuite) TestSaveWithNoExistImage(c *check.C) {
+func (s *DockerSuite) TestSaveWithNoExistImage(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	imgName := "foobar-non-existing-image"
 	imgName := "foobar-non-existing-image"
@@ -187,7 +186,7 @@ func (s *DockerSuite) TestSaveWithNoExistImage(c *check.C) {
 	assert.Assert(c, strings.Contains(out, fmt.Sprintf("No such image: %s", imgName)))
 	assert.Assert(c, strings.Contains(out, fmt.Sprintf("No such image: %s", imgName)))
 }
 }
 
 
-func (s *DockerSuite) TestSaveMultipleNames(c *check.C) {
+func (s *DockerSuite) TestSaveMultipleNames(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	repoName := "foobar-save-multi-name-test"
 	repoName := "foobar-save-multi-name-test"
 
 
@@ -205,7 +204,7 @@ func (s *DockerSuite) TestSaveMultipleNames(c *check.C) {
 	assert.NilError(c, err, "failed to save multiple repos: %s, %v", out, err)
 	assert.NilError(c, err, "failed to save multiple repos: %s, %v", out, err)
 }
 }
 
 
-func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {
+func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	makeImage := func(from string, tag string) string {
 	makeImage := func(from string, tag string) string {
 		var (
 		var (
@@ -257,14 +256,14 @@ func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {
 }
 }
 
 
 // Issue #6722 #5892 ensure directories are included in changes
 // Issue #6722 #5892 ensure directories are included in changes
-func (s *DockerSuite) TestSaveDirectoryPermissions(c *check.C) {
+func (s *DockerSuite) TestSaveDirectoryPermissions(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	layerEntries := []string{"opt/", "opt/a/", "opt/a/b/", "opt/a/b/c"}
 	layerEntries := []string{"opt/", "opt/a/", "opt/a/b/", "opt/a/b/c"}
 	layerEntriesAUFS := []string{"./", ".wh..wh.aufs", ".wh..wh.orph/", ".wh..wh.plnk/", "opt/", "opt/a/", "opt/a/b/", "opt/a/b/c"}
 	layerEntriesAUFS := []string{"./", ".wh..wh.aufs", ".wh..wh.orph/", ".wh..wh.plnk/", "opt/", "opt/a/", "opt/a/b/", "opt/a/b/c"}
 
 
 	name := "save-directory-permissions"
 	name := "save-directory-permissions"
 	tmpDir, err := ioutil.TempDir("", "save-layers-with-directories")
 	tmpDir, err := ioutil.TempDir("", "save-layers-with-directories")
-	c.Assert(err, checker.IsNil, check.Commentf("failed to create temporary directory: %s", err))
+	assert.Assert(c, err == nil, "failed to create temporary directory: %s", err)
 	extractionDirectory := filepath.Join(tmpDir, "image-extraction-dir")
 	extractionDirectory := filepath.Join(tmpDir, "image-extraction-dir")
 	os.Mkdir(extractionDirectory, 0777)
 	os.Mkdir(extractionDirectory, 0777)
 
 
@@ -331,7 +330,7 @@ func listTar(f io.Reader) ([]string, error) {
 // Test loading a weird image where one of the layers is of zero size.
 // Test loading a weird image where one of the layers is of zero size.
 // The layer.tar file is actually zero bytes, no padding or anything else.
 // The layer.tar file is actually zero bytes, no padding or anything else.
 // See issue: 18170
 // See issue: 18170
-func (s *DockerSuite) TestLoadZeroSizeLayer(c *check.C) {
+func (s *DockerSuite) TestLoadZeroSizeLayer(c *testing.T) {
 	// this will definitely not work if using remote daemon
 	// this will definitely not work if using remote daemon
 	// very weird test
 	// very weird test
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
@@ -339,7 +338,7 @@ func (s *DockerSuite) TestLoadZeroSizeLayer(c *check.C) {
 	dockerCmd(c, "load", "-i", "testdata/emptyLayer.tar")
 	dockerCmd(c, "load", "-i", "testdata/emptyLayer.tar")
 }
 }
 
 
-func (s *DockerSuite) TestSaveLoadParents(c *check.C) {
+func (s *DockerSuite) TestSaveLoadParents(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	makeImage := func(from string, addfile string) string {
 	makeImage := func(from string, addfile string) string {
@@ -378,7 +377,7 @@ func (s *DockerSuite) TestSaveLoadParents(c *check.C) {
 	assert.Equal(c, inspectOut, "")
 	assert.Equal(c, inspectOut, "")
 }
 }
 
 
-func (s *DockerSuite) TestSaveLoadNoTag(c *check.C) {
+func (s *DockerSuite) TestSaveLoadNoTag(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	name := "saveloadnotag"
 	name := "saveloadnotag"
@@ -393,16 +392,15 @@ func (s *DockerSuite) TestSaveLoadNoTag(c *check.C) {
 	assert.NilError(c, err, "failed to save and load repo: %s, %v", out, err)
 	assert.NilError(c, err, "failed to save and load repo: %s, %v", out, err)
 
 
 	// Should not show 'name' but should show the image ID during the load
 	// Should not show 'name' but should show the image ID during the load
-	c.Assert(out, checker.Not(checker.Contains), "Loaded image: ")
-	c.Assert(out, checker.Contains, "Loaded image ID:")
-	c.Assert(out, checker.Contains, id)
-
+	assert.Assert(c, !strings.Contains(out, "Loaded image: "))
+	assert.Assert(c, strings.Contains(out, "Loaded image ID:"))
+	assert.Assert(c, strings.Contains(out, id))
 	// Test to make sure that save by name shows that name during load
 	// Test to make sure that save by name shows that name during load
 	out, err = RunCommandPipelineWithOutput(
 	out, err = RunCommandPipelineWithOutput(
 		exec.Command(dockerBinary, "save", name),
 		exec.Command(dockerBinary, "save", name),
 		exec.Command(dockerBinary, "load"))
 		exec.Command(dockerBinary, "load"))
 	assert.NilError(c, err, "failed to save and load repo: %s, %v", out, err)
 	assert.NilError(c, err, "failed to save and load repo: %s, %v", out, err)
 
 
-	c.Assert(out, checker.Contains, "Loaded image: "+name+":latest")
-	c.Assert(out, checker.Not(checker.Contains), "Loaded image ID:")
+	assert.Assert(c, strings.Contains(out, "Loaded image: "+name+":latest"))
+	assert.Assert(c, !strings.Contains(out, "Loaded image ID:"))
 }
 }

+ 4 - 4
integration-cli/docker_cli_save_load_unix_test.go

@@ -9,17 +9,17 @@ import (
 	"os"
 	"os"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/creack/pty"
 	"github.com/creack/pty"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 // save a repo and try to load it using stdout
 // save a repo and try to load it using stdout
-func (s *DockerSuite) TestSaveAndLoadRepoStdout(c *check.C) {
+func (s *DockerSuite) TestSaveAndLoadRepoStdout(c *testing.T) {
 	name := "test-save-and-load-repo-stdout"
 	name := "test-save-and-load-repo-stdout"
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
 	dockerCmd(c, "run", "--name", name, "busybox", "true")
 
 
@@ -70,7 +70,7 @@ func (s *DockerSuite) TestSaveAndLoadRepoStdout(c *check.C) {
 	assert.Assert(c, strings.Contains(string(buf[:n]), "cowardly refusing"), "help output is not being yielded")
 	assert.Assert(c, strings.Contains(string(buf[:n]), "cowardly refusing"), "help output is not being yielded")
 }
 }
 
 
-func (s *DockerSuite) TestSaveAndLoadWithProgressBar(c *check.C) {
+func (s *DockerSuite) TestSaveAndLoadWithProgressBar(c *testing.T) {
 	name := "test-load"
 	name := "test-load"
 	buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox
 	buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox
 	RUN touch aa
 	RUN touch aa
@@ -88,7 +88,7 @@ func (s *DockerSuite) TestSaveAndLoadWithProgressBar(c *check.C) {
 }
 }
 
 
 // fail because load didn't receive data from stdin
 // fail because load didn't receive data from stdin
-func (s *DockerSuite) TestLoadNoStdinFail(c *check.C) {
+func (s *DockerSuite) TestLoadNoStdinFail(c *testing.T) {
 	pty, tty, err := pty.Open()
 	pty, tty, err := pty.Open()
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
 	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)

+ 6 - 6
integration-cli/docker_cli_search_test.go

@@ -3,18 +3,18 @@ package main
 import (
 import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // search for repos named  "registry" on the central registry
 // search for repos named  "registry" on the central registry
-func (s *DockerSuite) TestSearchOnCentralRegistry(c *check.C) {
+func (s *DockerSuite) TestSearchOnCentralRegistry(c *testing.T) {
 	out, _ := dockerCmd(c, "search", "busybox")
 	out, _ := dockerCmd(c, "search", "busybox")
 	assert.Assert(c, strings.Contains(out, "Busybox base image."), "couldn't find any repository named (or containing) 'Busybox base image.'")
 	assert.Assert(c, strings.Contains(out, "Busybox base image."), "couldn't find any repository named (or containing) 'Busybox base image.'")
 }
 }
 
 
-func (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *check.C) {
+func (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *testing.T) {
 	out, _, err := dockerCmdWithError("search", "--filter", "stars=a", "busybox")
 	out, _, err := dockerCmdWithError("search", "--filter", "stars=a", "busybox")
 	assert.ErrorContains(c, err, "", out)
 	assert.ErrorContains(c, err, "", out)
 	assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning")
 	assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning")
@@ -32,7 +32,7 @@ func (s *DockerSuite) TestSearchStarsOptionWithWrongParameter(c *check.C) {
 	assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning")
 	assert.Assert(c, strings.Contains(out, "Invalid filter"), "couldn't find the invalid filter warning")
 }
 }
 
 
-func (s *DockerSuite) TestSearchCmdOptions(c *check.C) {
+func (s *DockerSuite) TestSearchCmdOptions(c *testing.T) {
 	outSearchCmd, _ := dockerCmd(c, "search", "busybox")
 	outSearchCmd, _ := dockerCmd(c, "search", "busybox")
 	assert.Assert(c, strings.Count(outSearchCmd, "\n") > 3, outSearchCmd)
 	assert.Assert(c, strings.Count(outSearchCmd, "\n") > 3, outSearchCmd)
 
 
@@ -60,12 +60,12 @@ func (s *DockerSuite) TestSearchCmdOptions(c *check.C) {
 }
 }
 
 
 // search for repos which start with "ubuntu-" on the central registry
 // search for repos which start with "ubuntu-" on the central registry
-func (s *DockerSuite) TestSearchOnCentralRegistryWithDash(c *check.C) {
+func (s *DockerSuite) TestSearchOnCentralRegistryWithDash(c *testing.T) {
 	dockerCmd(c, "search", "ubuntu-")
 	dockerCmd(c, "search", "ubuntu-")
 }
 }
 
 
 // test case for #23055
 // test case for #23055
-func (s *DockerSuite) TestSearchWithLimit(c *check.C) {
+func (s *DockerSuite) TestSearchWithLimit(c *testing.T) {
 	for _, limit := range []int{10, 50, 100} {
 	for _, limit := range []int{10, 50, 100} {
 		out, _, err := dockerCmdWithError("search", fmt.Sprintf("--limit=%d", limit), "docker")
 		out, _, err := dockerCmdWithError("search", fmt.Sprintf("--limit=%d", limit), "docker")
 		assert.NilError(c, err)
 		assert.NilError(c, err)

+ 104 - 103
integration-cli/docker_cli_service_create_test.go

@@ -7,64 +7,65 @@ import (
 	"fmt"
 	"fmt"
 	"path/filepath"
 	"path/filepath"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
+	"gotest.tools/poll"
 )
 )
 
 
-func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 	out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=volume,source=foo,target=/foo,volume-nocopy", "busybox", "top")
 	out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=volume,source=foo,target=/foo,volume-nocopy", "busybox", "top")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, id)
 		tasks = d.GetServiceTasks(c, id)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// check container mount config
 	// check container mount config
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .HostConfig.Mounts}}", task.Status.ContainerStatus.ContainerID)
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .HostConfig.Mounts}}", task.Status.ContainerStatus.ContainerID)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	var mountConfig []mount.Mount
 	var mountConfig []mount.Mount
-	c.Assert(json.Unmarshal([]byte(out), &mountConfig), checker.IsNil)
-	c.Assert(mountConfig, checker.HasLen, 1)
+	assert.Assert(c, json.Unmarshal([]byte(out), &mountConfig) == nil)
+	assert.Equal(c, len(mountConfig), 1)
 
 
-	c.Assert(mountConfig[0].Source, checker.Equals, "foo")
-	c.Assert(mountConfig[0].Target, checker.Equals, "/foo")
-	c.Assert(mountConfig[0].Type, checker.Equals, mount.TypeVolume)
-	c.Assert(mountConfig[0].VolumeOptions, checker.NotNil)
-	c.Assert(mountConfig[0].VolumeOptions.NoCopy, checker.True)
+	assert.Equal(c, mountConfig[0].Source, "foo")
+	assert.Equal(c, mountConfig[0].Target, "/foo")
+	assert.Equal(c, mountConfig[0].Type, mount.TypeVolume)
+	assert.Assert(c, mountConfig[0].VolumeOptions != nil)
+	assert.Assert(c, mountConfig[0].VolumeOptions.NoCopy)
 
 
 	// check container mounts actual
 	// check container mounts actual
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	var mounts []types.MountPoint
 	var mounts []types.MountPoint
-	c.Assert(json.Unmarshal([]byte(out), &mounts), checker.IsNil)
-	c.Assert(mounts, checker.HasLen, 1)
+	assert.Assert(c, json.Unmarshal([]byte(out), &mounts) == nil)
+	assert.Equal(c, len(mounts), 1)
 
 
-	c.Assert(mounts[0].Type, checker.Equals, mount.TypeVolume)
-	c.Assert(mounts[0].Name, checker.Equals, "foo")
-	c.Assert(mounts[0].Destination, checker.Equals, "/foo")
-	c.Assert(mounts[0].RW, checker.Equals, true)
+	assert.Equal(c, mounts[0].Type, mount.TypeVolume)
+	assert.Equal(c, mounts[0].Name, "foo")
+	assert.Equal(c, mounts[0].Destination, "/foo")
+	assert.Equal(c, mounts[0].RW, true)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	serviceName := "test-service-secret"
 	serviceName := "test-service-secret"
@@ -75,7 +76,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *check.C) {
 		},
 		},
 		Data: []byte("TESTINGDATA"),
 		Data: []byte("TESTINGDATA"),
 	})
 	})
-	c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("secrets: %s", id))
+	assert.Assert(c, id != "", "secrets: %s", id)
 
 
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--secret", testName, "busybox", "top")
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--secret", testName, "busybox", "top")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
@@ -84,21 +85,21 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	var refs []swarm.SecretReference
 	var refs []swarm.SecretReference
-	c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
+	assert.Assert(c, json.Unmarshal([]byte(out), &refs) == nil)
 	assert.Equal(c, len(refs), 1)
 	assert.Equal(c, len(refs), 1)
 
 
-	c.Assert(refs[0].SecretName, checker.Equals, testName)
-	c.Assert(refs[0].File, checker.Not(checker.IsNil))
-	c.Assert(refs[0].File.Name, checker.Equals, testName)
-	c.Assert(refs[0].File.UID, checker.Equals, "0")
-	c.Assert(refs[0].File.GID, checker.Equals, "0")
+	assert.Equal(c, refs[0].SecretName, testName)
+	assert.Assert(c, refs[0].File != nil)
+	assert.Equal(c, refs[0].File.Name, testName)
+	assert.Equal(c, refs[0].File.UID, "0")
+	assert.Equal(c, refs[0].File.GID, "0")
 
 
 	out, err = d.Cmd("service", "rm", serviceName)
 	out, err = d.Cmd("service", "rm", serviceName)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 	d.DeleteSecret(c, testName)
 	d.DeleteSecret(c, testName)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	testPaths := map[string]string{
 	testPaths := map[string]string{
@@ -117,7 +118,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *check
 			},
 			},
 			Data: []byte("TESTINGDATA " + testName + " " + testTarget),
 			Data: []byte("TESTINGDATA " + testName + " " + testTarget),
 		})
 		})
-		c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("secrets: %s", id))
+		assert.Assert(c, id != "", "secrets: %s", id)
 
 
 		secretFlags = append(secretFlags, "--secret", fmt.Sprintf("source=%s,target=%s", testName, testTarget))
 		secretFlags = append(secretFlags, "--secret", fmt.Sprintf("source=%s,target=%s", testName, testTarget))
 	}
 	}
@@ -133,22 +134,22 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *check
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	var refs []swarm.SecretReference
 	var refs []swarm.SecretReference
-	c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
+	assert.Assert(c, json.Unmarshal([]byte(out), &refs) == nil)
 	assert.Equal(c, len(refs), len(testPaths))
 	assert.Equal(c, len(refs), len(testPaths))
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, serviceName)
 		tasks = d.GetServiceTasks(c, serviceName)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	for testName, testTarget := range testPaths {
 	for testName, testTarget := range testPaths {
 		path := testTarget
 		path := testTarget
@@ -164,7 +165,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSourceTargetPaths(c *check
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	id := d.CreateSecret(c, swarm.SecretSpec{
 	id := d.CreateSecret(c, swarm.SecretSpec{
@@ -173,7 +174,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C
 		},
 		},
 		Data: []byte("TESTINGDATA"),
 		Data: []byte("TESTINGDATA"),
 	})
 	})
-	c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("secrets: %s", id))
+	assert.Assert(c, id != "", "secrets: %s", id)
 
 
 	serviceName := "svc"
 	serviceName := "svc"
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--secret", "source=mysecret,target=target1", "--secret", "source=mysecret,target=target2", "busybox", "top")
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--secret", "source=mysecret,target=target1", "--secret", "source=mysecret,target=target2", "busybox", "top")
@@ -183,22 +184,22 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	var refs []swarm.SecretReference
 	var refs []swarm.SecretReference
-	c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
+	assert.Assert(c, json.Unmarshal([]byte(out), &refs) == nil)
 	assert.Equal(c, len(refs), 2)
 	assert.Equal(c, len(refs), 2)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, serviceName)
 		tasks = d.GetServiceTasks(c, serviceName)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	for _, target := range []string{"target1", "target2"} {
 	for _, target := range []string{"target1", "target2"} {
 		assert.NilError(c, err, out)
 		assert.NilError(c, err, out)
@@ -212,7 +213,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretReferencedTwice(c *check.C
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	serviceName := "test-service-config"
 	serviceName := "test-service-config"
@@ -223,7 +224,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *check.C) {
 		},
 		},
 		Data: []byte("TESTINGDATA"),
 		Data: []byte("TESTINGDATA"),
 	})
 	})
-	c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("configs: %s", id))
+	assert.Assert(c, id != "", "configs: %s", id)
 
 
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--config", testName, "busybox", "top")
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--config", testName, "busybox", "top")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
@@ -232,21 +233,21 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	var refs []swarm.ConfigReference
 	var refs []swarm.ConfigReference
-	c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
+	assert.Assert(c, json.Unmarshal([]byte(out), &refs) == nil)
 	assert.Equal(c, len(refs), 1)
 	assert.Equal(c, len(refs), 1)
 
 
-	c.Assert(refs[0].ConfigName, checker.Equals, testName)
-	c.Assert(refs[0].File, checker.Not(checker.IsNil))
-	c.Assert(refs[0].File.Name, checker.Equals, testName)
-	c.Assert(refs[0].File.UID, checker.Equals, "0")
-	c.Assert(refs[0].File.GID, checker.Equals, "0")
+	assert.Equal(c, refs[0].ConfigName, testName)
+	assert.Assert(c, refs[0].File != nil)
+	assert.Equal(c, refs[0].File.Name, testName)
+	assert.Equal(c, refs[0].File.UID, "0")
+	assert.Equal(c, refs[0].File.GID, "0")
 
 
 	out, err = d.Cmd("service", "rm", serviceName)
 	out, err = d.Cmd("service", "rm", serviceName)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 	d.DeleteConfig(c, testName)
 	d.DeleteConfig(c, testName)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	testPaths := map[string]string{
 	testPaths := map[string]string{
@@ -264,7 +265,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *check
 			},
 			},
 			Data: []byte("TESTINGDATA " + testName + " " + testTarget),
 			Data: []byte("TESTINGDATA " + testName + " " + testTarget),
 		})
 		})
-		c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("configs: %s", id))
+		assert.Assert(c, id != "", "configs: %s", id)
 
 
 		configFlags = append(configFlags, "--config", fmt.Sprintf("source=%s,target=%s", testName, testTarget))
 		configFlags = append(configFlags, "--config", fmt.Sprintf("source=%s,target=%s", testName, testTarget))
 	}
 	}
@@ -280,22 +281,22 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *check
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	var refs []swarm.ConfigReference
 	var refs []swarm.ConfigReference
-	c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
+	assert.Assert(c, json.Unmarshal([]byte(out), &refs) == nil)
 	assert.Equal(c, len(refs), len(testPaths))
 	assert.Equal(c, len(refs), len(testPaths))
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, serviceName)
 		tasks = d.GetServiceTasks(c, serviceName)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	for testName, testTarget := range testPaths {
 	for testName, testTarget := range testPaths {
 		path := testTarget
 		path := testTarget
@@ -311,7 +312,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSourceTargetPaths(c *check
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	id := d.CreateConfig(c, swarm.ConfigSpec{
 	id := d.CreateConfig(c, swarm.ConfigSpec{
@@ -320,7 +321,7 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C
 		},
 		},
 		Data: []byte("TESTINGDATA"),
 		Data: []byte("TESTINGDATA"),
 	})
 	})
-	c.Assert(id, checker.Not(checker.Equals), "", check.Commentf("configs: %s", id))
+	assert.Assert(c, id != "", "configs: %s", id)
 
 
 	serviceName := "svc"
 	serviceName := "svc"
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--config", "source=myconfig,target=target1", "--config", "source=myconfig,target=target2", "busybox", "top")
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--config", "source=myconfig,target=target1", "--config", "source=myconfig,target=target2", "busybox", "top")
@@ -330,22 +331,22 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	var refs []swarm.ConfigReference
 	var refs []swarm.ConfigReference
-	c.Assert(json.Unmarshal([]byte(out), &refs), checker.IsNil)
+	assert.Assert(c, json.Unmarshal([]byte(out), &refs) == nil)
 	assert.Equal(c, len(refs), 2)
 	assert.Equal(c, len(refs), 2)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, serviceName)
 		tasks = d.GetServiceTasks(c, serviceName)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	for _, target := range []string{"target1", "target2"} {
 	for _, target := range []string{"target1", "target2"} {
 		assert.NilError(c, err, out)
 		assert.NilError(c, err, out)
@@ -359,52 +360,52 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigReferencedTwice(c *check.C
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 	out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=tmpfs,target=/foo,tmpfs-size=1MB", "busybox", "sh", "-c", "mount | grep foo; tail -f /dev/null")
 	out, err := d.Cmd("service", "create", "--no-resolve-image", "--detach=true", "--mount", "type=tmpfs,target=/foo,tmpfs-size=1MB", "busybox", "sh", "-c", "mount | grep foo; tail -f /dev/null")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, id)
 		tasks = d.GetServiceTasks(c, id)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// check container mount config
 	// check container mount config
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .HostConfig.Mounts}}", task.Status.ContainerStatus.ContainerID)
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .HostConfig.Mounts}}", task.Status.ContainerStatus.ContainerID)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	var mountConfig []mount.Mount
 	var mountConfig []mount.Mount
-	c.Assert(json.Unmarshal([]byte(out), &mountConfig), checker.IsNil)
-	c.Assert(mountConfig, checker.HasLen, 1)
+	assert.Assert(c, json.Unmarshal([]byte(out), &mountConfig) == nil)
+	assert.Equal(c, len(mountConfig), 1)
 
 
-	c.Assert(mountConfig[0].Source, checker.Equals, "")
-	c.Assert(mountConfig[0].Target, checker.Equals, "/foo")
-	c.Assert(mountConfig[0].Type, checker.Equals, mount.TypeTmpfs)
-	c.Assert(mountConfig[0].TmpfsOptions, checker.NotNil)
-	c.Assert(mountConfig[0].TmpfsOptions.SizeBytes, checker.Equals, int64(1048576))
+	assert.Equal(c, mountConfig[0].Source, "")
+	assert.Equal(c, mountConfig[0].Target, "/foo")
+	assert.Equal(c, mountConfig[0].Type, mount.TypeTmpfs)
+	assert.Assert(c, mountConfig[0].TmpfsOptions != nil)
+	assert.Equal(c, mountConfig[0].TmpfsOptions.SizeBytes, int64(1048576))
 
 
 	// check container mounts actual
 	// check container mounts actual
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	var mounts []types.MountPoint
 	var mounts []types.MountPoint
-	c.Assert(json.Unmarshal([]byte(out), &mounts), checker.IsNil)
-	c.Assert(mounts, checker.HasLen, 1)
+	assert.Assert(c, json.Unmarshal([]byte(out), &mounts) == nil)
+	assert.Equal(c, len(mounts), 1)
 
 
-	c.Assert(mounts[0].Type, checker.Equals, mount.TypeTmpfs)
-	c.Assert(mounts[0].Name, checker.Equals, "")
-	c.Assert(mounts[0].Destination, checker.Equals, "/foo")
-	c.Assert(mounts[0].RW, checker.Equals, true)
+	assert.Equal(c, mounts[0].Type, mount.TypeTmpfs)
+	assert.Equal(c, mounts[0].Name, "")
+	assert.Equal(c, mounts[0].Destination, "/foo")
+	assert.Equal(c, mounts[0].RW, true)
 
 
 	out, err = s.nodeCmd(c, task.NodeID, "logs", task.Status.ContainerStatus.ContainerID)
 	out, err = s.nodeCmd(c, task.NodeID, "logs", task.Status.ContainerStatus.ContainerID)
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
@@ -412,7 +413,7 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *check.C) {
 	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "size=1024k"))
 	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "size=1024k"))
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceCreateWithNetworkAlias(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceCreateWithNetworkAlias(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 	out, err := d.Cmd("network", "create", "--scope=swarm", "test_swarm_br")
 	out, err := d.Cmd("network", "create", "--scope=swarm", "test_swarm_br")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
@@ -422,18 +423,18 @@ func (s *DockerSwarmSuite) TestServiceCreateWithNetworkAlias(c *check.C) {
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, id)
 		tasks = d.GetServiceTasks(c, id)
-		return len(tasks) > 0, nil
-	}, checker.Equals, true)
+		return len(tasks) > 0, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 		if task.NodeID == "" || task.Status.ContainerStatus == nil {
 			task = d.GetTask(c, task.ID)
 			task = d.GetTask(c, task.ID)
 		}
 		}
-		return task.NodeID != "" && task.Status.ContainerStatus != nil, nil
-	}, checker.Equals, true)
+		return task.NodeID != "" && task.Status.ContainerStatus != nil, ""
+	}, checker.Equals(true)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// check container alias config
 	// check container alias config
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .NetworkSettings.Networks.test_swarm_br.Aliases}}", task.Status.ContainerStatus.ContainerID)
 	out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .NetworkSettings.Networks.test_swarm_br.Aliases}}", task.Status.ContainerStatus.ContainerID)
@@ -441,8 +442,8 @@ func (s *DockerSwarmSuite) TestServiceCreateWithNetworkAlias(c *check.C) {
 
 
 	// Make sure the only alias seen is the container-id
 	// Make sure the only alias seen is the container-id
 	var aliases []string
 	var aliases []string
-	c.Assert(json.Unmarshal([]byte(out), &aliases), checker.IsNil)
-	c.Assert(aliases, checker.HasLen, 1)
+	assert.Assert(c, json.Unmarshal([]byte(out), &aliases) == nil)
+	assert.Equal(c, len(aliases), 1)
 
 
-	c.Assert(task.Status.ContainerStatus.ContainerID, checker.Contains, aliases[0])
+	assert.Assert(c, strings.Contains(task.Status.ContainerStatus.ContainerID, aliases[0]))
 }
 }

+ 34 - 31
integration-cli/docker_cli_service_health_test.go

@@ -5,20 +5,21 @@ package main
 import (
 import (
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/daemon/cluster/executor/container"
 	"github.com/docker/docker/daemon/cluster/executor/container"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
+	"gotest.tools/poll"
 )
 )
 
 
 // start a service, and then make its task unhealthy during running
 // start a service, and then make its task unhealthy during running
 // finally, unhealthy task should be detected and killed
 // finally, unhealthy task should be detected and killed
-func (s *DockerSwarmSuite) TestServiceHealthRun(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceHealthRun(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 
 
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
@@ -39,39 +40,40 @@ func (s *DockerSwarmSuite) TestServiceHealthRun(c *check.C) {
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, id)
 		tasks = d.GetServiceTasks(c, id)
-		return tasks, nil
-	}, checker.HasLen, 1)
+		return tasks, ""
+	}, checker.HasLen(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
 
 
 	// wait for task to start
 	// wait for task to start
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		task = d.GetTask(c, task.ID)
 		task = d.GetTask(c, task.ID)
-		return task.Status.State, nil
-	}, checker.Equals, swarm.TaskStateRunning)
+		return task.Status.State, ""
+	}, checker.Equals(swarm.TaskStateRunning)), poll.WithTimeout(defaultReconciliationTimeout))
+
 	containerID := task.Status.ContainerStatus.ContainerID
 	containerID := task.Status.ContainerStatus.ContainerID
 
 
 	// wait for container to be healthy
 	// wait for container to be healthy
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		out, _ := d.Cmd("inspect", "--format={{.State.Health.Status}}", containerID)
 		out, _ := d.Cmd("inspect", "--format={{.State.Health.Status}}", containerID)
-		return strings.TrimSpace(out), nil
-	}, checker.Equals, "healthy")
+		return strings.TrimSpace(out), ""
+	}, checker.Equals("healthy")), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// make it fail
 	// make it fail
 	d.Cmd("exec", containerID, "rm", "/status")
 	d.Cmd("exec", containerID, "rm", "/status")
 	// wait for container to be unhealthy
 	// wait for container to be unhealthy
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		out, _ := d.Cmd("inspect", "--format={{.State.Health.Status}}", containerID)
 		out, _ := d.Cmd("inspect", "--format={{.State.Health.Status}}", containerID)
-		return strings.TrimSpace(out), nil
-	}, checker.Equals, "unhealthy")
+		return strings.TrimSpace(out), ""
+	}, checker.Equals("unhealthy")), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// Task should be terminated
 	// Task should be terminated
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		task = d.GetTask(c, task.ID)
 		task = d.GetTask(c, task.ID)
-		return task.Status.State, nil
-	}, checker.Equals, swarm.TaskStateFailed)
+		return task.Status.State, ""
+	}, checker.Equals(swarm.TaskStateFailed)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	if !strings.Contains(task.Status.Err, container.ErrContainerUnhealthy.Error()) {
 	if !strings.Contains(task.Status.Err, container.ErrContainerUnhealthy.Error()) {
 		c.Fatal("unhealthy task exits because of other error")
 		c.Fatal("unhealthy task exits because of other error")
@@ -80,7 +82,7 @@ func (s *DockerSwarmSuite) TestServiceHealthRun(c *check.C) {
 
 
 // start a service whose task is unhealthy at beginning
 // start a service whose task is unhealthy at beginning
 // its tasks should be blocked in starting stage, until health check is passed
 // its tasks should be blocked in starting stage, until health check is passed
-func (s *DockerSwarmSuite) TestServiceHealthStart(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceHealthStart(c *testing.T) {
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 	testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
 
 
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
@@ -100,38 +102,39 @@ func (s *DockerSwarmSuite) TestServiceHealthStart(c *check.C) {
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
 	var tasks []swarm.Task
 	var tasks []swarm.Task
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		tasks = d.GetServiceTasks(c, id)
 		tasks = d.GetServiceTasks(c, id)
-		return tasks, nil
-	}, checker.HasLen, 1)
+		return tasks, ""
+	}, checker.HasLen(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	task := tasks[0]
 	task := tasks[0]
 
 
 	// wait for task to start
 	// wait for task to start
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		task = d.GetTask(c, task.ID)
 		task = d.GetTask(c, task.ID)
-		return task.Status.State, nil
-	}, checker.Equals, swarm.TaskStateStarting)
+		return task.Status.State, ""
+	}, checker.Equals(swarm.TaskStateStarting)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	containerID := task.Status.ContainerStatus.ContainerID
 	containerID := task.Status.ContainerStatus.ContainerID
 
 
 	// wait for health check to work
 	// wait for health check to work
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		out, _ := d.Cmd("inspect", "--format={{.State.Health.FailingStreak}}", containerID)
 		out, _ := d.Cmd("inspect", "--format={{.State.Health.FailingStreak}}", containerID)
 		failingStreak, _ := strconv.Atoi(strings.TrimSpace(out))
 		failingStreak, _ := strconv.Atoi(strings.TrimSpace(out))
-		return failingStreak, nil
-	}, checker.GreaterThan, 0)
+		return failingStreak, ""
+	}, checker.GreaterThan(0)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// task should be blocked at starting status
 	// task should be blocked at starting status
 	task = d.GetTask(c, task.ID)
 	task = d.GetTask(c, task.ID)
-	c.Assert(task.Status.State, check.Equals, swarm.TaskStateStarting)
+	assert.Equal(c, task.Status.State, swarm.TaskStateStarting)
 
 
 	// make it healthy
 	// make it healthy
 	d.Cmd("exec", containerID, "touch", "/status")
 	d.Cmd("exec", containerID, "touch", "/status")
 
 
 	// Task should be at running status
 	// Task should be at running status
-	waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
+	poll.WaitOn(c, pollCheck(c, func(c *testing.T) (interface{}, string) {
 		task = d.GetTask(c, task.ID)
 		task = d.GetTask(c, task.ID)
-		return task.Status.State, nil
-	}, checker.Equals, swarm.TaskStateRunning)
+		return task.Status.State, ""
+	}, checker.Equals(swarm.TaskStateRunning)), poll.WithTimeout(defaultReconciliationTimeout))
+
 }
 }

+ 32 - 32
integration-cli/docker_cli_service_logs_test.go

@@ -8,13 +8,14 @@ import (
 	"io"
 	"io"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
+	"gotest.tools/poll"
 )
 )
 
 
 type logMessage struct {
 type logMessage struct {
@@ -22,7 +23,7 @@ type logMessage struct {
 	data []byte
 	data []byte
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogs(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogs(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	// we have multiple services here for detecting the goroutine issue #28915
 	// we have multiple services here for detecting the goroutine issue #28915
@@ -39,9 +40,8 @@ func (s *DockerSwarmSuite) TestServiceLogs(c *check.C) {
 	}
 	}
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout,
-		d.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{"busybox:latest": len(services)})
+	poll.WaitOn(c, pollCheck(c,
+		d.CheckRunningTaskImages, checker.DeepEquals(map[string]int{"busybox:latest": len(services)})), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	for name, message := range services {
 	for name, message := range services {
 		out, err := d.Cmd("service", "logs", name)
 		out, err := d.Cmd("service", "logs", name)
@@ -54,22 +54,22 @@ func (s *DockerSwarmSuite) TestServiceLogs(c *check.C) {
 // countLogLines returns a closure that can be used with waitAndAssert to
 // countLogLines returns a closure that can be used with waitAndAssert to
 // verify that a minimum number of expected container log messages have been
 // verify that a minimum number of expected container log messages have been
 // output.
 // output.
-func countLogLines(d *daemon.Daemon, name string) func(*check.C) (interface{}, check.CommentInterface) {
-	return func(c *check.C) (interface{}, check.CommentInterface) {
+func countLogLines(d *daemon.Daemon, name string) func(*testing.T) (interface{}, string) {
+	return func(c *testing.T) (interface{}, string) {
 		result := icmd.RunCmd(d.Command("service", "logs", "-t", "--raw", name))
 		result := icmd.RunCmd(d.Command("service", "logs", "-t", "--raw", name))
 		result.Assert(c, icmd.Expected{})
 		result.Assert(c, icmd.Expected{})
 		// if this returns an emptystring, trying to split it later will return
 		// if this returns an emptystring, trying to split it later will return
 		// an array containing emptystring. a valid log line will NEVER be
 		// an array containing emptystring. a valid log line will NEVER be
 		// emptystring because we ask for the timestamp.
 		// emptystring because we ask for the timestamp.
 		if result.Stdout() == "" {
 		if result.Stdout() == "" {
-			return 0, check.Commentf("Empty stdout")
+			return 0, "Empty stdout"
 		}
 		}
 		lines := strings.Split(strings.TrimSpace(result.Stdout()), "\n")
 		lines := strings.Split(strings.TrimSpace(result.Stdout()), "\n")
-		return len(lines), check.Commentf("output, %q", string(result.Stdout()))
+		return len(lines), fmt.Sprintf("output, %q", string(result.Stdout()))
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsCompleteness(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsCompleteness(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServiceLogsCompleteness"
 	name := "TestServiceLogsCompleteness"
@@ -80,9 +80,9 @@ func (s *DockerSwarmSuite) TestServiceLogsCompleteness(c *check.C) {
 	assert.Assert(c, strings.TrimSpace(out) != "")
 	assert.Assert(c, strings.TrimSpace(out) != "")
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 	// and make sure we have all the log lines
 	// and make sure we have all the log lines
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 6)
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(6)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	out, err = d.Cmd("service", "logs", name)
 	out, err = d.Cmd("service", "logs", name)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -96,7 +96,7 @@ func (s *DockerSwarmSuite) TestServiceLogsCompleteness(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsTail(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsTail(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServiceLogsTail"
 	name := "TestServiceLogsTail"
@@ -107,8 +107,8 @@ func (s *DockerSwarmSuite) TestServiceLogsTail(c *check.C) {
 	assert.Assert(c, strings.TrimSpace(out) != "")
 	assert.Assert(c, strings.TrimSpace(out) != "")
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 6)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(6)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	out, err = d.Cmd("service", "logs", "--tail=2", name)
 	out, err = d.Cmd("service", "logs", "--tail=2", name)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -120,7 +120,7 @@ func (s *DockerSwarmSuite) TestServiceLogsTail(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsSince(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsSince(c *testing.T) {
 	// See DockerSuite.TestLogsSince, which is where this comes from
 	// See DockerSuite.TestLogsSince, which is where this comes from
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
@@ -129,9 +129,9 @@ func (s *DockerSwarmSuite) TestServiceLogsSince(c *check.C) {
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "for i in $(seq 1 3); do sleep .1; echo log$i; done; sleep 10000000")
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "busybox", "sh", "-c", "for i in $(seq 1 3); do sleep .1; echo log$i; done; sleep 10000000")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	assert.Assert(c, strings.TrimSpace(out) != "")
 	assert.Assert(c, strings.TrimSpace(out) != "")
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 	// wait a sec for the logs to come in
 	// wait a sec for the logs to come in
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 3)
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(3)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	out, err = d.Cmd("service", "logs", "-t", name)
 	out, err = d.Cmd("service", "logs", "-t", name)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -155,7 +155,7 @@ func (s *DockerSwarmSuite) TestServiceLogsSince(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsFollow(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsFollow(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServiceLogsFollow"
 	name := "TestServiceLogsFollow"
@@ -165,7 +165,7 @@ func (s *DockerSwarmSuite) TestServiceLogsFollow(c *check.C) {
 	assert.Assert(c, strings.TrimSpace(out) != "")
 	assert.Assert(c, strings.TrimSpace(out) != "")
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	args := []string{"service", "logs", "-f", name}
 	args := []string{"service", "logs", "-f", name}
 	cmd := exec.Command(dockerBinary, d.PrependHostArg(args)...)
 	cmd := exec.Command(dockerBinary, d.PrependHostArg(args)...)
@@ -201,7 +201,7 @@ func (s *DockerSwarmSuite) TestServiceLogsFollow(c *check.C) {
 	assert.NilError(c, cmd.Process.Kill())
 	assert.NilError(c, cmd.Process.Kill())
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsTaskLogs(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsTaskLogs(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServicelogsTaskLogs"
 	name := "TestServicelogsTaskLogs"
@@ -228,8 +228,8 @@ func (s *DockerSwarmSuite) TestServiceLogsTaskLogs(c *check.C) {
 	result.Assert(c, icmd.Expected{Out: id})
 	result.Assert(c, icmd.Expected{Out: id})
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, replicas)
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 6*replicas)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(replicas)), poll.WithTimeout(defaultReconciliationTimeout))
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(6*replicas)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// get the task ids
 	// get the task ids
 	result = icmd.RunCmd(d.Command("service", "ps", "-q", name))
 	result = icmd.RunCmd(d.Command("service", "ps", "-q", name))
@@ -254,7 +254,7 @@ func (s *DockerSwarmSuite) TestServiceLogsTaskLogs(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsTTY(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsTTY(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServiceLogsTTY"
 	name := "TestServiceLogsTTY"
@@ -281,9 +281,9 @@ func (s *DockerSwarmSuite) TestServiceLogsTTY(c *check.C) {
 	result.Assert(c, icmd.Expected{Out: id})
 	result.Assert(c, icmd.Expected{Out: id})
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 	// and make sure we have all the log lines
 	// and make sure we have all the log lines
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 2)
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(2)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	cmd := d.Command("service", "logs", "--raw", name)
 	cmd := d.Command("service", "logs", "--raw", name)
 	result = icmd.RunCmd(cmd)
 	result = icmd.RunCmd(cmd)
@@ -292,7 +292,7 @@ func (s *DockerSwarmSuite) TestServiceLogsTTY(c *check.C) {
 	result.Assert(c, icmd.Expected{Out: "out\r\nerr\r\n"})
 	result.Assert(c, icmd.Expected{Out: "out\r\nerr\r\n"})
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsNoHangDeletedContainer(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsNoHangDeletedContainer(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServiceLogsNoHangDeletedContainer"
 	name := "TestServiceLogsNoHangDeletedContainer"
@@ -315,9 +315,9 @@ func (s *DockerSwarmSuite) TestServiceLogsNoHangDeletedContainer(c *check.C) {
 	assert.Assert(c, id != "")
 	assert.Assert(c, id != "")
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 	// and make sure we have all the log lines
 	// and make sure we have all the log lines
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 2)
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(2)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// now find and nuke the container
 	// now find and nuke the container
 	result = icmd.RunCmd(d.Command("ps", "-q"))
 	result = icmd.RunCmd(d.Command("ps", "-q"))
@@ -341,7 +341,7 @@ func (s *DockerSwarmSuite) TestServiceLogsNoHangDeletedContainer(c *check.C) {
 	result.Assert(c, icmd.Expected{})
 	result.Assert(c, icmd.Expected{})
 }
 }
 
 
-func (s *DockerSwarmSuite) TestServiceLogsDetails(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceLogsDetails(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	name := "TestServiceLogsDetails"
 	name := "TestServiceLogsDetails"
@@ -368,9 +368,9 @@ func (s *DockerSwarmSuite) TestServiceLogsDetails(c *check.C) {
 	assert.Assert(c, id != "")
 	assert.Assert(c, id != "")
 
 
 	// make sure task has been deployed
 	// make sure task has been deployed
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 	// and make sure we have all the log lines
 	// and make sure we have all the log lines
-	waitAndAssert(c, defaultReconciliationTimeout, countLogLines(d, name), checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, countLogLines(d, name), checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// First, test without pretty printing
 	// First, test without pretty printing
 	// call service logs with details. set raw to skip pretty printing
 	// call service logs with details. set raw to skip pretty printing

+ 2 - 2
integration-cli/docker_cli_service_scale_test.go

@@ -5,12 +5,12 @@ package main
 import (
 import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSwarmSuite) TestServiceScale(c *check.C) {
+func (s *DockerSwarmSuite) TestServiceScale(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	service1Name := "TestService1"
 	service1Name := "TestService1"

+ 2 - 2
integration-cli/docker_cli_sni_test.go

@@ -9,12 +9,12 @@ import (
 	"net/url"
 	"net/url"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestClientSetsTLSServerName(c *check.C) {
+func (s *DockerSuite) TestClientSetsTLSServerName(c *testing.T) {
 	c.Skip("Flakey test")
 	c.Skip("Flakey test")
 	// there may be more than one hit to the server for each registry request
 	// there may be more than one hit to the server for each registry request
 	var serverNameReceived []string
 	var serverNameReceived []string

+ 24 - 26
integration-cli/docker_cli_start_test.go

@@ -3,17 +3,16 @@ package main
 import (
 import (
 	"fmt"
 	"fmt"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
 // Regression test for https://github.com/docker/docker/issues/7843
 // Regression test for https://github.com/docker/docker/issues/7843
-func (s *DockerSuite) TestStartAttachReturnsOnError(c *check.C) {
+func (s *DockerSuite) TestStartAttachReturnsOnError(c *testing.T) {
 	// Windows does not support link
 	// Windows does not support link
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "run", "--name", "test", "busybox")
 	dockerCmd(c, "run", "--name", "test", "busybox")
@@ -21,7 +20,7 @@ func (s *DockerSuite) TestStartAttachReturnsOnError(c *check.C) {
 	// Expect this to fail because the above container is stopped, this is what we want
 	// Expect this to fail because the above container is stopped, this is what we want
 	out, _, err := dockerCmdWithError("run", "--name", "test2", "--link", "test:test", "busybox")
 	out, _, err := dockerCmdWithError("run", "--name", "test2", "--link", "test:test", "busybox")
 	// err shouldn't be nil because container test2 try to link to stopped container
 	// err shouldn't be nil because container test2 try to link to stopped container
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 
 
 	ch := make(chan error)
 	ch := make(chan error)
 	go func() {
 	go func() {
@@ -42,7 +41,7 @@ func (s *DockerSuite) TestStartAttachReturnsOnError(c *check.C) {
 }
 }
 
 
 // gh#8555: Exit code should be passed through when using start -a
 // gh#8555: Exit code should be passed through when using start -a
-func (s *DockerSuite) TestStartAttachCorrectExitCode(c *check.C) {
+func (s *DockerSuite) TestStartAttachCorrectExitCode(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "sh", "-c", "sleep 2; exit 1").Stdout()
 	out := cli.DockerCmd(c, "run", "-d", "busybox", "sh", "-c", "sleep 2; exit 1").Stdout()
 	out = strings.TrimSpace(out)
 	out = strings.TrimSpace(out)
@@ -55,7 +54,7 @@ func (s *DockerSuite) TestStartAttachCorrectExitCode(c *check.C) {
 	})
 	})
 }
 }
 
 
-func (s *DockerSuite) TestStartAttachSilent(c *check.C) {
+func (s *DockerSuite) TestStartAttachSilent(c *testing.T) {
 	name := "teststartattachcorrectexitcode"
 	name := "teststartattachcorrectexitcode"
 	dockerCmd(c, "run", "--name", name, "busybox", "echo", "test")
 	dockerCmd(c, "run", "--name", name, "busybox", "echo", "test")
 
 
@@ -64,35 +63,34 @@ func (s *DockerSuite) TestStartAttachSilent(c *check.C) {
 
 
 	startOut, _ := dockerCmd(c, "start", "-a", name)
 	startOut, _ := dockerCmd(c, "start", "-a", name)
 	// start -a produced unexpected output
 	// start -a produced unexpected output
-	c.Assert(startOut, checker.Equals, "test\n")
+	assert.Equal(c, startOut, "test\n")
 }
 }
 
 
-func (s *DockerSuite) TestStartRecordError(c *check.C) {
+func (s *DockerSuite) TestStartRecordError(c *testing.T) {
 	// TODO Windows CI: Requires further porting work. Should be possible.
 	// TODO Windows CI: Requires further porting work. Should be possible.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// when container runs successfully, we should not have state.Error
 	// when container runs successfully, we should not have state.Error
 	dockerCmd(c, "run", "-d", "-p", "9999:9999", "--name", "test", "busybox", "top")
 	dockerCmd(c, "run", "-d", "-p", "9999:9999", "--name", "test", "busybox", "top")
 	stateErr := inspectField(c, "test", "State.Error")
 	stateErr := inspectField(c, "test", "State.Error")
 	// Expected to not have state error
 	// Expected to not have state error
-	c.Assert(stateErr, checker.Equals, "")
+	assert.Equal(c, stateErr, "")
 
 
 	// Expect this to fail and records error because of ports conflict
 	// Expect this to fail and records error because of ports conflict
 	out, _, err := dockerCmdWithError("run", "-d", "--name", "test2", "-p", "9999:9999", "busybox", "top")
 	out, _, err := dockerCmdWithError("run", "-d", "--name", "test2", "-p", "9999:9999", "busybox", "top")
 	// err shouldn't be nil because docker run will fail
 	// err shouldn't be nil because docker run will fail
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 
 
 	stateErr = inspectField(c, "test2", "State.Error")
 	stateErr = inspectField(c, "test2", "State.Error")
-	c.Assert(stateErr, checker.Contains, "port is already allocated")
-
+	assert.Assert(c, strings.Contains(stateErr, "port is already allocated"))
 	// Expect the conflict to be resolved when we stop the initial container
 	// Expect the conflict to be resolved when we stop the initial container
 	dockerCmd(c, "stop", "test")
 	dockerCmd(c, "stop", "test")
 	dockerCmd(c, "start", "test2")
 	dockerCmd(c, "start", "test2")
 	stateErr = inspectField(c, "test2", "State.Error")
 	stateErr = inspectField(c, "test2", "State.Error")
 	// Expected to not have state error but got one
 	// Expected to not have state error but got one
-	c.Assert(stateErr, checker.Equals, "")
+	assert.Equal(c, stateErr, "")
 }
 }
 
 
-func (s *DockerSuite) TestStartPausedContainer(c *check.C) {
+func (s *DockerSuite) TestStartPausedContainer(c *testing.T) {
 	// Windows does not support pausing containers
 	// Windows does not support pausing containers
 	testRequires(c, IsPausable)
 	testRequires(c, IsPausable)
 
 
@@ -102,12 +100,12 @@ func (s *DockerSuite) TestStartPausedContainer(c *check.C) {
 
 
 	out, _, err := dockerCmdWithError("start", "testing")
 	out, _, err := dockerCmdWithError("start", "testing")
 	// an error should have been shown that you cannot start paused container
 	// an error should have been shown that you cannot start paused container
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 	// an error should have been shown that you cannot start paused container
 	// an error should have been shown that you cannot start paused container
-	c.Assert(strings.ToLower(out), checker.Contains, "cannot start a paused container, try unpause instead")
+	assert.Assert(c, strings.Contains(strings.ToLower(out), "cannot start a paused container, try unpause instead"))
 }
 }
 
 
-func (s *DockerSuite) TestStartMultipleContainers(c *check.C) {
+func (s *DockerSuite) TestStartMultipleContainers(c *testing.T) {
 	// Windows does not support --link
 	// Windows does not support --link
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	// run a container named 'parent' and create two container link to `parent`
 	// run a container named 'parent' and create two container link to `parent`
@@ -130,7 +128,7 @@ func (s *DockerSuite) TestStartMultipleContainers(c *check.C) {
 	expErr := "failed to start containers: [child_first]"
 	expErr := "failed to start containers: [child_first]"
 	out, _, err := dockerCmdWithError("start", "child_first", "parent", "child_second")
 	out, _, err := dockerCmdWithError("start", "child_first", "parent", "child_second")
 	// err shouldn't be nil because start will fail
 	// err shouldn't be nil because start will fail
-	c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+	assert.Assert(c, err != nil, "out: %s", out)
 	// output does not correspond to what was expected
 	// output does not correspond to what was expected
 	if !(strings.Contains(out, expOut) || strings.Contains(err.Error(), expErr)) {
 	if !(strings.Contains(out, expOut) || strings.Contains(err.Error(), expErr)) {
 		c.Fatalf("Expected out: %v with err: %v  but got out: %v with err: %v", expOut, expErr, out, err)
 		c.Fatalf("Expected out: %v with err: %v  but got out: %v with err: %v", expOut, expErr, out, err)
@@ -143,7 +141,7 @@ func (s *DockerSuite) TestStartMultipleContainers(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestStartAttachMultipleContainers(c *check.C) {
+func (s *DockerSuite) TestStartAttachMultipleContainers(c *testing.T) {
 	// run  multiple containers to test
 	// run  multiple containers to test
 	for _, container := range []string{"test1", "test2", "test3"} {
 	for _, container := range []string{"test1", "test2", "test3"} {
 		runSleepingContainer(c, "--name", container)
 		runSleepingContainer(c, "--name", container)
@@ -158,9 +156,9 @@ func (s *DockerSuite) TestStartAttachMultipleContainers(c *check.C) {
 	for _, option := range []string{"-a", "-i", "-ai"} {
 	for _, option := range []string{"-a", "-i", "-ai"} {
 		out, _, err := dockerCmdWithError("start", option, "test1", "test2", "test3")
 		out, _, err := dockerCmdWithError("start", option, "test1", "test2", "test3")
 		// err shouldn't be nil because start will fail
 		// err shouldn't be nil because start will fail
-		c.Assert(err, checker.NotNil, check.Commentf("out: %s", out))
+		assert.Assert(c, err != nil, "out: %s", out)
 		// output does not correspond to what was expected
 		// output does not correspond to what was expected
-		c.Assert(out, checker.Contains, "you cannot start and attach multiple containers at once")
+		assert.Assert(c, strings.Contains(out, "you cannot start and attach multiple containers at once"))
 	}
 	}
 
 
 	// confirm the state of all the containers be stopped
 	// confirm the state of all the containers be stopped
@@ -172,7 +170,7 @@ func (s *DockerSuite) TestStartAttachMultipleContainers(c *check.C) {
 }
 }
 
 
 // Test case for #23716
 // Test case for #23716
-func (s *DockerSuite) TestStartAttachWithRename(c *check.C) {
+func (s *DockerSuite) TestStartAttachWithRename(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	cli.DockerCmd(c, "create", "-t", "--name", "before", "busybox")
 	cli.DockerCmd(c, "create", "-t", "--name", "before", "busybox")
 	go func() {
 	go func() {
@@ -184,18 +182,18 @@ func (s *DockerSuite) TestStartAttachWithRename(c *check.C) {
 	result := cli.Docker(cli.Args("start", "-a", "before")).Assert(c, icmd.Expected{
 	result := cli.Docker(cli.Args("start", "-a", "before")).Assert(c, icmd.Expected{
 		ExitCode: 137,
 		ExitCode: 137,
 	})
 	})
-	c.Assert(result.Stderr(), checker.Not(checker.Contains), "No such container")
+	assert.Assert(c, !strings.Contains(result.Stderr(), "No such container"))
 }
 }
 
 
-func (s *DockerSuite) TestStartReturnCorrectExitCode(c *check.C) {
+func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) {
 	dockerCmd(c, "create", "--restart=on-failure:2", "--name", "withRestart", "busybox", "sh", "-c", "exit 11")
 	dockerCmd(c, "create", "--restart=on-failure:2", "--name", "withRestart", "busybox", "sh", "-c", "exit 11")
 	dockerCmd(c, "create", "--rm", "--name", "withRm", "busybox", "sh", "-c", "exit 12")
 	dockerCmd(c, "create", "--rm", "--name", "withRm", "busybox", "sh", "-c", "exit 12")
 
 
 	out, exitCode, err := dockerCmdWithError("start", "-a", "withRestart")
 	out, exitCode, err := dockerCmdWithError("start", "-a", "withRestart")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(exitCode, checker.Equals, 11, check.Commentf("out: %s", out))
+	assert.Equal(c, exitCode, 11, fmt.Sprintf("out: %s", out))
 
 
 	out, exitCode, err = dockerCmdWithError("start", "-a", "withRm")
 	out, exitCode, err = dockerCmdWithError("start", "-a", "withRm")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(exitCode, checker.Equals, 12, check.Commentf("out: %s", out))
+	assert.Equal(c, exitCode, 12, fmt.Sprintf("out: %s", out))
 }
 }

+ 7 - 7
integration-cli/docker_cli_stats_test.go

@@ -5,15 +5,15 @@ import (
 	"os/exec"
 	"os/exec"
 	"regexp"
 	"regexp"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/integration-cli/cli"
 	"github.com/docker/docker/integration-cli/cli"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
 
 
-func (s *DockerSuite) TestStatsNoStream(c *check.C) {
+func (s *DockerSuite) TestStatsNoStream(c *testing.T) {
 	// Windows does not support stats
 	// Windows does not support stats
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "-d", "busybox", "top")
@@ -42,7 +42,7 @@ func (s *DockerSuite) TestStatsNoStream(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestStatsContainerNotFound(c *check.C) {
+func (s *DockerSuite) TestStatsContainerNotFound(c *testing.T) {
 	// Windows does not support stats
 	// Windows does not support stats
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -55,7 +55,7 @@ func (s *DockerSuite) TestStatsContainerNotFound(c *check.C) {
 	assert.Assert(c, is.Contains(out, "No such container: notfound"), "Expected to fail on not found container stats with --no-stream, got %q instead", out)
 	assert.Assert(c, is.Contains(out, "No such container: notfound"), "Expected to fail on not found container stats with --no-stream, got %q instead", out)
 }
 }
 
 
-func (s *DockerSuite) TestStatsAllRunningNoStream(c *check.C) {
+func (s *DockerSuite) TestStatsAllRunningNoStream(c *testing.T) {
 	// Windows does not support stats
 	// Windows does not support stats
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -91,7 +91,7 @@ func (s *DockerSuite) TestStatsAllRunningNoStream(c *check.C) {
 	assert.Assert(c, realData != nil, "stat result are empty: %s", out)
 	assert.Assert(c, realData != nil, "stat result are empty: %s", out)
 }
 }
 
 
-func (s *DockerSuite) TestStatsAllNoStream(c *check.C) {
+func (s *DockerSuite) TestStatsAllNoStream(c *testing.T) {
 	// Windows does not support stats
 	// Windows does not support stats
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -121,7 +121,7 @@ func (s *DockerSuite) TestStatsAllNoStream(c *check.C) {
 	assert.Assert(c, realData == nil, "stat result of %s should be empty : %s", id1, out)
 	assert.Assert(c, realData == nil, "stat result of %s should be empty : %s", id1, out)
 }
 }
 
 
-func (s *DockerSuite) TestStatsAllNewContainersAdded(c *check.C) {
+func (s *DockerSuite) TestStatsAllNewContainersAdded(c *testing.T) {
 	// Windows does not support stats
 	// Windows does not support stats
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
@@ -162,7 +162,7 @@ func (s *DockerSuite) TestStatsAllNewContainersAdded(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestStatsFormatAll(c *check.C) {
+func (s *DockerSuite) TestStatsFormatAll(c *testing.T) {
 	// Windows does not support stats
 	// Windows does not support stats
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 

File diff suppressed because it is too large
+ 180 - 202
integration-cli/docker_cli_swarm_test.go


+ 10 - 9
integration-cli/docker_cli_swarm_unix_test.go

@@ -5,22 +5,23 @@ package main
 import (
 import (
 	"encoding/json"
 	"encoding/json"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/api/types/swarm"
 	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/checker"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
+	"gotest.tools/poll"
 )
 )
 
 
-func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *check.C) {
+func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *testing.T) {
 	d := s.AddDaemon(c, true, true)
 	d := s.AddDaemon(c, true, true)
 
 
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--mount", "type=volume,source=my-volume,destination=/foo,volume-driver=customvolumedriver", "--name", "top", "busybox", "top")
 	out, err := d.Cmd("service", "create", "--detach", "--no-resolve-image", "--mount", "type=volume,source=my-volume,destination=/foo,volume-driver=customvolumedriver", "--name", "top", "busybox", "top")
 	assert.NilError(c, err, out)
 	assert.NilError(c, err, out)
 
 
 	// Make sure task stays pending before plugin is available
 	// Make sure task stays pending before plugin is available
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckServiceTasksInStateWithError("top", swarm.TaskStatePending, "missing plugin on 1 node"), checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckServiceTasksInStateWithError("top", swarm.TaskStatePending, "missing plugin on 1 node"), checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	plugin := newVolumePlugin(c, "customvolumedriver")
 	plugin := newVolumePlugin(c, "customvolumedriver")
 	defer plugin.Close()
 	defer plugin.Close()
@@ -34,7 +35,7 @@ func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *check.C) {
 	// this long delay.
 	// this long delay.
 
 
 	// make sure task has been deployed.
 	// make sure task has been deployed.
-	waitAndAssert(c, defaultReconciliationTimeout, d.CheckActiveContainerCount, checker.Equals, 1)
+	poll.WaitOn(c, pollCheck(c, d.CheckActiveContainerCount, checker.Equals(1)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	out, err = d.Cmd("ps", "-q")
 	out, err = d.Cmd("ps", "-q")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -55,7 +56,7 @@ func (s *DockerSwarmSuite) TestSwarmVolumePlugin(c *check.C) {
 }
 }
 
 
 // Test network plugin filter in swarm
 // Test network plugin filter in swarm
-func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *check.C) {
+func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *testing.T) {
 	testRequires(c, IsAmd64)
 	testRequires(c, IsAmd64)
 	d1 := s.AddDaemon(c, true, true)
 	d1 := s.AddDaemon(c, true, true)
 	d2 := s.AddDaemon(c, true, false)
 	d2 := s.AddDaemon(c, true, false)
@@ -80,7 +81,7 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	// wait for tasks ready
 	// wait for tasks ready
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, 2)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals(2)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// remove service
 	// remove service
 	_, err = d1.Cmd("service", "rm", serviceName)
 	_, err = d1.Cmd("service", "rm", serviceName)
@@ -88,7 +89,7 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *check.C) {
 
 
 	// wait to ensure all containers have exited before removing the plugin. Else there's a
 	// wait to ensure all containers have exited before removing the plugin. Else there's a
 	// possibility of container exits erroring out due to plugins being unavailable.
 	// possibility of container exits erroring out due to plugins being unavailable.
-	waitAndAssert(c, defaultReconciliationTimeout, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals, 0)
+	poll.WaitOn(c, pollCheck(c, reducedCheck(sumAsIntegers, d1.CheckActiveContainerCount, d2.CheckActiveContainerCount), checker.Equals(0)), poll.WithTimeout(defaultReconciliationTimeout))
 
 
 	// disable plugin on worker
 	// disable plugin on worker
 	_, err = d2.Cmd("plugin", "disable", "-f", pluginName)
 	_, err = d2.Cmd("plugin", "disable", "-f", pluginName)
@@ -101,6 +102,6 @@ func (s *DockerSwarmSuite) TestSwarmNetworkPluginV2(c *check.C) {
 	_, err = d1.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--mode=global", "--network", networkName, image, "top")
 	_, err = d1.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", serviceName, "--mode=global", "--network", networkName, image, "top")
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
-	waitAndAssert(c, defaultReconciliationTimeout, d1.CheckRunningTaskImages, checker.DeepEquals,
-		map[string]int{image: 1})
+	poll.WaitOn(c, pollCheck(c, d1.CheckRunningTaskImages, checker.DeepEquals(map[string]int{image: 1})), poll.WithTimeout(defaultReconciliationTimeout))
+
 }
 }

+ 5 - 5
integration-cli/docker_cli_top_test.go

@@ -2,13 +2,13 @@ package main
 
 
 import (
 import (
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestTopMultipleArgs(c *check.C) {
+func (s *DockerSuite) TestTopMultipleArgs(c *testing.T) {
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
 
 
@@ -23,7 +23,7 @@ func (s *DockerSuite) TestTopMultipleArgs(c *check.C) {
 	result.Assert(c, expected)
 	result.Assert(c, expected)
 }
 }
 
 
-func (s *DockerSuite) TestTopNonPrivileged(c *check.C) {
+func (s *DockerSuite) TestTopNonPrivileged(c *testing.T) {
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
 
 
@@ -47,7 +47,7 @@ func (s *DockerSuite) TestTopNonPrivileged(c *check.C) {
 // TestTopWindowsCoreProcesses validates that there are lines for the critical
 // TestTopWindowsCoreProcesses validates that there are lines for the critical
 // processes which are found in a Windows container. Note Windows is architecturally
 // processes which are found in a Windows container. Note Windows is architecturally
 // very different to Linux in this regard.
 // very different to Linux in this regard.
-func (s *DockerSuite) TestTopWindowsCoreProcesses(c *check.C) {
+func (s *DockerSuite) TestTopWindowsCoreProcesses(c *testing.T) {
 	testRequires(c, DaemonIsWindows)
 	testRequires(c, DaemonIsWindows)
 	out := runSleepingContainer(c, "-d")
 	out := runSleepingContainer(c, "-d")
 	cleanedContainerID := strings.TrimSpace(out)
 	cleanedContainerID := strings.TrimSpace(out)
@@ -58,7 +58,7 @@ func (s *DockerSuite) TestTopWindowsCoreProcesses(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestTopPrivileged(c *check.C) {
+func (s *DockerSuite) TestTopPrivileged(c *testing.T) {
 	// Windows does not support --privileged
 	// Windows does not support --privileged
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	testRequires(c, DaemonIsLinux, NotUserNamespace)
 	out, _ := dockerCmd(c, "run", "--privileged", "-i", "-d", "busybox", "top")
 	out, _ := dockerCmd(c, "run", "--privileged", "-i", "-d", "busybox", "top")

+ 16 - 16
integration-cli/docker_cli_update_unix_test.go

@@ -8,6 +8,7 @@ import (
 	"fmt"
 	"fmt"
 	"os/exec"
 	"os/exec"
 	"strings"
 	"strings"
+	"testing"
 	"time"
 	"time"
 
 
 	"github.com/creack/pty"
 	"github.com/creack/pty"
@@ -15,11 +16,10 @@ import (
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/pkg/parsers/kernel"
 	"github.com/docker/docker/pkg/parsers/kernel"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
-func (s *DockerSuite) TestUpdateRunningContainer(c *check.C) {
+func (s *DockerSuite) TestUpdateRunningContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 
 
@@ -34,7 +34,7 @@ func (s *DockerSuite) TestUpdateRunningContainer(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "524288000")
 	assert.Equal(c, strings.TrimSpace(out), "524288000")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateRunningContainerWithRestart(c *check.C) {
+func (s *DockerSuite) TestUpdateRunningContainerWithRestart(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 
 
@@ -50,7 +50,7 @@ func (s *DockerSuite) TestUpdateRunningContainerWithRestart(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "524288000")
 	assert.Equal(c, strings.TrimSpace(out), "524288000")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateStoppedContainer(c *check.C) {
+func (s *DockerSuite) TestUpdateStoppedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 
 
@@ -65,7 +65,7 @@ func (s *DockerSuite) TestUpdateStoppedContainer(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "524288000")
 	assert.Equal(c, strings.TrimSpace(out), "524288000")
 }
 }
 
 
-func (s *DockerSuite) TestUpdatePausedContainer(c *check.C) {
+func (s *DockerSuite) TestUpdatePausedContainer(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, cpuShare)
 	testRequires(c, cpuShare)
 
 
@@ -82,7 +82,7 @@ func (s *DockerSuite) TestUpdatePausedContainer(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "500")
 	assert.Equal(c, strings.TrimSpace(out), "500")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateWithUntouchedFields(c *check.C) {
+func (s *DockerSuite) TestUpdateWithUntouchedFields(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, cpuShare)
 	testRequires(c, cpuShare)
@@ -100,7 +100,7 @@ func (s *DockerSuite) TestUpdateWithUntouchedFields(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "800")
 	assert.Equal(c, strings.TrimSpace(out), "800")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateContainerInvalidValue(c *check.C) {
+func (s *DockerSuite) TestUpdateContainerInvalidValue(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 
 
@@ -112,7 +112,7 @@ func (s *DockerSuite) TestUpdateContainerInvalidValue(c *check.C) {
 	assert.Assert(c, strings.Contains(out, expected))
 	assert.Assert(c, strings.Contains(out, expected))
 }
 }
 
 
-func (s *DockerSuite) TestUpdateContainerWithoutFlags(c *check.C) {
+func (s *DockerSuite) TestUpdateContainerWithoutFlags(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 
 
@@ -122,7 +122,7 @@ func (s *DockerSuite) TestUpdateContainerWithoutFlags(c *check.C) {
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateKernelMemory(c *check.C) {
+func (s *DockerSuite) TestUpdateKernelMemory(c *testing.T) {
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 
 
 	name := "test-update-container"
 	name := "test-update-container"
@@ -136,7 +136,7 @@ func (s *DockerSuite) TestUpdateKernelMemory(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "104857600")
 	assert.Equal(c, strings.TrimSpace(out), "104857600")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateKernelMemoryUninitialized(c *check.C) {
+func (s *DockerSuite) TestUpdateKernelMemoryUninitialized(c *testing.T) {
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 	testRequires(c, DaemonIsLinux, kernelMemorySupport)
 
 
 	isNewKernel := CheckKernelVersion(4, 6, 0)
 	isNewKernel := CheckKernelVersion(4, 6, 0)
@@ -183,7 +183,7 @@ func CheckKernelVersion(k, major, minor int) bool {
 	return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) >= 0
 	return kernel.CompareKernelVersion(*GetKernelVersion(), kernel.VersionInfo{Kernel: k, Major: major, Minor: minor}) >= 0
 }
 }
 
 
-func (s *DockerSuite) TestUpdateSwapMemoryOnly(c *check.C) {
+func (s *DockerSuite) TestUpdateSwapMemoryOnly(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, swapMemorySupport)
 	testRequires(c, swapMemorySupport)
@@ -199,7 +199,7 @@ func (s *DockerSuite) TestUpdateSwapMemoryOnly(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "629145600")
 	assert.Equal(c, strings.TrimSpace(out), "629145600")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateInvalidSwapMemory(c *check.C) {
+func (s *DockerSuite) TestUpdateInvalidSwapMemory(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, swapMemorySupport)
 	testRequires(c, swapMemorySupport)
@@ -224,7 +224,7 @@ func (s *DockerSuite) TestUpdateInvalidSwapMemory(c *check.C) {
 	assert.Equal(c, strings.TrimSpace(out), "629145600")
 	assert.Equal(c, strings.TrimSpace(out), "629145600")
 }
 }
 
 
-func (s *DockerSuite) TestUpdateStats(c *check.C) {
+func (s *DockerSuite) TestUpdateStats(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, cpuCfsQuota)
 	testRequires(c, cpuCfsQuota)
@@ -253,7 +253,7 @@ func (s *DockerSuite) TestUpdateStats(c *check.C) {
 	assert.Equal(c, preMemLimit, curMemLimit)
 	assert.Equal(c, preMemLimit, curMemLimit)
 }
 }
 
 
-func (s *DockerSuite) TestUpdateMemoryWithSwapMemory(c *check.C) {
+func (s *DockerSuite) TestUpdateMemoryWithSwapMemory(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, memoryLimitSupport)
 	testRequires(c, swapMemorySupport)
 	testRequires(c, swapMemorySupport)
@@ -267,7 +267,7 @@ func (s *DockerSuite) TestUpdateMemoryWithSwapMemory(c *check.C) {
 	dockerCmd(c, "update", "--memory", "800M", "--memory-swap", "1000M", name)
 	dockerCmd(c, "update", "--memory", "800M", "--memory-swap", "1000M", name)
 }
 }
 
 
-func (s *DockerSuite) TestUpdateNotAffectMonitorRestartPolicy(c *check.C) {
+func (s *DockerSuite) TestUpdateNotAffectMonitorRestartPolicy(c *testing.T) {
 	testRequires(c, DaemonIsLinux, cpuShare)
 	testRequires(c, DaemonIsLinux, cpuShare)
 
 
 	out, _ := dockerCmd(c, "run", "-tid", "--restart=always", "busybox", "sh")
 	out, _ := dockerCmd(c, "run", "-tid", "--restart=always", "busybox", "sh")
@@ -295,7 +295,7 @@ func (s *DockerSuite) TestUpdateNotAffectMonitorRestartPolicy(c *check.C) {
 	assert.NilError(c, waitRun(id))
 	assert.NilError(c, waitRun(id))
 }
 }
 
 
-func (s *DockerSuite) TestUpdateWithNanoCPUs(c *check.C) {
+func (s *DockerSuite) TestUpdateWithNanoCPUs(c *testing.T) {
 	testRequires(c, cpuCfsQuota, cpuCfsPeriod)
 	testRequires(c, cpuCfsQuota, cpuCfsPeriod)
 
 
 	file1 := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"
 	file1 := "/sys/fs/cgroup/cpu/cpu.cfs_quota_us"

+ 13 - 14
integration-cli/docker_cli_userns_test.go

@@ -11,18 +11,17 @@ import (
 	"path/filepath"
 	"path/filepath"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/stringid"
 	"github.com/docker/docker/pkg/system"
 	"github.com/docker/docker/pkg/system"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // user namespaces test: run daemon with remapped root setting
 // user namespaces test: run daemon with remapped root setting
 // 1. validate uid/gid maps are set properly
 // 1. validate uid/gid maps are set properly
 // 2. verify that files created are owned by remapped root
 // 2. verify that files created are owned by remapped root
-func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
+func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *testing.T) {
 	testRequires(c, UserNamespaceInKernel)
 	testRequires(c, UserNamespaceInKernel)
 
 
 	s.d.StartWithBusybox(c, "--userns-remap", "default")
 	s.d.StartWithBusybox(c, "--userns-remap", "default")
@@ -38,7 +37,7 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
 
 
 	// we need to find the uid and gid of the remapped root from the daemon's root dir info
 	// we need to find the uid and gid of the remapped root from the daemon's root dir info
 	uidgid := strings.Split(filepath.Base(s.d.Root), ".")
 	uidgid := strings.Split(filepath.Base(s.d.Root), ".")
-	c.Assert(uidgid, checker.HasLen, 2, check.Commentf("Should have gotten uid/gid strings from root dirname: %s", filepath.Base(s.d.Root)))
+	assert.Equal(c, len(uidgid), 2, fmt.Sprintf("Should have gotten uid/gid strings from root dirname: %s", filepath.Base(s.d.Root)))
 	uid, err := strconv.Atoi(uidgid[0])
 	uid, err := strconv.Atoi(uidgid[0])
 	assert.NilError(c, err, "Can't parse uid")
 	assert.NilError(c, err, "Can't parse uid")
 	gid, err := strconv.Atoi(uidgid[1])
 	gid, err := strconv.Atoi(uidgid[1])
@@ -51,16 +50,16 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
 	assert.NilError(c, err, "Output: %s", out)
 	assert.NilError(c, err, "Output: %s", out)
 
 
 	user := s.findUser(c, "userns")
 	user := s.findUser(c, "userns")
-	c.Assert(uidgid[0], checker.Equals, user)
+	assert.Equal(c, uidgid[0], user)
 
 
 	// check that the created directory is owned by remapped uid:gid
 	// check that the created directory is owned by remapped uid:gid
 	statNotExists, err := system.Stat(tmpDirNotExists)
 	statNotExists, err := system.Stat(tmpDirNotExists)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(statNotExists.UID(), checker.Equals, uint32(uid), check.Commentf("Created directory not owned by remapped root UID"))
-	c.Assert(statNotExists.GID(), checker.Equals, uint32(gid), check.Commentf("Created directory not owned by remapped root GID"))
+	assert.Equal(c, statNotExists.UID(), uint32(uid), "Created directory not owned by remapped root UID")
+	assert.Equal(c, statNotExists.GID(), uint32(gid), "Created directory not owned by remapped root GID")
 
 
 	pid, err := s.d.Cmd("inspect", "--format={{.State.Pid}}", "userns")
 	pid, err := s.d.Cmd("inspect", "--format={{.State.Pid}}", "userns")
-	c.Assert(err, checker.IsNil, check.Commentf("Could not inspect running container: out: %q", pid))
+	assert.Assert(c, err == nil, "Could not inspect running container: out: %q", pid)
 	// check the uid and gid maps for the PID to ensure root is remapped
 	// check the uid and gid maps for the PID to ensure root is remapped
 	// (cmd = cat /proc/<pid>/uid_map | grep -E '0\s+9999\s+1')
 	// (cmd = cat /proc/<pid>/uid_map | grep -E '0\s+9999\s+1')
 	_, err = RunCommandPipelineWithOutput(
 	_, err = RunCommandPipelineWithOutput(
@@ -76,21 +75,21 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
 	// check that the touched file is owned by remapped uid:gid
 	// check that the touched file is owned by remapped uid:gid
 	stat, err := system.Stat(filepath.Join(tmpDir, "testfile"))
 	stat, err := system.Stat(filepath.Join(tmpDir, "testfile"))
 	assert.NilError(c, err)
 	assert.NilError(c, err)
-	c.Assert(stat.UID(), checker.Equals, uint32(uid), check.Commentf("Touched file not owned by remapped root UID"))
-	c.Assert(stat.GID(), checker.Equals, uint32(gid), check.Commentf("Touched file not owned by remapped root GID"))
+	assert.Equal(c, stat.UID(), uint32(uid), "Touched file not owned by remapped root UID")
+	assert.Equal(c, stat.GID(), uint32(gid), "Touched file not owned by remapped root GID")
 
 
 	// use host usernamespace
 	// use host usernamespace
 	out, err = s.d.Cmd("run", "-d", "--name", "userns_skip", "--userns", "host", "busybox", "sh", "-c", "touch /goofy/testfile; top")
 	out, err = s.d.Cmd("run", "-d", "--name", "userns_skip", "--userns", "host", "busybox", "sh", "-c", "touch /goofy/testfile; top")
-	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
+	assert.Assert(c, err == nil, "Output: %s", out)
 	user = s.findUser(c, "userns_skip")
 	user = s.findUser(c, "userns_skip")
 	// userns are skipped, user is root
 	// userns are skipped, user is root
-	c.Assert(user, checker.Equals, "root")
+	assert.Equal(c, user, "root")
 }
 }
 
 
 // findUser finds the uid or name of the user of the first process that runs in a container
 // findUser finds the uid or name of the user of the first process that runs in a container
-func (s *DockerDaemonSuite) findUser(c *check.C, container string) string {
+func (s *DockerDaemonSuite) findUser(c *testing.T, container string) string {
 	out, err := s.d.Cmd("top", container)
 	out, err := s.d.Cmd("top", container)
-	c.Assert(err, checker.IsNil, check.Commentf("Output: %s", out))
+	assert.Assert(c, err == nil, "Output: %s", out)
 	rows := strings.Split(out, "\n")
 	rows := strings.Split(out, "\n")
 	if len(rows) < 2 {
 	if len(rows) < 2 {
 		// No process rows founds
 		// No process rows founds

+ 2 - 2
integration-cli/docker_cli_v2_only_test.go

@@ -5,9 +5,9 @@ import (
 	"io/ioutil"
 	"io/ioutil"
 	"net/http"
 	"net/http"
 	"os"
 	"os"
+	"testing"
 
 
 	"github.com/docker/docker/internal/test/registry"
 	"github.com/docker/docker/internal/test/registry"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
@@ -25,7 +25,7 @@ func makefile(path string, contents string) (string, error) {
 
 
 // TestV2Only ensures that a daemon does not
 // TestV2Only ensures that a daemon does not
 // attempt to contact any v1 registry endpoints.
 // attempt to contact any v1 registry endpoints.
-func (s *DockerRegistrySuite) TestV2Only(c *check.C) {
+func (s *DockerRegistrySuite) TestV2Only(c *testing.T) {
 	reg, err := registry.NewMock(c)
 	reg, err := registry.NewMock(c)
 	defer reg.Close()
 	defer reg.Close()
 	assert.NilError(c, err)
 	assert.NilError(c, err)

+ 119 - 146
integration-cli/docker_cli_volume_test.go

@@ -8,19 +8,18 @@ import (
 	"os/exec"
 	"os/exec"
 	"path/filepath"
 	"path/filepath"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/container"
 	"github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/client"
 	"github.com/docker/docker/client"
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/cli/build"
 	"github.com/docker/docker/integration-cli/cli/build"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	"gotest.tools/icmd"
 	"gotest.tools/icmd"
 )
 )
 
 
-func (s *DockerSuite) TestVolumeCLICreate(c *check.C) {
+func (s *DockerSuite) TestVolumeCLICreate(c *testing.T) {
 	dockerCmd(c, "volume", "create")
 	dockerCmd(c, "volume", "create")
 
 
 	_, _, err := dockerCmdWithError("volume", "create", "-d", "nosuchdriver")
 	_, _, err := dockerCmdWithError("volume", "create", "-d", "nosuchdriver")
@@ -29,31 +28,26 @@ func (s *DockerSuite) TestVolumeCLICreate(c *check.C) {
 	// test using hidden --name option
 	// test using hidden --name option
 	out, _ := dockerCmd(c, "volume", "create", "--name=test")
 	out, _ := dockerCmd(c, "volume", "create", "--name=test")
 	name := strings.TrimSpace(out)
 	name := strings.TrimSpace(out)
-	c.Assert(name, check.Equals, "test")
+	assert.Equal(c, name, "test")
 
 
 	out, _ = dockerCmd(c, "volume", "create", "test2")
 	out, _ = dockerCmd(c, "volume", "create", "test2")
 	name = strings.TrimSpace(out)
 	name = strings.TrimSpace(out)
-	c.Assert(name, check.Equals, "test2")
+	assert.Equal(c, name, "test2")
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLIInspect(c *check.C) {
-	c.Assert(
-		exec.Command(dockerBinary, "volume", "inspect", "doesnotexist").Run(),
-		check.Not(check.IsNil),
-		check.Commentf("volume inspect should error on non-existent volume"),
-	)
-
+func (s *DockerSuite) TestVolumeCLIInspect(c *testing.T) {
+	assert.Assert(c, exec.Command(dockerBinary, "volume", "inspect", "doesnotexist").Run() != nil, "volume inspect should error on non-existent volume")
 	out, _ := dockerCmd(c, "volume", "create")
 	out, _ := dockerCmd(c, "volume", "create")
 	name := strings.TrimSpace(out)
 	name := strings.TrimSpace(out)
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", name)
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", name)
-	c.Assert(strings.TrimSpace(out), check.Equals, name)
+	assert.Equal(c, strings.TrimSpace(out), name)
 
 
 	dockerCmd(c, "volume", "create", "test")
 	dockerCmd(c, "volume", "create", "test")
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", "test")
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", "test")
-	c.Assert(strings.TrimSpace(out), check.Equals, "test")
+	assert.Equal(c, strings.TrimSpace(out), "test")
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLIInspectMulti(c *check.C) {
+func (s *DockerSuite) TestVolumeCLIInspectMulti(c *testing.T) {
 	dockerCmd(c, "volume", "create", "test1")
 	dockerCmd(c, "volume", "create", "test1")
 	dockerCmd(c, "volume", "create", "test2")
 	dockerCmd(c, "volume", "create", "test2")
 	dockerCmd(c, "volume", "create", "test3")
 	dockerCmd(c, "volume", "create", "test3")
@@ -65,12 +59,12 @@ func (s *DockerSuite) TestVolumeCLIInspectMulti(c *check.C) {
 	})
 	})
 
 
 	out := result.Stdout()
 	out := result.Stdout()
-	c.Assert(out, checker.Contains, "test1")
-	c.Assert(out, checker.Contains, "test2")
-	c.Assert(out, checker.Contains, "test3")
+	assert.Assert(c, strings.Contains(out, "test1"))
+	assert.Assert(c, strings.Contains(out, "test2"))
+	assert.Assert(c, strings.Contains(out, "test3"))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLILs(c *check.C) {
+func (s *DockerSuite) TestVolumeCLILs(c *testing.T) {
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
 	dockerCmd(c, "volume", "create", "aaa")
 	dockerCmd(c, "volume", "create", "aaa")
 
 
@@ -83,7 +77,7 @@ func (s *DockerSuite) TestVolumeCLILs(c *check.C) {
 	assertVolumesInList(c, out, []string{"aaa", "soo", "test"})
 	assertVolumesInList(c, out, []string{"aaa", "soo", "test"})
 }
 }
 
 
-func (s *DockerSuite) TestVolumeLsFormat(c *check.C) {
+func (s *DockerSuite) TestVolumeLsFormat(c *testing.T) {
 	dockerCmd(c, "volume", "create", "aaa")
 	dockerCmd(c, "volume", "create", "aaa")
 	dockerCmd(c, "volume", "create", "test")
 	dockerCmd(c, "volume", "create", "test")
 	dockerCmd(c, "volume", "create", "soo")
 	dockerCmd(c, "volume", "create", "soo")
@@ -92,7 +86,7 @@ func (s *DockerSuite) TestVolumeLsFormat(c *check.C) {
 	assertVolumesInList(c, out, []string{"aaa", "soo", "test"})
 	assertVolumesInList(c, out, []string{"aaa", "soo", "test"})
 }
 }
 
 
-func (s *DockerSuite) TestVolumeLsFormatDefaultFormat(c *check.C) {
+func (s *DockerSuite) TestVolumeLsFormatDefaultFormat(c *testing.T) {
 	dockerCmd(c, "volume", "create", "aaa")
 	dockerCmd(c, "volume", "create", "aaa")
 	dockerCmd(c, "volume", "create", "test")
 	dockerCmd(c, "volume", "create", "test")
 	dockerCmd(c, "volume", "create", "soo")
 	dockerCmd(c, "volume", "create", "soo")
@@ -111,7 +105,7 @@ func (s *DockerSuite) TestVolumeLsFormatDefaultFormat(c *check.C) {
 	assertVolumesInList(c, out, []string{"aaa default", "soo default", "test default"})
 	assertVolumesInList(c, out, []string{"aaa default", "soo default", "test default"})
 }
 }
 
 
-func assertVolumesInList(c *check.C, out string, expected []string) {
+func assertVolumesInList(c *testing.T, out string, expected []string) {
 	lines := strings.Split(strings.TrimSpace(string(out)), "\n")
 	lines := strings.Split(strings.TrimSpace(string(out)), "\n")
 	for _, expect := range expected {
 	for _, expect := range expected {
 		found := false
 		found := false
@@ -125,7 +119,7 @@ func assertVolumesInList(c *check.C, out string, expected []string) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLILsFilterDangling(c *check.C) {
+func (s *DockerSuite) TestVolumeCLILsFilterDangling(c *testing.T) {
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
 	dockerCmd(c, "volume", "create", "testnotinuse1")
 	dockerCmd(c, "volume", "create", "testnotinuse1")
 	dockerCmd(c, "volume", "create", "testisinuse1")
 	dockerCmd(c, "volume", "create", "testisinuse1")
@@ -139,55 +133,50 @@ func (s *DockerSuite) TestVolumeCLILsFilterDangling(c *check.C) {
 	out, _ := dockerCmd(c, "volume", "ls")
 	out, _ := dockerCmd(c, "volume", "ls")
 
 
 	// No filter, all volumes should show
 	// No filter, all volumes should show
-	c.Assert(out, checker.Contains, "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
-
+	assert.Assert(c, strings.Contains(out, "testnotinuse1\n"), "expected volume 'testnotinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse1\n"), "expected volume 'testisinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse2\n"), "expected volume 'testisinuse2' in output")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=false")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=false")
 
 
 	// Explicitly disabling dangling
 	// Explicitly disabling dangling
-	c.Assert(out, check.Not(checker.Contains), "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
-
+	assert.Assert(c, !strings.Contains(out, "testnotinuse1\n"), "expected volume 'testnotinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse1\n"), "expected volume 'testisinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse2\n"), "expected volume 'testisinuse2' in output")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=true")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=true")
 
 
 	// Filter "dangling" volumes; only "dangling" (unused) volumes should be in the output
 	// Filter "dangling" volumes; only "dangling" (unused) volumes should be in the output
-	c.Assert(out, checker.Contains, "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
-	c.Assert(out, check.Not(checker.Contains), "testisinuse1\n", check.Commentf("volume 'testisinuse1' in output, but not expected"))
-	c.Assert(out, check.Not(checker.Contains), "testisinuse2\n", check.Commentf("volume 'testisinuse2' in output, but not expected"))
-
+	assert.Assert(c, strings.Contains(out, "testnotinuse1\n"), "expected volume 'testnotinuse1' in output")
+	assert.Assert(c, !strings.Contains(out, "testisinuse1\n"), "volume 'testisinuse1' in output, but not expected")
+	assert.Assert(c, !strings.Contains(out, "testisinuse2\n"), "volume 'testisinuse2' in output, but not expected")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=1")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=1")
 	// Filter "dangling" volumes; only "dangling" (unused) volumes should be in the output, dangling also accept 1
 	// Filter "dangling" volumes; only "dangling" (unused) volumes should be in the output, dangling also accept 1
-	c.Assert(out, checker.Contains, "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
-	c.Assert(out, check.Not(checker.Contains), "testisinuse1\n", check.Commentf("volume 'testisinuse1' in output, but not expected"))
-	c.Assert(out, check.Not(checker.Contains), "testisinuse2\n", check.Commentf("volume 'testisinuse2' in output, but not expected"))
-
+	assert.Assert(c, strings.Contains(out, "testnotinuse1\n"), "expected volume 'testnotinuse1' in output")
+	assert.Assert(c, !strings.Contains(out, "testisinuse1\n"), "volume 'testisinuse1' in output, but not expected")
+	assert.Assert(c, !strings.Contains(out, "testisinuse2\n"), "volume 'testisinuse2' in output, but not expected")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=0")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=0")
 	// dangling=0 is same as dangling=false case
 	// dangling=0 is same as dangling=false case
-	c.Assert(out, check.Not(checker.Contains), "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
-
+	assert.Assert(c, !strings.Contains(out, "testnotinuse1\n"), "expected volume 'testnotinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse1\n"), "expected volume 'testisinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse2\n"), "expected volume 'testisinuse2' in output")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "name=testisin")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "name=testisin")
-	c.Assert(out, check.Not(checker.Contains), "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
-	c.Assert(out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
+	assert.Assert(c, !strings.Contains(out, "testnotinuse1\n"), "expected volume 'testnotinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse1\n"), "expected volume 'testisinuse1' in output")
+	assert.Assert(c, strings.Contains(out, "testisinuse2\n"), "expected volume 'testisinuse2' in output")
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLILsErrorWithInvalidFilterName(c *check.C) {
+func (s *DockerSuite) TestVolumeCLILsErrorWithInvalidFilterName(c *testing.T) {
 	out, _, err := dockerCmdWithError("volume", "ls", "-f", "FOO=123")
 	out, _, err := dockerCmdWithError("volume", "ls", "-f", "FOO=123")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Invalid filter")
+	assert.Assert(c, strings.Contains(out, "Invalid filter"))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLILsWithIncorrectFilterValue(c *check.C) {
+func (s *DockerSuite) TestVolumeCLILsWithIncorrectFilterValue(c *testing.T) {
 	out, _, err := dockerCmdWithError("volume", "ls", "-f", "dangling=invalid")
 	out, _, err := dockerCmdWithError("volume", "ls", "-f", "dangling=invalid")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
-	c.Assert(out, checker.Contains, "Invalid filter")
+	assert.Assert(c, strings.Contains(out, "Invalid filter"))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLIRm(c *check.C) {
+func (s *DockerSuite) TestVolumeCLIRm(c *testing.T) {
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
 	prefix, _ := getPrefixAndSlashFromDaemonPlatform()
 	out, _ := dockerCmd(c, "volume", "create")
 	out, _ := dockerCmd(c, "volume", "create")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
@@ -205,30 +194,25 @@ func (s *DockerSuite) TestVolumeCLIRm(c *check.C) {
 	})
 	})
 
 
 	out, _ = dockerCmd(c, "run", "--volumes-from=test", "--name=test2", "busybox", "sh", "-c", "cat /foo/bar")
 	out, _ = dockerCmd(c, "run", "--volumes-from=test", "--name=test2", "busybox", "sh", "-c", "cat /foo/bar")
-	c.Assert(strings.TrimSpace(out), check.Equals, "hello")
+	assert.Equal(c, strings.TrimSpace(out), "hello")
 	dockerCmd(c, "rm", "-fv", "test2")
 	dockerCmd(c, "rm", "-fv", "test2")
 	dockerCmd(c, "volume", "inspect", volumeID)
 	dockerCmd(c, "volume", "inspect", volumeID)
 	dockerCmd(c, "rm", "-f", "test")
 	dockerCmd(c, "rm", "-f", "test")
 
 
 	out, _ = dockerCmd(c, "run", "--name=test2", "-v", volumeID+":"+prefix+"/foo", "busybox", "sh", "-c", "cat /foo/bar")
 	out, _ = dockerCmd(c, "run", "--name=test2", "-v", volumeID+":"+prefix+"/foo", "busybox", "sh", "-c", "cat /foo/bar")
-	c.Assert(strings.TrimSpace(out), check.Equals, "hello", check.Commentf("volume data was removed"))
+	assert.Equal(c, strings.TrimSpace(out), "hello", "volume data was removed")
 	dockerCmd(c, "rm", "test2")
 	dockerCmd(c, "rm", "test2")
 
 
 	dockerCmd(c, "volume", "rm", volumeID)
 	dockerCmd(c, "volume", "rm", volumeID)
-	c.Assert(
-		exec.Command("volume", "rm", "doesnotexist").Run(),
-		check.Not(check.IsNil),
-		check.Commentf("volume rm should fail with non-existent volume"),
-	)
+	assert.Assert(c, exec.Command("volume", "rm", "doesnotexist").Run() != nil, "volume rm should fail with non-existent volume")
 }
 }
 
 
 // FIXME(vdemeester) should be a unit test in cli/command/volume package
 // FIXME(vdemeester) should be a unit test in cli/command/volume package
-func (s *DockerSuite) TestVolumeCLINoArgs(c *check.C) {
+func (s *DockerSuite) TestVolumeCLINoArgs(c *testing.T) {
 	out, _ := dockerCmd(c, "volume")
 	out, _ := dockerCmd(c, "volume")
 	// no args should produce the cmd usage output
 	// no args should produce the cmd usage output
 	usage := "Usage:	docker volume COMMAND"
 	usage := "Usage:	docker volume COMMAND"
-	c.Assert(out, checker.Contains, usage)
-
+	assert.Assert(c, strings.Contains(out, usage))
 	// invalid arg should error and show the command usage on stderr
 	// invalid arg should error and show the command usage on stderr
 	icmd.RunCommand(dockerBinary, "volume", "somearg").Assert(c, icmd.Expected{
 	icmd.RunCommand(dockerBinary, "volume", "somearg").Assert(c, icmd.Expected{
 		ExitCode: 1,
 		ExitCode: 1,
@@ -243,20 +227,20 @@ func (s *DockerSuite) TestVolumeCLINoArgs(c *check.C) {
 		Error:    "exit status 125",
 		Error:    "exit status 125",
 		Err:      usage,
 		Err:      usage,
 	})
 	})
-	c.Assert(result.Stderr(), checker.Contains, "unknown flag: --no-such-flag")
+	assert.Assert(c, strings.Contains(result.Stderr(), "unknown flag: --no-such-flag"))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLIInspectTmplError(c *check.C) {
+func (s *DockerSuite) TestVolumeCLIInspectTmplError(c *testing.T) {
 	out, _ := dockerCmd(c, "volume", "create")
 	out, _ := dockerCmd(c, "volume", "create")
 	name := strings.TrimSpace(out)
 	name := strings.TrimSpace(out)
 
 
 	out, exitCode, err := dockerCmdWithError("volume", "inspect", "--format='{{ .FooBar }}'", name)
 	out, exitCode, err := dockerCmdWithError("volume", "inspect", "--format='{{ .FooBar }}'", name)
-	c.Assert(err, checker.NotNil, check.Commentf("Output: %s", out))
-	c.Assert(exitCode, checker.Equals, 1, check.Commentf("Output: %s", out))
-	c.Assert(out, checker.Contains, "Template parsing error")
+	assert.Assert(c, err != nil, "Output: %s", out)
+	assert.Equal(c, exitCode, 1, fmt.Sprintf("Output: %s", out))
+	assert.Assert(c, strings.Contains(out, "Template parsing error"))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLICreateWithOpts(c *check.C) {
+func (s *DockerSuite) TestVolumeCLICreateWithOpts(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	dockerCmd(c, "volume", "create", "-d", "local", "test", "--opt=type=tmpfs", "--opt=device=tmpfs", "--opt=o=size=1m,uid=1000")
 	dockerCmd(c, "volume", "create", "-d", "local", "test", "--opt=type=tmpfs", "--opt=device=tmpfs", "--opt=o=size=1m,uid=1000")
@@ -269,18 +253,18 @@ func (s *DockerSuite) TestVolumeCLICreateWithOpts(c *check.C) {
 			found = true
 			found = true
 			info := strings.Fields(m)
 			info := strings.Fields(m)
 			// tmpfs on <path> type tmpfs (rw,relatime,size=1024k,uid=1000)
 			// tmpfs on <path> type tmpfs (rw,relatime,size=1024k,uid=1000)
-			c.Assert(info[0], checker.Equals, "tmpfs")
-			c.Assert(info[2], checker.Equals, "/foo")
-			c.Assert(info[4], checker.Equals, "tmpfs")
-			c.Assert(info[5], checker.Contains, "uid=1000")
-			c.Assert(info[5], checker.Contains, "size=1024k")
+			assert.Equal(c, info[0], "tmpfs")
+			assert.Equal(c, info[2], "/foo")
+			assert.Equal(c, info[4], "tmpfs")
+			assert.Assert(c, strings.Contains(info[5], "uid=1000"))
+			assert.Assert(c, strings.Contains(info[5], "size=1024k"))
 			break
 			break
 		}
 		}
 	}
 	}
-	c.Assert(found, checker.Equals, true)
+	assert.Equal(c, found, true)
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLICreateLabel(c *check.C) {
+func (s *DockerSuite) TestVolumeCLICreateLabel(c *testing.T) {
 	testVol := "testvolcreatelabel"
 	testVol := "testvolcreatelabel"
 	testLabel := "foo"
 	testLabel := "foo"
 	testValue := "bar"
 	testValue := "bar"
@@ -289,10 +273,10 @@ func (s *DockerSuite) TestVolumeCLICreateLabel(c *check.C) {
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 
 
 	out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Labels."+testLabel+" }}", testVol)
 	out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Labels."+testLabel+" }}", testVol)
-	c.Assert(strings.TrimSpace(out), check.Equals, testValue)
+	assert.Equal(c, strings.TrimSpace(out), testValue)
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLICreateLabelMultiple(c *check.C) {
+func (s *DockerSuite) TestVolumeCLICreateLabelMultiple(c *testing.T) {
 	testVol := "testvolcreatelabel"
 	testVol := "testvolcreatelabel"
 
 
 	testLabels := map[string]string{
 	testLabels := map[string]string{
@@ -315,11 +299,11 @@ func (s *DockerSuite) TestVolumeCLICreateLabelMultiple(c *check.C) {
 
 
 	for k, v := range testLabels {
 	for k, v := range testLabels {
 		out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Labels."+k+" }}", testVol)
 		out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Labels."+k+" }}", testVol)
-		c.Assert(strings.TrimSpace(out), check.Equals, v)
+		assert.Equal(c, strings.TrimSpace(out), v)
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLILsFilterLabels(c *check.C) {
+func (s *DockerSuite) TestVolumeCLILsFilterLabels(c *testing.T) {
 	testVol1 := "testvolcreatelabel-1"
 	testVol1 := "testvolcreatelabel-1"
 	_, _, err := dockerCmdWithError("volume", "create", "--label", "foo=bar1", testVol1)
 	_, _, err := dockerCmdWithError("volume", "create", "--label", "foo=bar1", testVol1)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
@@ -331,25 +315,23 @@ func (s *DockerSuite) TestVolumeCLILsFilterLabels(c *check.C) {
 	out, _ := dockerCmd(c, "volume", "ls", "--filter", "label=foo")
 	out, _ := dockerCmd(c, "volume", "ls", "--filter", "label=foo")
 
 
 	// filter with label=key
 	// filter with label=key
-	c.Assert(out, checker.Contains, "testvolcreatelabel-1\n", check.Commentf("expected volume 'testvolcreatelabel-1' in output"))
-	c.Assert(out, checker.Contains, "testvolcreatelabel-2\n", check.Commentf("expected volume 'testvolcreatelabel-2' in output"))
-
+	assert.Assert(c, strings.Contains(out, "testvolcreatelabel-1\n"), "expected volume 'testvolcreatelabel-1' in output")
+	assert.Assert(c, strings.Contains(out, "testvolcreatelabel-2\n"), "expected volume 'testvolcreatelabel-2' in output")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=foo=bar1")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=foo=bar1")
 
 
 	// filter with label=key=value
 	// filter with label=key=value
-	c.Assert(out, checker.Contains, "testvolcreatelabel-1\n", check.Commentf("expected volume 'testvolcreatelabel-1' in output"))
-	c.Assert(out, check.Not(checker.Contains), "testvolcreatelabel-2\n", check.Commentf("expected volume 'testvolcreatelabel-2 in output"))
-
+	assert.Assert(c, strings.Contains(out, "testvolcreatelabel-1\n"), "expected volume 'testvolcreatelabel-1' in output")
+	assert.Assert(c, !strings.Contains(out, "testvolcreatelabel-2\n"), "expected volume 'testvolcreatelabel-2 in output")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=non-exist")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=non-exist")
 	outArr := strings.Split(strings.TrimSpace(out), "\n")
 	outArr := strings.Split(strings.TrimSpace(out), "\n")
-	c.Assert(len(outArr), check.Equals, 1, check.Commentf("\n%s", out))
+	assert.Equal(c, len(outArr), 1, fmt.Sprintf("\n%s", out))
 
 
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=foo=non-exist")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=foo=non-exist")
 	outArr = strings.Split(strings.TrimSpace(out), "\n")
 	outArr = strings.Split(strings.TrimSpace(out), "\n")
-	c.Assert(len(outArr), check.Equals, 1, check.Commentf("\n%s", out))
+	assert.Equal(c, len(outArr), 1, fmt.Sprintf("\n%s", out))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLILsFilterDrivers(c *check.C) {
+func (s *DockerSuite) TestVolumeCLILsFilterDrivers(c *testing.T) {
 	// using default volume driver local to create volumes
 	// using default volume driver local to create volumes
 	testVol1 := "testvol-1"
 	testVol1 := "testvol-1"
 	_, _, err := dockerCmdWithError("volume", "create", testVol1)
 	_, _, err := dockerCmdWithError("volume", "create", testVol1)
@@ -361,26 +343,25 @@ func (s *DockerSuite) TestVolumeCLILsFilterDrivers(c *check.C) {
 
 
 	// filter with driver=local
 	// filter with driver=local
 	out, _ := dockerCmd(c, "volume", "ls", "--filter", "driver=local")
 	out, _ := dockerCmd(c, "volume", "ls", "--filter", "driver=local")
-	c.Assert(out, checker.Contains, "testvol-1\n", check.Commentf("expected volume 'testvol-1' in output"))
-	c.Assert(out, checker.Contains, "testvol-2\n", check.Commentf("expected volume 'testvol-2' in output"))
-
+	assert.Assert(c, strings.Contains(out, "testvol-1\n"), "expected volume 'testvol-1' in output")
+	assert.Assert(c, strings.Contains(out, "testvol-2\n"), "expected volume 'testvol-2' in output")
 	// filter with driver=invaliddriver
 	// filter with driver=invaliddriver
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=invaliddriver")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=invaliddriver")
 	outArr := strings.Split(strings.TrimSpace(out), "\n")
 	outArr := strings.Split(strings.TrimSpace(out), "\n")
-	c.Assert(len(outArr), check.Equals, 1, check.Commentf("\n%s", out))
+	assert.Equal(c, len(outArr), 1, fmt.Sprintf("\n%s", out))
 
 
 	// filter with driver=loca
 	// filter with driver=loca
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=loca")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=loca")
 	outArr = strings.Split(strings.TrimSpace(out), "\n")
 	outArr = strings.Split(strings.TrimSpace(out), "\n")
-	c.Assert(len(outArr), check.Equals, 1, check.Commentf("\n%s", out))
+	assert.Equal(c, len(outArr), 1, fmt.Sprintf("\n%s", out))
 
 
 	// filter with driver=
 	// filter with driver=
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=")
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=")
 	outArr = strings.Split(strings.TrimSpace(out), "\n")
 	outArr = strings.Split(strings.TrimSpace(out), "\n")
-	c.Assert(len(outArr), check.Equals, 1, check.Commentf("\n%s", out))
+	assert.Equal(c, len(outArr), 1, fmt.Sprintf("\n%s", out))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLIRmForceUsage(c *check.C) {
+func (s *DockerSuite) TestVolumeCLIRmForceUsage(c *testing.T) {
 	out, _ := dockerCmd(c, "volume", "create")
 	out, _ := dockerCmd(c, "volume", "create")
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
 
 
@@ -388,13 +369,13 @@ func (s *DockerSuite) TestVolumeCLIRmForceUsage(c *check.C) {
 	dockerCmd(c, "volume", "rm", "--force", "nonexist")
 	dockerCmd(c, "volume", "rm", "--force", "nonexist")
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCLIRmForce(c *check.C) {
+func (s *DockerSuite) TestVolumeCLIRmForce(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	name := "test"
 	name := "test"
 	out, _ := dockerCmd(c, "volume", "create", name)
 	out, _ := dockerCmd(c, "volume", "create", name)
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
-	c.Assert(id, checker.Equals, name)
+	assert.Equal(c, id, name)
 
 
 	out, _ = dockerCmd(c, "volume", "inspect", "--format", "{{.Mountpoint}}", name)
 	out, _ = dockerCmd(c, "volume", "inspect", "--format", "{{.Mountpoint}}", name)
 	assert.Assert(c, strings.TrimSpace(out) != "")
 	assert.Assert(c, strings.TrimSpace(out) != "")
@@ -404,19 +385,19 @@ func (s *DockerSuite) TestVolumeCLIRmForce(c *check.C) {
 
 
 	dockerCmd(c, "volume", "rm", "-f", name)
 	dockerCmd(c, "volume", "rm", "-f", name)
 	out, _ = dockerCmd(c, "volume", "ls")
 	out, _ = dockerCmd(c, "volume", "ls")
-	c.Assert(out, checker.Not(checker.Contains), name)
+	assert.Assert(c, !strings.Contains(out, name))
 	dockerCmd(c, "volume", "create", name)
 	dockerCmd(c, "volume", "create", name)
 	out, _ = dockerCmd(c, "volume", "ls")
 	out, _ = dockerCmd(c, "volume", "ls")
-	c.Assert(out, checker.Contains, name)
+	assert.Assert(c, strings.Contains(out, name))
 }
 }
 
 
 // TestVolumeCLIRmForceInUse verifies that repeated `docker volume rm -f` calls does not remove a volume
 // TestVolumeCLIRmForceInUse verifies that repeated `docker volume rm -f` calls does not remove a volume
 // if it is in use. Test case for https://github.com/docker/docker/issues/31446
 // if it is in use. Test case for https://github.com/docker/docker/issues/31446
-func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *check.C) {
+func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *testing.T) {
 	name := "testvolume"
 	name := "testvolume"
 	out, _ := dockerCmd(c, "volume", "create", name)
 	out, _ := dockerCmd(c, "volume", "create", name)
 	id := strings.TrimSpace(out)
 	id := strings.TrimSpace(out)
-	c.Assert(id, checker.Equals, name)
+	assert.Equal(c, id, name)
 
 
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	prefix, slash := getPrefixAndSlashFromDaemonPlatform()
 	out, _ = dockerCmd(c, "create", "-v", "testvolume:"+prefix+slash+"foo", "busybox")
 	out, _ = dockerCmd(c, "create", "-v", "testvolume:"+prefix+slash+"foo", "busybox")
@@ -426,8 +407,7 @@ func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *check.C) {
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "volume is in use")
 	assert.ErrorContains(c, err, "volume is in use")
 	out, _ = dockerCmd(c, "volume", "ls")
 	out, _ = dockerCmd(c, "volume", "ls")
-	c.Assert(out, checker.Contains, name)
-
+	assert.Assert(c, strings.Contains(out, name))
 	// The original issue did not _remove_ the volume from the list
 	// The original issue did not _remove_ the volume from the list
 	// the first time. But a second call to `volume rm` removed it.
 	// the first time. But a second call to `volume rm` removed it.
 	// Calling `volume rm` a second time to confirm it's not removed
 	// Calling `volume rm` a second time to confirm it's not removed
@@ -436,29 +416,27 @@ func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *check.C) {
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "")
 	assert.ErrorContains(c, err, "volume is in use")
 	assert.ErrorContains(c, err, "volume is in use")
 	out, _ = dockerCmd(c, "volume", "ls")
 	out, _ = dockerCmd(c, "volume", "ls")
-	c.Assert(out, checker.Contains, name)
-
+	assert.Assert(c, strings.Contains(out, name))
 	// Verify removing the volume after the container is removed works
 	// Verify removing the volume after the container is removed works
 	_, e := dockerCmd(c, "rm", cid)
 	_, e := dockerCmd(c, "rm", cid)
-	c.Assert(e, check.Equals, 0)
+	assert.Equal(c, e, 0)
 
 
 	_, e = dockerCmd(c, "volume", "rm", "-f", name)
 	_, e = dockerCmd(c, "volume", "rm", "-f", name)
-	c.Assert(e, check.Equals, 0)
+	assert.Equal(c, e, 0)
 
 
 	out, e = dockerCmd(c, "volume", "ls")
 	out, e = dockerCmd(c, "volume", "ls")
-	c.Assert(e, check.Equals, 0)
-	c.Assert(out, checker.Not(checker.Contains), name)
+	assert.Equal(c, e, 0)
+	assert.Assert(c, !strings.Contains(out, name))
 }
 }
 
 
-func (s *DockerSuite) TestVolumeCliInspectWithVolumeOpts(c *check.C) {
+func (s *DockerSuite) TestVolumeCliInspectWithVolumeOpts(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	// Without options
 	// Without options
 	name := "test1"
 	name := "test1"
 	dockerCmd(c, "volume", "create", "-d", "local", name)
 	dockerCmd(c, "volume", "create", "-d", "local", name)
 	out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Options }}", name)
 	out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Options }}", name)
-	c.Assert(strings.TrimSpace(out), checker.Contains, "map[]")
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), "map[]"))
 	// With options
 	// With options
 	name = "test2"
 	name = "test2"
 	k1, v1 := "type", "tmpfs"
 	k1, v1 := "type", "tmpfs"
@@ -466,13 +444,13 @@ func (s *DockerSuite) TestVolumeCliInspectWithVolumeOpts(c *check.C) {
 	k3, v3 := "o", "size=1m,uid=1000"
 	k3, v3 := "o", "size=1m,uid=1000"
 	dockerCmd(c, "volume", "create", "-d", "local", name, "--opt", fmt.Sprintf("%s=%s", k1, v1), "--opt", fmt.Sprintf("%s=%s", k2, v2), "--opt", fmt.Sprintf("%s=%s", k3, v3))
 	dockerCmd(c, "volume", "create", "-d", "local", name, "--opt", fmt.Sprintf("%s=%s", k1, v1), "--opt", fmt.Sprintf("%s=%s", k2, v2), "--opt", fmt.Sprintf("%s=%s", k3, v3))
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Options }}", name)
 	out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Options }}", name)
-	c.Assert(strings.TrimSpace(out), checker.Contains, fmt.Sprintf("%s:%s", k1, v1))
-	c.Assert(strings.TrimSpace(out), checker.Contains, fmt.Sprintf("%s:%s", k2, v2))
-	c.Assert(strings.TrimSpace(out), checker.Contains, fmt.Sprintf("%s:%s", k3, v3))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), fmt.Sprintf("%s:%s", k1, v1)))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), fmt.Sprintf("%s:%s", k2, v2)))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), fmt.Sprintf("%s:%s", k3, v3)))
 }
 }
 
 
 // Test case (1) for 21845: duplicate targets for --volumes-from
 // Test case (1) for 21845: duplicate targets for --volumes-from
-func (s *DockerSuite) TestDuplicateMountpointsForVolumesFrom(c *check.C) {
+func (s *DockerSuite) TestDuplicateMountpointsForVolumesFrom(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	image := "vimage"
 	image := "vimage"
@@ -485,19 +463,18 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFrom(c *check.C) {
 
 
 	out, _ := dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1")
 	out, _ := dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1")
 	data1 := strings.TrimSpace(out)
 	data1 := strings.TrimSpace(out)
-	c.Assert(data1, checker.Not(checker.Equals), "")
+	assert.Assert(c, data1 != "")
 
 
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data2")
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data2")
 	data2 := strings.TrimSpace(out)
 	data2 := strings.TrimSpace(out)
-	c.Assert(data2, checker.Not(checker.Equals), "")
+	assert.Assert(c, data2 != "")
 
 
 	// Both volume should exist
 	// Both volume should exist
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Contains, data1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, data2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), data2))
 	out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-d", "busybox", "top")
 	out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-d", "busybox", "top")
-	c.Assert(err, checker.IsNil, check.Commentf("Out: %s", out))
+	assert.Assert(c, err == nil, "Out: %s", out)
 
 
 	// Only the second volume will be referenced, this is backward compatible
 	// Only the second volume will be referenced, this is backward compatible
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
@@ -509,12 +486,12 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFrom(c *check.C) {
 
 
 	// Both volume should not exist
 	// Both volume should not exist
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
 }
 }
 
 
 // Test case (2) for 21845: duplicate targets for --volumes-from and -v (bind)
 // Test case (2) for 21845: duplicate targets for --volumes-from and -v (bind)
-func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C) {
+func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *testing.T) {
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 
 
 	image := "vimage"
 	image := "vimage"
@@ -527,38 +504,36 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *check.C)
 
 
 	out, _ := dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1")
 	out, _ := dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1")
 	data1 := strings.TrimSpace(out)
 	data1 := strings.TrimSpace(out)
-	c.Assert(data1, checker.Not(checker.Equals), "")
+	assert.Assert(c, data1 != "")
 
 
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data2")
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data2")
 	data2 := strings.TrimSpace(out)
 	data2 := strings.TrimSpace(out)
-	c.Assert(data2, checker.Not(checker.Equals), "")
+	assert.Assert(c, data2 != "")
 
 
 	// Both volume should exist
 	// Both volume should exist
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Contains, data1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, data2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), data2))
 	// /tmp/data is automatically created, because we are not using the modern mount API here
 	// /tmp/data is automatically created, because we are not using the modern mount API here
 	out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-v", "/tmp/data:/tmp/data", "-d", "busybox", "top")
 	out, _, err := dockerCmdWithError("run", "--name=app", "--volumes-from=data1", "--volumes-from=data2", "-v", "/tmp/data:/tmp/data", "-d", "busybox", "top")
-	c.Assert(err, checker.IsNil, check.Commentf("Out: %s", out))
+	assert.Assert(c, err == nil, "Out: %s", out)
 
 
 	// No volume will be referenced (mount is /tmp/data), this is backward compatible
 	// No volume will be referenced (mount is /tmp/data), this is backward compatible
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data2)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
 	dockerCmd(c, "rm", "-f", "-v", "app")
 	dockerCmd(c, "rm", "-f", "-v", "app")
 	dockerCmd(c, "rm", "-f", "-v", "data1")
 	dockerCmd(c, "rm", "-f", "-v", "data1")
 	dockerCmd(c, "rm", "-f", "-v", "data2")
 	dockerCmd(c, "rm", "-f", "-v", "data2")
 
 
 	// Both volume should not exist
 	// Both volume should not exist
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
 }
 }
 
 
 // Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
 // Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
-func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C) {
+func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *testing.T) {
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 	testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
 
 
 	image := "vimage"
 	image := "vimage"
@@ -571,17 +546,16 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C
 
 
 	out, _ := dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1")
 	out, _ := dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data1")
 	data1 := strings.TrimSpace(out)
 	data1 := strings.TrimSpace(out)
-	c.Assert(data1, checker.Not(checker.Equals), "")
+	assert.Assert(c, data1 != "")
 
 
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data2")
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "data2")
 	data2 := strings.TrimSpace(out)
 	data2 := strings.TrimSpace(out)
-	c.Assert(data2, checker.Not(checker.Equals), "")
+	assert.Assert(c, data2 != "")
 
 
 	// Both volume should exist
 	// Both volume should exist
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Contains, data1)
-	c.Assert(strings.TrimSpace(out), checker.Contains, data2)
-
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, strings.Contains(strings.TrimSpace(out), data2))
 	err := os.MkdirAll("/tmp/data", 0755)
 	err := os.MkdirAll("/tmp/data", 0755)
 	assert.NilError(c, err)
 	assert.NilError(c, err)
 	// Mounts is available in API
 	// Mounts is available in API
@@ -610,15 +584,14 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *check.C
 
 
 	// No volume will be referenced (mount is /tmp/data), this is backward compatible
 	// No volume will be referenced (mount is /tmp/data), this is backward compatible
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data2)
-
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
 	dockerCmd(c, "rm", "-f", "-v", "app")
 	dockerCmd(c, "rm", "-f", "-v", "app")
 	dockerCmd(c, "rm", "-f", "-v", "data1")
 	dockerCmd(c, "rm", "-f", "-v", "data1")
 	dockerCmd(c, "rm", "-f", "-v", "data2")
 	dockerCmd(c, "rm", "-f", "-v", "data2")
 
 
 	// Both volume should not exist
 	// Both volume should not exist
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data1)
-	c.Assert(strings.TrimSpace(out), checker.Not(checker.Contains), data2)
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
 }
 }

+ 11 - 11
integration-cli/docker_deprecated_api_v124_test.go

@@ -6,10 +6,10 @@ package main
 import (
 import (
 	"net/http"
 	"net/http"
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
 	is "gotest.tools/assert/cmp"
 )
 )
@@ -18,7 +18,7 @@ func formatV123StartAPIURL(url string) string {
 	return "/v1.23" + url
 	return "/v1.23" + url
 }
 }
 
 
-func (s *DockerSuite) TestDeprecatedContainerAPIStartHostConfig(c *check.C) {
+func (s *DockerSuite) TestDeprecatedContainerAPIStartHostConfig(c *testing.T) {
 	name := "test-deprecated-api-124"
 	name := "test-deprecated-api-124"
 	dockerCmd(c, "create", "--name", name, "busybox")
 	dockerCmd(c, "create", "--name", name, "busybox")
 	config := map[string]interface{}{
 	config := map[string]interface{}{
@@ -37,7 +37,7 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartHostConfig(c *check.C) {
 	}
 	}
 }
 }
 
 
-func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumeBinds(c *check.C) {
+func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumeBinds(c *testing.T) {
 	// TODO Windows CI: Investigate further why this fails on Windows to Windows CI.
 	// TODO Windows CI: Investigate further why this fails on Windows to Windows CI.
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	path := "/foo"
 	path := "/foo"
@@ -68,7 +68,7 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumeBinds(c *check.C) {
 }
 }
 
 
 // Test for GH#10618
 // Test for GH#10618
-func (s *DockerSuite) TestDeprecatedContainerAPIStartDupVolumeBinds(c *check.C) {
+func (s *DockerSuite) TestDeprecatedContainerAPIStartDupVolumeBinds(c *testing.T) {
 	// TODO Windows to Windows CI - Port this
 	// TODO Windows to Windows CI - Port this
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "testdups"
 	name := "testdups"
@@ -101,7 +101,7 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartDupVolumeBinds(c *check.C)
 	assert.Assert(c, strings.Contains(string(buf), "Duplicate mount point"), "Expected failure due to duplicate bind mounts to same path, instead got: %q with error: %v", string(buf), err)
 	assert.Assert(c, strings.Contains(string(buf), "Duplicate mount point"), "Expected failure due to duplicate bind mounts to same path, instead got: %q with error: %v", string(buf), err)
 }
 }
 
 
-func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumesFrom(c *check.C) {
+func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumesFrom(c *testing.T) {
 	// TODO Windows to Windows CI - Port this
 	// TODO Windows to Windows CI - Port this
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	volName := "voltst"
 	volName := "voltst"
@@ -134,7 +134,7 @@ func (s *DockerSuite) TestDeprecatedContainerAPIStartVolumesFrom(c *check.C) {
 }
 }
 
 
 // #9981 - Allow a docker created volume (ie, one in /var/lib/docker/volumes) to be used to overwrite (via passing in Binds on api start) an existing volume
 // #9981 - Allow a docker created volume (ie, one in /var/lib/docker/volumes) to be used to overwrite (via passing in Binds on api start) an existing volume
-func (s *DockerSuite) TestDeprecatedPostContainerBindNormalVolume(c *check.C) {
+func (s *DockerSuite) TestDeprecatedPostContainerBindNormalVolume(c *testing.T) {
 	// TODO Windows to Windows CI - Port this
 	// TODO Windows to Windows CI - Port this
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	dockerCmd(c, "create", "-v", "/foo", "--name=one", "busybox")
 	dockerCmd(c, "create", "-v", "/foo", "--name=one", "busybox")
@@ -154,7 +154,7 @@ func (s *DockerSuite) TestDeprecatedPostContainerBindNormalVolume(c *check.C) {
 	assert.Equal(c, fooDir2, fooDir, "expected volume path to be %s, got: %s", fooDir, fooDir2)
 	assert.Equal(c, fooDir2, fooDir, "expected volume path to be %s, got: %s", fooDir, fooDir2)
 }
 }
 
 
-func (s *DockerSuite) TestDeprecatedStartWithTooLowMemoryLimit(c *check.C) {
+func (s *DockerSuite) TestDeprecatedStartWithTooLowMemoryLimit(c *testing.T) {
 	// TODO Windows: Port once memory is supported
 	// TODO Windows: Port once memory is supported
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "create", "busybox")
 	out, _ := dockerCmd(c, "create", "busybox")
@@ -179,7 +179,7 @@ func (s *DockerSuite) TestDeprecatedStartWithTooLowMemoryLimit(c *check.C) {
 }
 }
 
 
 // #14640
 // #14640
-func (s *DockerSuite) TestDeprecatedPostContainersStartWithoutLinksInHostConfig(c *check.C) {
+func (s *DockerSuite) TestDeprecatedPostContainersStartWithoutLinksInHostConfig(c *testing.T) {
 	// TODO Windows: Windows doesn't support supplying a hostconfig on start.
 	// TODO Windows: Windows doesn't support supplying a hostconfig on start.
 	// An alternate test could be written to validate the negative testing aspect of this
 	// An alternate test could be written to validate the negative testing aspect of this
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -196,7 +196,7 @@ func (s *DockerSuite) TestDeprecatedPostContainersStartWithoutLinksInHostConfig(
 }
 }
 
 
 // #14640
 // #14640
-func (s *DockerSuite) TestDeprecatedPostContainersStartWithLinksInHostConfig(c *check.C) {
+func (s *DockerSuite) TestDeprecatedPostContainersStartWithLinksInHostConfig(c *testing.T) {
 	// TODO Windows: Windows doesn't support supplying a hostconfig on start.
 	// TODO Windows: Windows doesn't support supplying a hostconfig on start.
 	// An alternate test could be written to validate the negative testing aspect of this
 	// An alternate test could be written to validate the negative testing aspect of this
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
@@ -214,7 +214,7 @@ func (s *DockerSuite) TestDeprecatedPostContainersStartWithLinksInHostConfig(c *
 }
 }
 
 
 // #14640
 // #14640
-func (s *DockerSuite) TestDeprecatedPostContainersStartWithLinksInHostConfigIdLinked(c *check.C) {
+func (s *DockerSuite) TestDeprecatedPostContainersStartWithLinksInHostConfigIdLinked(c *testing.T) {
 	// Windows does not support links
 	// Windows does not support links
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	name := "test-host-config-links"
 	name := "test-host-config-links"
@@ -233,7 +233,7 @@ func (s *DockerSuite) TestDeprecatedPostContainersStartWithLinksInHostConfigIdLi
 	b.Close()
 	b.Close()
 }
 }
 
 
-func (s *DockerSuite) TestDeprecatedStartWithNilDNS(c *check.C) {
+func (s *DockerSuite) TestDeprecatedStartWithNilDNS(c *testing.T) {
 	// TODO Windows: Add once DNS is supported
 	// TODO Windows: Add once DNS is supported
 	testRequires(c, DaemonIsLinux)
 	testRequires(c, DaemonIsLinux)
 	out, _ := dockerCmd(c, "create", "busybox")
 	out, _ := dockerCmd(c, "create", "busybox")

+ 2 - 2
integration-cli/docker_deprecated_api_v124_unix_test.go

@@ -4,14 +4,14 @@ package main
 
 
 import (
 import (
 	"strings"
 	"strings"
+	"testing"
 
 
 	"github.com/docker/docker/internal/test/request"
 	"github.com/docker/docker/internal/test/request"
-	"github.com/go-check/check"
 	"gotest.tools/assert"
 	"gotest.tools/assert"
 )
 )
 
 
 // #19100 This is a deprecated feature test, it should be removed in Docker 1.12
 // #19100 This is a deprecated feature test, it should be removed in Docker 1.12
-func (s *DockerNetworkSuite) TestDeprecatedDockerNetworkStartAPIWithHostconfig(c *check.C) {
+func (s *DockerNetworkSuite) TestDeprecatedDockerNetworkStartAPIWithHostconfig(c *testing.T) {
 	netName := "test"
 	netName := "test"
 	conName := "foo"
 	conName := "foo"
 	dockerCmd(c, "network", "create", netName)
 	dockerCmd(c, "network", "create", netName)

+ 8 - 17
integration-cli/docker_hub_pull_suite_test.go

@@ -2,23 +2,14 @@ package main
 
 
 import (
 import (
 	"os/exec"
 	"os/exec"
-	"runtime"
 	"strings"
 	"strings"
+	"testing"
 
 
-	"github.com/docker/docker/integration-cli/checker"
 	"github.com/docker/docker/integration-cli/daemon"
 	"github.com/docker/docker/integration-cli/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
 	testdaemon "github.com/docker/docker/internal/test/daemon"
-	"github.com/go-check/check"
+	"gotest.tools/assert"
 )
 )
 
 
-func init() {
-	// FIXME. Temporarily turning this off for Windows as GH16039 was breaking
-	// Windows to Linux CI @icecrime
-	if runtime.GOOS != "windows" {
-		check.Suite(newDockerHubPullSuite())
-	}
-}
-
 // DockerHubPullSuite provides an isolated daemon that doesn't have all the
 // DockerHubPullSuite provides an isolated daemon that doesn't have all the
 // images that are baked into our 'global' test environment daemon (e.g.,
 // images that are baked into our 'global' test environment daemon (e.g.,
 // busybox, httpserver, ...).
 // busybox, httpserver, ...).
@@ -39,26 +30,26 @@ func newDockerHubPullSuite() *DockerHubPullSuite {
 }
 }
 
 
 // SetUpSuite starts the suite daemon.
 // SetUpSuite starts the suite daemon.
-func (s *DockerHubPullSuite) SetUpSuite(c *check.C) {
+func (s *DockerHubPullSuite) SetUpSuite(c *testing.T) {
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
 	s.d.Start(c)
 	s.d.Start(c)
 }
 }
 
 
 // TearDownSuite stops the suite daemon.
 // TearDownSuite stops the suite daemon.
-func (s *DockerHubPullSuite) TearDownSuite(c *check.C) {
+func (s *DockerHubPullSuite) TearDownSuite(c *testing.T) {
 	if s.d != nil {
 	if s.d != nil {
 		s.d.Stop(c)
 		s.d.Stop(c)
 	}
 	}
 }
 }
 
 
 // SetUpTest declares that all tests of this suite require network.
 // SetUpTest declares that all tests of this suite require network.
-func (s *DockerHubPullSuite) SetUpTest(c *check.C) {
+func (s *DockerHubPullSuite) SetUpTest(c *testing.T) {
 	testRequires(c, Network)
 	testRequires(c, Network)
 }
 }
 
 
 // TearDownTest removes all images from the suite daemon.
 // TearDownTest removes all images from the suite daemon.
-func (s *DockerHubPullSuite) TearDownTest(c *check.C) {
+func (s *DockerHubPullSuite) TearDownTest(c *testing.T) {
 	out := s.Cmd(c, "images", "-aq")
 	out := s.Cmd(c, "images", "-aq")
 	images := strings.Split(out, "\n")
 	images := strings.Split(out, "\n")
 	images = append([]string{"rmi", "-f"}, images...)
 	images = append([]string{"rmi", "-f"}, images...)
@@ -68,9 +59,9 @@ func (s *DockerHubPullSuite) TearDownTest(c *check.C) {
 
 
 // Cmd executes a command against the suite daemon and returns the combined
 // Cmd executes a command against the suite daemon and returns the combined
 // output. The function fails the test when the command returns an error.
 // output. The function fails the test when the command returns an error.
-func (s *DockerHubPullSuite) Cmd(c *check.C, name string, arg ...string) string {
+func (s *DockerHubPullSuite) Cmd(c *testing.T, name string, arg ...string) string {
 	out, err := s.CmdWithError(name, arg...)
 	out, err := s.CmdWithError(name, arg...)
-	c.Assert(err, checker.IsNil, check.Commentf("%q failed with errors: %s, %v", strings.Join(arg, " "), out, err))
+	assert.Assert(c, err == nil, "%q failed with errors: %s, %v", strings.Join(arg, " "), out, err)
 	return out
 	return out
 }
 }
 
 

Some files were not shown because too many files changed in this diff