-
Notifications
You must be signed in to change notification settings - Fork 62
257 lines (217 loc) · 8.85 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: test
on:
push:
branches:
- "*"
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-10.15]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install go
uses: actions/setup-go@v2
with:
stable: true
go-version: 1.18.*
- 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"
$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
sudo apt-get -qq install 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: |
# requires macos-10.15; does not work on macos-latest
# see https://github.com/actions/virtual-environments/issues/4731
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 some tests for macOS
sed -e 's/expect EINVAL \(.*\.\.\)$/expect ENOTEMPTY \1/' -i "" 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
# remove tests that fail on macOS with ENAMETOOLONG: these tests send a path
# with a length close to 1024; when ptfs/unionfs prefixes them with the backing
# directory the total path is over 1024 and macOS errors with ENAMETOOLONG
rm secfs.test/fstest/fstest/tests/chflags/03.t
rm secfs.test/fstest/fstest/tests/chmod/03.t
rm secfs.test/fstest/fstest/tests/chown/03.t
rm secfs.test/fstest/fstest/tests/link/03.t
rm secfs.test/fstest/fstest/tests/mkdir/03.t
rm secfs.test/fstest/fstest/tests/mkfifo/03.t
rm secfs.test/fstest/fstest/tests/open/03.t
rm secfs.test/fstest/fstest/tests/rename/02.t
rm secfs.test/fstest/fstest/tests/rmdir/03.t
rm secfs.test/fstest/fstest/tests/symlink/03.t
rm secfs.test/fstest/fstest/tests/truncate/03.t
rm secfs.test/fstest/fstest/tests/unlink/03.t
- name: Build HUBFS
run: |
build/make dist
- name: Test HUBFS packages (Windows)
if: runner.os == 'Windows'
env:
HUBFS_TOKEN: ${{ secrets.HUBFS_TOKEN }}
run: |
Set-Location src
$env:CGO_ENABLED=0
go test -count=1 ./...
- name: Test HUBFS packages (Linux / macOS)
if: runner.os == 'Linux' || runner.os == 'macOS'
env:
HUBFS_TOKEN: ${{ secrets.HUBFS_TOKEN }}
run: |
cd src
go test -count=1 ./...
- name: Test component file systems (Windows)
if: runner.os == 'Windows'
run: |
Set-PSDebug -Trace 1
$testexe = (Get-Item winfsp-tests\winfsp-tests-x64.exe)
Set-Location src
New-Item -Type Directory -Path hi,lo >$null
$env:CGO_ENABLED=0
go build _tools/ptfs.go
go build _tools/unionfs.go
Start-Process -NoNewWindow .\ptfs.exe "-o uid=-1,rellinks,FileInfoTimeout=-1 lo X:"
Start-Sleep 3
Push-Location X:\
. $testexe --fuse-external --resilient --case-insensitive-cmp `
+* `
-create_fileattr_test `
-delete_access_test `
-delete_ex_test `
-create_backup_test `
-create_restore_test `
-rename_flipflop_test `
-exec_rename_dir_test `
-reparse_nfs_test `
-ea*
Stop-Process -Name ptfs
Start-Sleep 3
Pop-Location
Start-Process -NoNewWindow .\unionfs.exe "-o uid=-1,rellinks,FileInfoTimeout=-1 hi lo X:"
Start-Sleep 3
Push-Location X:\
. $testexe --fuse-external --resilient --case-insensitive-cmp `
+* `
-create_fileattr_test `
-delete_access_test `
-delete_ex_test `
-create_backup_test `
-create_restore_test `
-rename_flipflop_test `
-exec_rename_dir_test `
-reparse_nfs_test `
-ea*
Stop-Process -Name unionfs
Start-Sleep 3
Pop-Location
- name: Test component file systems (Linux / macOS)
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
set -x
cd src
mkdir hi lo mnt
go build _tools/ptfs.go
go build _tools/unionfs.go
sudo ./ptfs -o allow_other,default_permissions,use_ino,attr_timeout=0 lo mnt &
sleep 3
(cd mnt && sudo prove -fr ../../secfs.test/fstest/fstest/tests)
sudo umount mnt
sudo ./unionfs -o allow_other,default_permissions,use_ino,attr_timeout=0 hi lo mnt &
sleep 3
(cd mnt && sudo prove -fr ../../secfs.test/fstest/fstest/tests)
(cd mnt && ../../secfs.test/tools/bin/fsx -N 50000 test xxxxxx)
seed=$(date +%s)
../secfs.test/tools/bin/fsstress -d mnt -s $seed -n 5000 -p 10 -S
../secfs.test/tools/bin/fsstress -d mnt -s $seed -n 5000 -p 10 -S
sudo umount mnt
rm -rf hi lo
rmdir mnt
- name: Test HUBFS file system (Windows)
if: runner.os == 'Windows'
env:
HUBFS_TOKEN: ${{ secrets.HUBFS_TOKEN }}
HUBFS_GL_TOKEN: ${{ secrets.HUBFS_GL_TOKEN }}
run: |
Set-PSDebug -Trace 1
Start-Process -NoNewWindow .\build\out\hubfs.exe "-auth token=$env:HUBFS_TOKEN github.com X:"
Start-Sleep 3
Push-Location X:\winfsp\hubfs\master
build/make dist
cd X:\winfsp\hubfs\TestTag
build/make dist
Stop-Process -Name hubfs
Start-Sleep 3
Pop-Location
Start-Process -NoNewWindow .\build\out\hubfs.exe "-auth token=$env:HUBFS_GL_TOKEN gitlab.com X:"
Start-Sleep 3
Push-Location X:\winfsp\hubfs\master
build/make dist
cd X:\winfsp\hubfs\TestTag
build/make dist
Stop-Process -Name hubfs
Start-Sleep 3
Pop-Location
- name: Test HUBFS file system (Linux / macOS)
if: runner.os == 'Linux' || runner.os == 'macOS'
env:
HUBFS_TOKEN: ${{ secrets.HUBFS_TOKEN }}
HUBFS_GL_TOKEN: ${{ secrets.HUBFS_GL_TOKEN }}
run: |
set -x
mkdir mnt
./build/out/hubfs -auth token=$HUBFS_TOKEN github.com mnt &
sleep 3
(cd mnt/winfsp/hubfs/master && build/make dist)
(cd mnt/winfsp/hubfs/TestTag && build/make dist)
sudo umount mnt
./build/out/hubfs -auth token=$HUBFS_GL_TOKEN gitlab.com mnt &
sleep 3
(cd mnt/winfsp/hubfs/master && build/make dist)
(cd mnt/winfsp/hubfs/TestTag && build/make dist)
sudo umount mnt
rmdir mnt