Skip to content

Commit 7f485f4

Browse files
WeiZhang555eryugey
authored andcommitted
CI: add unionmount-testsuite
Add unionmount-testsuite into CI for Overlay implementation Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
1 parent 75823c4 commit 7f485f4

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

.github/workflows/xfstests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,24 @@ jobs:
5252
run: |
5353
cd $GITHUB_WORKSPACE
5454
sudo ./tests/scripts/xfstests_overlay.sh
55+
56+
unionmount_testsuite_on_overlayfs:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
- name: Install Rust
62+
uses: actions-rs/toolchain@v1
63+
with:
64+
profile: minimal
65+
toolchain: stable
66+
override: true
67+
- name: Build overlay binary
68+
run: |
69+
cd tests/overlay
70+
cargo build --release
71+
sudo install -t /usr/sbin/ -m 700 ./target/release/overlay
72+
- name: Setup and run unionmount testsuite
73+
run: |
74+
cd $GITHUB_WORKSPACE
75+
sudo ./tests/scripts/unionmount_test_overlay.sh
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#!/bin/bash
2+
3+
# create fuse overlay mount script.
4+
# /tmp/testoverlay must exists.
5+
sudo cat >/usr/sbin/mount.fuse.testoverlay <<EOF
6+
#!/bin/bash
7+
8+
ulimit -n 1048576
9+
exec /usr/sbin/overlay \$@ -l info 1>>/tmp/testoverlay.log 2>&1 &
10+
sleep 1
11+
EOF
12+
sudo chmod +x /usr/sbin/mount.fuse.testoverlay
13+
14+
15+
# clone xfstests and install.
16+
cd /tmp/
17+
git clone -b ci-fuse-backend-rs https://github.com/WeiZhang555/unionmount-testsuite.git
18+
cd unionmount-testsuite
19+
20+
echo "====> Start to run unionmount-testsuite."
21+
22+
mkdir -p /tmp/unionmount/
23+
touch /tmp/summary
24+
success=0
25+
fail=0
26+
27+
for testcase in dir-open-dir \
28+
dir-open \
29+
dir-sym1-open \
30+
dir-sym1-weird-open \
31+
dir-sym2-open \
32+
dir-sym2-weird-open \
33+
dir-weird-open \
34+
hard-link-dir \
35+
hard-link \
36+
hard-link-sym \
37+
impermissible \
38+
mkdir \
39+
noent-creat-excl \
40+
noent-creat-excl-trunc \
41+
noent-creat \
42+
noent-creat-trunc \
43+
noent-plain \
44+
noent-trunc \
45+
open-creat-excl \
46+
open-creat-excl-trunc \
47+
open-creat \
48+
open-creat-trunc \
49+
open-plain \
50+
open-trunc \
51+
readlink \
52+
rename-exdev \
53+
rmdir \
54+
rmtree-new \
55+
rmtree \
56+
sym1-creat-excl \
57+
sym1-creat \
58+
sym1-plain \
59+
sym1-trunc \
60+
sym2-creat-excl \
61+
sym2-creat \
62+
sym2-plain \
63+
sym2-trunc \
64+
symx-creat-excl \
65+
symx-creat \
66+
symx-creat-trunc \
67+
symx-plain \
68+
symx-trunc \
69+
truncate \
70+
unlink
71+
# === Some test cases are not supported by unionmount currently ===
72+
# dir-weird-open-dir
73+
# rename-dir
74+
# rename-empty-dir
75+
# rename-file
76+
# rename-hard-link
77+
# rename-mass-2
78+
# rename-mass-3
79+
# rename-mass-4
80+
# rename-mass-5
81+
# rename-mass-dir
82+
# rename-mass
83+
# rename-mass-sym
84+
# rename-move-dir
85+
# rename-new-dir
86+
# rename-new-pop-dir
87+
# rename-pop-dir
88+
do
89+
UNIONMOUNT_BASEDIR=/tmp/unionmount sudo -E ./run --ov --fuse=testoverlay --xdev $testcase
90+
if [ $? -eq 0 ]
91+
then
92+
echo "===== SUCCESS: " $testcase >> /tmp/summary
93+
let success+=1
94+
else
95+
echo ">>>>>>>> FAIL: " $testcase >> /tmp/summary
96+
let fail+=1
97+
fi
98+
done;
99+
100+
cat /tmp/summary && rm /tmp/summary
101+
echo "Total: success: $success, fail: $fail"
102+
103+
if [ $fail -gt 0 ]
104+
then
105+
exit 1
106+
fi

0 commit comments

Comments
 (0)