2021-08-23 15:14:53 +02:00
|
|
|
//go:build windows
|
2017-02-03 18:05:20 -08:00
|
|
|
// +build windows
|
|
|
|
|
2018-02-05 16:05:59 -05:00
|
|
|
package container // import "github.com/docker/docker/daemon/cluster/executor/container"
|
2018-07-06 00:18:49 +03:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/docker/swarmkit/api"
|
|
|
|
)
|
2016-08-01 17:00:13 -04:00
|
|
|
|
|
|
|
const (
|
2017-02-03 18:05:20 -08:00
|
|
|
testAbsPath = `c:\foo`
|
|
|
|
testAbsNonExistent = `c:\some-non-existing-host-path\`
|
2016-08-01 17:00:13 -04:00
|
|
|
)
|
2018-07-06 00:18:49 +03:00
|
|
|
|
|
|
|
func TestControllerValidateMountNamedPipe(t *testing.T) {
|
|
|
|
if _, err := newTestControllerWithMount(api.Mount{
|
|
|
|
Type: api.MountTypeNamedPipe,
|
|
|
|
Source: "",
|
|
|
|
Target: `\\.\pipe\foo`,
|
|
|
|
}); err == nil || !strings.Contains(err.Error(), "invalid npipe source, source must not be empty") {
|
|
|
|
t.Fatalf("expected error, got: %v", err)
|
|
|
|
}
|
|
|
|
}
|