Merge pull request #63338 from humblec/e2e-test-1

Automatic merge from submit-queue (batch tested with PRs 63373, 63338). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enable GCE/GKE e2e tests for GlusterFS Dynamic Provisioner.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
This commit is contained in:
Kubernetes Submit Queue 2018-05-07 12:22:10 -07:00 committed by GitHub
commit d7d4381961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,14 +99,10 @@ func testDynamicProvisioning(t storageClassTest, client clientset.Interface, cla
pv, err := client.CoreV1().PersistentVolumes().Get(claim.Spec.VolumeName, metav1.GetOptions{}) pv, err := client.CoreV1().PersistentVolumes().Get(claim.Spec.VolumeName, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())
if class.Provisioner == "kubernetes.io/glusterfs" && framework.ProviderIs("gke", "gce") { // Check sizes
framework.Logf("Skipping glusterfs dynamic test for cloud provider %v", "GCE/GKE") expectedCapacity := resource.MustParse(t.expectedSize)
} else { pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)]
// Check sizes Expect(pvCapacity.Value()).To(Equal(expectedCapacity.Value()), "pvCapacity is not equal to expectedCapacity")
expectedCapacity := resource.MustParse(t.expectedSize)
pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)]
Expect(pvCapacity.Value()).To(Equal(expectedCapacity.Value()), "pvCapacity is not equal to expectedCapacity")
}
requestedCapacity := resource.MustParse(t.claimSize) requestedCapacity := resource.MustParse(t.claimSize)
claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
@ -802,6 +798,17 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
parameters: map[string]string{"resturl": serverUrl}, parameters: map[string]string{"resturl": serverUrl},
attach: false, attach: false,
} }
// GCE/GKE
if getDefaultPluginName() == "kubernetes.io/gce-pd" {
// Keeping an extra condition here based on below facts:
//*) gce-pd rounds up to the next gb.
//*) GlusterFS provisioner rounduptoGiB() and send it to backend,
// which does 'size/number' from provisioner*1024*1024*1024
test.claimSize = "2Gi"
test.expectedSize = "3G"
}
suffix := fmt.Sprintf("glusterdptest") suffix := fmt.Sprintf("glusterdptest")
class := newStorageClass(test, ns, suffix) class := newStorageClass(test, ns, suffix)