From fca9963c243d1a66acc8791a3785d6bf7ab586b6 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 6 Jan 2020 16:50:55 -0500 Subject: [PATCH] Move publish and unpublish counting up in test So as publish and unpublish are counted always --- test/e2e/storage/csi_mock_volume.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/e2e/storage/csi_mock_volume.go b/test/e2e/storage/csi_mock_volume.go index 08d162349ca..5c28bdc4612 100644 --- a/test/e2e/storage/csi_mock_volume.go +++ b/test/e2e/storage/csi_mock_volume.go @@ -784,6 +784,13 @@ func checkPodLogs(cs clientset.Interface, namespace, driverPodName, driverContai numNodeUnpublishVolume++ } } + if numNodePublishVolume == 0 { + return fmt.Errorf("NodePublish was never called") + } + + if numNodeUnpublishVolume == 0 { + return fmt.Errorf("NodeUnpublish was never called") + } if expectPodInfo { if foundAttributes.Len() != len(expectedAttributes) { return fmt.Errorf("number of found volume attributes does not match, expected %d, got %d", len(expectedAttributes), foundAttributes.Len()) @@ -793,13 +800,7 @@ func checkPodLogs(cs clientset.Interface, namespace, driverPodName, driverContai if foundAttributes.Len() != 0 { return fmt.Errorf("some unexpected volume attributes were found: %+v", foundAttributes.List()) } - if numNodePublishVolume == 0 { - return fmt.Errorf("NodePublish was never called") - } - if numNodeUnpublishVolume == 0 { - return fmt.Errorf("NodeUnpublish was never called") - } return nil }