-
Notifications
You must be signed in to change notification settings - Fork 86
173 lines (144 loc) · 5.37 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
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 }}
GOEXPERIMENT: cgocheck2
strategy:
matrix:
include:
- os: windows-latest
arch: amd64
cgo: 1
cpath: C:\Program Files (x86)\WinFsp\inc\fuse
- os: windows-latest
arch: amd64
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:
go-version: '1.23'
- name: Install winfsp and winfsp-tests (Windows)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: runner.os == 'Windows'
run: |
$headers = @{
Authorization = "token $env:GITHUB_TOKEN"
"User-Agent" = "GitHub Actions"
}
$releases = Invoke-WebRequest https://api.github.com/repos/winfsp/winfsp/releases -Headers $headers | `
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 (macOS)
if: runner.os == 'macOS'
run: |
brew install macfuse
- name: Build packages with fuse2
run: |
go build -v -o . ./...
- name: Test packages with fuse2
if: runner.os == 'Linux' || runner.os == 'Windows'
run: |
go test -v -count=1 ./fuse
- name: Test file systems (Windows) with fuse2
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
- name: Test file systems (Linux) with fuse2
if: runner.os == 'Linux'
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 ./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 test -v -count=1 ./fuse
- name: Test file systems (Linux) with fuse3
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 ./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