66
77 "github.com/opencontainers/runc/libcontainer/cgroups"
88 "github.com/opencontainers/runc/libcontainer/cgroups/fscommon"
9- "github.com/opencontainers/runc/libcontainer/configs"
109)
1110
1211const (
@@ -184,7 +183,7 @@ func TestBlkioSetWeight(t *testing.T) {
184183 weightFilename : strconv .Itoa (weightBefore ),
185184 })
186185 // Apply new configuration
187- r := & configs .Resources {
186+ r := & cgroups .Resources {
188187 BlkioWeight : weightAfter ,
189188 }
190189 blkio := & BlkioGroup {}
@@ -224,10 +223,10 @@ func TestBlkioSetWeightDevice(t *testing.T) {
224223 weightDeviceFilename : weightDeviceBefore ,
225224 })
226225 // Apply new configuration
227- wd := configs .NewWeightDevice (8 , 0 , 500 , 0 )
226+ wd := cgroups .NewWeightDevice (8 , 0 , 500 , 0 )
228227 weightDeviceAfter := wd .WeightString ()
229- r := & configs .Resources {
230- BlkioWeightDevice : []* configs .WeightDevice {wd },
228+ r := & cgroups .Resources {
229+ BlkioWeightDevice : []* cgroups .WeightDevice {wd },
231230 }
232231 blkio := & BlkioGroup {}
233232 if err := blkio .Set (path , r ); err != nil {
@@ -255,8 +254,8 @@ func TestBlkioSetMultipleWeightDevice(t *testing.T) {
255254 weightDeviceBefore = "8:0 400"
256255 )
257256
258- wd1 := configs .NewWeightDevice (8 , 0 , 500 , 0 )
259- wd2 := configs .NewWeightDevice (8 , 16 , 500 , 0 )
257+ wd1 := cgroups .NewWeightDevice (8 , 0 , 500 , 0 )
258+ wd2 := cgroups .NewWeightDevice (8 , 16 , 500 , 0 )
260259 // we cannot actually set and check both because normal os.WriteFile
261260 // when writing to cgroup file will overwrite the whole file content instead
262261 // of updating it as the kernel is doing. Just check the second device
@@ -272,8 +271,8 @@ func TestBlkioSetMultipleWeightDevice(t *testing.T) {
272271 blkio .weightDeviceFilename : weightDeviceBefore ,
273272 })
274273
275- r := & configs .Resources {
276- BlkioWeightDevice : []* configs .WeightDevice {wd1 , wd2 },
274+ r := & cgroups .Resources {
275+ BlkioWeightDevice : []* cgroups .WeightDevice {wd1 , wd2 },
277276 }
278277 if err := blkio .Set (path , r ); err != nil {
279278 t .Fatal (err )
@@ -745,15 +744,15 @@ func TestBlkioSetThrottleReadBpsDevice(t *testing.T) {
745744 throttleBefore = `8:0 1024`
746745 )
747746
748- td := configs .NewThrottleDevice (8 , 0 , 2048 )
747+ td := cgroups .NewThrottleDevice (8 , 0 , 2048 )
749748 throttleAfter := td .String ()
750749
751750 writeFileContents (t , path , map [string ]string {
752751 "blkio.throttle.read_bps_device" : throttleBefore ,
753752 })
754753
755- r := & configs .Resources {
756- BlkioThrottleReadBpsDevice : []* configs .ThrottleDevice {td },
754+ r := & cgroups .Resources {
755+ BlkioThrottleReadBpsDevice : []* cgroups .ThrottleDevice {td },
757756 }
758757 blkio := & BlkioGroup {}
759758 if err := blkio .Set (path , r ); err != nil {
@@ -776,15 +775,15 @@ func TestBlkioSetThrottleWriteBpsDevice(t *testing.T) {
776775 throttleBefore = `8:0 1024`
777776 )
778777
779- td := configs .NewThrottleDevice (8 , 0 , 2048 )
778+ td := cgroups .NewThrottleDevice (8 , 0 , 2048 )
780779 throttleAfter := td .String ()
781780
782781 writeFileContents (t , path , map [string ]string {
783782 "blkio.throttle.write_bps_device" : throttleBefore ,
784783 })
785784
786- r := & configs .Resources {
787- BlkioThrottleWriteBpsDevice : []* configs .ThrottleDevice {td },
785+ r := & cgroups .Resources {
786+ BlkioThrottleWriteBpsDevice : []* cgroups .ThrottleDevice {td },
788787 }
789788 blkio := & BlkioGroup {}
790789 if err := blkio .Set (path , r ); err != nil {
@@ -807,15 +806,15 @@ func TestBlkioSetThrottleReadIOpsDevice(t *testing.T) {
807806 throttleBefore = `8:0 1024`
808807 )
809808
810- td := configs .NewThrottleDevice (8 , 0 , 2048 )
809+ td := cgroups .NewThrottleDevice (8 , 0 , 2048 )
811810 throttleAfter := td .String ()
812811
813812 writeFileContents (t , path , map [string ]string {
814813 "blkio.throttle.read_iops_device" : throttleBefore ,
815814 })
816815
817- r := & configs .Resources {
818- BlkioThrottleReadIOPSDevice : []* configs .ThrottleDevice {td },
816+ r := & cgroups .Resources {
817+ BlkioThrottleReadIOPSDevice : []* cgroups .ThrottleDevice {td },
819818 }
820819 blkio := & BlkioGroup {}
821820 if err := blkio .Set (path , r ); err != nil {
@@ -838,15 +837,15 @@ func TestBlkioSetThrottleWriteIOpsDevice(t *testing.T) {
838837 throttleBefore = `8:0 1024`
839838 )
840839
841- td := configs .NewThrottleDevice (8 , 0 , 2048 )
840+ td := cgroups .NewThrottleDevice (8 , 0 , 2048 )
842841 throttleAfter := td .String ()
843842
844843 writeFileContents (t , path , map [string ]string {
845844 "blkio.throttle.write_iops_device" : throttleBefore ,
846845 })
847846
848- r := & configs .Resources {
849- BlkioThrottleWriteIOPSDevice : []* configs .ThrottleDevice {td },
847+ r := & cgroups .Resources {
848+ BlkioThrottleWriteIOPSDevice : []* cgroups .ThrottleDevice {td },
850849 }
851850 blkio := & BlkioGroup {}
852851 if err := blkio .Set (path , r ); err != nil {
0 commit comments