Commit 1f16cdfe authored by Steven Allen's avatar Steven Allen

fix tests for go-conn-security refactor

parent 2064740b
......@@ -6,27 +6,27 @@ import (
"sync"
"testing"
connsec "github.com/libp2p/go-conn-security"
insecure "github.com/libp2p/go-conn-security/insecure"
sst "github.com/libp2p/go-conn-security/test"
)
func TestCommonProto(t *testing.T) {
var at, bt SSMuxer
atInsecure := connsec.InsecureTransport("peerA")
btInsecure := connsec.InsecureTransport("peerB")
at.AddTransport("/plaintext/1.0.0", &atInsecure)
bt.AddTransport("/plaintext/1.1.0", &btInsecure)
bt.AddTransport("/plaintext/1.0.0", &btInsecure)
atInsecure := insecure.New("peerA")
btInsecure := insecure.New("peerB")
at.AddTransport("/plaintext/1.0.0", atInsecure)
bt.AddTransport("/plaintext/1.1.0", btInsecure)
bt.AddTransport("/plaintext/1.0.0", btInsecure)
sst.SubtestRW(t, &at, &bt, "peerA", "peerB")
}
func TestNoCommonProto(t *testing.T) {
var at, bt SSMuxer
atInsecure := connsec.InsecureTransport("peerA")
btInsecure := connsec.InsecureTransport("peerB")
atInsecure := insecure.New("peerA")
btInsecure := insecure.New("peerB")
at.AddTransport("/plaintext/1.0.0", &atInsecure)
bt.AddTransport("/plaintext/1.1.0", &btInsecure)
at.AddTransport("/plaintext/1.0.0", atInsecure)
bt.AddTransport("/plaintext/1.1.0", btInsecure)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment