@@ -193,7 +193,7 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
...
@@ -193,7 +193,7 @@ var _ = utils.SIGDescribe("PersistentVolumes:vsphere", func() {
4. Start kubelet.
4. Start kubelet.
5. Verify that volume mount not to be found.
5. Verify that volume mount not to be found.
*/
*/
It("should test that a vspehre volume mounted to a pod that is deleted while the kubelet is down unmounts when the kubelet returns [Disruptive]",func(){
ginkgo.It("should test that a vspehre volume mounted to a pod that is deleted while the kubelet is down unmounts when the kubelet returns [Disruptive]",func(){
Expect(ssPodsBeforeScaleDown.Items).NotTo(BeEmpty(),fmt.Sprintf("Unable to get list of Pods from the Statefulset: %v",statefulset.Name))
gomega.Expect(ssPodsBeforeScaleDown.Items).NotTo(gomega.BeEmpty(),fmt.Sprintf("Unable to get list of Pods from the Statefulset: %v",statefulset.Name))
Expect(len(ssPodsBeforeScaleDown.Items)==int(replicas)).To(BeTrue(),"Number of Pods in the statefulset should match with number of replicas")
gomega.Expect(len(ssPodsBeforeScaleDown.Items)==int(replicas)).To(gomega.BeTrue(),"Number of Pods in the statefulset should match with number of replicas")
// Get the list of Volumes attached to Pods before scale down
// Get the list of Volumes attached to Pods before scale down
Expect(ssPodsAfterScaleUp.Items).NotTo(BeEmpty(),fmt.Sprintf("Unable to get list of Pods from the Statefulset: %v",statefulset.Name))
gomega.Expect(ssPodsAfterScaleUp.Items).NotTo(gomega.BeEmpty(),fmt.Sprintf("Unable to get list of Pods from the Statefulset: %v",statefulset.Name))
Expect(len(ssPodsAfterScaleUp.Items)==int(replicas)).To(BeTrue(),"Number of Pods in the statefulset should match with number of replicas")
gomega.Expect(len(ssPodsAfterScaleUp.Items)==int(replicas)).To(gomega.BeTrue(),"Number of Pods in the statefulset should match with number of replicas")
// After scale up, verify all vsphere volumes are attached to node VMs.
// After scale up, verify all vsphere volumes are attached to node VMs.
By("Verify all volumes are attached to Nodes after Statefulsets is scaled up")
ginkgo.By("Verify all volumes are attached to Nodes after Statefulsets is scaled up")
Expect(nodeList.Items).NotTo(BeEmpty(),"Unable to find ready and schedulable Node")
gomega.Expect(nodeList.Items).NotTo(gomega.BeEmpty(),"Unable to find ready and schedulable Node")
// if VCP_STRESS_INSTANCES = 12 and VCP_STRESS_ITERATIONS is 10. 12 threads will run in parallel for 10 times.
// if VCP_STRESS_INSTANCES = 12 and VCP_STRESS_ITERATIONS is 10. 12 threads will run in parallel for 10 times.
// Resulting 120 Volumes and POD Creation. Volumes will be provisioned with each different types of Storage Class,
// Resulting 120 Volumes and POD Creation. Volumes will be provisioned with each different types of Storage Class,
// Each iteration creates PVC, verify PV is provisioned, then creates a pod, verify volume is attached to the node, and then delete the pod and delete pvc.
// Each iteration creates PVC, verify PV is provisioned, then creates a pod, verify volume is attached to the node, and then delete the pod and delete pvc.
Expect(instances<=volumesPerNode*len(nodeList.Items)).To(BeTrue(),fmt.Sprintf("Number of Instances should be less or equal: %v",volumesPerNode*len(nodeList.Items)))
gomega.Expect(instances<=volumesPerNode*len(nodeList.Items)).To(gomega.BeTrue(),fmt.Sprintf("Number of Instances should be less or equal: %v",volumesPerNode*len(nodeList.Items)))
Expect(instances>len(scNames)).To(BeTrue(),"VCP_STRESS_INSTANCES should be greater than 3 to utilize all 4 types of storage classes")
gomega.Expect(instances>len(scNames)).To(gomega.BeTrue(),"VCP_STRESS_INSTANCES should be greater than 3 to utilize all 4 types of storage classes")
By(fmt.Sprintf("%v Verifing the volume: %v is attached to the node VM: %v",logPrefix,persistentvolumes[0].Spec.VsphereVolume.VolumePath,pod.Spec.NodeName))
ginkgo.By(fmt.Sprintf("%v Verifing the volume: %v is attached to the node VM: %v",logPrefix,persistentvolumes[0].Spec.VsphereVolume.VolumePath,pod.Spec.NodeName))
By(fmt.Sprintf("%v Verifing the volume: %v is accessible in the pod: %v",logPrefix,persistentvolumes[0].Spec.VsphereVolume.VolumePath,pod.Name))
ginkgo.By(fmt.Sprintf("%v Verifing the volume: %v is accessible in the pod: %v",logPrefix,persistentvolumes[0].Spec.VsphereVolume.VolumePath,pod.Name))
By(fmt.Sprintf("%v Waiting for volume: %v to be detached from the node: %v",logPrefix,persistentvolumes[0].Spec.VsphereVolume.VolumePath,pod.Spec.NodeName))
ginkgo.By(fmt.Sprintf("%v Waiting for volume: %v to be detached from the node: %v",logPrefix,persistentvolumes[0].Spec.VsphereVolume.VolumePath,pod.Spec.NodeName))
Expect(len(nodes.Items)).To(BeNumerically(">=",1),"Requires at least %d nodes (not %d)",2,len(nodes.Items))
gomega.Expect(len(nodes.Items)).To(gomega.BeNumerically(">=",1),"Requires at least %d nodes (not %d)",2,len(nodes.Items))
msg:=fmt.Sprintf("Cannot attach %d volumes to %d nodes. Maximum volumes that can be attached on %d nodes is %d",volumeCount,len(nodes.Items),len(nodes.Items),SCSIUnitsAvailablePerNode*len(nodes.Items))
msg:=fmt.Sprintf("Cannot attach %d volumes to %d nodes. Maximum volumes that can be attached on %d nodes is %d",volumeCount,len(nodes.Items),len(nodes.Items),SCSIUnitsAvailablePerNode*len(nodes.Items))