diff --git a/cmd/integration_test.go b/cmd/integration_test.go index 3eda98ed9d98a5d558d4084e32a02bb2426d9198..1281d8da401866f9a08e52a137b1d13d8c3d9e25 100644 --- a/cmd/integration_test.go +++ b/cmd/integration_test.go @@ -9,7 +9,7 @@ import ( ) var testAddress = "141.100.70.171:6030" -var testApiEndpoint = "http://141.100.70.171:8080" +var testAPIEndpoint = "http://141.100.70.171:8080" var testUsername = "admin" var testPassword = "arista" @@ -20,7 +20,7 @@ func testSetupIntegration() { } api := os.Getenv("GOSDN_TEST_API_ENDPOINT") if api != "" { - testApiEndpoint = api + testAPIEndpoint = api } u := os.Getenv("GOSDN_TEST_USER") if u != "" { @@ -53,7 +53,7 @@ func TestCliIntegration(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { defer viper.Reset() - if err := cli.HttpGet(testApiEndpoint, "init"); (err != nil) != tt.wantErr { + if err := cli.HTTPGet(testAPIEndpoint, "init"); (err != nil) != tt.wantErr { switch err.(type) { case viper.ConfigFileNotFoundError: default: @@ -64,8 +64,8 @@ func TestCliIntegration(t *testing.T) { cliPnd = viper.GetString("CLI_PND") cliSbi = viper.GetString("CLI_SBI") - if err := cli.HttpGet( - testApiEndpoint, + if err := cli.HTTPGet( + testAPIEndpoint, "addDevice", "address="+testAddress, "password="+testPassword, @@ -78,8 +78,8 @@ func TestCliIntegration(t *testing.T) { } did := viper.GetString("LAST_DEVICE_UUID") - if err := cli.HttpGet( - testApiEndpoint, + if err := cli.HTTPGet( + testAPIEndpoint, "request", "uuid="+did, "sbi="+cliSbi, @@ -90,8 +90,8 @@ func TestCliIntegration(t *testing.T) { return } - if err := cli.HttpGet( - testApiEndpoint, + if err := cli.HTTPGet( + testAPIEndpoint, "getDevice", "address="+testAddress, "uuid="+did, @@ -103,8 +103,8 @@ func TestCliIntegration(t *testing.T) { } hostname := guuid.New().String() - if err := cli.HttpGet( - testApiEndpoint, + if err := cli.HTTPGet( + testAPIEndpoint, "set", "address="+testAddress, "uuid="+did, diff --git a/nucleus/gnmi_transport_test.go b/nucleus/gnmi_transport_test.go index d77cbe0caef4de1daf8f373b0bb821724ba3a0e3..9487efccccd35e49fe5936a51420b1d21c52d2fa 100644 --- a/nucleus/gnmi_transport_test.go +++ b/nucleus/gnmi_transport_test.go @@ -47,7 +47,7 @@ func TestMain(m *testing.M) { testSetupPnd() testSetupStore() testSetupSbi() - testSetupHttp() + testSetupHTTP() testSetupIntegration() os.Exit(m.Run()) } diff --git a/nucleus/http_test.go b/nucleus/http_test.go index 4658b16423a1b5261989b8508b98b38a7b842aa9..85b52dfb61a9d887143f564513220d688c7d2392 100644 --- a/nucleus/http_test.go +++ b/nucleus/http_test.go @@ -18,7 +18,7 @@ var args string var argsNotFound string var d Device -func testSetupHttp() { +func testSetupHTTP() { testSetupPnd() sbi = &OpenConfig{id: defaultSbiID} sbi.Schema() @@ -166,7 +166,7 @@ func Test_httpApi(t *testing.T) { t.Errorf("httpApi() got: %v, want %v", got.StatusCode, tt.want.StatusCode) } if tt.name == "add-device" { - for k := range pnd.(*pndImplementation).devices.store{ + for k := range pnd.(*pndImplementation).devices.store { if k != mdid { if err := pnd.RemoveDevice(k); err != nil { t.Error(err)