From dec53a0fcf7ee61fbc5c7ea3ac5c322a94069171 Mon Sep 17 00:00:00 2001 From: soodpr Date: Wed, 12 Sep 2018 01:54:50 -0700 Subject: [PATCH 1/5] Modifying the dockerfile to remove dependencies getting installed via go get --- Dockerfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index dd4f0443..95725bb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,7 @@ -FROM golang:1.6.2 - -RUN go get github.com/golang/lint/golint \ - github.com/mattn/goveralls \ - golang.org/x/tools/cover \ - github.com/tools/godep \ - github.com/aktau/github-release +FROM golang:1.11 ENV USER root WORKDIR /go/src/github.com/HewlettPackard/oneview-golang COPY . /go/src/github.com/HewlettPackard/oneview-golang -RUN mkdir bin +RUN go build github.com/HewlettPackard/oneview-golang From 8ada92d0da6d51063a796c57c4244d37af7f0817 Mon Sep 17 00:00:00 2001 From: soodpr Date: Wed, 12 Sep 2018 02:10:15 -0700 Subject: [PATCH 2/5] updgrading go version for travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92449600..bdbf33f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: -- 1.6 +- 1.11 install: - go get github.com/mattn/goveralls - go get -u github.com/golang/lint/golint From a64b3c9836274a05945440f0e57857d9c08827e1 Mon Sep 17 00:00:00 2001 From: Priyanka Sood Date: Thu, 13 Sep 2018 13:39:05 +0000 Subject: [PATCH 3/5] Fixed formatting issue Signed-off-by: Priyanka Sood --- test/ov/profile_templates_test.go | 4 ++-- test/ov/storage_volume_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/ov/profile_templates_test.go b/test/ov/profile_templates_test.go index 7d92a0b3..c80ab095 100644 --- a/test/ov/profile_templates_test.go +++ b/test/ov/profile_templates_test.go @@ -29,8 +29,8 @@ func TestCreateProfileTemplate(t *testing.T) { if testServerProfileTemplate.URI.IsNil() { testServerProfileTemplate = ov.ServerProfile{ - Name: testName, - Type: d.Tc.GetTestData(d.Env, "Type").(string), + Name: testName, + Type: d.Tc.GetTestData(d.Env, "Type").(string), ServerHardwareTypeURI: utils.NewNstring(d.Tc.GetTestData(d.Env, "ServerHardwareTypeUri").(string)), EnclosureGroupURI: utils.NewNstring(d.Tc.GetTestData(d.Env, "EnclosureGroupUri").(string)), } diff --git a/test/ov/storage_volume_test.go b/test/ov/storage_volume_test.go index f8d9b773..b396d2ed 100644 --- a/test/ov/storage_volume_test.go +++ b/test/ov/storage_volume_test.go @@ -33,9 +33,9 @@ func TestCreateStorageVolume(t *testing.T) { if testSVol.URI.IsNil() { testSVol = ov.StorageVolumeV3{ - Name: testName, - StorageSystemUri: utils.NewNstring(d.Tc.GetTestData(d.Env, "StorageSystemUri").(string)), - Type: d.Tc.GetTestData(d.Env, "Type").(string), + Name: testName, + StorageSystemUri: utils.NewNstring(d.Tc.GetTestData(d.Env, "StorageSystemUri").(string)), + Type: d.Tc.GetTestData(d.Env, "Type").(string), ProvisioningParameters: provParams, } From d71b20b138229d2444eb20ec00fbb0a9993c31b7 Mon Sep 17 00:00:00 2001 From: Priyanka Sood Date: Fri, 14 Sep 2018 02:50:29 -0700 Subject: [PATCH 4/5] Fixing all the composite literal uses unkeyed fields Vet errors Signed-off-by: Priyanka Sood --- test/i3s/i3s_test.go | 34 ++++++++++++++++------------------ test/icsp/icsp_test.go | 38 ++++++++++++++++++-------------------- test/ov/ov_test.go | 38 ++++++++++++++++++-------------------- 3 files changed, 52 insertions(+), 58 deletions(-) diff --git a/test/i3s/i3s_test.go b/test/i3s/i3s_test.go index 07610aa2..956adce7 100644 --- a/test/i3s/i3s_test.go +++ b/test/i3s/i3s_test.go @@ -38,17 +38,16 @@ func getTestDriverA(env string) (*I3STest, *i3s.I3SClient) { ot = &I3STest{Tc: tc.NewTestConfig(), Env: "dev"} ot.GetEnvironment(env) ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA")) - ot.OVClient = &ov.OVClient{ - rest.Client{ - User: os.Getenv("ONEVIEW_OV_USER"), - Password: os.Getenv("ONEVIEW_OV_PASSWORD"), - Domain: os.Getenv("ONEVIEW_OV_DOMAIN"), - Endpoint: os.Getenv("ONEVIEW_OV_ENDPOINT"), - APIVersion: 300, - // ConfigDir: - SSLVerify: false, - APIKey: "none", - }, + ot.OVClient = &ov.OVClient{Client: rest.Client{ + User: os.Getenv("ONEVIEW_OV_USER"), + Password: os.Getenv("ONEVIEW_OV_PASSWORD"), + Domain: os.Getenv("ONEVIEW_OV_DOMAIN"), + Endpoint: os.Getenv("ONEVIEW_OV_ENDPOINT"), + APIVersion: 300, + // ConfigDir: + SSLVerify: false, + APIKey: "none", + }, } ot.OVClient.RefreshLogin() ot.Client = ot.Client.NewI3SClient(os.Getenv("ONEVIEW_I3S_ENDPOINT"), ot.OVClient.SSLVerify, ot.OVClient.APIVersion, ot.OVClient.APIKey) @@ -64,13 +63,12 @@ func getTestDriverU(env string) (*I3STest, *i3s.I3SClient) { ot = &I3STest{Tc: tc.NewTestConfig(), Env: "dev"} ot.GetEnvironment(env) ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA")) - ot.Client = &i3s.I3SClient{ - rest.Client{ - Endpoint: "https://i3stestcase", - SSLVerify: false, - APIVersion: 300, - APIKey: "none", - }, + ot.Client = &i3s.I3SClient{Client: rest.Client{ + Endpoint: "https://i3stestcase", + SSLVerify: false, + APIVersion: 300, + APIKey: "none", + }, } return ot, ot.Client } diff --git a/test/icsp/icsp_test.go b/test/icsp/icsp_test.go index 42706415..93ae17c2 100644 --- a/test/icsp/icsp_test.go +++ b/test/icsp/icsp_test.go @@ -58,16 +58,15 @@ func getTestDriverA() (*ICSPTest, *icsp.ICSPClient) { ot = &ICSPTest{Tc: tc.NewTestConfig(), Env: "dev"} ot.GetEnvironment() ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA")) - ot.Client = &icsp.ICSPClient{ - rest.Client{ - User: os.Getenv("ONEVIEW_ICSP_USER"), - Password: os.Getenv("ONEVIEW_ICSP_PASSWORD"), - Domain: os.Getenv("ONEVIEW_ICSP_DOMAIN"), - Endpoint: os.Getenv("ONEVIEW_ICSP_ENDPOINT"), - // ConfigDir: - SSLVerify: false, - APIKey: "none", - }, + ot.Client = &icsp.ICSPClient{Client: rest.Client{ + User: os.Getenv("ONEVIEW_ICSP_USER"), + Password: os.Getenv("ONEVIEW_ICSP_PASSWORD"), + Domain: os.Getenv("ONEVIEW_ICSP_DOMAIN"), + Endpoint: os.Getenv("ONEVIEW_ICSP_ENDPOINT"), + // ConfigDir: + SSLVerify: false, + APIKey: "none", + }, } ot.Client.RefreshVersion() // fmt.Println("Setting up test with getTestDriverA") @@ -81,16 +80,15 @@ func getTestDriverU() (*ICSPTest, *icsp.ICSPClient) { ot = &ICSPTest{Tc: tc.NewTestConfig(), Env: "dev"} ot.GetEnvironment() ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA")) - ot.Client = &icsp.ICSPClient{ - rest.Client{ - User: "foo", - Password: "bar", - Domain: "LOCAL", - Endpoint: "https://icsptestcase", - SSLVerify: false, - APIVersion: 108, - APIKey: "none", - }, + ot.Client = &icsp.ICSPClient{Client: rest.Client{ + User: "foo", + Password: "bar", + Domain: "LOCAL", + Endpoint: "https://icsptestcase", + SSLVerify: false, + APIVersion: 108, + APIKey: "none", + }, } // fmt.Println("Setting up test with getTestDriverU") return ot, ot.Client diff --git a/test/ov/ov_test.go b/test/ov/ov_test.go index b057dcce..22e7db67 100644 --- a/test/ov/ov_test.go +++ b/test/ov/ov_test.go @@ -52,16 +52,15 @@ func getTestDriverA(env string) (*OVTest, *ov.OVClient) { ot = &OVTest{Tc: tc.NewTestConfig(), Env: env} ot.GetEnvironment(env) ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA")) - ot.Client = &ov.OVClient{ - rest.Client{ - User: os.Getenv("ONEVIEW_OV_USER"), - Password: os.Getenv("ONEVIEW_OV_PASSWORD"), - Domain: os.Getenv("ONEVIEW_OV_DOMAIN"), - Endpoint: os.Getenv("ONEVIEW_OV_ENDPOINT"), - // ConfigDir: - SSLVerify: false, - APIKey: "none", - }, + ot.Client = &ov.OVClient{Client: rest.Client{ + User: os.Getenv("ONEVIEW_OV_USER"), + Password: os.Getenv("ONEVIEW_OV_PASSWORD"), + Domain: os.Getenv("ONEVIEW_OV_DOMAIN"), + Endpoint: os.Getenv("ONEVIEW_OV_ENDPOINT"), + // ConfigDir: + SSLVerify: false, + APIKey: "none", + }, } err := ot.Client.RefreshVersion() if err != nil { @@ -78,16 +77,15 @@ func getTestDriverU(env string) (*OVTest, *ov.OVClient) { ot = &OVTest{Tc: tc.NewTestConfig(), Env: env} ot.GetEnvironment(env) ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA")) - ot.Client = &ov.OVClient{ - rest.Client{ - User: "foo", - Password: "bar", - Domain: "LOCAL", - Endpoint: "https://ovtestcase", - SSLVerify: false, - APIVersion: 120, - APIKey: "none", - }, + ot.Client = &ov.OVClient{Client: rest.Client{ + User: "foo", + Password: "bar", + Domain: "LOCAL", + Endpoint: "https://ovtestcase", + SSLVerify: false, + APIVersion: 120, + APIKey: "none", + }, } // fmt.Println("Setting up test with getTestDriverU") return ot, ot.Client From 3130e37642ddb2a8bb02e16ede1fa56994502502 Mon Sep 17 00:00:00 2001 From: Priyanka Sood Date: Fri, 14 Sep 2018 03:19:07 -0700 Subject: [PATCH 5/5] Adding documentation for latest version of GO lang Signed-off-by: Priyanka Sood --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 988cecef..2d34861d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ HPE OneView allows you to treat your physical infrastructure as code, and now you can integrate your favorite tools based in golang with HPE OneView. ## Build requirements -We use docker to build and test, run this project on a system that has docker. +We use docker to build and test, run this project on a system that has docker. If you don't use docker, you will need to install and setup go-lang locally as well as any other make requirements. You can use `USE_CONTAINER=false` environment setting for make to avoid using docker. Otherwise make sure to have these tools: @@ -21,7 +21,7 @@ make test ``` ### Without docker -* Install golang 1.5 or better +* Install golang 1.5 or higher(We recommend using Go 1.11) * Install go packages listed in .travis.yml ``` USE_CONTAINER=false make test @@ -39,4 +39,4 @@ Use the [hacking guide](HACKING.md) to run local acceptance testing and debuggin Currently test cases are not supported portion of our CI/CD approval process but might be made available from this test suite in the future. Contributions to the test suite is appreciated. ## License -This project is licensed under the Apache License, Version 2.0. See LICENSE for full license text. \ No newline at end of file +This project is licensed under the Apache License, Version 2.0. See LICENSE for full license text.