Skip to content

Commit d9c85ea

Browse files
WeiZhang555eryugey
authored andcommitted
CI: add xfstests
Add xfstests into CI for overlayfs, it will work as Github Actions. Currently not all test cases can be run, only about half of `generic/*` for the Fuse Overlay FS, some test cases are expected to fail due to missing function implementation, little are unexpected due to potential bugs which will be investigated laterly. Signed-off-by: Wei Zhang <[email protected]>
1 parent 1b080d6 commit d9c85ea

File tree

6 files changed

+105
-2
lines changed

6 files changed

+105
-2
lines changed

.github/workflows/xfstests.yml

+20
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,23 @@ jobs:
3232
cd $GITHUB_WORKSPACE
3333
sudo ./tests/scripts/xfstests_pathr.sh
3434
35+
xfstests_on_overlayfs:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
- name: Install Rust
41+
uses: actions-rs/toolchain@v1
42+
with:
43+
profile: minimal
44+
toolchain: stable
45+
override: true
46+
- name: Build overlay binary
47+
run: |
48+
cd tests/overlay
49+
cargo build --release
50+
sudo install -t /usr/sbin/ -m 700 ./target/release/overlay
51+
- name: Setup and run xfstest
52+
run: |
53+
cd $GITHUB_WORKSPACE
54+
sudo ./tests/scripts/xfstests_overlay.sh

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,10 @@ smoke-macos: check-macos
5454

5555
docker-smoke:
5656
docker run --env RUST_BACKTRACE=1 --rm --privileged --volume ${current_dir}:/fuse-rs rust:1.68 sh -c "rustup component add clippy rustfmt; cd /fuse-rs; make smoke-all"
57+
58+
testoverlay:
59+
cd tests/testoverlay && cargo build
60+
61+
# Setup xfstests env and run.
62+
xfstests:
63+
./tests/scripts/xfstests.sh

tests/testoverlay/Cargo.toml renamed to tests/overlay/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "testoverlay"
2+
name = "overlay"
33
version = "0.1.0"
44
edition = "2021"
55

tests/testoverlay/src/main.rs renamed to tests/overlay/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn new_passthroughfs_layer(rootdir: &str) -> Result<BoxedLayer> {
5252

5353
fn help() {
5454
println!(
55-
"Usage:\n testoverlay -o lowerdir=<lower1>:<lower2>:<more>,upperdir=<upper>,workdir=<work> <name> <mountpoint> [-l log_level]\n"
55+
"Usage:\n overlay -o lowerdir=<lower1>:<lower2>:<more>,upperdir=<upper>,workdir=<work> <name> <mountpoint> [-l log_level]\n"
5656
);
5757
}
5858

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Exclude list for tests that we know are broken in smb3
2+
#
3+
generic/011 # Broken: dirstress 5 processes.
4+
generic/020 # ENOSPC, suppose to be FUSE compatibility issue.
5+
generic/023 # Rename is not supported currently.
6+
generic/024 # Rename is not supported currently.
7+
generic/025 # Rename is not supported currently.
8+
generic/035 # Rename is not supported currently.
9+
generic/078 # Rename is not supported currently.
10+
generic/089 # Rename is not supported currently.
11+
generic/099 # Suppose to be FUSE compatibility issue.
12+
generic/184 # Special device isn't supported due to 'nodev' mount option.
13+
generic/241 # Rename is not supported currently.
14+
generic/245 # Rename is not supported currently.
15+
generic/375 # Suppose to be FUSE compatibility issue, about posix acl support
16+
generic/426 # Suppose to be FUSE compatibility issue: 'open_by_handle'
17+
generic/434 # Special device isn't supported due to 'nodev' mount option.
18+
generic/444 # Suppose to be FUSE compatibility issue, about posix acl support
19+
generic/467 # Suppose to be FUSE compatibility issue: 'open_by_handle'
20+
generic/477 # Suppose to be FUSE compatibility issue: 'open_by_handle'
21+
generic/591 # Broken.
22+
generic/633 # Suppose to be FUSE compatibility issue.
23+
generic/697 # Suppose to be FUSE compatibility issue.
24+
generic/736

tests/scripts/xfstests_overlay.sh

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
current_dir=$(dirname $(realpath $0))
4+
5+
sudo apt-get update
6+
sudo apt-get install acl attr automake bc dbench dump e2fsprogs fio gawk \
7+
gcc git indent libacl1-dev libaio-dev libcap-dev libgdbm-dev libtool \
8+
libtool-bin liburing-dev libuuid1 lvm2 make psmisc python3 quota sed \
9+
uuid-dev uuid-runtime xfsprogs linux-headers-$(uname -r) sqlite3
10+
sudo apt-get install exfatprogs f2fs-tools ocfs2-tools udftools xfsdump \
11+
xfslibs-dev
12+
13+
# clone xfstests and install.
14+
cd /tmp/
15+
git clone -b v2023.12.10 git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git
16+
cd xfstests-dev
17+
make
18+
sudo make install
19+
# overwrite local config.
20+
cat >local.config <<EOF
21+
export TEST_DEV=testoverlay
22+
export TEST_DIR=/tmp/testoverlay/merged
23+
#export SCRATCH_DEV=testoverlay
24+
#export SCRATCH_MNT=/tmp/test2/merged
25+
export FSTYP=fuse
26+
export FUSE_SUBTYP=.testoverlay
27+
EOF
28+
29+
# create fuse overlay mount script.
30+
# /tmp/testoverlay must exists.
31+
sudo cat >/usr/sbin/mount.fuse.testoverlay <<EOF
32+
#!/bin/bash
33+
34+
ulimit -n 1048576
35+
exec /usr/sbin/overlay -o \
36+
lowerdir=/tmp/testoverlay/lower2:/tmp/testoverlay/lower1,upperdir=/tmp/testoverlay/upper,workdir=/tmp/testoverlay/work \
37+
testoverlay /tmp/testoverlay/merged \
38+
1>>/tmp/testoverlay.log 2>&1 &
39+
sleep 1
40+
EOF
41+
sudo chmod +x /usr/sbin/mount.fuse.testoverlay
42+
43+
# create related directories.
44+
mkdir -p /tmp/testoverlay/{upper,work,merged,lower2,lower1}
45+
46+
echo "====> Start to run xfstests."
47+
# run tests.
48+
cd /tmp/xfstests-dev
49+
# Some tests are not supported by fuse or cannot pass currently.
50+
sudo ./check -fuse -E $current_dir/xfstests_overlay.exclude
51+
52+

0 commit comments

Comments
 (0)