...

Source file src/github.com/containerd/cgroups/v2/iov2_test.go

Documentation: github.com/containerd/cgroups/v2

     1  /*
     2     Copyright The containerd Authors.
     3  
     4     Licensed under the Apache License, Version 2.0 (the "License");
     5     you may not use this file except in compliance with the License.
     6     You may obtain a copy of the License at
     7  
     8         http://www.apache.org/licenses/LICENSE-2.0
     9  
    10     Unless required by applicable law or agreed to in writing, software
    11     distributed under the License is distributed on an "AS IS" BASIS,
    12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13     See the License for the specific language governing permissions and
    14     limitations under the License.
    15  */
    16  
    17  package v2
    18  
    19  import (
    20  	"fmt"
    21  	"os"
    22  	"testing"
    23  )
    24  
    25  func TestCgroupv2IOController(t *testing.T) {
    26  	t.Skip("FIXME: this test doesn't work on Fedora 32 Vagrant: TestCgroupv2IOController: iov2_test.go:42: failed to init new cgroup manager:  write /sys/fs/cgroup/io-test-cg-22708/io.max: no such device")
    27  	checkCgroupMode(t)
    28  	group := "/io-test-cg"
    29  	groupPath := fmt.Sprintf("%s-%d", group, os.Getpid())
    30  	var (
    31  		// weight uint16 = 100
    32  		maj  int64  = 8
    33  		min  int64  = 0
    34  		rate uint64 = 120
    35  	)
    36  	res := Resources{
    37  		IO: &IO{
    38  			Max: []Entry{{Major: maj, Minor: min, Type: ReadIOPS, Rate: rate}},
    39  		},
    40  	}
    41  	c, err := NewManager(defaultCgroup2Path, groupPath, &res)
    42  	if err != nil {
    43  		t.Fatal("failed to init new cgroup manager: ", err)
    44  	}
    45  	defer os.Remove(c.path)
    46  
    47  	checkFileContent(t, c.path, "io.max", "8:0 rbps=max wbps=max riops=120 wiops=max")
    48  }
    49  

View as plain text