github.com/amylindburg/docker@v1.7.0/daemon/utils_test.go (about)

     1  package daemon
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/docker/docker/runconfig"
     7  )
     8  
     9  func TestMergeLxcConfig(t *testing.T) {
    10  	kv := []runconfig.KeyValuePair{
    11  		{"lxc.cgroups.cpuset", "1,2"},
    12  	}
    13  	hostConfig := &runconfig.HostConfig{
    14  		LxcConf: runconfig.NewLxcConfig(kv),
    15  	}
    16  
    17  	out, err := mergeLxcConfIntoOptions(hostConfig)
    18  	if err != nil {
    19  		t.Fatalf("Failed to merge Lxc Config: %s", err)
    20  	}
    21  
    22  	cpuset := out[0]
    23  	if expected := "cgroups.cpuset=1,2"; cpuset != expected {
    24  		t.Fatalf("expected %s got %s", expected, cpuset)
    25  	}
    26  }