From 7d660d9ccf04e751a3a024f4926e0417c9bdb648 Mon Sep 17 00:00:00 2001 From: Zhou Cheng Date: Fri, 7 Jul 2023 10:10:23 +0800 Subject: [PATCH] Ci test config min/max client verion (#3882) --- .github/scripts/command/config.sh | 43 +++++++++++++++++++++++++++++++ .github/scripts/command/quota.sh | 4 +-- .github/workflows/command.yml | 6 ++++- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100755 .github/scripts/command/config.sh diff --git a/.github/scripts/command/config.sh b/.github/scripts/command/config.sh new file mode 100755 index 000000000000..93a2f143cb11 --- /dev/null +++ b/.github/scripts/command/config.sh @@ -0,0 +1,43 @@ +#!/bin/bash -e +source .github/scripts/common/common.sh + +[[ -z "$META" ]] && META=sqlite3 +source .github/scripts/start_meta_engine.sh +start_meta_engine $META +META_URL=$(get_meta_url $META) + +download_juicefs_client(){ + version=$1 + wget -q https://github.com/juicedata/juicefs/releases/download/v$version/juicefs-$version-linux-amd64.tar.gz + tar -xzf juicefs-$version-linux-amd64.tar.gz -C /tmp/ + sudo cp /tmp/juicefs juicefs-$version + ./juicefs-$version version +} + +test_config_min_client_version() +{ + prepare_test + download_juicefs_client 1.0.0 + ./juicefs format $META_URL myjfs + ./juicefs-1.0.0 mount $META_URL /jfs -d && exit 1 || true + ./juicefs config $META_URL --min-client-version 1.0.1 + ./juicefs-1.0.0 mount $META_URL /jfs -d && exit 1 || true + ./juicefs config $META_URL --min-client-version 1.0.0 + ./juicefs-1.0.0 mount $META_URL /jfs -d +} + +test_config_max_client_version() +{ + prepare_test + current_version=$(./juicefs version | awk '{print $3}') + download_juicefs_client 1.0.0 + ./juicefs-1.0.0 format $META_URL myjfs + ./juicefs-1.0.0 config $META_URL --max-client-version 1.0.1 + ./juicefs mount $META_URL /jfs -d && exit 1 || true + ./juicefs config $META_URL --max-client-version $current_version + ./juicefs mount $META_URL /jfs -d +} + + +source .github/scripts/common/run_test.sh && run_test $@ + diff --git a/.github/scripts/command/quota.sh b/.github/scripts/command/quota.sh index 61d2406b4542..7913e66a9700 100755 --- a/.github/scripts/command/quota.sh +++ b/.github/scripts/command/quota.sh @@ -52,10 +52,10 @@ test_total_inodes(){ echo a | tee /jfs/test1001 2>error.log && echo "write should fail on out of inodes" && exit 1 || true grep "No space left on device" error.log ./juicefs config $META_URL --inodes 2000 - sleep 6s + sleep $((HEARTBEAT_INTERVAL+1)) set +x for i in {1001..2000}; do - echo $i | tee /jfs/test$i > /dev/null + echo $i | tee /jfs/test$i > /dev/null || (echo "df -i /jfs" && exit 1) done set -x sleep $VOLUME_QUOTA_FLUSH_INTERVAL diff --git a/.github/workflows/command.yml b/.github/workflows/command.yml index 55f3ed233901..3f3563637547 100644 --- a/.github/workflows/command.yml +++ b/.github/workflows/command.yml @@ -74,6 +74,10 @@ jobs: - name: Build uses: ./.github/actions/build + - name: Test Config + run: | + sudo META=${{matrix.meta}} .github/scripts/command/config.sh + - name: Test Quota timeout-minutes: 30 run: | @@ -102,7 +106,7 @@ jobs: - name: Test Info run: | sudo META=${{matrix.meta}} .github/scripts/command/info.sh - + - name: Test Sync timeout-minutes: 30 run: |