Skip to content

Commit

Permalink
CI: add unionmount-testsuite
Browse files Browse the repository at this point in the history
Add unionmount-testsuite into CI for Overlay implementation

Signed-off-by: Wei Zhang <[email protected]>
  • Loading branch information
WeiZhang555 committed Jan 19, 2024
1 parent 9f71b81 commit 8f623a5
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/xfstests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,24 @@ jobs:
run: |
cd $GITHUB_WORKSPACE
sudo ./tests/scripts/xfstests_overlay.sh
unionmount_testsuite_on_overlayfs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build overlay binary
run: |
cd tests/overlay
cargo build --release
sudo install -t /usr/sbin/ -m 700 ./target/release/overlay
- name: Setup and run unionmount testsuite
run: |
cd $GITHUB_WORKSPACE
sudo ./tests/scripts/unionmount_test_overlay.sh
106 changes: 106 additions & 0 deletions tests/scripts/unionmount_test_overlay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash

# create fuse overlay mount script.
# /tmp/testoverlay must exists.
sudo cat >/usr/sbin/mount.fuse.testoverlay <<EOF
#!/bin/bash
ulimit -n 1048576
exec /usr/sbin/overlay \$@ -l info 1>>/tmp/testoverlay.log 2>&1 &
sleep 1
EOF
sudo chmod +x /usr/sbin/mount.fuse.testoverlay


# clone xfstests and install.
cd /tmp/
git clone -b ci-fuse-backend-rs https://github.com/WeiZhang555/unionmount-testsuite.git
cd unionmount-testsuite

echo "====> Start to run unionmount-testsuite."

mkdir -p /tmp/unionmount/
touch /tmp/summary
success=0
fail=0

for testcase in dir-open-dir \
dir-open \
dir-sym1-open \
dir-sym1-weird-open \
dir-sym2-open \
dir-sym2-weird-open \
dir-weird-open \
hard-link-dir \
hard-link \
hard-link-sym \
impermissible \
mkdir \
noent-creat-excl \
noent-creat-excl-trunc \
noent-creat \
noent-creat-trunc \
noent-plain \
noent-trunc \
open-creat-excl \
open-creat-excl-trunc \
open-creat \
open-creat-trunc \
open-plain \
open-trunc \
readlink \
rename-exdev \
rmdir \
rmtree-new \
rmtree \
sym1-creat-excl \
sym1-creat \
sym1-plain \
sym1-trunc \
sym2-creat-excl \
sym2-creat \
sym2-plain \
sym2-trunc \
symx-creat-excl \
symx-creat \
symx-creat-trunc \
symx-plain \
symx-trunc \
truncate \
unlink
# === Some test cases are not supported by unionmount currently ===
# dir-weird-open-dir
# rename-dir
# rename-empty-dir
# rename-file
# rename-hard-link
# rename-mass-2
# rename-mass-3
# rename-mass-4
# rename-mass-5
# rename-mass-dir
# rename-mass
# rename-mass-sym
# rename-move-dir
# rename-new-dir
# rename-new-pop-dir
# rename-pop-dir
do
UNIONMOUNT_BASEDIR=/tmp/unionmount sudo -E ./run --ov --fuse=testoverlay --xdev $testcase
if [ $? -eq 0 ]
then
echo "===== SUCCESS: " $testcase >> /tmp/summary
let success+=1
else
echo ">>>>>>>> FAIL: " $testcase >> /tmp/summary
let fail+=1
fi
done;

cat /tmp/summary && rm /tmp/summary
echo "Total: success: $success, fail: $fail"

if [ $fail -gt 0 ]
then
exit 1
fi

0 comments on commit 8f623a5

Please sign in to comment.