add GCE PD volume e2e tests

Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
Huamin Chen 2016-05-03 14:51:02 +00:00
parent fe4d83dc81
commit 079474b69e

View File

@ -725,4 +725,48 @@ var _ = framework.KubeDescribe("Volumes [Feature:Volumes]", func() {
testVolumeClient(c, config, volume, &fsGroup, content) testVolumeClient(c, config, volume, &fsGroup, content)
}) })
}) })
////////////////////////////////////////////////////////////////////////
// GCE PD
////////////////////////////////////////////////////////////////////////
framework.KubeDescribe("PD", func() {
It("should be mountable", func() {
framework.SkipUnlessProviderIs("gce", "gke")
config := VolumeTestConfig{
namespace: namespace.Name,
prefix: "pd",
}
By("creating a test gce pd volume")
volumeName, err := createPDWithRetry()
Expect(err).NotTo(HaveOccurred())
defer func() {
deletePDWithRetry(volumeName)
}()
defer func() {
if clean {
framework.Logf("Running volumeTestCleanup")
volumeTestCleanup(f, config)
}
}()
volume := api.VolumeSource{
GCEPersistentDisk: &api.GCEPersistentDiskVolumeSource{
PDName: volumeName,
FSType: "ext3",
ReadOnly: false,
},
}
// Insert index.html into the test volume with some random content
// to make sure we don't see the content from previous test runs.
content := "Hello from GCE PD from namespace " + volumeName
injectHtml(c, config, volume, content)
fsGroup := int64(1234)
testVolumeClient(c, config, volume, &fsGroup, content)
})
})
}) })