Skip to content

Commit 50d3ef5

Browse files
committed
const version string
1 parent 6b5ea62 commit 50d3ef5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

vpn/speaker_internal_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ func TestMain(m *testing.M) {
2323
goleak.VerifyTestMain(m, testutil.GoleakOptions...)
2424
}
2525

26+
const expectedHandshake = "codervpn tunnel 1.2\n"
27+
2628
// TestSpeaker_RawPeer tests the speaker with a peer that we simulate by directly making reads and
2729
// writes to the other end of the pipe. There should be at least one test that does this, rather
2830
// than use 2 speakers so that we don't have a bug where we don't adhere to the stated protocol, but
@@ -48,8 +50,6 @@ func TestSpeaker_RawPeer(t *testing.T) {
4850
errCh <- err
4951
}()
5052

51-
expectedHandshake := "codervpn tunnel 1.2\n"
52-
5353
b := make([]byte, 256)
5454
n, err := mp.Read(b)
5555
require.NoError(t, err)
@@ -157,8 +157,6 @@ func TestSpeaker_OversizeHandshake(t *testing.T) {
157157
errCh <- err
158158
}()
159159

160-
expectedHandshake := "codervpn tunnel 1.2\n"
161-
162160
b := make([]byte, 256)
163161
n, err := mp.Read(b)
164162
require.NoError(t, err)
@@ -210,7 +208,6 @@ func TestSpeaker_HandshakeInvalid(t *testing.T) {
210208
_, err = mp.Write([]byte(tc.handshake))
211209
require.NoError(t, err)
212210

213-
expectedHandshake := "codervpn tunnel 1.2\n"
214211
b := make([]byte, 256)
215212
n, err := mp.Read(b)
216213
require.NoError(t, err)
@@ -248,8 +245,6 @@ func TestSpeaker_CorruptMessage(t *testing.T) {
248245
errCh <- err
249246
}()
250247

251-
expectedHandshake := "codervpn tunnel 1.2\n"
252-
253248
b := make([]byte, 256)
254249
n, err := mp.Read(b)
255250
require.NoError(t, err)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy