summaryrefslogtreecommitdiff
path: root/runtime/utils_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/utils_test.go')
-rw-r--r--runtime/utils_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/runtime/utils_test.go b/runtime/utils_test.go
new file mode 100644
index 0000000000..bdf3543a49
--- /dev/null
+++ b/runtime/utils_test.go
@@ -0,0 +1,29 @@
+package runtime
+
+import (
+ "testing"
+
+ "github.com/dotcloud/docker/runconfig"
+ "github.com/dotcloud/docker/utils"
+)
+
+func TestMergeLxcConfig(t *testing.T) {
+ var (
+ hostConfig = &runconfig.HostConfig{
+ LxcConf: []utils.KeyValuePair{
+ {Key: "lxc.cgroups.cpuset", Value: "1,2"},
+ },
+ }
+ driverConfig = make(map[string][]string)
+ )
+
+ mergeLxcConfIntoOptions(hostConfig, driverConfig)
+ if l := len(driverConfig["lxc"]); l > 1 {
+ t.Fatalf("expected lxc options len of 1 got %d", l)
+ }
+
+ cpuset := driverConfig["lxc"][0]
+ if expected := "cgroups.cpuset=1,2"; cpuset != expected {
+ t.Fatalf("expected %s got %s", expected, cpuset)
+ }
+}