From 5b3633bfd6c2add55b2aa1dc15268cc5cb092650 Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Thu, 19 May 2022 23:02:56 +0900 Subject: [PATCH] test: add canary integration test for osd with metadata device "metadataDevice" field in host based cluster is not tested yet. Signed-off-by: Satoru Takeuchi --- .github/workflows/canary-integration-test.yml | 61 ++++++++++++++++++- tests/scripts/github-action-helper.sh | 11 ++-- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 380a777fc..cb46ce3e7 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -328,6 +328,59 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + osd-with-metadata-device: + runs-on: ubuntu-18.04 + if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: setup cluster resources + uses: ./.github/workflows/setup-cluster-resources + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: validate-yaml + run: tests/scripts/github-action-helper.sh validate_yaml + + - name: use local disk as OSD + run: | + + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh use_local_disk + tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only + + - name: create LV on disk + run: | + dd if=/dev/zero of=test-rook.img bs=1 count=0 seek=10G + # If we use metadata device, both data devices and metadata devices should be logical volumes or raw devices + tests/scripts/github-action-helper.sh create_LV_on_disk $(sudo losetup --find --show test-rook.img) + + - name: deploy cluster + run: tests/scripts/github-action-helper.sh deploy_cluster osd_with_metadata_device + + - name: wait for prepare pod + run: tests/scripts/github-action-helper.sh wait_for_prepare_pod + + - name: wait for ceph to be ready + run: tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 1 + + - name: check-ownerreferences + run: tests/scripts/github-action-helper.sh check_ownerreferences + + - name: collect common logs + if: always() + uses: ./.github/workflows/collect-logs + with: + name: canary + + - name: setup tmate session for debugging when event is PR + if: failure() && github.event_name == 'pull_request' + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 60 + pvc: runs-on: ubuntu-18.04 if: "!contains(github.event.pull_request.labels.*.name, 'skip-ci')" @@ -814,11 +867,17 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} + - name: create cluster prerequisites + run: tests/scripts/github-action-helper.sh create_cluster_prerequisites + - name: use local disk run: tests/scripts/github-action-helper.sh use_local_disk - name: create LV on disk - run: tests/scripts/github-action-helper.sh create_LV_on_disk + run: | + BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1) + tests/scripts/github-action-helper.sh create_LV_on_disk $BLOCK + tests/scripts/localPathPV.sh /dev/test-rook-vg/test-rook-lv - name: deploy cluster run: | diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index 80a31da00..8962e2409 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -212,6 +212,8 @@ function deploy_cluster() { sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\/}|g" cluster-test.yaml elif [ "$1" = "two_osds_in_device" ] ; then sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\/}\n config:\n osdsPerDevice: \"2\"|g" cluster-test.yaml + 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 cluster-test.yaml kubectl create -f object-test.yaml @@ -280,15 +282,12 @@ function check_ownerreferences() { } function create_LV_on_disk() { - sudo sgdisk --zap-all "${BLOCK}" + DEVICE=$1 VG=test-rook-vg LV=test-rook-lv - sudo pvcreate "$BLOCK" - sudo vgcreate "$VG" "$BLOCK" || sudo vgcreate "$VG" "$BLOCK" || sudo vgcreate "$VG" "$BLOCK" + sudo sgdisk --zap-all "${DEVICE}" + sudo vgcreate "$VG" "$DEVICE" || sudo vgcreate "$VG" "$DEVICE" || sudo vgcreate "$VG" "$DEVICE" sudo lvcreate -l 100%FREE -n "${LV}" "${VG}" - tests/scripts/localPathPV.sh /dev/"${VG}"/${LV} - kubectl create -f deploy/examples/crds.yaml - kubectl create -f deploy/examples/common.yaml } function deploy_first_rook_cluster() {