From 8ca08f1cedc13d5627c8cae1eff403e37ef8a8ab Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Tue, 18 Aug 2020 13:35:48 -0700 Subject: [PATCH] tests: Use Windows absolute path on Windows pods The test "should fail substituting values in a volume subpath with absolute path" creates a pod with a variable expansion path which is set as an absolute path. However "/tmp" is not an absolute on Windows, it has to be prefixed with the drive letter (C:\tmp). But C:\tmp does not typically exist on Windows nodes, so we use C:\Users instead. --- test/e2e/common/expansion.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/common/expansion.go b/test/e2e/common/expansion.go index 1723a969f4f..a50206efb05 100644 --- a/test/e2e/common/expansion.go +++ b/test/e2e/common/expansion.go @@ -181,11 +181,16 @@ var _ = framework.KubeDescribe("Variable Expansion", func() { Description: Make sure a container's subpath can not be set using an expansion of environment variables when absolute path is supplied. */ framework.ConformanceIt("should fail substituting values in a volume subpath with absolute path [sig-storage][Slow]", func() { + absolutePath := "/tmp" + if framework.NodeOSDistroIs("windows") { + // Windows does not typically have a C:\tmp folder. + absolutePath = "C:\\Users" + } envVars := []v1.EnvVar{ { Name: "POD_NAME", - Value: "/tmp", + Value: absolutePath, }, } mounts := []v1.VolumeMount{