diff --git a/cmd/fb-om-exporter/main.go b/cmd/fb-om-exporter/main.go index 450a623..610b76a 100644 --- a/cmd/fb-om-exporter/main.go +++ b/cmd/fb-om-exporter/main.go @@ -145,8 +145,9 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) { return } + uagent := r.Header.Get("User-Agent") registry := prometheus.NewRegistry() - fbclient := client.NewRestClient(address, apitoken, apiver, debug) + fbclient := client.NewRestClient(address, apitoken, apiver, uagent, debug) if fbclient.Error != nil { http.Error(w, "Error connecting to FlashBlade. Check your management endpoint and/or api token are correct.", http.StatusBadRequest) return diff --git a/internal/openmetrics-exporter/alerts_collector_test.go b/internal/openmetrics-exporter/alerts_collector_test.go index 7eb34f2..03a40cb 100644 --- a/internal/openmetrics-exporter/alerts_collector_test.go +++ b/internal/openmetrics-exporter/alerts_collector_test.go @@ -51,7 +51,7 @@ func TestAlertsCollector(t *testing.T) { alert := strings.Split(a, "\n") want[fmt.Sprintf("label:{name:\"action\" value:\"%s\"} label:{name:\"code\" value:\"%s\"} label:{name:\"component_name\" value:\"%s\"} label:{name:\"component_type\" value:\"%s\"} label:{name:\"created\" value:\"%s\"} label:{name:\"kburl\" value:\"%s\"} label:{name:\"severity\" value:\"%s\"} label:{name:\"summary\" value:\"%s\"} gauge:{value:%g}", alert[0], alert[1], alert[2], alert[3], alert[4], alert[5], alert[6], alert[7], n)] = true } - c := client.NewRestClient(e, "fake-api-token", "latest", false) + c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) ac := NewAlertsCollector(c) metricsCheck(t, ac, want) server.Close() diff --git a/internal/openmetrics-exporter/arrays_collector_test.go b/internal/openmetrics-exporter/arrays_collector_test.go index 761a997..6d57193 100644 --- a/internal/openmetrics-exporter/arrays_collector_test.go +++ b/internal/openmetrics-exporter/arrays_collector_test.go @@ -36,7 +36,7 @@ func TestArraysCollector(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] want := make(map[string]bool) - c := client.NewRestClient(e, "fake-api-token", "latest", false) + c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) for _, a := range arrs.Items { want[fmt.Sprintf("label:{name:\"array_name\" value:\"%s\"} label:{name:\"os\" value:\"%s\"} label:{name:\"system_id\" value:\"%s\"} label:{name:\"version\" value:\"%s\"} gauge:{value:1}", a.Name, a.Os, a.Id, a.Version)] = true } diff --git a/internal/openmetrics-exporter/arrays_http_perf_collector_test.go b/internal/openmetrics-exporter/arrays_http_perf_collector_test.go index 9d6c590..587575f 100644 --- a/internal/openmetrics-exporter/arrays_http_perf_collector_test.go +++ b/internal/openmetrics-exporter/arrays_http_perf_collector_test.go @@ -36,7 +36,7 @@ func TestArraysHttpPerfCollector(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] want := make(map[string]bool) - c := client.NewRestClient(e, "fake-api-token", "latest", false) + c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) for _, p := range arrs.Items { want[fmt.Sprintf("label:{name:\"dimension\" value:\"others_per_sec\"} gauge:{value:%g}", p.OthersPerSec)] = true want[fmt.Sprintf("label:{name:\"dimension\" value:\"read_dirs_per_sec\"} gauge:{value:%g}", p.ReadDirsPerSec)] = true diff --git a/internal/openmetrics-exporter/arrays_nfs_perf_collector_test.go b/internal/openmetrics-exporter/arrays_nfs_perf_collector_test.go index eee2569..07f659d 100644 --- a/internal/openmetrics-exporter/arrays_nfs_perf_collector_test.go +++ b/internal/openmetrics-exporter/arrays_nfs_perf_collector_test.go @@ -36,7 +36,7 @@ func TestArraysNfsPerfCollector(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] want := make(map[string]bool) - c := client.NewRestClient(e, "fake-api-token", "latest", false) + c := client.NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) for _, p := range arrs.Items { want[fmt.Sprintf("label:{name:\"dimension\" value:\"fsinfos_per_sec\"} gauge:{value:%g}", p.FsinfosPerSec)] = true want[fmt.Sprintf("label:{name:\"dimension\" value:\"fsstats_per_sec\"} gauge:{value:%g}", p.FsstatsPerSec)] = true diff --git a/internal/rest-client/alerts_test.go b/internal/rest-client/alerts_test.go index cc1d3c3..b39c1e9 100644 --- a/internal/rest-client/alerts_test.go +++ b/internal/rest-client/alerts_test.go @@ -44,7 +44,7 @@ func TestAlerts(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] t.Run("alerts_open", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) al := c.GetAlerts("state='open'") if diff := cmp.Diff(al.Items, aopen.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -52,7 +52,7 @@ func TestAlerts(t *testing.T) { } }) t.Run("alerts_all", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) al := c.GetAlerts("") if diff := cmp.Diff(al.Items, aall.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_http_perf_test.go b/internal/rest-client/arrays_http_perf_test.go index 5dcd971..7c66b5d 100644 --- a/internal/rest-client/arrays_http_perf_test.go +++ b/internal/rest-client/arrays_http_perf_test.go @@ -36,7 +36,7 @@ func TestArraysHttpPerformance(t *testing.T) { e := endp[len(endp)-1] t.Run("arrays_http_performance_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) ahpl := c.GetArraysHttpPerformance() if diff := cmp.Diff(ahpl.Items[0], arrhp.Items[0]); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_nfs_perf_test.go b/internal/rest-client/arrays_nfs_perf_test.go index e14538a..9cb94a8 100644 --- a/internal/rest-client/arrays_nfs_perf_test.go +++ b/internal/rest-client/arrays_nfs_perf_test.go @@ -36,7 +36,7 @@ func TestArraysNfsPerformance(t *testing.T) { e := endp[len(endp)-1] t.Run("arrays_http_performance_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) apl := c.GetArraysNfsPerformance() if diff := cmp.Diff(apl.Items[0], arrsp.Items[0]); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_perf_replication_test.go b/internal/rest-client/arrays_perf_replication_test.go index 4ecfb86..319252b 100644 --- a/internal/rest-client/arrays_perf_replication_test.go +++ b/internal/rest-client/arrays_perf_replication_test.go @@ -37,7 +37,7 @@ func TestArraysPerformanceReplication(t *testing.T) { e := endp[len(endp)-1] t.Run("array_performance_replication_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) aprl := c.GetArraysPerformanceReplication() if diff := cmp.Diff(aprl.Items, arrpr.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_perf_test.go b/internal/rest-client/arrays_perf_test.go index 2910cab..e5dd24d 100644 --- a/internal/rest-client/arrays_perf_test.go +++ b/internal/rest-client/arrays_perf_test.go @@ -71,7 +71,7 @@ func TestArraysPerformance(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] t.Run("array_perf_all", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetArraysPerformance("all") if diff := cmp.Diff(pl.Items, aall.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -79,7 +79,7 @@ func TestArraysPerformance(t *testing.T) { } }) t.Run("array_perf_http", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetArraysPerformance("HTTP") if diff := cmp.Diff(pl.Items, ahttp.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -87,7 +87,7 @@ func TestArraysPerformance(t *testing.T) { } }) t.Run("array_perf_nfs", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetArraysPerformance("NFS") if diff := cmp.Diff(pl.Items, anfs.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -95,7 +95,7 @@ func TestArraysPerformance(t *testing.T) { } }) t.Run("array_perf_smb", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetArraysPerformance("SMB") if diff := cmp.Diff(pl.Items, asmb.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -103,7 +103,7 @@ func TestArraysPerformance(t *testing.T) { } }) t.Run("array_perf_s3", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetArraysPerformance("S3") if diff := cmp.Diff(pl.Items, as3.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_s3_perf_test.go b/internal/rest-client/arrays_s3_perf_test.go index de2e56d..398f730 100644 --- a/internal/rest-client/arrays_s3_perf_test.go +++ b/internal/rest-client/arrays_s3_perf_test.go @@ -36,7 +36,7 @@ func TestArraysS3Performance(t *testing.T) { e := endp[len(endp)-1] t.Run("array_s3_specific_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetArraysS3Performance() if diff := cmp.Diff(pl.Items, as3.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_space_test.go b/internal/rest-client/arrays_space_test.go index 27436f8..f1d1370 100644 --- a/internal/rest-client/arrays_space_test.go +++ b/internal/rest-client/arrays_space_test.go @@ -53,7 +53,7 @@ func TestArraysSpace(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] t.Run("arrays_space_1", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) asl := c.GetArraysSpace("array") if diff := cmp.Diff(asl.Items, arrsa.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -61,7 +61,7 @@ func TestArraysSpace(t *testing.T) { } }) t.Run("arrays_space_2", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) asfs := c.GetArraysSpace("file-system") if diff := cmp.Diff(asfs.Items, arrsfs.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) @@ -69,7 +69,7 @@ func TestArraysSpace(t *testing.T) { } }) t.Run("arrays_space_3", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) aso := c.GetArraysSpace("object-store") if diff := cmp.Diff(aso.Items, arrso.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/arrays_test.go b/internal/rest-client/arrays_test.go index 9ce6171..46399dc 100644 --- a/internal/rest-client/arrays_test.go +++ b/internal/rest-client/arrays_test.go @@ -36,7 +36,7 @@ func TestArraysInfo(t *testing.T) { e := endp[len(endp)-1] t.Run("arrays_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) al := c.GetArrays() if diff := cmp.Diff(al.Items, arr.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/blades_test.go b/internal/rest-client/blades_test.go index e7b50b6..8fad5f6 100644 --- a/internal/rest-client/blades_test.go +++ b/internal/rest-client/blades_test.go @@ -36,7 +36,7 @@ func TestBlades(t *testing.T) { e := endp[len(endp)-1] t.Run("blades_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) bl := c.GetBlades() if diff := cmp.Diff(bl.Items, abl.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/buckets_perf_test.go b/internal/rest-client/buckets_perf_test.go index bced201..33b1cd6 100644 --- a/internal/rest-client/buckets_perf_test.go +++ b/internal/rest-client/buckets_perf_test.go @@ -43,7 +43,7 @@ func TestBucketsPerformance(t *testing.T) { e := endp[len(endp)-1] t.Run("buckets_performance_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) b := c.GetBuckets() pl := c.GetBucketsPerformance(b) if diff := cmp.Diff(pl.Items, bpl.Items); diff != "" { diff --git a/internal/rest-client/buckets_s3_perf_test.go b/internal/rest-client/buckets_s3_perf_test.go index 6a37164..9221a54 100644 --- a/internal/rest-client/buckets_s3_perf_test.go +++ b/internal/rest-client/buckets_s3_perf_test.go @@ -43,7 +43,7 @@ func TestBucketsS3Performance(t *testing.T) { e := endp[len(endp)-1] t.Run("buckets_s3_performance_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) b := c.GetBuckets() pl := c.GetBucketsS3Performance(b) if diff := cmp.Diff(pl.Items, bpl.Items); diff != "" { diff --git a/internal/rest-client/buckets_test.go b/internal/rest-client/buckets_test.go index b4f3174..a85a269 100644 --- a/internal/rest-client/buckets_test.go +++ b/internal/rest-client/buckets_test.go @@ -36,7 +36,7 @@ func TestBuckets(t *testing.T) { e := endp[len(endp)-1] t.Run("buckets_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) bl := c.GetBuckets() if diff := cmp.Diff(bl.Items, ab.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/clients_perf_test.go b/internal/rest-client/clients_perf_test.go index 21868eb..bb552e1 100644 --- a/internal/rest-client/clients_perf_test.go +++ b/internal/rest-client/clients_perf_test.go @@ -36,7 +36,7 @@ func TestClientsPerformance(t *testing.T) { e := endp[len(endp)-1] t.Run("clients_performance_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) cp := c.GetClientsPerformance() if diff := cmp.Diff(cp.Items, cpl.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/filesystems_perf_test.go b/internal/rest-client/filesystems_perf_test.go index 72854b4..d2b3c00 100644 --- a/internal/rest-client/filesystems_perf_test.go +++ b/internal/rest-client/filesystems_perf_test.go @@ -42,7 +42,7 @@ func TestFileSystemsPerformance(t *testing.T) { endp := strings.Split(server.URL, "/") e := endp[len(endp)-1] t.Run("filesystems_performance_all", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) f := c.GetFileSystems() fl := c.GetFileSystemsPerformance(f, "all") if diff := cmp.Diff(fl.Items, fpl.Items); diff != "" { @@ -51,7 +51,7 @@ func TestFileSystemsPerformance(t *testing.T) { } }) t.Run("filesystems_performance_nfs", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) f := c.GetFileSystems() fl := c.GetFileSystemsPerformance(f, "NFS") if diff := cmp.Diff(fl.Items, fpl.Items); diff != "" { @@ -60,7 +60,7 @@ func TestFileSystemsPerformance(t *testing.T) { } }) t.Run("filesystems_performance_smb", func(t *testing.T) { - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) f := c.GetFileSystems() fl := c.GetFileSystemsPerformance(f, "SMB") if diff := cmp.Diff(fl.Items, fpl.Items); diff != "" { diff --git a/internal/rest-client/filesystems_test.go b/internal/rest-client/filesystems_test.go index f749325..11c669a 100644 --- a/internal/rest-client/filesystems_test.go +++ b/internal/rest-client/filesystems_test.go @@ -35,7 +35,7 @@ func TestFileSystems(t *testing.T) { e := endp[len(endp)-1] t.Run("filesystems_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) fsl := c.GetFileSystems() if diff := cmp.Diff(fsl.Items, fs.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/flashblade_client.go b/internal/rest-client/flashblade_client.go index 15b7d95..69dc222 100644 --- a/internal/rest-client/flashblade_client.go +++ b/internal/rest-client/flashblade_client.go @@ -40,7 +40,7 @@ type FBClient struct { Error error } -func NewRestClient(endpoint string, apitoken string, apiversion string, debug bool) *FBClient { +func NewRestClient(endpoint string, apitoken string, apiversion string, uagent string, debug bool) *FBClient { type ApiVersions struct { Versions []string `json:"versions"` } @@ -92,7 +92,7 @@ func NewRestClient(endpoint string, apitoken string, apiversion string, debug bo fb.XAuthToken = res.Header().Get("x-auth-token") fb.RestClient.SetBaseURL("https://" + endpoint + "/api/" + fb.ApiVersion) fb.RestClient.SetHeader("x-auth-token", fb.XAuthToken) - fb.RestClient.SetHeader("User-Agent", FBRestUserAgent) + fb.RestClient.SetHeader("User-Agent", FBRestUserAgent + " (" + uagent + ")") return fb } diff --git a/internal/rest-client/flashblade_client_test.go b/internal/rest-client/flashblade_client_test.go index fbb6283..c0eb9f9 100644 --- a/internal/rest-client/flashblade_client_test.go +++ b/internal/rest-client/flashblade_client_test.go @@ -30,7 +30,7 @@ func TestNewRestClient(t *testing.T) { e := endp[len(endp)-1] t.Run("login", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) if c.EndPoint != e || c.ApiToken != "fake-api-token" || c.XAuthToken != "faketoken" { t.Errorf("expected (%s, fake-api-token, faketoken), got (%s %s %s)", e, c.EndPoint, c.ApiToken, c.XAuthToken) } diff --git a/internal/rest-client/hardware_connectors_perf_test.go b/internal/rest-client/hardware_connectors_perf_test.go index 18816e9..28ddc3d 100644 --- a/internal/rest-client/hardware_connectors_perf_test.go +++ b/internal/rest-client/hardware_connectors_perf_test.go @@ -36,7 +36,7 @@ func TestHwConnectorsPerformance(t *testing.T) { e := endp[len(endp)-1] t.Run("hardware_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) hl := c.GetHwConnectorsPerformance() if diff := cmp.Diff(hl.Items, hw.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/hardware_test.go b/internal/rest-client/hardware_test.go index e758980..ec1f00b 100644 --- a/internal/rest-client/hardware_test.go +++ b/internal/rest-client/hardware_test.go @@ -36,7 +36,7 @@ func TestHardware(t *testing.T) { e := endp[len(endp)-1] t.Run("hardware_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) hl := c.GetHardware() if diff := cmp.Diff(hl.Items, hw.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff) diff --git a/internal/rest-client/nfs_export_policies_test.go b/internal/rest-client/nfs_export_policies_test.go index 5997a93..626e015 100644 --- a/internal/rest-client/nfs_export_policies_test.go +++ b/internal/rest-client/nfs_export_policies_test.go @@ -36,7 +36,7 @@ func TestNFSExportPolicies(t *testing.T) { e := endp[len(endp)-1] t.Run("nfs_policies_1", func(t *testing.T) { defer server.Close() - c := NewRestClient(e, "fake-api-token", "latest", false) + c := NewRestClient(e, "fake-api-token", "latest", "test-user-agent-string", false) pl := c.GetNFSExportPolicies() if diff := cmp.Diff(pl.Items, nfsp.Items); diff != "" { t.Errorf("Mismatch (-want +got):\n%s", diff)