Skip to content
This repository was archived by the owner on Jul 13, 2022. It is now read-only.

Commit 19ce248

Browse files
⚡ Fix tests (#10)
* ⚡ Fix config test * ⚡️ Fix VMess outbound test * 🔧 Workaround: Disable IV check for tests * 🔧 Fix source path * 🔧 Workaround: Disable IV check for unencrypted shadowsocks * 🪔 Codecov wants higher fetch depth * ☂ Remove codecov Co-authored-by: database64128 <[email protected]>
1 parent 325656b commit 19ce248

File tree

6 files changed

+29
-30
lines changed

6 files changed

+29
-30
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,3 @@ jobs:
4545
export PATH=$(go env GOPATH)/bin:${PATH}
4646
go install -v github.com/ory/go-acc@latest
4747
go-acc --covermode=atomic -o=coverage.txt ./...
48-
49-
- name: Upload codecov
50-
run: bash <(curl -s https://codecov.io/bash)

infra/conf/v2ray_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ func TestV2RayConfig(t *testing.T) {
4343
runMultiTestCase(t, []TestCase{
4444
{
4545
Input: `{
46-
"outbound": {
47-
"protocol": "freedom",
48-
"settings": {}
49-
},
5046
"log": {
5147
"access": "/var/log/v2ray/access.log",
5248
"loglevel": "error",
5349
"error": "/var/log/v2ray/error.log"
5450
},
55-
"inbound": {
51+
"inbounds": [{
5652
"streamSettings": {
5753
"network": "ws",
5854
"wsSettings": {
@@ -77,7 +73,7 @@ func TestV2RayConfig(t *testing.T) {
7773
]
7874
}
7975
},
80-
"inbounds": [{
76+
{
8177
"streamSettings": {
8278
"network": "ws",
8379
"wsSettings": {
@@ -106,7 +102,11 @@ func TestV2RayConfig(t *testing.T) {
106102
]
107103
}
108104
}],
109-
"outboundDetour": [
105+
"outbounds": [
106+
{
107+
"protocol": "freedom",
108+
"settings": {}
109+
},
110110
{
111111
"tag": "blocked",
112112
"protocol": "blackhole"

infra/conf/vmess_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ func TestVMessOutbound(t *testing.T) {
2020
runMultiTestCase(t, []TestCase{
2121
{
2222
Input: `{
23-
"vnext": [{
24-
"address": "127.0.0.1",
25-
"port": 80,
26-
"users": [
27-
{
28-
"id": "e641f5ad-9397-41e3-bf1a-e8740dfed019",
29-
"email": "[email protected]",
30-
"level": 255
31-
}
32-
]
33-
}]
23+
"address": "127.0.0.1",
24+
"port": 80,
25+
"users": [
26+
{
27+
"id": "e641f5ad-9397-41e3-bf1a-e8740dfed019",
28+
"email": "[email protected]",
29+
"level": 255
30+
}
31+
]
3432
}`,
3533
Parser: loadJSON(creator),
3634
Output: &outbound.Config{

proxy/shadowsocks/protocol_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ func TestTCPRequest(t *testing.T) {
6969
User: &protocol.MemoryUser{
7070
7171
Account: toAccount(&Account{
72-
Password: "tcp-password",
73-
CipherType: CipherType_AES_128_GCM,
72+
Password: "tcp-password",
73+
CipherType: CipherType_AES_128_GCM,
74+
DisableIvCheck: true,
7475
}),
7576
},
7677
},
@@ -85,8 +86,9 @@ func TestTCPRequest(t *testing.T) {
8586
User: &protocol.MemoryUser{
8687
8788
Account: toAccount(&Account{
88-
Password: "password",
89-
CipherType: CipherType_AES_256_GCM,
89+
Password: "password",
90+
CipherType: CipherType_AES_256_GCM,
91+
DisableIvCheck: true,
9092
}),
9193
},
9294
},
@@ -101,8 +103,9 @@ func TestTCPRequest(t *testing.T) {
101103
User: &protocol.MemoryUser{
102104
103105
Account: toAccount(&Account{
104-
Password: "password",
105-
CipherType: CipherType_CHACHA20_POLY1305,
106+
Password: "password",
107+
CipherType: CipherType_CHACHA20_POLY1305,
108+
DisableIvCheck: true,
106109
}),
107110
},
108111
},

testing/scenarios/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func genTestBinaryPath() {
118118
}
119119

120120
func GetSourcePath() string {
121-
return filepath.Join("github.com", "v2fly", "v2ray-core", "v4", "main")
121+
return filepath.Join("github.com", "Shadowsocks-NET", "v2ray-go", "v4", "main")
122122
}
123123

124124
func CloseAllServers(servers []*exec.Cmd) {

testing/scenarios/shadowsocks_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,9 @@ func TestShadowsocksNone(t *testing.T) {
409409
defer tcpServer.Close()
410410

411411
account := serial.ToTypedMessage(&shadowsocks.Account{
412-
Password: "shadowsocks-password",
413-
CipherType: shadowsocks.CipherType_NONE,
412+
Password: "shadowsocks-password",
413+
CipherType: shadowsocks.CipherType_NONE,
414+
DisableIvCheck: true,
414415
})
415416

416417
serverPort := tcp.PickPort()

0 commit comments

Comments
 (0)