@@ -3,7 +3,7 @@ package sysdig
33import (
44 "context"
55 "encoding/json"
6- "io/ioutil "
6+ "os "
77 "sort"
88 "testing"
99
@@ -55,7 +55,7 @@ func sortAndCompare(t *testing.T, expected []byte, actual []byte) {
5555}
5656
5757func TestECStransformation (t * testing.T ) {
58- inputfile , err := ioutil .ReadFile ("testfiles/ECSinput.json" )
58+ inputfile , err := os .ReadFile ("testfiles/ECSinput.json" )
5959
6060 if err != nil {
6161 t .Fatalf ("Cannot find testfiles/ECSinput.json" )
@@ -89,7 +89,7 @@ func TestECStransformation(t *testing.T) {
8989 t .Fatalf ("Cannot execute PatchFargateTaskDefinition : %v" , err .Error ())
9090 }
9191
92- expectedOutput , err := ioutil .ReadFile ("testfiles/ECSInstrumented.json" )
92+ expectedOutput , err := os .ReadFile ("testfiles/ECSInstrumented.json" )
9393 if err != nil {
9494 t .Fatalf ("Cannot find testfiles/ECSinput.json" )
9595 }
@@ -145,9 +145,9 @@ func TestTransform(t *testing.T) {
145145 RecipeConfig : string (jsonConfig ),
146146 }
147147
148- inputContainerDefinition , _ := ioutil .ReadFile ("testfiles/" + testName + ".json" )
148+ inputContainerDefinition , _ := os .ReadFile ("testfiles/" + testName + ".json" )
149149 patched , _ := patchFargateTaskDefinition (context .Background (), string (inputContainerDefinition ), kiltConfig , nil )
150- expectedContainerDefinition , _ := ioutil .ReadFile ("testfiles/" + testName + "_expected.json" )
150+ expectedContainerDefinition , _ := os .ReadFile ("testfiles/" + testName + "_expected.json" )
151151
152152 sortAndCompare (t , expectedContainerDefinition , []byte (* patched ))
153153 })
@@ -170,9 +170,9 @@ func TestLogGroup(t *testing.T) {
170170 "region" : "test_region" ,
171171 }
172172
173- inputContainerDefinition , _ := ioutil .ReadFile ("testfiles/fargate_log_group.json" )
173+ inputContainerDefinition , _ := os .ReadFile ("testfiles/fargate_log_group.json" )
174174 patched , _ := patchFargateTaskDefinition (context .Background (), string (inputContainerDefinition ), kiltConfig , logConfig )
175- expectedContainerDefinition , _ := ioutil .ReadFile ("testfiles/fargate_log_group_expected.json" )
175+ expectedContainerDefinition , _ := os .ReadFile ("testfiles/fargate_log_group_expected.json" )
176176
177177 sortAndCompare (t , expectedContainerDefinition , []byte (* patched ))
178178}
0 commit comments