From ceb6dea1e05c9c5fd8b86bc1300a0ccf1bba2073 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Mon, 11 Dec 2017 14:46:03 +0100 Subject: [PATCH] test: e2e: support NFS test on overlayfs TL;DR; NFS is not supported over overlayfs. In CRI-O we default to overlayfs as the storage driver, therefore running the NFS test always fails to export the directory. This patch adds a volume mount from the host so /exports isn't on overlayfs anymore. Signed-off-by: Antonio Murdaca --- test/e2e/framework/volume_util.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/e2e/framework/volume_util.go b/test/e2e/framework/volume_util.go index 4c396c06676..4a0e8e7ac8f 100644 --- a/test/e2e/framework/volume_util.go +++ b/test/e2e/framework/volume_util.go @@ -83,6 +83,7 @@ type VolumeTestConfig struct { ServerArgs []string // Volumes needed to be mounted to the server container from the host // map -> + // if is empty, mount a tmpfs emptydir ServerVolumes map[string]string // Wait for the pod to terminate successfully // False indicates that the pod is long running @@ -106,10 +107,11 @@ type VolumeTest struct { // NFS-specific wrapper for CreateStorageServer. func NewNFSServer(cs clientset.Interface, namespace string, args []string) (config VolumeTestConfig, pod *v1.Pod, ip string) { config = VolumeTestConfig{ - Namespace: namespace, - Prefix: "nfs", - ServerImage: imageutils.GetE2EImage(imageutils.VolumeNFSServer), - ServerPorts: []int{2049}, + Namespace: namespace, + Prefix: "nfs", + ServerImage: imageutils.GetE2EImage(imageutils.VolumeNFSServer), + ServerPorts: []int{2049}, + ServerVolumes: map[string]string{"": "/exports"}, } if len(args) > 0 { config.ServerArgs = args @@ -230,8 +232,12 @@ func StartVolumeServer(client clientset.Interface, config VolumeTestConfig) *v1. for src, dst := range config.ServerVolumes { mountName := fmt.Sprintf("path%d", i) volumes[i].Name = mountName - volumes[i].VolumeSource.HostPath = &v1.HostPathVolumeSource{ - Path: src, + if src == "" { + volumes[i].VolumeSource.EmptyDir = &v1.EmptyDirVolumeSource{Medium: v1.StorageMediumMemory} + } else { + volumes[i].VolumeSource.HostPath = &v1.HostPathVolumeSource{ + Path: src, + } } mounts[i].Name = mountName