diff --git a/api_test.go b/api_test.go index 9a4fc2c..c0d17ba 100644 --- a/api_test.go +++ b/api_test.go @@ -150,7 +150,7 @@ func TestClientVersion(t *testing.T) { } // Test unauthorized authentication - _, err = client.Authenticate(context.Background(), &ConfigConnect{ + _, err = client.Authenticate(&ConfigConnect{ Username: "ScaleIOUser", Password: "badpassword", Endpoint: "", @@ -161,12 +161,12 @@ func TestClientVersion(t *testing.T) { } // Test for version retrieval with retry - _, err = client.GetVersion(context.Background()) + _, err = client.GetVersion() if err != nil { // Check if the error is due to unauthorized access if strings.Contains(err.Error(), "Unauthorized") { //retry - _, err = client.Authenticate(context.Background(), &ConfigConnect{ + _, err = client.Authenticate(&ConfigConnect{ Username: "ScaleIOUser", Password: "password", Endpoint: "", diff --git a/compatibility_management_test.go b/compatibility_management_test.go index 7ad7bef..37d7c1d 100644 --- a/compatibility_management_test.go +++ b/compatibility_management_test.go @@ -13,7 +13,6 @@ package goscaleio import ( - "context" "encoding/json" "math" "net/http" @@ -73,7 +72,7 @@ func TestGetCompatibility(t *testing.T) { client: client, } - _, err = s.GetCompatibilityManagement(context.Background()) + _, err = s.GetCompatibilityManagement() if err != nil { if tc.error != err.Error() { t.Fatal(err) @@ -109,7 +108,7 @@ func TestSetCompatibility(t *testing.T) { client: client, } - _, err = s.SetCompatibilityManagement(context.Background(), &tc.compatibilitymanagement) + _, err = s.SetCompatibilityManagement(&tc.compatibilitymanagement) if err != nil { if tc.error != err.Error() { t.Fatal(err) diff --git a/device_test.go b/device_test.go index a721461..b87998c 100644 --- a/device_test.go +++ b/device_test.go @@ -13,7 +13,6 @@ package goscaleio import ( - "context" "encoding/json" "errors" "fmt" @@ -118,7 +117,7 @@ func TestGetAllDevices(t *testing.T) { client: client, } - _, err = s.GetAllDevice(context.Background()) + _, err = s.GetAllDevice() if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -177,7 +176,7 @@ func TestGetDevice(t *testing.T) { client: client, } - _, err = s.GetDevice(context.Background(), "1") + _, err = s.GetDevice("1") if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -271,7 +270,7 @@ func TestGetDeviceByField(t *testing.T) { temp := deviceFields[id] for fieldKey, fieldValue := range temp { - _, err = s.GetDeviceByField(context.Background(), fieldKey, fieldValue) + _, err = s.GetDeviceByField(fieldKey, fieldValue) if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -362,7 +361,7 @@ func TestSDSFindDevice(t *testing.T) { sds.Sds.Name = "mock-sds-name" sds.Sds.ID = "mock-sds-id" for fieldKey, fieldValue := range deviceFields[id] { - _, err = sds.FindDevice(context.Background(), fieldKey, fieldValue) + _, err = sds.FindDevice(fieldKey, fieldValue) if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -423,7 +422,7 @@ func TestSDSGetDevice(t *testing.T) { sds := NewSds(client) sds.Sds.Name = "mock-sds-name" sds.Sds.ID = "mock-sds-id" - _, err = sds.GetDevice(context.Background()) + _, err = sds.GetDevice() if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -482,7 +481,7 @@ func TestStoragePoolGetDevice(t *testing.T) { pool := NewStoragePool(client) pool.StoragePool.Name = "mock-storage-pool-name" - _, err = pool.GetDevice(context.Background()) + _, err = pool.GetDevice() if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -571,7 +570,7 @@ func TestStoragePoolFindDevice(t *testing.T) { pool.StoragePool.Name = "mock-storage-pool-name" pool.StoragePool.ID = "mock-storage-pool-id" for fieldKey, fieldValue := range deviceFields[id] { - _, err = pool.FindDevice(context.Background(), fieldKey, fieldValue) + _, err = pool.FindDevice(fieldKey, fieldValue) if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) @@ -635,7 +634,7 @@ func TestStoragePoolSetDeviceName(t *testing.T) { client, _ := NewClientWithArgs(server.URL, "", math.MaxInt64, true, false) storagePool := NewStoragePool(client) - err := storagePool.SetDeviceName(context.Background(), "mock-device-id", "mock-device-name") + err := storagePool.SetDeviceName("mock-device-id", "mock-device-name") for _, checkFn := range checkFns { checkFn(t, err) @@ -696,7 +695,7 @@ func TestStoragePoolSetMediaType(t *testing.T) { client, _ := NewClientWithArgs(server.URL, "", math.MaxInt64, true, false) storagePool := NewStoragePool(client) - err := storagePool.SetDeviceMediaType(context.Background(), "mock-device-id", "mock-media-type") + err := storagePool.SetDeviceMediaType("mock-device-id", "mock-media-type") for _, checkFn := range checkFns { checkFn(t, err) @@ -757,7 +756,7 @@ func TestStoragePoolSetDeviceExternalAccelerationType(t *testing.T) { client, _ := NewClientWithArgs(server.URL, "", math.MaxInt64, true, false) storagePool := NewStoragePool(client) - err := storagePool.SetDeviceExternalAccelerationType(context.Background(), "mock-device-id", "mock-acceleration-type") + err := storagePool.SetDeviceExternalAccelerationType("mock-device-id", "mock-acceleration-type") for _, checkFn := range checkFns { checkFn(t, err) @@ -818,7 +817,7 @@ func TestStoragePoolSetDeviceCapacityLimit(t *testing.T) { client, _ := NewClientWithArgs(server.URL, "", math.MaxInt64, true, false) storagePool := NewStoragePool(client) - err := storagePool.SetDeviceCapacityLimit(context.Background(), "mock-device-id", "100G") + err := storagePool.SetDeviceCapacityLimit("mock-device-id", "100G") for _, checkFn := range checkFns { checkFn(t, err) @@ -879,7 +878,7 @@ func TestStoragePoolUpdateDeviceOriginalPathways(t *testing.T) { client, _ := NewClientWithArgs(server.URL, "", math.MaxInt64, true, false) storagePool := NewStoragePool(client) - err := storagePool.UpdateDeviceOriginalPathways(context.Background(), "mock-device-id") + err := storagePool.UpdateDeviceOriginalPathways("mock-device-id") for _, checkFn := range checkFns { checkFn(t, err) @@ -940,7 +939,7 @@ func TestStoragePoolRemoveDevice(t *testing.T) { client, _ := NewClientWithArgs(server.URL, "", math.MaxInt64, true, false) storagePool := NewStoragePool(client) - err := storagePool.RemoveDevice(context.Background(), "mock-device-id") + err := storagePool.RemoveDevice("mock-device-id") for _, checkFn := range checkFns { checkFn(t, err) @@ -1003,7 +1002,7 @@ func TestStoragePoolAttachDevice(t *testing.T) { deviceParam := &types.DeviceParam{ Name: "mock-device-name", } - _, err := storagePool.AttachDevice(context.Background(), deviceParam) + _, err := storagePool.AttachDevice(deviceParam) for _, checkFn := range checkFns { checkFn(t, err) diff --git a/fault_set_test.go b/fault_set_test.go index 7eab1a7..7a602bd 100644 --- a/fault_set_test.go +++ b/fault_set_test.go @@ -13,7 +13,6 @@ package goscaleio import ( - "context" "encoding/json" "errors" "math" @@ -380,7 +379,7 @@ func TestGetFaultSetByName(t *testing.T) { s := System{ client: client, } - _, err = s.GetFaultSetByName(context.Background(), "mock-fault-set-name") + _, err = s.GetFaultSetByName("mock-fault-set-name") if err != nil { if tc.expectedErr.Error() != err.Error() { t.Fatal(err) diff --git a/instance_test.go b/instance_test.go index 7af58ce..3ba6d23 100644 --- a/instance_test.go +++ b/instance_test.go @@ -13,7 +13,6 @@ package goscaleio import ( - "context" "encoding/json" "fmt" "math" @@ -196,7 +195,7 @@ func TestGetInstance(t *testing.T) { if err != nil { t.Fatal(err) } - _, err = client.GetInstance(context.Background(), tc.systemhref) + _, err = client.GetInstance(tc.systemhref) if err != nil { if tc.error != err.Error() { t.Fatal(err) @@ -270,7 +269,7 @@ func TestGetVolume(t *testing.T) { t.Fatal(err) } - _, err = client.GetVolume(context.Background(), tc.volumehref, tc.volumeid, tc.ancestorevolumeid, tc.volumename, tc.snapshots) + _, err = client.GetVolume(tc.volumehref, tc.volumeid, tc.ancestorevolumeid, tc.volumename, tc.snapshots) if err != nil { if tc.error != err.Error() { t.Fatal(err) @@ -306,7 +305,7 @@ func TestGetStoragePool(t *testing.T) { t.Fatal(err) } - _, err = client.GetStoragePool(context.Background(), tc.storagepoolhref) + _, err = client.GetStoragePool(tc.storagepoolhref) if err != nil { if tc.error != err.Error() { t.Fatal(err) @@ -361,7 +360,7 @@ func TestFindStoragePool(t *testing.T) { t.Fatal(err) } - _, err = client.FindStoragePool(context.Background(), tc.poolid, tc.poolname, tc.storagepoolhref, tc.protectiondomainid) + _, err = client.FindStoragePool(tc.poolid, tc.poolname, tc.storagepoolhref, tc.protectiondomainid) if err != nil { if tc.error != err.Error() { t.Fatal(err) @@ -397,7 +396,7 @@ func TestGetStoragePoolVolumes(t *testing.T) { t.Fatal(err) } - _, err = client.GetStoragePoolVolumes(context.Background(), tc.storagepoolid) + _, err = client.GetStoragePoolVolumes(tc.storagepoolid) if err != nil { if tc.error != err.Error() { t.Fatal(err) @@ -476,7 +475,7 @@ func TestGetSnapshotPolicyI(t *testing.T) { t.Fatal(err) } - _, err = client.GetSnapshotPolicy(context.Background(), tc.snapshotpolicyname, tc.snapshotpolicyid) + _, err = client.GetSnapshotPolicy(tc.snapshotpolicyname, tc.snapshotpolicyid) if err != nil { if tc.error != err.Error() { t.Fatal(err)