tests: dump/restore a container with cgroups
Signed-off-by: Andrey Vagin <avagin@openvz.org>
This commit is contained in:
parent
b40c790184
commit
e2e6a73b62
|
@ -5,9 +5,11 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer"
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
)
|
||||
|
||||
func TestCheckpoint(t *testing.T) {
|
||||
|
@ -28,6 +30,12 @@ func TestCheckpoint(t *testing.T) {
|
|||
|
||||
config := newTemplateConfig(rootfs)
|
||||
|
||||
config.Mounts = append(config.Mounts, &configs.Mount{
|
||||
Destination: "/sys/fs/cgroup",
|
||||
Device: "cgroup",
|
||||
Flags: defaultMountFlags | syscall.MS_RDONLY,
|
||||
})
|
||||
|
||||
factory, err := libcontainer.New(root, libcontainer.Cgroupfs)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue