validate_windows_test.go 629 B

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