-
Notifications
You must be signed in to change notification settings - Fork 86
216 lines (181 loc) · 7.27 KB
/
test.yml
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: test
on:
push:
branches:
- "*"
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
env:
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: ${{ matrix.cgo }}
CPATH: ${{ matrix.cpath }}
GODEBUG: cgocheck=2
strategy:
matrix:
include:
- os: windows-latest
arch: amd64
exe: .exe
cgo: 1
cpath: C:\Program Files (x86)\WinFsp\inc\fuse
- os: windows-latest
arch: amd64
exe: .exe
cgo: 0
- os: windows-latest
arch: 386
exe: .exe
cgo: 0
- os: ubuntu-latest
arch: amd64
cgo: 1
- os: macos-latest
arch: amd64
cgo: 1
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install go
uses: actions/setup-go@v5
with:
stable: true
go-version: 1.17.*
- name: Install winfsp and winfsp-tests (Windows)
if: runner.os == 'Windows'
run: |
$releases = Invoke-WebRequest https://api.github.com/repos/winfsp/winfsp/releases | `
ConvertFrom-Json
$asseturi = $releases[0].assets.browser_download_url | `
Where-Object { $_ -match "winfsp-.*\.msi" }
Invoke-WebRequest -Uri $asseturi -Out winfsp.msi
Start-Process -NoNewWindow -Wait msiexec "/i winfsp.msi /qn INSTALLLEVEL=1000"
$asseturi = $releases[0].assets.browser_download_url | `
Where-Object { $_ -match "winfsp-tests-.*\.zip" }
Invoke-WebRequest -Uri $asseturi -Out winfsp-tests.zip
Expand-Archive -Path winfsp-tests.zip
Copy-Item "C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll" winfsp-tests
- name: Install FUSE and secfs.test (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get -qq install libfuse-dev libfuse3-dev libacl1-dev
git clone -q https://github.com/billziss-gh/secfs.test.git secfs.test
git -C secfs.test checkout -q edf5eb4a108bfb41073f765aef0cdd32bb3ee1ed
mkdir -p secfs.test/tools/bin
touch secfs.test/tools/bin/bonnie++
touch secfs.test/tools/bin/iozone
make -C secfs.test
# configure fstest for cgofuse
sed -e 's/^fs=.*$/fs="cgofuse"/' -i"" secfs.test/fstest/fstest/tests/conf
# remove irrelevant tests
rm -rf secfs.test/fstest/fstest/tests/xacl
rm -rf secfs.test/fstest/fstest/tests/zzz_ResourceFork
- name: Install FUSE and secfs.test (macOS)
if: runner.os == 'macOS'
run: |
brew install macfuse
git clone -q https://github.com/billziss-gh/secfs.test.git secfs.test
git -C secfs.test checkout -q edf5eb4a108bfb41073f765aef0cdd32bb3ee1ed
mkdir -p secfs.test/tools/bin
touch secfs.test/tools/bin/bonnie++
touch secfs.test/tools/bin/iozone
make -C secfs.test
# configure fstest for cgofuse
sed -e 's/^fs=.*$/fs="cgofuse"/' -i "" secfs.test/fstest/fstest/tests/conf
# monkey-patch/disable some tests for macOS
rm secfs.test/fstest/fstest/tests/rmdir/12.t
sed -e 's/lchmod)/lchmod) return 1/' -i "" secfs.test/fstest/fstest/tests/misc.sh
# remove irrelevant tests
rm -rf secfs.test/fstest/fstest/tests/xacl
rm -rf secfs.test/fstest/fstest/tests/zzz_ResourceFork
- name: Build/test packages with FUSE2
run: |
go build -v -o . ./...
go build -tags=memfs3 -v -o memfs3${{ matrix.exe }} ./examples/memfs
go test -v -count=1 ./fuse
- name: Test file systems with FUSE2 (Windows)
if: runner.os == 'Windows'
run: |
Set-PSDebug -Trace 1
$testexe = (Get-Item winfsp-tests\winfsp-tests-x64.exe)
Start-Process -NoNewWindow .\memfs.exe "-o uid=-1,rellinks,FileInfoTimeout=-1 X:"
Start-Sleep 3
Push-Location X:\
. $testexe --fuse-external --resilient --case-insensitive-cmp `
+* `
-create_fileattr_test `
-reparse_nfs_test `
-ea*
Stop-Process -Name memfs
Start-Sleep 3
Pop-Location
Start-Process -NoNewWindow .\memfs3.exe "-o uid=-1,rellinks,FileInfoTimeout=-1 X:"
Start-Sleep 3
Push-Location X:\
. $testexe --fuse-external --resilient --case-insensitive-cmp `
+* `
-create_fileattr_test `
-reparse_nfs_test `
-ea*
Stop-Process -Name memfs3
Start-Sleep 3
Pop-Location
- name: Test file systems (Linux / macOS) with FUSE2
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
set -x
mkdir p mnt
sudo ./memfs -o allow_other,default_permissions,use_ino,attr_timeout=0 mnt &
sleep 3
(cd mnt && sudo prove -fr ../secfs.test/fstest/fstest/tests)
(cd mnt && ../secfs.test/tools/bin/fsx -N 10000 test xxxxxx)
(cd mnt && ../secfs.test/tools/bin/fsx -e -N 1000 test xxxx)
sudo umount mnt
sudo ./memfs3 -o allow_other,default_permissions,use_ino,attr_timeout=0 mnt &
sleep 3
(cd mnt && sudo prove -fr ../secfs.test/fstest/fstest/tests)
(cd mnt && ../secfs.test/tools/bin/fsx -N 10000 test xxxxxx)
(cd mnt && ../secfs.test/tools/bin/fsx -e -N 1000 test xxxx)
sudo umount mnt
sudo ./passthrough -o allow_other,default_permissions,use_ino,attr_timeout=0 p mnt &
sleep 3
(cd mnt && sudo prove -fr ../secfs.test/fstest/fstest/tests)
(cd mnt && ../secfs.test/tools/bin/fsx -N 10000 test xxxxxx)
sudo umount mnt
rm -rf p
rmdir mnt
- name: Build packages with FUSE3 (Linux)
if: runner.os == 'Linux'
run: |
go build -tags=fuse3 -v -o . ./...
go build -tags=fuse3,memfs3 -v -o memfs3${{ matrix.exe }} ./examples/memfs
go test -tags=fuse3 -v -count=1 ./fuse
- name: Test file systems with FUSE3 (Linux)
if: runner.os == 'Linux'
run: |
set -x
mkdir p mnt
sudo ./memfs -o allow_other,default_permissions,attr_timeout=0 mnt &
sleep 3
(cd mnt && sudo prove -fr ../secfs.test/fstest/fstest/tests)
(cd mnt && ../secfs.test/tools/bin/fsx -N 10000 test xxxxxx)
(cd mnt && ../secfs.test/tools/bin/fsx -e -N 1000 test xxxx)
sudo umount mnt
sudo ./memfs3 -o allow_other,default_permissions,attr_timeout=0 mnt &
sleep 3
(cd mnt && sudo prove -fr ../secfs.test/fstest/fstest/tests)
(cd mnt && ../secfs.test/tools/bin/fsx -N 10000 test xxxxxx)
(cd mnt && ../secfs.test/tools/bin/fsx -e -N 1000 test xxxx)
sudo umount mnt
sudo ./passthrough -o allow_other,default_permissions,attr_timeout=0 p mnt &
sleep 3
(cd mnt && sudo prove -fr ../secfs.test/fstest/fstest/tests)
(cd mnt && ../secfs.test/tools/bin/fsx -N 10000 test xxxxxx)
sudo umount mnt
rm -rf p
rmdir mnt