Skip to content

Commit

Permalink
Ci test config min/max client verion (#3882)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored Jul 7, 2023
1 parent 7255da5 commit 7d660d9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/scripts/command/config.sh
Original file line number Diff line number Diff line change
@@ -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 $@

4 changes: 2 additions & 2 deletions .github/scripts/command/quota.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 7d660d9

Please sign in to comment.