aboutsummaryrefslogtreecommitdiffstats
path: root/test/xdsserver_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/xdsserver_test.go')
-rw-r--r--test/xdsserver_test.go17
1 files changed, 3 insertions, 14 deletions
diff --git a/test/xdsserver_test.go b/test/xdsserver_test.go
index 585ad50..ba56321 100644
--- a/test/xdsserver_test.go
+++ b/test/xdsserver_test.go
@@ -22,7 +22,6 @@ import (
"log"
"os"
"os/exec"
- "path"
"sync"
"testing"
"time"
@@ -46,7 +45,6 @@ type IOSockClient struct {
//global client
var HTTPCli *common.HTTPClient
var logDir string
-var sdkDir string
var sCli *IOSockClient
func Copy(src, dst string) error {
@@ -81,7 +79,7 @@ func initEnv(launchProcess bool) {
if err := os.Setenv(envRootCfgDir, rootTestLog); err != nil {
log.Fatal(err)
}
- sdkDir = rootTestLog + "/sdks/"
+ sdkDir := rootTestLog + "/sdks/"
if err := os.Setenv(envXdtSdk, sdkDir); err != nil {
log.Fatal(err)
}
@@ -98,14 +96,6 @@ func initEnv(launchProcess bool) {
os.MkdirAll(rootTestLog, 0755)
logDir = rootTestLog + "/logs/"
os.MkdirAll(logDir, 0755)
- os.MkdirAll(sdkDir, 0755)
- currentDir, err := os.Getwd()
- if err != nil {
- log.Fatal(err)
- }
- if err := Copy(path.Join(currentDir, sdkFile), path.Join(sdkDir, sdkFileName)); err != nil {
- log.Fatal(err)
- }
}
func launchXdsServer(proc **os.Process) *os.File {
@@ -180,11 +170,12 @@ func NewIoSocketClient(url, clientID string) (*IOSockClient, error) {
sCli.Connected = false
})
+ log.Printf("Connect websocket with url=%v clientId=%v\n", prefixURL, HTTPCli.GetClientID())
return sCli, nil
}
func TestMain(m *testing.M) {
launchProcess := true
- log.Printf("TestMain: launchProcess is %v", launchProcess)
+ log.Printf("TestMain: launchProcess is %v, so launching xds-server", launchProcess)
initEnv(launchProcess)
var proc *os.Process
@@ -211,8 +202,6 @@ func TestMain(m *testing.M) {
log.Fatal(err)
}
- log.Printf("HTTPCli id is %v", HTTPCli.GetClientID())
-
if HTTPCli == nil {
log.Fatal("HTTPCLi is nil")
}