e2e: add tests to validate cluster name

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-06-14 19:20:42 +05:30 committed by mergify[bot]
parent 3ddb8c289c
commit 2390a43415
2 changed files with 11 additions and 0 deletions

View File

@ -194,6 +194,14 @@ var _ = Describe(cephfsType, func() {
if err != nil {
e2elog.Failf("failed to create node secret: %v", err)
}
// wait for cluster name update in deployment
containers := []string{cephFSContainerName}
err = waitForContainersArgsUpdate(c, cephCSINamespace, cephFSDeploymentName,
"clustername", defaultClusterName, containers, deployTimeout)
if err != nil {
e2elog.Failf("timeout waiting for deployment update %s/%s: %v", cephCSINamespace, cephFSDeploymentName, err)
}
})
AfterEach(func() {
@ -441,6 +449,8 @@ var _ = Describe(cephfsType, func() {
e2elog.Failf("expected pvcNamespace %q got %q", pvc.Namespace, metadata.PVCNamespaceKey)
} else if metadata.PVNameKey != pvcObj.Spec.VolumeName {
e2elog.Failf("expected pvName %q got %q", pvcObj.Spec.VolumeName, metadata.PVNameKey)
} else if metadata.ClusterNameKey != defaultClusterName {
e2elog.Failf("expected clusterName %q got %q", defaultClusterName, metadata.ClusterNameKey)
}
err = deletePVCAndValidatePV(f.ClientSet, pvc, deployTimeout)

View File

@ -216,6 +216,7 @@ type cephfsSubvolumeMetadata struct {
PVCNameKey string `json:"csi.storage.k8s.io/pvc/name"`
PVCNamespaceKey string `json:"csi.storage.k8s.io/pvc/namespace"`
PVNameKey string `json:"csi.storage.k8s.io/pv/name"`
ClusterNameKey string `json:"csi.ceph.com/cluster/name"`
}
func listCephFSSubvolumeMetadata(