feat: add file handler e2e tests covering GET, PUT, index, auth, and 404

Adds 5 test methods (7 test cases) for the file handler:
GET existing file, GET nonexistent file, GET index.html, PUT upload,
PUT without permission, and auth (no-auth-401, with-auth-success).

Includes test data files and server YAML configs under
tests/e2e/testdata/file/.
This commit is contained in:
ginuerzh
2026-06-26 22:19:13 +08:00
parent 69b561f944
commit 590c6f48bd
6 changed files with 229 additions and 0 deletions
View File
+1
View File
@@ -0,0 +1 @@
<html><body>gost file index</body></html>
+9
View File
@@ -0,0 +1,9 @@
services:
- name: file-server
addr: :8080
handler:
type: file
metadata:
file.dir: /srv/files
listener:
type: tcp
+15
View File
@@ -0,0 +1,15 @@
services:
- name: file-server-auth
addr: :8080
handler:
type: file
auther: auther-0
metadata:
file.dir: /srv/files
listener:
type: tcp
authers:
- name: auther-0
auths:
- username: user
password: pass
+10
View File
@@ -0,0 +1,10 @@
services:
- name: file-server-put
addr: :8080
handler:
type: file
metadata:
file.dir: /srv/files
file.put: true
listener:
type: tcp