1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Break out non-Windows sys/mount usage into helper

Rather than bifurcate the test completely, this lets us keep the test
intact with a small function wrapper to allow the compiler to build the
code that'll never be called on Windows, on Windows.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
This commit is contained in:
Paul "TBBle" Hampson 2020-11-06 01:23:49 +11:00
parent 3e3f3d7168
commit 7bb729e928
3 changed files with 16 additions and 2 deletions

View file

@ -15,6 +15,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/mount"
"github.com/pkg/errors"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
@ -75,3 +76,8 @@ func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *testing.T) {
assert.NilError(c, err)
assert.Check(c, is.Equal(text, strings.TrimSpace(string(b))))
}
func mountWrapper(device, target, mType, options string) error {
// This should never be called.
return errors.Errorf("there is no implementation of Mount on this platform")
}