From 66bb0e4e54aa690d8d02ee78dd50c26326f1b5f8 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Mon, 10 Jun 2019 13:30:40 +0530 Subject: [PATCH] Combine the variable section in e2e and also introuce new vars. Signed-off-by: Humble Chirammal --- e2e/cephfs.go | 14 ++++++-------- e2e/rbd.go | 15 +++++++-------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index 1429e0d96..52ec432ef 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -11,12 +11,10 @@ var ( cephfsProvisionerRBAC = "csi-provisioner-rbac.yaml" cephfsNodePlugin = "csi-cephfsplugin.yaml" cephfsNodePluginRBAC = "csi-nodeplugin-rbac.yaml" -) - -var ( - cephfsDirPath = "../deploy/cephfs/kubernetes/" - - cephfsExamplePath = "../examples/cephfs/" + cephfsDeploymentName = "csi-cephfsplugin-provisioner" + cephfsDeamonSetName = "csi-cephfsplugin" + cephfsDirPath = "../deploy/cephfs/kubernetes/" + cephfsExamplePath = "../examples/cephfs/" ) func deployCephfsPlugin() { @@ -53,13 +51,13 @@ var _ = Describe("cephfs", func() { Context("Test cephfs CSI", func() { It("Test cephfs CSI", func() { By("checking provisioner deployment is completed") - err := waitForDeploymentComplete("csi-cephfsplugin-provisioner", "default", f.ClientSet, deployTimeout) + err := waitForDeploymentComplete(cephfsDeploymentName, namespace, f.ClientSet, deployTimeout) if err != nil { Fail(err.Error()) } By("checking nodeplugin deamonsets is running") - err = waitForDaemonSets("csi-cephfsplugin", "default", f.ClientSet, deployTimeout) + err = waitForDaemonSets(cephfsDeamonSetName, namespace, f.ClientSet, deployTimeout) if err != nil { Fail(err.Error()) } diff --git a/e2e/rbd.go b/e2e/rbd.go index 5a8fe5a01..4acabb276 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -12,12 +12,11 @@ var ( rbdNodePlugin = "csi-rbdplugin.yaml" rbdNodePluginRBAC = "csi-nodeplugin-rbac.yaml" rbdConfigMap = "csi-config-map.yaml" -) - -var ( - rbdDirPath = "../deploy/rbd/kubernetes/" - - rbdExamplePath = "../examples/rbd/" + rbdDirPath = "../deploy/rbd/kubernetes/" + rbdExamplePath = "../examples/rbd/" + rbdDeploymentName = "csi-rbdplugin-provisioner" + rbdDaemonsetName = "csi-rbdplugin" + namespace = "default" ) func deployRBDPlugin() { @@ -54,13 +53,13 @@ var _ = Describe("RBD", func() { Context("Test RBD CSI", func() { It("Test RBD CSI", func() { By("checking provisioner deployment is completed") - err := waitForDeploymentComplete("csi-rbdplugin-provisioner", "default", f.ClientSet, deployTimeout) + err := waitForDeploymentComplete(rbdDeploymentName, namespace, f.ClientSet, deployTimeout) if err != nil { Fail(err.Error()) } By("checking nodeplugin deamonsets is running") - err = waitForDaemonSets("csi-rbdplugin", "default", f.ClientSet, deployTimeout) + err = waitForDaemonSets(rbdDaemonsetName, namespace, f.ClientSet, deployTimeout) if err != nil { Fail(err.Error()) }