Update tests to check returned errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
77c5668baf
commit
161e0a90a6
81 changed files with 359 additions and 2 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestCheckpointCreateError(t *testing.T) {
|
||||
|
@ -25,6 +26,9 @@ func TestCheckpointCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckpointCreate(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestCheckpointDeleteError(t *testing.T) {
|
||||
|
@ -24,6 +25,9 @@ func TestCheckpointDeleteError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckpointDelete(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestCheckpointListError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestCheckpointListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckpointList(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -34,6 +35,9 @@ func TestConfigCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigCreate(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
|
@ -58,6 +59,9 @@ func TestConfigInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigInspectConfigNotFound(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -36,6 +37,9 @@ func TestConfigListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigList(t *testing.T) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -32,6 +33,9 @@ func TestConfigRemoveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigRemove(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -33,6 +34,9 @@ func TestConfigUpdateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigUpdate(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerCommitError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestContainerCommitError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerCommit(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerStatPathError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestContainerStatPathError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerStatPathNotFoundError(t *testing.T) {
|
||||
|
@ -102,6 +106,9 @@ func TestCopyToContainerError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCopyToContainerNotFoundError(t *testing.T) {
|
||||
|
@ -178,6 +185,9 @@ func TestCopyFromContainerError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCopyFromContainerNotFoundError(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerCreateError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestContainerCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error while testing StatusInternalServerError, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error while testing StatusInternalServerError, got %T", err)
|
||||
}
|
||||
|
||||
// 404 doesn't automatically means an unknown image
|
||||
client = &Client{
|
||||
|
@ -30,6 +34,9 @@ func TestContainerCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error while testing StatusNotFound, got %v", err)
|
||||
}
|
||||
if err == nil || !IsErrNotFound(err) {
|
||||
t.Fatalf("expected a Server Error while testing StatusNotFound, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerCreateImageNotFound(t *testing.T) {
|
||||
|
@ -38,7 +45,7 @@ func TestContainerCreateImageNotFound(t *testing.T) {
|
|||
}
|
||||
_, err := client.ContainerCreate(context.Background(), &container.Config{Image: "unknown_image"}, nil, nil, "unknown")
|
||||
if err == nil || !IsErrNotFound(err) {
|
||||
t.Fatalf("expected an imageNotFound error, got %v", err)
|
||||
t.Fatalf("expected an imageNotFound error, got %v, %T", err, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerDiffError(t *testing.T) {
|
||||
|
@ -21,7 +22,9 @@ func TestContainerDiffError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerDiff(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerExecCreateError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestContainerExecCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerExecCreate(t *testing.T) {
|
||||
|
@ -76,6 +80,9 @@ func TestContainerExecStartError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerExecStart(t *testing.T) {
|
||||
|
@ -120,6 +127,9 @@ func TestContainerExecInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerExecInspect(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerExportError(t *testing.T) {
|
||||
|
@ -18,6 +20,9 @@ func TestContainerExportError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerExport(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -23,6 +24,9 @@ func TestContainerInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerInspectContainerNotFound(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerKillError(t *testing.T) {
|
||||
|
@ -18,6 +20,9 @@ func TestContainerKillError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerKill(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerListError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestContainerListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerList(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerPauseError(t *testing.T) {
|
||||
|
@ -18,6 +20,9 @@ func TestContainerPauseError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerPause(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerRenameError(t *testing.T) {
|
||||
|
@ -18,6 +20,9 @@ func TestContainerRenameError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerRename(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerResizeError(t *testing.T) {
|
||||
|
@ -20,6 +21,9 @@ func TestContainerResizeError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerExecResizeError(t *testing.T) {
|
||||
|
@ -30,6 +34,9 @@ func TestContainerExecResizeError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerResize(t *testing.T) {
|
||||
|
|
|
@ -9,6 +9,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerRestartError(t *testing.T) {
|
||||
|
@ -20,6 +22,9 @@ func TestContainerRestartError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerRestart(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerStartError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestContainerStartError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerStart(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerStatsError(t *testing.T) {
|
||||
|
@ -18,6 +20,9 @@ func TestContainerStatsError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerStats(t *testing.T) {
|
||||
|
|
|
@ -9,6 +9,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerStopError(t *testing.T) {
|
||||
|
@ -20,6 +22,9 @@ func TestContainerStopError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerStop(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerTopError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestContainerTopError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerTop(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerUnpauseError(t *testing.T) {
|
||||
|
@ -18,6 +20,9 @@ func TestContainerUnpauseError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerUnpause(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerUpdateError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestContainerUpdateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerUpdate(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestContainerWaitError(t *testing.T) {
|
||||
|
@ -27,6 +28,9 @@ func TestContainerWaitError(t *testing.T) {
|
|||
if err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestDiskUsageError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestDiskUsageError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDiskUsage(t *testing.T) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestEventsErrorInOptions(t *testing.T) {
|
||||
|
@ -55,6 +56,9 @@ func TestEventsErrorFromServer(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEvents(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/go-units"
|
||||
)
|
||||
|
||||
|
@ -23,6 +24,9 @@ func TestImageBuildError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageBuild(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageCreateError(t *testing.T) {
|
||||
|
@ -20,6 +21,9 @@ func TestImageCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageCreate(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageHistoryError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestImageHistoryError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageHistory(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageImportError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestImageImportError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageImport(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -24,6 +25,9 @@ func TestImageInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageInspectImageNotFound(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageListError(t *testing.T) {
|
||||
|
@ -23,6 +24,9 @@ func TestImageListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageList(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageLoadError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestImageLoadError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageLoad(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImagePullReferenceParseError(t *testing.T) {
|
||||
|
@ -33,6 +34,9 @@ func TestImagePullAnyError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImagePullStatusUnauthorizedError(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImagePushReferenceError(t *testing.T) {
|
||||
|
@ -38,6 +39,9 @@ func TestImagePushAnyError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImagePushStatusUnauthorizedError(t *testing.T) {
|
||||
|
|
|
@ -9,6 +9,8 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageSaveError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestImageSaveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageSave(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageSearchAnyError(t *testing.T) {
|
||||
|
@ -23,6 +24,9 @@ func TestImageSearchAnyError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageSearchStatusUnauthorizedError(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestImageTagError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestImageTagError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Note: this is not testing all the InvalidReference as it's the responsibility
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestInfoServerError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestInfoServerError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInfoInvalidResponseJSONError(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNetworkConnectError(t *testing.T) {
|
||||
|
@ -23,6 +24,9 @@ func TestNetworkConnectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkConnectEmptyNilEndpointSettings(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNetworkCreateError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestNetworkCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkCreate(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNetworkDisconnectError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestNetworkDisconnectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkDisconnect(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNetworkListError(t *testing.T) {
|
||||
|
@ -25,6 +26,9 @@ func TestNetworkListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkList(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -28,6 +29,9 @@ func TestNetworksPruneError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworksPrune(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNetworkRemoveError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestNetworkRemoveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkRemove(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -23,6 +24,9 @@ func TestNodeInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeInspectNodeNotFound(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNodeListError(t *testing.T) {
|
||||
|
@ -24,6 +25,9 @@ func TestNodeListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeList(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNodeRemoveError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestNodeRemoveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeRemove(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestNodeUpdateError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestNodeUpdateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeUpdate(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestPluginDisableError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestPluginDisableError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginDisable(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestPluginEnableError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestPluginEnableError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginEnable(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -23,6 +24,9 @@ func TestPluginInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginInspectWithEmptyID(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestPluginListError(t *testing.T) {
|
||||
|
@ -23,6 +24,9 @@ func TestPluginListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginList(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestPluginPushError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestPluginPushError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginPush(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestPluginRemoveError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestPluginRemoveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginRemove(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestPluginSetError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestPluginSetError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginSet(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -88,6 +89,9 @@ func TestPlainTextError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInfiniteError(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -34,6 +35,9 @@ func TestSecretCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretCreate(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
|
@ -35,6 +36,9 @@ func TestSecretInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretInspectSecretNotFound(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -36,6 +37,9 @@ func TestSecretListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretList(t *testing.T) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -32,6 +33,9 @@ func TestSecretRemoveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretRemove(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"gotest.tools/assert"
|
||||
is "gotest.tools/assert/cmp"
|
||||
)
|
||||
|
@ -33,6 +34,9 @@ func TestSecretUpdateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretUpdate(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
registrytypes "github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/opencontainers/go-digest"
|
||||
"github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"gotest.tools/assert"
|
||||
|
@ -27,6 +28,9 @@ func TestServiceCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceCreate(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -24,6 +25,9 @@ func TestServiceInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceInspectServiceNotFound(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestServiceListError(t *testing.T) {
|
||||
|
@ -24,6 +25,9 @@ func TestServiceListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceList(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestServiceUpdateError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestServiceUpdateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceUpdate(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestSwarmInitError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestSwarmInitError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSwarmInit(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestSwarmInspectError(t *testing.T) {
|
||||
|
@ -22,6 +23,9 @@ func TestSwarmInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSwarmInspect(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestSwarmJoinError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestSwarmJoinError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSwarmJoin(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestSwarmLeaveError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestSwarmLeaveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSwarmLeave(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestSwarmUnlockError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestSwarmUnlockError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSwarmUnlock(t *testing.T) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestSwarmUpdateError(t *testing.T) {
|
||||
|
@ -21,6 +22,9 @@ func TestSwarmUpdateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSwarmUpdate(t *testing.T) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -23,6 +24,9 @@ func TestTaskInspectError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskInspectWithEmptyID(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestTaskListError(t *testing.T) {
|
||||
|
@ -24,6 +25,9 @@ func TestTaskListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskList(t *testing.T) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
volumetypes "github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestVolumeCreateError(t *testing.T) {
|
||||
|
@ -23,6 +24,9 @@ func TestVolumeCreateError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeCreate(t *testing.T) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
volumetypes "github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestVolumeListError(t *testing.T) {
|
||||
|
@ -24,6 +25,9 @@ func TestVolumeListError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeList(t *testing.T) {
|
||||
|
|
|
@ -8,6 +8,8 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
)
|
||||
|
||||
func TestVolumeRemoveError(t *testing.T) {
|
||||
|
@ -19,6 +21,9 @@ func TestVolumeRemoveError(t *testing.T) {
|
|||
if err == nil || err.Error() != "Error response from daemon: Server error" {
|
||||
t.Fatalf("expected a Server Error, got %v", err)
|
||||
}
|
||||
if !errdefs.IsSystem(err) {
|
||||
t.Fatalf("expected a Server Error, got %T", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeRemove(t *testing.T) {
|
||||
|
|
Loading…
Add table
Reference in a new issue