github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/daemon/cluster/executor/container/validate_windows_test.go (about)

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