mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
c30a55f14d
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
25 lines
501 B
Go
25 lines
501 B
Go
package daemon
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/docker/docker/runconfig"
|
|
)
|
|
|
|
func TestMergeLxcConfig(t *testing.T) {
|
|
hostConfig := &runconfig.HostConfig{
|
|
LxcConf: []runconfig.KeyValuePair{
|
|
{Key: "lxc.cgroups.cpuset", Value: "1,2"},
|
|
},
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|