-
Notifications
You must be signed in to change notification settings - Fork 113
193 lines (161 loc) · 5.51 KB
/
Copy pathxfstests-nfs.yml
File metadata and controls
193 lines (161 loc) · 5.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: xfstests-nfs
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
xfstests:
name: Run xfstests NFS Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Disk space cleanup"
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y acl attr automake bc dbench dump e2fsprogs fio gawk \
gcc git indent libacl1-dev libaio-dev libcap-dev libgdbm-dev libtool \
libtool-bin liburing-dev libuuid1 lvm2 make psmisc python3 quota sed \
uuid-dev uuid-runtime xfsprogs linux-headers-$(uname -r) sqlite3 \
libgdbm-compat-dev nfs-common
sudo apt-get install -y exfatprogs f2fs-tools ocfs2-tools udftools xfsdump \
xfslibs-dev || true
sudo apt-get install -y systemd-coredump systemd jq pkg-config
- name: Clone xfstests
run: |
git clone https://github.com/Barre/xfstests.git /tmp/xfstests
- name: Build xfstests
working-directory: /tmp/xfstests
run: |
make
sudo make install
- name: Build ZeroFS
working-directory: zerofs
run: cargo build --profile ci
- name: Create ZeroFS data directories
run: |
mkdir -p ${{ github.workspace }}/zerofs-test-data
mkdir -p ${{ github.workspace }}/zerofs-scratch-data
mkdir -p /tmp/zerofs-cache-test
mkdir -p /tmp/zerofs-cache-scratch
- name: Start ZeroFS (TEST instance)
working-directory: zerofs
run: |
# Create ZeroFS configuration for TEST
cat > zerofs-test.toml << EOF
[cache]
dir = "/tmp/zerofs-cache-test"
disk_size_gb = 1.0
memory_size_gb = 1.0
[storage]
url = "file://${{ github.workspace }}/zerofs-test-data"
encryption_password = "test-password-123"
[servers.nfs]
addresses = ["127.0.0.1:2049"]
[telemetry]
enabled = false
EOF
# Start ZeroFS in the background
./target/ci/zerofs run -c zerofs-test.toml &
echo $! > /tmp/zerofs-test.pid
# Wait for ZeroFS to start
echo "Waiting for ZeroFS TEST instance to start..."
for i in {1..30}; do
if nc -z 127.0.0.1 2049; then
echo "ZeroFS TEST instance is ready"
break
fi
sleep 1
done
if ! nc -z 127.0.0.1 2049; then
echo "ZeroFS TEST instance failed to start"
exit 1
fi
- name: Start ZeroFS (SCRATCH instance)
working-directory: zerofs
run: |
# Create ZeroFS configuration for SCRATCH
cat > zerofs-scratch.toml << EOF
[cache]
dir = "/tmp/zerofs-cache-scratch"
disk_size_gb = 1.0
memory_size_gb = 1.0
[storage]
url = "file://${{ github.workspace }}/zerofs-scratch-data"
encryption_password = "test-password-123"
[servers.nfs]
addresses = ["127.0.0.1:20499"]
[telemetry]
enabled = false
EOF
# Start ZeroFS in the background
./target/ci/zerofs run -c zerofs-scratch.toml &
echo $! > /tmp/zerofs-scratch.pid
# Wait for ZeroFS to start
echo "Waiting for ZeroFS SCRATCH instance to start..."
for i in {1..30}; do
if nc -z 127.0.0.1 20499; then
echo "ZeroFS SCRATCH instance is ready"
break
fi
sleep 1
done
if ! nc -z 127.0.0.1 20499; then
echo "ZeroFS SCRATCH instance failed to start"
exit 1
fi
- name: Create mount points
run: |
sudo mkdir -p /mnt/test
sudo mkdir -p /mnt/scratch
- name: Configure xfstests
working-directory: /tmp/xfstests
run: |
cat > local.config << 'EOF'
export FSTYP=nfs
export TEST_DIR=/mnt/test
export SCRATCH_MNT=/mnt/scratch
export TEST_DEV=localhost:/
export SCRATCH_DEV=127.0.0.1:/
export TEST_FS_MOUNT_OPTS="-o nolock,tcp,port=2049,mountport=2049,hard"
export NFS_MOUNT_OPTIONS="-o nolock,tcp,port=20499,mountport=20499,hard"
EOF
cat > excludes << 'EOF'
generic/035
generic/126
generic/394
generic/467
generic/263
generic/759
generic/760
generic/477
generic/564
generic/633
generic/696
generic/591
generic/615
EOF
- name: Run xfstests
working-directory: /tmp/xfstests
run: |
sudo ./check -g quick -E excludes
- name: Cleanup
if: always()
run: |
# Unmount filesystems
sudo umount /mnt/test || true
sudo umount /mnt/scratch || true
# Kill ZeroFS instances
if [ -f /tmp/zerofs-test.pid ]; then
kill $(cat /tmp/zerofs-test.pid) || true
fi
if [ -f /tmp/zerofs-scratch.pid ]; then
kill $(cat /tmp/zerofs-scratch.pid) || true
fi
pkill -f "zerofs-test.toml" || true
pkill -f "zerofs-scratch.toml" || true