v2ray-core/net/socks/socks_test.go

40 lines
808 B
Go
Raw Normal View History

2015-09-11 12:12:09 +00:00
package socks
import (
"bytes"
"testing"
"github.com/v2ray/v2ray-core"
"github.com/v2ray/v2ray-core/testing/mocks"
"github.com/v2ray/v2ray-core/testing/unit"
)
func TestSocksTcpConnect(t *testing.T) {
t.Skip("Not ready yet.")
assert := unit.Assert(t)
2015-09-11 12:15:06 +00:00
port := uint16(12384)
2015-09-11 12:12:09 +00:00
uuid := "2418d087-648d-4990-86e8-19dca1d006d3"
vid, err := core.UUIDToVID(uuid)
assert.Error(err).IsNil()
2015-09-11 12:15:06 +00:00
config := core.VConfig{
2015-09-11 12:12:09 +00:00
port,
2015-09-11 12:15:06 +00:00
[]core.VUser{core.VUser{vid}},
2015-09-11 12:12:09 +00:00
"",
[]core.VNext{}}
2015-09-11 12:15:06 +00:00
och := new(mocks.FakeOutboundConnectionHandler)
2015-09-11 12:12:09 +00:00
och.Data2Send = bytes.NewBuffer(make([]byte, 1024))
och.Data2Return = []byte("The data to be returned to socks server.")
2015-09-11 12:15:06 +00:00
vpoint, err := core.NewVPoint(&config, SocksServerFactory{}, och)
2015-09-11 12:12:09 +00:00
assert.Error(err).IsNil()
err = vpoint.Start()
assert.Error(err).IsNil()
}