diff options
author | Clément Bénier <clement.benier@iot.bzh> | 2018-08-20 15:43:22 +0200 |
---|---|---|
committer | Clément Bénier <clement.benier@iot.bzh> | 2018-08-21 11:08:36 +0200 |
commit | 83fad88204387d196f755c718de40828c08dc7ac (patch) | |
tree | c943126bf4baac0a365652505a283df664f2ea85 /test/target_test.go | |
parent | cf3266b208d3ba0fb8f172c29725768bbd41d509 (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/target_test.go')
-rw-r--r-- | test/target_test.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/target_test.go b/test/target_test.go index 401c641..e222505 100644 --- a/test/target_test.go +++ b/test/target_test.go @@ -147,6 +147,13 @@ func AddTerms(t *testing.T, nbTerms int, listID []string, chTermEvt chan xsapiv1 } func PostTerms(t *testing.T, post string, chTermEvt chan xsapiv1.TerminalConfig) { + var status string + switch post { + case "open": + status = "Open" + case "close": + status = "Closing" + } var targets []xsapiv1.TargetConfig assert.Nil(t, HTTPCli.Get("/targets", &targets)) for i := 0; i < len(targets); i++ { @@ -155,12 +162,14 @@ func PostTerms(t *testing.T, post string, chTermEvt chan xsapiv1.TerminalConfig) listTermsID := make([]string, len(terms)) for j := 0; j < len(terms); j++ { var term xsapiv1.TerminalConfig - assert.Nil(t, HTTPCli.Post("/targets/"+targets[i].ID+"/terminals/"+terms[j].ID+"/"+post, term, &term)) + assert.Nil(t, HTTPCli.Post("/targets/"+targets[i].ID+"/terminals/"+terms[j].ID+"/"+post, terms[j], &term)) termEvt := <-chTermEvt //waiting for event terminalStateChange assert.Equal(t, term.ID, termEvt.ID) - assert.True(t, strings.EqualFold(termEvt.Status, post)) + assert.Equal(t, term.Status, status) + assert.Equal(t, termEvt.Status, status) listTermsID[i] = term.ID } + time.Sleep(10 * time.Millisecond) for j := 0; j < len(listTermsID); j++ { var term xsapiv1.TerminalConfig assert.Nil(t, HTTPCli.Get("/targets/"+targets[i].ID+"/terminals/"+listTermsID[i], &term)) |