From 2e6a8deecec101a8be0a30fd3f3881f6868f48a2 Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Tue, 9 Oct 2018 21:15:45 +0000 Subject: [PATCH] Add debugging info in pv/pvc protection e2e tests When facing an issue which is due to lack of PV/PVC Protection finalizer on the e2e tests, the error message is just like Expected : false to be true Actually we cannot understand what happened during the tests. This adds more debugging info on the tests. --- test/e2e/storage/pv_protection.go | 2 +- test/e2e/storage/pvc_protection.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/storage/pv_protection.go b/test/e2e/storage/pv_protection.go index 44865d1d026..d94aa6effe3 100644 --- a/test/e2e/storage/pv_protection.go +++ b/test/e2e/storage/pv_protection.go @@ -85,7 +85,7 @@ var _ = utils.SIGDescribe("PV Protection", func() { By("Checking that PV Protection finalizer is set") pv, err = client.CoreV1().PersistentVolumes().Get(pv.Name, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred(), "While getting PV status") - Expect(slice.ContainsString(pv.ObjectMeta.Finalizers, volumeutil.PVProtectionFinalizer, nil)).To(BeTrue()) + Expect(slice.ContainsString(pv.ObjectMeta.Finalizers, volumeutil.PVProtectionFinalizer, nil)).To(BeTrue(), "PV Protection finalizer(%v) is not set in %v", volumeutil.PVProtectionFinalizer, pv.ObjectMeta.Finalizers) }) AfterEach(func() { diff --git a/test/e2e/storage/pvc_protection.go b/test/e2e/storage/pvc_protection.go index 2d2346ee134..ee627ad029c 100644 --- a/test/e2e/storage/pvc_protection.go +++ b/test/e2e/storage/pvc_protection.go @@ -63,7 +63,7 @@ var _ = utils.SIGDescribe("PVC Protection", func() { By("Checking that PVC Protection finalizer is set") pvc, err = client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(pvc.Name, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred(), "While getting PVC status") - Expect(slice.ContainsString(pvc.ObjectMeta.Finalizers, volumeutil.PVCProtectionFinalizer, nil)).To(BeTrue()) + Expect(slice.ContainsString(pvc.ObjectMeta.Finalizers, volumeutil.PVCProtectionFinalizer, nil)).To(BeTrue(), "PVC Protection finalizer(%v) is not set in %v", volumeutil.PVCProtectionFinalizer, pvc.ObjectMeta.Finalizers) }) AfterEach(func() {