diff options
author | Clément Bénier <clement.benier@iot.bzh> | 2018-10-23 15:07:59 +0200 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2018-10-24 10:43:14 +0000 |
commit | 3e3222406a6f015a9fee3720e8ba76ecf58b087f (patch) | |
tree | 4b05435bdcd2dc1cfb16f30cf2613ac80882b0c9 /test/exec_test.go | |
parent | 2076b45c1905265b9edae342f8e4f7a3366966cc (diff) |
testExec: error exec with a fakeid
add an assert when exec with a fakeid
Change-Id: I56b9e3372c31f7941e705a40d40d72a1b31ca679
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'test/exec_test.go')
-rw-r--r-- | test/exec_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/exec_test.go b/test/exec_test.go index f4d1ac4..39f00c6 100644 --- a/test/exec_test.go +++ b/test/exec_test.go @@ -89,13 +89,23 @@ func TestExec(t *testing.T) { sCli.Conn.On(xsapiv1.ExecOutEvent, func(ev xsapiv1.ExecOutMsg) { cmdOut += ev.Stdout + ev.Stderr }) - - /*basic check: verify that environment is set correctly (use the right sdk)*/ + /*error when exec with fakeid*/ var execRes xsapiv1.ExecArgs cmd := "pwd && echo \"SDKTARGETSYSROOT=<$SDKTARGETSYSROOT>\"" exec := xsapiv1.ExecArgs{ ID: cfg.ID, Cmd: cmd, + SdkID: "11111-invalid", + } + Debugf(t, "exec cmake cmd(%v)", cmd) + cmdOut = "" + assert.NotNil(t, HTTPCli.Post("/exec", exec, &execRes)) + + /*basic check: verify that environment is set correctly (use the right sdk)*/ + cmd = "pwd && echo \"SDKTARGETSYSROOT=<$SDKTARGETSYSROOT>\"" + exec = xsapiv1.ExecArgs{ + ID: cfg.ID, + Cmd: cmd, SdkID: sdkRes.ID, } Debugf(t, "exec cmake cmd(%v)", cmd) |