-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify testcases to avoid port confilict
Signed-off-by: bill fort <fxbao@hotmail.com>
- Loading branch information
1 parent
7c00d4f
commit d21b671
Showing
13 changed files
with
214 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package tests | ||
|
||
var port int = 1080 | ||
var proxyAddr string = "127.0.0.1:1080" | ||
|
||
const ( | ||
numMsgs = 10 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
package tests | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
"time" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
// go test -v -run=TestProxy | ||
func TestProxy(t *testing.T) { | ||
tuna, udp, tun := true, true, false | ||
go func() { | ||
err := startNconnect("client.json", tuna, udp, tun, nil) | ||
if err != nil { | ||
fmt.Printf("start nconnect client err: %v\n", err) | ||
return | ||
} | ||
require.NoError(t, err) | ||
}() | ||
time.Sleep(15 * time.Second) | ||
|
||
dnsQuery() | ||
time.Sleep(5 * time.Second) | ||
|
||
err := waitSSAndTunaReady() | ||
require.NoError(t, err) | ||
|
||
err = dnsQuery() | ||
require.NoError(t, err) | ||
for _, server := range servers { | ||
StartWebClient("http://" + server + httpPort + "/httpEcho") | ||
StartTCPClient(server + tcpPort) | ||
StartUDPClient(server + udpPort) | ||
err := StartWebClient("http://" + server + httpPort + "/httpEcho") | ||
require.NoError(t, err) | ||
err = StartTCPClient(server + tcpPort) | ||
require.NoError(t, err) | ||
err = StartUDPClient(server + udpPort) | ||
require.NoError(t, err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.