tests: Symlink volume tests
There was a known issue regarding how the symlink files mounted as volumes were being handled on Windows. This commit adds tests that will check against those issue to ensure there won't be any regressions. Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -206,6 +207,15 @@ func WithResources(r *runtime.LinuxContainerResources) ContainerOpts { //nolint:
|
||||
}
|
||||
}
|
||||
|
||||
func WithVolumeMount(hostPath, containerPath string) ContainerOpts {
|
||||
return func(c *runtime.ContainerConfig) {
|
||||
hostPath, _ = filepath.Abs(hostPath)
|
||||
containerPath, _ = filepath.Abs(containerPath)
|
||||
mount := &runtime.Mount{HostPath: hostPath, ContainerPath: containerPath}
|
||||
c.Mounts = append(c.Mounts, mount)
|
||||
}
|
||||
}
|
||||
|
||||
// Add container command.
|
||||
func WithCommand(cmd string, args ...string) ContainerOpts {
|
||||
return func(c *runtime.ContainerConfig) {
|
||||
|
||||
Reference in New Issue
Block a user