Fix multizone gce pd subpath test

This commit is contained in:
Michelle Au
2018-08-30 12:30:23 -07:00
parent e45d74d00d
commit 233db366cc
4 changed files with 70 additions and 60 deletions

View File

@@ -57,7 +57,7 @@ var _ = utils.SIGDescribe("Subpath", func() {
Description: Containers in a pod can read content from a secret mounted volume which was configured with a subpath.
*/
framework.ConformanceIt("should support subpaths with secret pod", func() {
pod := testsuites.TestPodSubpath(f, "secret-key", "secret", &v1.VolumeSource{Secret: &v1.SecretVolumeSource{SecretName: "my-secret"}}, privilegedSecurityContext)
pod := testsuites.SubpathTestPod(f, "secret-key", "secret", &v1.VolumeSource{Secret: &v1.SecretVolumeSource{SecretName: "my-secret"}}, privilegedSecurityContext)
testsuites.TestBasicSubpath(f, "secret-value", pod)
})
@@ -67,7 +67,7 @@ var _ = utils.SIGDescribe("Subpath", func() {
Description: Containers in a pod can read content from a configmap mounted volume which was configured with a subpath.
*/
framework.ConformanceIt("should support subpaths with configmap pod", func() {
pod := testsuites.TestPodSubpath(f, "configmap-key", "configmap", &v1.VolumeSource{ConfigMap: &v1.ConfigMapVolumeSource{LocalObjectReference: v1.LocalObjectReference{Name: "my-configmap"}}}, privilegedSecurityContext)
pod := testsuites.SubpathTestPod(f, "configmap-key", "configmap", &v1.VolumeSource{ConfigMap: &v1.ConfigMapVolumeSource{LocalObjectReference: v1.LocalObjectReference{Name: "my-configmap"}}}, privilegedSecurityContext)
testsuites.TestBasicSubpath(f, "configmap-value", pod)
})
@@ -77,7 +77,7 @@ var _ = utils.SIGDescribe("Subpath", func() {
Description: Containers in a pod can read content from a configmap mounted volume which was configured with a subpath and also using a mountpath that is a specific file.
*/
framework.ConformanceIt("should support subpaths with configmap pod with mountPath of existing file", func() {
pod := testsuites.TestPodSubpath(f, "configmap-key", "configmap", &v1.VolumeSource{ConfigMap: &v1.ConfigMapVolumeSource{LocalObjectReference: v1.LocalObjectReference{Name: "my-configmap"}}}, privilegedSecurityContext)
pod := testsuites.SubpathTestPod(f, "configmap-key", "configmap", &v1.VolumeSource{ConfigMap: &v1.ConfigMapVolumeSource{LocalObjectReference: v1.LocalObjectReference{Name: "my-configmap"}}}, privilegedSecurityContext)
file := "/etc/resolv.conf"
pod.Spec.Containers[0].VolumeMounts[0].MountPath = file
testsuites.TestBasicSubpathFile(f, "configmap-value", pod, file)
@@ -89,7 +89,7 @@ var _ = utils.SIGDescribe("Subpath", func() {
Description: Containers in a pod can read content from a downwardAPI mounted volume which was configured with a subpath.
*/
framework.ConformanceIt("should support subpaths with downward pod", func() {
pod := testsuites.TestPodSubpath(f, "downward/podname", "downwardAPI", &v1.VolumeSource{
pod := testsuites.SubpathTestPod(f, "downward/podname", "downwardAPI", &v1.VolumeSource{
DownwardAPI: &v1.DownwardAPIVolumeSource{
Items: []v1.DownwardAPIVolumeFile{{Path: "downward/podname", FieldRef: &v1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.name"}}},
},
@@ -103,7 +103,7 @@ var _ = utils.SIGDescribe("Subpath", func() {
Description: Containers in a pod can read content from a projected mounted volume which was configured with a subpath.
*/
framework.ConformanceIt("should support subpaths with projected pod", func() {
pod := testsuites.TestPodSubpath(f, "projected/configmap-key", "projected", &v1.VolumeSource{
pod := testsuites.SubpathTestPod(f, "projected/configmap-key", "projected", &v1.VolumeSource{
Projected: &v1.ProjectedVolumeSource{
Sources: []v1.VolumeProjection{
{ConfigMap: &v1.ConfigMapProjection{