mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
e2e: added test to verify read affinity functionality
e2e test case is added to test if read affinity is enabled by verifying read_from_replica=localize option is passed Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
39
e2e/rbd.go
39
e2e/rbd.go
@ -65,6 +65,12 @@ var (
|
||||
rbdTopologyPool = "newrbdpool"
|
||||
rbdTopologyDataPool = "replicapool" // NOTE: should be different than rbdTopologyPool for test to be effective
|
||||
|
||||
// CRUSH location node labels & values.
|
||||
crushLocationRegionLabel = "topology.kubernetes.io/region"
|
||||
crushLocationRegionValue = "east"
|
||||
crushLocationZoneLabel = "topology.kubernetes.io/zone"
|
||||
crushLocationZoneValue = "east-zone1"
|
||||
|
||||
// yaml files required for deployment.
|
||||
pvcPath = rbdExamplePath + "pvc.yaml"
|
||||
appPath = rbdExamplePath + "pod.yaml"
|
||||
@ -161,9 +167,11 @@ func createORDeleteRbdResources(action kubectlAction) {
|
||||
},
|
||||
// the node-plugin itself
|
||||
&yamlResourceNamespaced{
|
||||
filename: rbdDirPath + rbdNodePlugin,
|
||||
namespace: cephCSINamespace,
|
||||
domainLabel: nodeRegionLabel + "," + nodeZoneLabel,
|
||||
filename: rbdDirPath + rbdNodePlugin,
|
||||
namespace: cephCSINamespace,
|
||||
domainLabel: nodeRegionLabel + "," + nodeZoneLabel,
|
||||
enableReadAffinity: true,
|
||||
crushLocationLabels: crushLocationRegionLabel + "," + crushLocationZoneLabel,
|
||||
},
|
||||
}
|
||||
|
||||
@ -275,6 +283,14 @@ var _ = Describe("RBD", func() {
|
||||
if err != nil {
|
||||
framework.Failf("failed to create node label: %v", err)
|
||||
}
|
||||
err = createNodeLabel(f, crushLocationRegionLabel, crushLocationRegionValue)
|
||||
if err != nil {
|
||||
framework.Failf("failed to create node label: %v", err)
|
||||
}
|
||||
err = createNodeLabel(f, crushLocationZoneLabel, crushLocationZoneValue)
|
||||
if err != nil {
|
||||
framework.Failf("failed to create node label: %v", err)
|
||||
}
|
||||
if cephCSINamespace != defaultNs {
|
||||
err = createNamespace(c, cephCSINamespace)
|
||||
if err != nil {
|
||||
@ -409,6 +425,15 @@ var _ = Describe("RBD", func() {
|
||||
if err != nil {
|
||||
framework.Failf("failed to delete node label: %v", err)
|
||||
}
|
||||
// Remove the CRUSH Location labels
|
||||
err = deleteNodeLabel(c, crushLocationRegionLabel)
|
||||
if err != nil {
|
||||
framework.Failf("failed to delete node label: %v", err)
|
||||
}
|
||||
err = deleteNodeLabel(c, crushLocationZoneLabel)
|
||||
if err != nil {
|
||||
framework.Failf("failed to delete node label: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
Context("Test RBD CSI", func() {
|
||||
@ -444,6 +469,14 @@ var _ = Describe("RBD", func() {
|
||||
})
|
||||
}
|
||||
|
||||
By("verify readAffinity support", func() {
|
||||
err := verifyReadAffinity(f, pvcPath, appPath,
|
||||
rbdDaemonsetName, rbdContainerName, cephCSINamespace)
|
||||
if err != nil {
|
||||
framework.Failf("failed to verify readAffinity: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
By("verify mountOptions support", func() {
|
||||
err := verifySeLinuxMountOption(f, pvcPath, appPath,
|
||||
rbdDaemonsetName, rbdContainerName, cephCSINamespace)
|
||||
|
Reference in New Issue
Block a user