validate_windows_test.go 611 B

123456789101112131415161718192021222324
  1. //go:build windows
  2. package container // import "github.com/docker/docker/daemon/cluster/executor/container"
  3. import (
  4. "strings"
  5. "testing"
  6. "github.com/moby/swarmkit/v2/api"
  7. )
  8. const (
  9. testAbsPath = `c:\foo`
  10. testAbsNonExistent = `c:\some-non-existing-host-path\`
  11. )
  12. func TestControllerValidateMountNamedPipe(t *testing.T) {
  13. if _, err := newTestControllerWithMount(api.Mount{
  14. Type: api.MountTypeNamedPipe,
  15. Source: "",
  16. Target: `\\.\pipe\foo`,
  17. }); err == nil || !strings.Contains(err.Error(), "invalid npipe source, source must not be empty") {
  18. t.Fatalf("expected error, got: %v", err)
  19. }
  20. }