diff options
author | Clément Bénier <clement.benier@iot.bzh> | 2018-07-31 16:03:08 +0200 |
---|---|---|
committer | Clément Bénier <clement.benier@iot.bzh> | 2018-08-21 11:08:36 +0200 |
commit | 0385142d33663cb70204123ed3680d58efd2ad90 (patch) | |
tree | 84251558fc9192dd311490d024b3d4caf5cc02e5 /test/sdks_test.go | |
parent | a70639fb60bfbe5899f580a48222b47f435ca1f8 (diff) |
[test exec]: in progress
Change-Id: Ie8eb5b66ecffa7cdb87a79a1543d7b303332f190
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Diffstat (limited to 'test/sdks_test.go')
-rw-r--r-- | test/sdks_test.go | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/test/sdks_test.go b/test/sdks_test.go index 6319542..51f1d95 100644 --- a/test/sdks_test.go +++ b/test/sdks_test.go @@ -26,7 +26,6 @@ import ( "testing" "time" - "gerrit.automotivelinux.org/gerrit/src/xds/xds-agent/lib/xaapiv1" "gerrit.automotivelinux.org/gerrit/src/xds/xds-server/lib/xsapiv1" socketio_client "github.com/sebd71/go-socket.io-client" "github.com/stretchr/testify/assert" @@ -91,6 +90,8 @@ func NewIoSocketClient(url, clientID string) (*IOSockClient, error) { return sCli, err } + //sCli.Conn.On(xsapiv1.) + return sCli, nil } @@ -129,24 +130,33 @@ func TestSdks(t *testing.T) { } } -func TestInstallFakeSdk(t *testing.T) { - sdk := xaapiv1.SDKInstallArgs{ - ID: "", - Filename: sdkFileName, - Force: false, - } +func installFakeSdk(t *testing.T, sdkInstall xsapiv1.SDKInstallArgs) xsapiv1.SDK { var sdkRes xsapiv1.SDK - assert.Nil(t, HTTPCli.Post("/sdks", sdk, &sdkRes)) + assert.Nil(t, HTTPCli.Post("/sdks", sdkInstall, &sdkRes)) assert.Equal(t, sdkRes.Status, "Installing") /*waiting for SDKStateChange event from channel*/ sdkFromEvent := <-ch t.Log(sdkFromEvent) assert.Equal(t, sdkRes.ID, sdkFromEvent.ID) assert.Equal(t, "Installed", sdkFromEvent.Status) + return sdkFromEvent +} + +func TestInstallFakeSdk(t *testing.T) { + sdk := xsapiv1.SDKInstallArgs{ + ID: "", + Filename: sdkFileName, + Force: false, + } + installFakeSdk(t, sdk) + var sdkRes xsapiv1.SDK + assert.NotNil(t, HTTPCli.Post("/sdks", sdk, &sdkRes)) + sdk.Force = true + //installFakeSdk(t, sdk) } func TestSdksError(t *testing.T) { - sdk := xaapiv1.SDKInstallArgs{ + sdk := xsapiv1.SDKInstallArgs{ ID: "", Filename: "", Force: false, |