ci: add e2e for csi-nfsplugin restart
This commit adds e2e for csi-nfsplugin restart
when it is not on host-networking.
Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 07aac106df)
This commit is contained in:
1 parent
cc19356068
commit
dd9d5076e0
4 files changed
+38
-11
No files matched your search
@@ -1400,6 +1400,10 @@ jobs:
|
||||
- name: test ceph-csi-cephfs plugin restart
|
||||
run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload
|
||||
|
||||
# uncomment once https://github.com/rook/rook/issues/10812 is resolved.
|
||||
# - name: test ceph-csi-nfs plugin restart
|
||||
# run: tests/scripts/github-action-helper.sh test_csi_nfs_workload
|
||||
|
||||
- name: collect common logs
|
||||
if: always()
|
||||
uses: ./.github/workflows/collect-logs
|
||||
@@ -1456,6 +1460,9 @@ jobs:
|
||||
- name: test ceph-csi-cephfs plugin restart
|
||||
run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload
|
||||
|
||||
- name: test ceph-csi-nfs plugin restart
|
||||
run: tests/scripts/github-action-helper.sh test_csi_nfs_workload
|
||||
|
||||
- name: collect common logs
|
||||
if: always()
|
||||
uses: ./.github/workflows/collect-logs
|
||||
|
||||
@@ -7,9 +7,4 @@
|
||||
registry.k8s.io/sig-storage/csi-provisioner:v3.2.1
|
||||
registry.k8s.io/sig-storage/csi-resizer:v1.5.0
|
||||
registry.k8s.io/sig-storage/csi-snapshotter:v6.0.1
|
||||
<<<<<<< HEAD
|
||||
registry.k8s.io/sig-storage/nfsplugin:v4.0.0
|
||||
rook/ceph:v1.10.0
|
||||
=======
|
||||
rook/ceph:master
|
||||
>>>>>>> 772222652 (csi: remove nfs image)
|
||||
@@ -164,7 +164,7 @@ function build_rook_all() {
|
||||
|
||||
function validate_yaml() {
|
||||
cd deploy/examples
|
||||
kubectl create -f crds.yaml -f common.yaml
|
||||
kubectl create -f crds.yaml -f common.yaml -f csi/nfs/rbac.yaml
|
||||
|
||||
# create and use PSPs on k8s versions older than 1.21
|
||||
kube_minor_ver="$(kubectl version -o json | jq -r '.serverVersion.minor')"
|
||||
@@ -192,10 +192,11 @@ function validate_yaml() {
|
||||
|
||||
function create_cluster_prerequisites() {
|
||||
# this might be called from another function that has already done a cd
|
||||
(cd deploy/examples && kubectl create -f crds.yaml -f common.yaml)
|
||||
( cd deploy/examples && kubectl create -f crds.yaml -f common.yaml -f csi/nfs/rbac.yaml )
|
||||
}
|
||||
|
||||
function deploy_manifest_with_local_build() {
|
||||
sed -i 's/.*ROOK_CSI_ENABLE_NFS:.*/ ROOK_CSI_ENABLE_NFS: \"true\"/g' $1
|
||||
if [[ "$USE_LOCAL_BUILD" != "false" ]]; then
|
||||
sed -i "s|image: rook/ceph:.*|image: rook/ceph:local-build|g" $1
|
||||
fi
|
||||
@@ -254,6 +255,7 @@ function deploy_csi_hostnetwork_disabled_cluster() {
|
||||
elif [ "$1" = "osd_with_metadata_device" ]; then
|
||||
sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\//}\n config:\n metadataDevice: /dev/test-rook-vg/test-rook-lv|g" cluster-test.yaml
|
||||
fi
|
||||
kubectl create -f nfs-test.yaml
|
||||
kubectl create -f cluster-test.yaml
|
||||
kubectl create -f filesystem-test.yaml
|
||||
deploy_manifest_with_local_build toolbox.yaml
|
||||
@@ -467,11 +469,14 @@ EOF
|
||||
|
||||
function deploy_multus_cluster() {
|
||||
cd deploy/examples
|
||||
sed -i 's/.*ROOK_CSI_ENABLE_NFS:.*/ ROOK_CSI_ENABLE_NFS: \"true\"/g' operator.yaml
|
||||
deploy_manifest_with_local_build operator.yaml
|
||||
deploy_manifest_with_local_build toolbox.yaml
|
||||
sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\//}|g" cluster-multus-test.yaml
|
||||
kubectl create -f cluster-multus-test.yaml
|
||||
kubectl create -f filesystem-test.yaml
|
||||
# uncomment once https://github.com/rook/rook/issues/10812 is resolved.
|
||||
# kubectl create -f nfs-test.yaml
|
||||
}
|
||||
|
||||
function wait_for_ceph_csi_configmap_to_be_updated {
|
||||
@@ -487,6 +492,12 @@ until [[ $(kubectl -n rook-ceph get configmap rook-ceph-csi-config -o jsonpath="
|
||||
sleep 5
|
||||
done
|
||||
EOF
|
||||
timeout 60 bash <<EOF
|
||||
until [[ $(kubectl -n rook-ceph get configmap rook-ceph-csi-config -o jsonpath="{.data.csi-cluster-config-json}" | jq .[0].nfs.netNamespaceFilePath) != "null" ]]; do
|
||||
echo "waiting for ceph csi configmap to be updated with nfs.netNamespaceFilePath"
|
||||
sleep 5
|
||||
done
|
||||
EOF
|
||||
}
|
||||
|
||||
function test_csi_rbd_workload {
|
||||
@@ -496,7 +507,7 @@ function test_csi_rbd_workload {
|
||||
kubectl create -f storageclass.yaml
|
||||
kubectl create -f pvc.yaml
|
||||
kubectl create -f pod.yaml
|
||||
timeout 45 sh -c 'until kubectl exec -t pod/csirbd-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test bs=1M count=1; do echo "waiting for test pod to be ready" && sleep 1; done'
|
||||
timeout 90 sh -c 'until kubectl exec -t pod/csirbd-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test bs=1M count=1; do echo "waiting for test pod to be ready" && sleep 1; done'
|
||||
kubectl exec -t pod/csirbd-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test oflag=direct bs=1M count=1
|
||||
kubectl -n rook-ceph logs ds/csi-rbdplugin -c csi-rbdplugin
|
||||
kubectl -n rook-ceph delete "$(kubectl -n rook-ceph get pod --selector=app=csi-rbdplugin --field-selector=status.phase=Running -o name)"
|
||||
@@ -509,7 +520,7 @@ function test_csi_cephfs_workload {
|
||||
kubectl create -f storageclass.yaml
|
||||
kubectl create -f pvc.yaml
|
||||
kubectl create -f pod.yaml
|
||||
timeout 45 sh -c 'until kubectl exec -t pod/csicephfs-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test bs=1M count=1; do echo "waiting for test pod to be ready" && sleep 1; done'
|
||||
timeout 90 sh -c 'until kubectl exec -t pod/csicephfs-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test bs=1M count=1; do echo "waiting for test pod to be ready" && sleep 1; done'
|
||||
kubectl exec -t pod/csicephfs-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test oflag=direct bs=1M count=1
|
||||
kubectl -n rook-ceph logs ds/csi-cephfsplugin -c csi-cephfsplugin
|
||||
kubectl -n rook-ceph delete "$(kubectl -n rook-ceph get pod --selector=app=csi-cephfsplugin --field-selector=status.phase=Running -o name)"
|
||||
@@ -517,6 +528,19 @@ function test_csi_cephfs_workload {
|
||||
kubectl exec -t pod/csicephfs-demo-pod -- ls -alh /var/lib/www/html/
|
||||
}
|
||||
|
||||
function test_csi_nfs_workload {
|
||||
cd deploy/examples/csi/nfs
|
||||
sed -i "s|#- debug|- nolock|" storageclass.yaml
|
||||
kubectl create -f storageclass.yaml
|
||||
kubectl create -f pvc.yaml
|
||||
kubectl create -f pod.yaml
|
||||
timeout 90 sh -c 'until kubectl exec -t pod/csinfs-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test bs=1M count=1; do echo "waiting for test pod to be ready" && sleep 1; done'
|
||||
kubectl exec -t pod/csinfs-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test oflag=direct bs=1M count=1
|
||||
kubectl -n rook-ceph delete "$(kubectl -n rook-ceph get pod --selector=app=csi-nfsplugin --field-selector=status.phase=Running -o name)"
|
||||
kubectl exec -t pod/csinfs-demo-pod -- dd if=/dev/random of=/var/lib/www/html/test1 oflag=direct bs=1M count=1
|
||||
kubectl exec -t pod/csinfs-demo-pod -- ls -alh /var/lib/www/html/
|
||||
}
|
||||
|
||||
FUNCTION="$1"
|
||||
shift # remove function arg now that we've recorded it
|
||||
# call the function with the remainder of the user-provided args
|
||||
|
||||
@@ -92,12 +92,12 @@ function test_csi {
|
||||
echo $IS_POD_NETWORK
|
||||
echo $IS_MULTUS
|
||||
if [ -z "$IS_POD_NETWORK" ]; then
|
||||
until [[ "$(kubectl -n rook-ceph get pods --field-selector=status.phase=Running|grep -c ^csi-)" -eq 4 ]]; do
|
||||
until [[ "$(kubectl -n rook-ceph get pods --field-selector=status.phase=Running|grep -c ^csi-)" -eq 6 ]]; do
|
||||
echo "waiting for csi pods to be ready"
|
||||
sleep 5
|
||||
done
|
||||
else
|
||||
until [[ "$(kubectl -n rook-ceph get pods --field-selector=status.phase=Running|grep -c ^csi-)" -eq 6 ]]; do
|
||||
until [[ "$(kubectl -n rook-ceph get pods --field-selector=status.phase=Running|grep -c ^csi-)" -eq 9 ]]; do
|
||||
echo "waiting for csi pods to be ready with multus or pod networking"
|
||||
sleep 5
|
||||
done
|
||||
@@ -106,6 +106,7 @@ function test_csi {
|
||||
echo "verifying csi holder interfaces (multus ones must be present)"
|
||||
kubectl -n rook-ceph exec -t ds/csi-rbdplugin-holder-my-cluster -- grep net /proc/net/dev
|
||||
kubectl -n rook-ceph exec -t ds/csi-cephfsplugin-holder-my-cluster -- grep net /proc/net/dev
|
||||
kubectl -n rook-ceph exec -t ds/csi-nfsplugin-holder-my-cluster -- grep net /proc/net/dev
|
||||
fi
|
||||
EOF
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user