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

fix tests for go-conn-security refactor

parent 2064740b
...@@ -6,27 +6,27 @@ import ( ...@@ -6,27 +6,27 @@ import (
"sync" "sync"
"testing" "testing"
connsec "github.com/libp2p/go-conn-security" insecure "github.com/libp2p/go-conn-security/insecure"
sst "github.com/libp2p/go-conn-security/test" sst "github.com/libp2p/go-conn-security/test"
) )
func TestCommonProto(t *testing.T) { func TestCommonProto(t *testing.T) {
var at, bt SSMuxer var at, bt SSMuxer
atInsecure := connsec.InsecureTransport("peerA") atInsecure := insecure.New("peerA")
btInsecure := connsec.InsecureTransport("peerB") btInsecure := insecure.New("peerB")
at.AddTransport("/plaintext/1.0.0", &atInsecure) at.AddTransport("/plaintext/1.0.0", atInsecure)
bt.AddTransport("/plaintext/1.1.0", &btInsecure) bt.AddTransport("/plaintext/1.1.0", btInsecure)
bt.AddTransport("/plaintext/1.0.0", &btInsecure) bt.AddTransport("/plaintext/1.0.0", btInsecure)
sst.SubtestRW(t, &at, &bt, "peerA", "peerB") sst.SubtestRW(t, &at, &bt, "peerA", "peerB")
} }
func TestNoCommonProto(t *testing.T) { func TestNoCommonProto(t *testing.T) {
var at, bt SSMuxer var at, bt SSMuxer
atInsecure := connsec.InsecureTransport("peerA") atInsecure := insecure.New("peerA")
btInsecure := connsec.InsecureTransport("peerB") btInsecure := insecure.New("peerB")
at.AddTransport("/plaintext/1.0.0", &atInsecure) at.AddTransport("/plaintext/1.0.0", atInsecure)
bt.AddTransport("/plaintext/1.1.0", &btInsecure) bt.AddTransport("/plaintext/1.1.0", btInsecure)
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() 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