Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier committed Mar 11, 2019
1 parent 1925847 commit d1f1c72
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions tests/ci/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ func TestCmdTcp(t *testing.T) {
if assert.NoError(err) {
defer s.Stop()
}
time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

c := util.NewProcess(consts.FRPC_BIN_PATH, []string{"tcp", "-s", "127.0.0.1:20000", "-t", "123", "-u", "test",
"-l", "10701", "-r", "20801", "-n", "tcp_test"})
err = c.Start()
if assert.NoError(err) {
defer c.Stop()
}
time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

res, err := util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
assert.NoError(err)
Expand All @@ -43,15 +43,15 @@ func TestCmdUdp(t *testing.T) {
if assert.NoError(err) {
defer s.Stop()
}
time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

c := util.NewProcess(consts.FRPC_BIN_PATH, []string{"udp", "-s", "127.0.0.1:20000", "-t", "123", "-u", "test",
"-l", "10702", "-r", "20802", "-n", "udp_test"})
err = c.Start()
if assert.NoError(err) {
defer c.Stop()
}
time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

res, err := util.SendUdpMsg("127.0.0.1:20802", consts.TEST_UDP_ECHO_STR)
assert.NoError(err)
Expand All @@ -67,15 +67,15 @@ func TestCmdHttp(t *testing.T) {
if assert.NoError(err) {
defer s.Stop()
}
time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

c := util.NewProcess(consts.FRPC_BIN_PATH, []string{"http", "-s", "127.0.0.1:20000", "-t", "123", "-u", "test",
"-n", "udp_test", "-l", "10704", "--custom_domain", "127.0.0.1"})
err = c.Start()
if assert.NoError(err) {
defer c.Stop()
}
time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

code, body, _, err := util.SendHttpMsg("GET", "http://127.0.0.1:20001", "", nil, "")
if assert.NoError(err) {
Expand Down
10 changes: 5 additions & 5 deletions tests/ci/reconnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ func TestReconnect(t *testing.T) {
defer frpsProcess.Stop()
}

time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

frpcProcess := util.NewProcess(consts.FRPC_BIN_PATH, []string{"-c", frpcCfgPath})
err = frpcProcess.Start()
if assert.NoError(err) {
defer frpcProcess.Stop()
}
time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

// test tcp
res, err := util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand All @@ -72,7 +72,7 @@ func TestReconnect(t *testing.T) {

// stop frpc
frpcProcess.Stop()
time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

// test tcp, expect failed
_, err = util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand All @@ -84,7 +84,7 @@ func TestReconnect(t *testing.T) {
if assert.NoError(err) {
defer newFrpcProcess.Stop()
}
time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

// test tcp
res, err = util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand All @@ -93,7 +93,7 @@ func TestReconnect(t *testing.T) {

// stop frps
frpsProcess.Stop()
time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

// test tcp, expect failed
_, err = util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand Down
4 changes: 2 additions & 2 deletions tests/ci/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ func TestReload(t *testing.T) {
defer frpsProcess.Stop()
}

time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

frpcProcess := util.NewProcess(consts.FRPC_BIN_PATH, []string{"-c", frpcCfgPath})
err = frpcProcess.Start()
if assert.NoError(err) {
defer frpcProcess.Stop()
}

time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

// test tcp1
res, err := util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand Down
4 changes: 2 additions & 2 deletions tests/ci/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ func TestConfTemplate(t *testing.T) {
defer frpsProcess.Stop()
}

time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

frpcProcess := util.NewProcess("env", []string{"FRP_TOKEN=123456", "TCP_REMOTE_PORT=20801", consts.FRPC_BIN_PATH, "-c", frpcCfgPath})
err = frpcProcess.Start()
if assert.NoError(err) {
defer frpcProcess.Stop()
}

time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

// test tcp1
res, err := util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand Down
4 changes: 2 additions & 2 deletions tests/ci/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ func TestTlsOverTCP(t *testing.T) {
defer frpsProcess.Stop()
}

time.Sleep(100 * time.Millisecond)
time.Sleep(200 * time.Millisecond)

frpcProcess := util.NewProcess(consts.FRPC_BIN_PATH, []string{"-c", frpcCfgPath})
err = frpcProcess.Start()
if assert.NoError(err) {
defer frpcProcess.Stop()
}
time.Sleep(250 * time.Millisecond)
time.Sleep(500 * time.Millisecond)

// test tcp
res, err := util.SendTcpMsg("127.0.0.1:20801", consts.TEST_TCP_ECHO_STR)
Expand Down

0 comments on commit d1f1c72

Please sign in to comment.