Merge pull request #9931 from cybozu-go/test-add-canary-integration-tests-for-osd-on-device

test: add canary integration tests for osd on device
This commit is contained in:
Satoru Takeuchi authored and GitHub committed 2022-05-06 05:25:57 +09:00
commit a9465efa07
3 files changed
+130 -18

No files matched your search

@@ -164,6 +164,98 @@ jobs:
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
raw-disk:
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: |
tests/scripts/github-action-helper.sh use_local_disk
BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)
tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only
- name: deploy cluster
run: tests/scripts/github-action-helper.sh deploy_cluster
- 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
two-osds-in-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: |
tests/scripts/github-action-helper.sh use_local_disk
BLOCK=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)
tests/scripts/create-bluestore-partitions.sh --disk "$BLOCK" --wipe-only
- name: deploy cluster
run: tests/scripts/github-action-helper.sh deploy_cluster two_osds_in_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 2
- 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')"
+32 -16
View File
@@ -35,8 +35,14 @@ function usage {
}
function wipe_disk {
sudo sgdisk --zap-all --clear --mbrtogpt -g -- "$DISK"
sudo sgdisk --zap-all -- "$DISK"
sudo dd if=/dev/zero of="$DISK" bs=1M count=10
if [ -n "$WIPE_ONLY" ]; then
# `parted "$DISK -s print" exits with 1 if the partition label doesn't exist.
# It's no problem in "--wipe-only" mode
sudo parted "$DISK" -s print || :
return
fi
sudo parted -s "$DISK" mklabel gpt
sudo partprobe "$DISK"
sudo udevadm settle
@@ -82,6 +88,9 @@ while [ "$1" != "" ]; do
shift
OSD_COUNT="$1"
;;
--wipe-only)
WIPE_ONLY=1
;;
-h | --help)
usage
exit
@@ -96,22 +105,29 @@ done
# First wipe the disk
wipe_disk
if [ -n "$BLUESTORE_TYPE" ]; then
case "$BLUESTORE_TYPE" in
block.db)
create_partition block.db
;;
block.wal)
create_partition block.db
create_partition block.wal
;;
*)
printf "invalid bluestore configuration %q" "$BLUESTORE_TYPE" >&2
exit 1
esac
if [ -n "$WIPE_ONLY" ]; then
exit
fi
if [ -z "$WIPE_ONLY" ]; then
if [ -n "$BLUESTORE_TYPE" ]; then
case "$BLUESTORE_TYPE" in
block.db)
create_partition block.db
;;
block.wal)
create_partition block.db
create_partition block.wal
;;
*)
printf "invalid bluestore configuration %q" "$BLUESTORE_TYPE" >&2
exit 1
esac
fi
# Create final block partitions
create_block_partition "$OSD_COUNT"
fi
# Create final block partitions
create_block_partition "$OSD_COUNT"
# Inform the kernel of partition table changes
sudo partprobe "$DISK"
+6 -2
View File
@@ -49,7 +49,7 @@ function use_local_disk() {
sudo wipefs --all --force "$BLOCK_DATA_PART"
else
# it's the hosted runner!
sudo sgdisk --zap-all --clear --mbrtogpt -g -- "${BLOCK}"
sudo sgdisk --zap-all -- "${BLOCK}"
sudo dd if=/dev/zero of="${BLOCK}" bs=1M count=10 oflag=direct,dsync
sudo parted -s "${BLOCK}" mklabel gpt
fi
@@ -208,7 +208,11 @@ function replace_ceph_image() {
function deploy_cluster() {
cd deploy/examples
deploy_manifest_with_local_build operator.yaml
sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\/}|g" cluster-test.yaml
if [ $# == 0 ]; then
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
fi
kubectl create -f cluster-test.yaml
kubectl create -f object-test.yaml
kubectl create -f pool-test.yaml