From e28eeb7551793b19dcc300c113d03a0dd3d8bbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= Date: Wed, 28 Aug 2019 14:44:00 +0200 Subject: [PATCH] Tests: Fix typo, defintion -> definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kristoffer Grönlund --- tests/integration/ceph_base_block_test.go | 6 ++--- .../ceph_zblock_mount_unmount_test.go | 24 +++++++++---------- tests/longhaul/base_block_test.go | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/integration/ceph_base_block_test.go b/tests/integration/ceph_base_block_test.go index 78c81810f..5b5a72e69 100644 --- a/tests/integration/ceph_base_block_test.go +++ b/tests/integration/ceph_base_block_test.go @@ -93,7 +93,7 @@ func runBlockE2ETest(helper *clients.TestClient, k8sh *utils.K8sHelper, s suite. logger.Infof("step 7: Mount same block storage on a different pod. Should not be allowed") otherPod := "block-test2" - _, mtErr := helper.BlockClient.BlockMap(getBlockPodDefintion(otherPod, blockName, false)) + _, mtErr := helper.BlockClient.BlockMap(getBlockPodDefinition(otherPod, blockName, false)) require.Nil(s.T(), mtErr) require.True(s.T(), k8sh.IsPodInError(otherPod, defaultNamespace, "FailedMount", "Volume is already attached by pod"), "make sure block-test2 pod errors out while mounting the volume") logger.Infof("Block Storage successfully fenced") @@ -147,7 +147,7 @@ func runBlockE2ETest(helper *clients.TestClient, k8sh *utils.K8sHelper, s suite. } func createPodWithBlock(helper *clients.TestClient, k8sh *utils.K8sHelper, s suite.Suite, namespace, blockName, podName string) string { - _, mtErr := helper.BlockClient.BlockMap(getBlockPodDefintion(podName, blockName, false)) + _, mtErr := helper.BlockClient.BlockMap(getBlockPodDefinition(podName, blockName, false)) require.Nil(s.T(), mtErr) crdName, err := k8sh.GetVolumeResourceName(defaultNamespace, blockName) require.Nil(s.T(), err) @@ -304,7 +304,7 @@ func cleanupDynamicBlockStorage(helper *clients.TestClient, namespace string) { } } -func getBlockPodDefintion(podName, blockName string, readOnly bool) string { +func getBlockPodDefinition(podName, blockName string, readOnly bool) string { return `apiVersion: v1 kind: Pod metadata: diff --git a/tests/integration/ceph_zblock_mount_unmount_test.go b/tests/integration/ceph_zblock_mount_unmount_test.go index e724ec28d..9ae79c982 100644 --- a/tests/integration/ceph_zblock_mount_unmount_test.go +++ b/tests/integration/ceph_zblock_mount_unmount_test.go @@ -116,7 +116,7 @@ func (s *BlockMountUnMountSuite) setupPVCs() { require.True(s.T(), s.kh.WaitUntilPVCIsBound(defaultNamespace, s.pvcNameRWX), "Make sure PVC is Bound") // Mount PVC on a pod and write some data. - _, mtErr := s.bc.BlockMap(getBlockPodDefintion("setup-block-rwo", s.pvcNameRWO, false)) + _, mtErr := s.bc.BlockMap(getBlockPodDefinition("setup-block-rwo", s.pvcNameRWO, false)) require.Nil(s.T(), mtErr) crdName, err := s.kh.GetVolumeResourceName(defaultNamespace, s.pvcNameRWO) require.Nil(s.T(), err) @@ -128,7 +128,7 @@ func (s *BlockMountUnMountSuite) setupPVCs() { } require.True(s.T(), rwoVolumePresent, fmt.Sprintf("make sure rwo Volume %s is created", crdName)) - _, mtErr1 := s.bc.BlockMap(getBlockPodDefintion("setup-block-rwx", s.pvcNameRWX, false)) + _, mtErr1 := s.bc.BlockMap(getBlockPodDefinition("setup-block-rwx", s.pvcNameRWX, false)) require.Nil(s.T(), mtErr1) crdName1, err1 := s.kh.GetVolumeResourceName(defaultNamespace, s.pvcNameRWX) require.Nil(s.T(), err1) @@ -170,10 +170,10 @@ func (s *BlockMountUnMountSuite) TestBlockStorageMountUnMountForDifferentAccessM logger.Infof("Test case when existing RWO PVC is mounted and unmounted on pods with various accessModes") logger.Infof("Step 1.1: Mount existing ReadWriteOnce and ReadWriteMany PVC on a Pod with RW access") // mount PVC with RWO access on a pod with readonly set to false - _, err := s.bc.BlockMap(getBlockPodDefintion("rwo-block-rw-one", s.pvcNameRWO, false)) + _, err := s.bc.BlockMap(getBlockPodDefinition("rwo-block-rw-one", s.pvcNameRWO, false)) require.Nil(s.T(), err) // mount PVC with RWX access on a pod with readonly set to false - _, err = s.bc.BlockMap(getBlockPodDefintion("rwx-block-rw-one", s.pvcNameRWX, false)) + _, err = s.bc.BlockMap(getBlockPodDefinition("rwx-block-rw-one", s.pvcNameRWX, false)) require.Nil(s.T(), err) crdName1, err1 := s.kh.GetVolumeResourceName(defaultNamespace, s.pvcNameRWO) crdName2, err2 := s.kh.GetVolumeResourceName(defaultNamespace, s.pvcNameRWX) @@ -214,10 +214,10 @@ func (s *BlockMountUnMountSuite) TestBlockStorageMountUnMountForDifferentAccessM // Mount another Pod with RW access on same PVC logger.Infof("Step 4: Mount existing ReadWriteOnce and ReadWriteMany PVC on a new Pod with RW access") // Mount RWO PVC on a new pod with ReadOnly set to false - _, err = s.bc.BlockMap(getBlockPodDefintion("rwo-block-rw-two", s.pvcNameRWO, false)) + _, err = s.bc.BlockMap(getBlockPodDefinition("rwo-block-rw-two", s.pvcNameRWO, false)) assert.Nil(s.T(), err) // Mount RWX PVC on a new pod with ReadOnly set to false - _, err = s.bc.BlockMap(getBlockPodDefintion("rwx-block-rw-two", s.pvcNameRWX, false)) + _, err = s.bc.BlockMap(getBlockPodDefinition("rwx-block-rw-two", s.pvcNameRWX, false)) assert.Nil(s.T(), err) assert.True(s.T(), s.kh.IsPodInError("rwo-block-rw-two", defaultNamespace, "FailedMount", "Volume is already attached by pod"), "make sure rwo-block-rw-two pod errors out while mounting the volume") assert.True(s.T(), s.kh.IsPodInError("rwx-block-rw-two", defaultNamespace, "FailedMount", "Volume is already attached by pod"), "make sure rwx-block-rw-two pod errors out while mounting the volume") @@ -228,10 +228,10 @@ func (s *BlockMountUnMountSuite) TestBlockStorageMountUnMountForDifferentAccessM logger.Infof("Step 5: Mount existing ReadWriteOnce and ReadWriteMany PVC on a new Pod with RO access") // Mount RWO PVC on a new pod with ReadOnly set to true - _, err = s.bc.BlockMap(getBlockPodDefintion("rwo-block-ro-one", s.pvcNameRWO, true)) + _, err = s.bc.BlockMap(getBlockPodDefinition("rwo-block-ro-one", s.pvcNameRWO, true)) assert.Nil(s.T(), err) // Mount RWX PVC on a new pod with ReadOnly set to true - _, err = s.bc.BlockMap(getBlockPodDefintion("rwx-block-ro-one", s.pvcNameRWX, true)) + _, err = s.bc.BlockMap(getBlockPodDefinition("rwx-block-ro-one", s.pvcNameRWX, true)) assert.Nil(s.T(), err) assert.True(s.T(), s.kh.IsPodInError("rwo-block-ro-one", defaultNamespace, "FailedMount", "Volume is already attached by pod"), "make sure rwo-block-ro-one pod errors out while mounting the volume") assert.True(s.T(), s.kh.IsPodInError("rwx-block-ro-one", defaultNamespace, "FailedMount", "Volume is already attached by pod"), "make sure rwx-block-ro-one pod errors out while mounting the volume") @@ -248,13 +248,13 @@ func (s *BlockMountUnMountSuite) TestBlockStorageMountUnMountForDifferentAccessM logger.Infof("Step 7: Mount ReadWriteOnce and ReadWriteMany PVC on two different pods with ReadOnlyMany with Readonly Access") // Mount RWO PVC on 2 pods with ReadOnly set to True - _, err1 = s.bc.BlockMap(getBlockPodDefintion("rwo-block-ro-one", s.pvcNameRWO, true)) - _, err2 = s.bc.BlockMap(getBlockPodDefintion("rwo-block-ro-two", s.pvcNameRWO, true)) + _, err1 = s.bc.BlockMap(getBlockPodDefinition("rwo-block-ro-one", s.pvcNameRWO, true)) + _, err2 = s.bc.BlockMap(getBlockPodDefinition("rwo-block-ro-two", s.pvcNameRWO, true)) assert.Nil(s.T(), err1) assert.Nil(s.T(), err2) // Mount RWX PVC on 2 pods with ReadOnly set to True - _, err1 = s.bc.BlockMap(getBlockPodDefintion("rwx-block-ro-one", s.pvcNameRWX, true)) - _, err2 = s.bc.BlockMap(getBlockPodDefintion("rwx-block-ro-two", s.pvcNameRWX, true)) + _, err1 = s.bc.BlockMap(getBlockPodDefinition("rwx-block-ro-one", s.pvcNameRWX, true)) + _, err2 = s.bc.BlockMap(getBlockPodDefinition("rwx-block-ro-two", s.pvcNameRWX, true)) assert.Nil(s.T(), err1) assert.Nil(s.T(), err2) assert.True(s.T(), s.kh.IsPodRunning("rwo-block-ro-one", defaultNamespace), "make sure rwo-block-ro-one pod is in running state") diff --git a/tests/longhaul/base_block_test.go b/tests/longhaul/base_block_test.go index 260aa376f..2902cb996 100644 --- a/tests/longhaul/base_block_test.go +++ b/tests/longhaul/base_block_test.go @@ -83,7 +83,7 @@ func mountUnmountPVCOnPod(k8sh *utils.K8sHelper, podName string, pvcName string, "readOnly": readonly, } - result, err := k8sh.ResourceOperationFromTemplate(action, getBlockPodDefintion(), config) + result, err := k8sh.ResourceOperationFromTemplate(action, getBlockPodDefinition(), config) return result, err } @@ -249,7 +249,7 @@ spec: claimName: {{.pvcName}}` } -func getBlockPodDefintion() string { +func getBlockPodDefinition() string { return `apiVersion: v1 kind: Pod metadata: