Properly close DummyTUN to avoid deadlock in TestNoiseHandshake

License: MIT
Signed-off-by: Filippo Valsorda <valsorda@google.com>
This commit is contained in:
Filippo Valsorda
2018-05-20 23:12:55 -04:00
committed by Jason A. Donenfeld
parent 1c666576d5
commit 7bdc5eb54e
3 changed files with 12 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ func TestNoiseHandshake(t *testing.T) {
packet := make([]byte, 0, 256)
writer := bytes.NewBuffer(packet)
err = binary.Write(writer, binary.LittleEndian, msg1)
assertNil(t, err)
peer := dev2.ConsumeMessageInitiation(msg1)
if peer == nil {
t.Fatal("handshake failed at initiation message")