github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/daemon/cluster/executor/container/validate_windows_test.go (about)

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