forked from 7Sageer/sublink-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-cases.yaml
More file actions
178 lines (170 loc) · 4.65 KB
/
test-cases.yaml
File metadata and controls
178 lines (170 loc) · 4.65 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
tests:
- name: 原始 YAML 配置测试
description: 验证 GitHub Gist 示例中的 Clash YAML 是否被正确解析
input: |
proxies:
- name: HY2-main
type: hysteria2
server: hajimi.com
port: 443
ports: 20000-20100
hop-interval: 15
up: "200 Mbps"
down: "200 Mbps"
password: REPLACE_HY2_PASS
sni: hajimi.com
obfs: salamander
obfs-password: REPLACE_OBFS_PASS
alpn:
- h3
skip-cert-verify: false
fast-open: true
- name: TUIC-main
type: tuic
server: hajimi.com
port: 444
uuid: REPLACE_TUIC_UUID
password: REPLACE_TUIC_PASS
sni: hajimi.com
alpn:
- h3
reduce-rtt: true
congestion-controller: bbr
udp-relay-mode: native
zero-rtt: false
fast-open: true
skip-cert-verify: false
- name: VLESS-REALITY
type: vless
server: hajimi.com
port: 445
uuid: REPLACE_VLESS_UUID
udp: true
flow: xtls-rprx-vision
tls: true
servername: www.apple.com
alpn:
- h2
- http/1.1
client-fingerprint: chrome
reality-opts:
public-key: REPLACE_PUBLIC_KEY
short-id: a1b2c3
packet-encoding: xudp
skip-cert-verify: false
expected:
proxyCount: 3
proxyTags:
- HY2-main
- TUIC-main
- VLESS-REALITY
typeCount:
hysteria2: 1
tuic: 1
vless: 1
- name: 空代理列表
description: proxies 数组为空时不应返回任何节点
input: |
proxies: []
expected:
proxyCount: 0
- name: 混合类型与无效节点
description: 仅返回受支持类型的节点,忽略未知类型
input: |
proxies:
- name: Valid-SS
type: ss
server: example.com
port: 443
cipher: aes-128-gcm
password: test
- name: Invalid-Type
type: unknown
server: invalid.com
port: 80
expected:
proxyCount: 1
proxyTags:
- Valid-SS
typeCount:
shadowsocks: 1
- name: Base64 编码 YAML
description: 验证 Base64 包裹的 YAML 能被正确解析
input: |
cHJveGllczoKICAtIG5hbWU6IEJhc2U2NC1ZQU1MLVRlc3QKICAgIHR5cGU6IHR1aWMKICAgIHNlcnZlcjogdGVzdC5jb20KICAgIHBvcnQ6IDQ1NQogICAgdXVpZDogNzJlMjQ1YzUtYzY4MS00Y2JjLTljY2QtN2IxMGJiOGYyYzUzCiAgICBwYXNzd29yZDogdGVzdC1wYXNzCiAgICBzbmk6IHRlc3QuY29tCiAgICBhbHBuOgogICAgICAtIGgzCiAgICB4dWRwOiB0cnVlCiAgICB6aXA6IHh1ZHAKICAgIHNraXAtY2VydC12ZXJpZnk6IGZhbHNlCg==
expected:
proxyCount: 1
proxyTags:
- Base64-YAML-Test
typeCount:
tuic: 1
- name: ANYTLS 基本解析
description: 验证 anytls 节点解析与关键字段(tag、idle-session、alpn 等)
input: |
proxies:
- name: ANYTLS-main
type: anytls
server: example.com
port: 443
password: REPLACE_ANYTLS_PASS
udp: true
sni: example.com
alpn:
- h2
- http/1.1
client-fingerprint: chrome
skip-cert-verify: false
idle-session-check-interval: 30
idle-session-timeout: 120
min-idle-session: 5
expected:
proxyCount: 1
proxyTags:
- ANYTLS-main
typeCount:
anytls: 1
proxyDetails:
- tag: ANYTLS-main
fields:
type: anytls
udp: true
tls.server_name: example.com
tls.insecure: false
tls.alpn:
- h2
- http/1.1
tls.utls.fingerprint: chrome
idle-session-check-interval: 30
idle-session-timeout: 120
min-idle-session: 5
- name: 解析 proxy-groups 段
description: 验证 Clash YAML 中的 proxy-groups 能被保留在配置中
input: |
proxies:
- name: Valid-SS
type: ss
server: example.com
port: 443
cipher: aes-128-gcm
password: test
proxy-groups:
- name: 自定义选择
type: select
proxies:
- DIRECT
- REJECT
- Valid-SS
- NotExist
expected:
proxyCount: 1
typeCount:
shadowsocks: 1
config:
proxy-groups:
- name: 自定义选择
type: select
proxies:
- DIRECT
- REJECT
- Valid-SS
- NotExist