aboutsummaryrefslogtreecommitdiffstats
path: root/test/xdsserver_test.go
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-08-20 15:43:22 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-08-21 11:08:36 +0200
commit83fad88204387d196f755c718de40828c08dc7ac (patch)
treec943126bf4baac0a365652505a283df664f2ea85 /test/xdsserver_test.go
parentcf3266b208d3ba0fb8f172c29725768bbd41d509 (diff)
test exec/sdk: use sdk for building exec project
source sdk before building helloworld project fix sdks misconfiguration and multiple sdk installs Change-Id: I019e6b6e2704737774e93f08fb79d2f4a84a12b9 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
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")
}