@@ -21,6 +21,7 @@ import (
2121
2222 "github.com/aws/amazon-ecs-agent/agent/utils"
2323 "github.com/aws/amazon-ecs-agent/ecs-agent/ecs_client/model/ecs"
24+ commonutils "github.com/aws/amazon-ecs-agent/ecs-agent/utils"
2425 "github.com/aws/aws-sdk-go/aws"
2526 "github.com/stretchr/testify/assert"
2627)
@@ -231,7 +232,7 @@ func TestConsumable(t *testing.T) {
231232 }
232233
233234 for _ , tc := range testCases {
234- resources := getTestTaskResourceMap (tc .cpu , tc .mem , utils .Uint16SliceToStringSlice (tc .ports ), utils .Uint16SliceToStringSlice (tc .portsUdp ), aws .StringSlice (tc .gpus ))
235+ resources := getTestTaskResourceMap (tc .cpu , tc .mem , commonutils .Uint16SliceToStringSlice (tc .ports ), commonutils .Uint16SliceToStringSlice (tc .portsUdp ), aws .StringSlice (tc .gpus ))
235236 canBeConsumed , err := h .consumable (resources )
236237 assert .Equal (t , canBeConsumed , tc .canBeConsumed , "Error in checking if resources can be successfully consumed" )
237238 assert .Equal (t , err , nil , "Error in checking if resources can be successfully consumed, error returned from consumable" )
@@ -244,7 +245,7 @@ func TestResourceHealthTrue(t *testing.T) {
244245 gpuIDs := []string {"gpu1" , "gpu2" , "gpu3" , "gpu4" }
245246 h := getTestHostResourceManager (int64 (2048 ), int64 (2048 ), []* string {& hostResourcePort1 }, []* string {& hostResourcePort2 }, aws .StringSlice (gpuIDs ))
246247
247- resources := getTestTaskResourceMap (1024 , 1024 , utils .Uint16SliceToStringSlice ([]uint16 {22 }), utils .Uint16SliceToStringSlice ([]uint16 {1000 }), aws .StringSlice ([]string {"gpu1" , "gpu2" }))
248+ resources := getTestTaskResourceMap (1024 , 1024 , commonutils .Uint16SliceToStringSlice ([]uint16 {22 }), commonutils .Uint16SliceToStringSlice ([]uint16 {1000 }), aws .StringSlice ([]string {"gpu1" , "gpu2" }))
248249 err := h .checkResourcesHealth (resources )
249250 assert .NoError (t , err , "Error in checking healthy resource map status" )
250251}
@@ -256,7 +257,7 @@ func TestResourceHealthGPUFalse(t *testing.T) {
256257 gpuIDs := []string {"gpu1" , "gpu2" , "gpu3" , "gpu4" }
257258 h := getTestHostResourceManager (int64 (2048 ), int64 (2048 ), []* string {& hostResourcePort1 }, []* string {& hostResourcePort2 }, aws .StringSlice (gpuIDs ))
258259
259- resources := getTestTaskResourceMap (1024 , 1024 , utils .Uint16SliceToStringSlice ([]uint16 {22 }), utils .Uint16SliceToStringSlice ([]uint16 {1000 }), aws .StringSlice ([]string {"gpu1" , "gpu5" }))
260+ resources := getTestTaskResourceMap (1024 , 1024 , commonutils .Uint16SliceToStringSlice ([]uint16 {22 }), commonutils .Uint16SliceToStringSlice ([]uint16 {1000 }), aws .StringSlice ([]string {"gpu1" , "gpu5" }))
260261 err := h .checkResourcesHealth (resources )
261262 assert .Error (t , err , "Error in checking unhealthy resource map status" )
262263}
0 commit comments