Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: test load dump in binary format #5401

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/scripts/command/load_dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ do_dump_load_with_fsrand(){
do_dump_load_and_compare --fast --skip-trash
}

test_dump_load_with_fsrand_binary(){
prepare_test
./juicefs format $META_URL myjfs --trash-days 1 --enable-acl
./juicefs mount -d $META_URL /jfs --enable-xattr
SEED=$SEED LOG_LEVEL=WARNING MAX_EXAMPLE=30 STEP_COUNT=20 PROFILE=generate ROOT_DIR1=/jfs/fsrand ROOT_DIR2=/tmp/fsrand python3 .github/scripts/hypo/fs.py || true
do_dump_load_and_compare_in_binary
}

do_dump_load_and_compare()
{
option=$@
Expand All @@ -101,6 +109,24 @@ do_dump_load_and_compare()
umount /jfs2
}

do_dump_load_and_compare_in_binary()
{
option=$@
echo option is $option
./juicefs dump $META_URL dump.bin $option --binary
rm -rf test2.db
./juicefs load sqlite3://test2.db dump.bin --binary --stat | tee dump.stat
./juicefs load sqlite3://test2.db dump.bin --binary
./juicefs dump sqlite3://test2.db dump2.bin $option
./juicefs load sqlite3://test2.db dump2.bin --binary --stat | tee dump2.stat
diff dump.stat dump2.stat
# compare_dump_json
./juicefs mount -d sqlite3://test2.db /jfs2
diff -ur /jfs/fsrand /jfs2/fsrand --no-dereference
compare_stat_acl_xattr /jfs/fsrand /jfs2/fsrand
umount /jfs2
}

compare_dump_json(){
cp dump.json dump.json.bak
cp dump2.json dump2.json.bak
Expand Down
Loading