summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-07-31 16:03:08 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-08-21 11:08:36 +0200
commit0385142d33663cb70204123ed3680d58efd2ad90 (patch)
tree84251558fc9192dd311490d024b3d4caf5cc02e5
parenta70639fb60bfbe5899f580a48222b47f435ca1f8 (diff)
[test exec]: in progress
Change-Id: Ie8eb5b66ecffa7cdb87a79a1543d7b303332f190 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rw-r--r--glide.yaml1
-rw-r--r--test/sdks_test.go28
2 files changed, 20 insertions, 9 deletions
diff --git a/glide.yaml b/glide.yaml
index 69ee318..be01c0f 100644
--- a/glide.yaml
+++ b/glide.yaml
@@ -39,3 +39,4 @@ import:
- assert
- package: github.com/sebd71/go-socket.io-client
version: 46defcb47f
+- package: github.com/libgit2/git2go
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,