Skip to content

Commit

Permalink
Merge pull request #107 from HewlettPackard/fix_for_Issue#106
Browse files Browse the repository at this point in the history
Upgrading go version and removing go get to download dependencies
  • Loading branch information
soodpr authored Sep 24, 2018
2 parents ac3de6c + 3130e37 commit 08c28c8
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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.
This project is licensed under the Apache License, Version 2.0. See LICENSE for full license text.
34 changes: 16 additions & 18 deletions test/i3s/i3s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
38 changes: 18 additions & 20 deletions test/icsp/icsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
38 changes: 18 additions & 20 deletions test/ov/ov_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/ov/profile_templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down
6 changes: 3 additions & 3 deletions test/ov/storage_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit 08c28c8

Please sign in to comment.