1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/utils_test.go
David Calavera 767df67e31 Decode container configurations into typed structures.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-04-15 10:22:07 -07:00

26 lines
521 B
Go

package daemon
import (
"testing"
"github.com/docker/docker/runconfig"
)
func TestMergeLxcConfig(t *testing.T) {
kv := []runconfig.KeyValuePair{
{"lxc.cgroups.cpuset", "1,2"},
}
hostConfig := &runconfig.HostConfig{
LxcConf: runconfig.NewLxcConfig(kv),
}
out, err := mergeLxcConfIntoOptions(hostConfig)
if err != nil {
t.Fatalf("Failed to merge Lxc Config: %s", err)
}
cpuset := out[0]
if expected := "cgroups.cpuset=1,2"; cpuset != expected {
t.Fatalf("expected %s got %s", expected, cpuset)
}
}