Merge pull request #10286 from cybozu-go/core-add-osd-with-metadata-device-case
test: add canary integration test for osd with metadata device
This commit is contained in:
2 files changed
+65
-7
No files matched your search
@@ -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: |
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user