Skip to content

Commit

Permalink
csi: add test for rbd ls with rados namespace
Browse files Browse the repository at this point in the history
this pr introduces a new test to verify the  `rbd ls`
command functionality when working with rados namespaces.
the test ensures that rbd images are correctly listed
when namespaces are configured.

Signed-off-by: Oded Viner <[email protected]>
  • Loading branch information
OdedViner committed Dec 17, 2024
1 parent d3a34a2 commit 39cd407
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/github-action-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,39 @@ deploy_csi_driver_default_ns() {
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/deploy/examples/csi/rbd/pvc.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/deploy/examples/csi/cephfs/storageclass.yaml
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/deploy/examples/csi/cephfs/pvc.yaml

# rasdos namespace
curl https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/pool-test.yaml -o pool_rados_ns.yaml
sed -i "s|name: replicapool|name: blockpool-rados-ns |g" pool_rados_ns.yaml
kubectl create -f pool_rados_ns.yaml
sleep 5

curl https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/radosnamespace.yaml -o cephblockpoolradosnamespace_a.yaml
sed -i "s|blockPoolName: replicapool|blockPoolName: blockpool-rados-ns |g" cephblockpoolradosnamespace_a.yaml
kubectl create -f cephblockpoolradosnamespace_a.yaml
sleep 5


cluster_id=$(kubectl -n rook-ceph get cephblockpoolradosnamespace/namespace-a -o jsonpath='{.status.info.clusterID}')
echo "debug_cluster_id=${cluster_id}"
curl https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/csi/rbd/storageclass-test.yaml -o storageclass-rados-namespace.yaml
sed -i "s|clusterID: rook-ceph # namespace:cluster|clusterID: ${cluster_id} |g" storageclass-rados-namespace.yaml
sed -i "s|name: rook-ceph-block|name: rook-ceph-block-rados-namespace |g" storageclass-rados-namespace.yaml
sed -i "s|pool: replicapool|pool: blockpool-rados-ns |g" storageclass-rados-namespace.yaml
kubectl apply -f storageclass-rados-namespace.yaml
sleep 5

curl https://raw.githubusercontent.com/rook/rook/refs/heads/master/deploy/examples/radosnamespace.yaml -o cephblockpoolradosnamespace_b.yaml
sed -i "s|blockPoolName: replicapool|blockPoolName: blockpool-rados-ns |g" cephblockpoolradosnamespace_b.yaml
sed -i "s|name: namespace-a|name: namespace-b |g" cephblockpoolradosnamespace_b.yaml
kubectl create -f cephblockpoolradosnamespace_b.yaml
sleep 5

curl https://raw.githubusercontent.com/rook/rook/master/deploy/examples/csi/rbd/pvc.yaml -o pvc-rados-namespace.yaml
sed -i "s|name: rbd-pvc|name: rbd-pvc-rados-namespace |g" pvc-rados-namespace.yaml
sed -i "s|storageClassName: rook-ceph-block|storageClassName: rook-ceph-block-rados-namespace |g" pvc-rados-namespace.yaml
kubectl create -f pvc-rados-namespace.yaml
sleep 5
}

deploy_csi_driver_custom_ns() {
Expand Down

0 comments on commit 39cd407

Please sign in to comment.