From 4f9c31fa8bf878dfa2260325db3a78642549482d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 11 Oct 2021 16:47:02 +0200 Subject: [PATCH 1/2] ci: clarify the wait for csi to be ready MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wait is now more comprehensive. Signed-off-by: Sébastien Han --- tests/scripts/validate_cluster.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/scripts/validate_cluster.sh b/tests/scripts/validate_cluster.sh index 0b60a51fe..aac2333a8 100755 --- a/tests/scripts/validate_cluster.sh +++ b/tests/scripts/validate_cluster.sh @@ -88,12 +88,12 @@ function test_demo_pool { } function test_csi { - # shellcheck disable=SC2046 - timeout 180 sh -c 'until [ $(kubectl -n rook-ceph get pods --field-selector=status.phase=Running|grep -c ^csi-) -eq 4 ]; do sleep 1; done' - if [ $? -eq 0 ]; then - return 0 - fi - return 1 + timeout 180 bash <<-'EOF' + until [[ "$(kubectl -n rook-ceph get pods --field-selector=status.phase=Running|grep -c ^csi-)" -eq 4 ]]; do + echo "waiting for csi pods to be ready" + sleep 5 + done +EOF } function display_status { From abc5c635a67b0d1d18b39b1efd9e4039cc5882d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 11 Oct 2021 16:47:49 +0200 Subject: [PATCH 2/2] ci: fix osd disk permission on provisioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the OSD is prepared, systemd-udev kicks in since the device has been exclusively opened and thus reverts the permissions to root:disk. We need a udev rule to force re-applying the correct ceph permission so we can consume the disk. Closes: https://github.com/rook/rook/issues/8942 Signed-off-by: Sébastien Han --- tests/scripts/create-bluestore-partitions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/scripts/create-bluestore-partitions.sh b/tests/scripts/create-bluestore-partitions.sh index c0d25517e..0c5f0891e 100755 --- a/tests/scripts/create-bluestore-partitions.sh +++ b/tests/scripts/create-bluestore-partitions.sh @@ -56,6 +56,7 @@ function create_block_partition { for osd in $(seq 1 "$osd_count"); do echo "$osd" create_partition osd-"$osd" + echo "SUBSYSTEM==\"block\", ATTR{size}==\"12582912\", ATTR{partition}==\"$osd\", ACTION==\"add\", RUN+=\"/bin/chown 167:167 ${DISK}${osd}\"" | sudo tee -a /etc/udev/rules.d/01-rook-"$osd".rules done fi } @@ -120,4 +121,4 @@ sudo udevadm settle # Print drives sudo lsblk -sudo parted "$DISK" -s print \ No newline at end of file +sudo parted "$DISK" -s print