mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Support running podman under a root v2 cgroup
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
This commit is contained in:
26
utils/utils_test.go
Normal file
26
utils/utils_test.go
Normal file
@ -0,0 +1,26 @@
|
||||
//go:build linux || darwin
|
||||
// +build linux darwin
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCgroupProcess(t *testing.T) {
|
||||
val, err := getCgroupProcess("testdata/cgroup.root", true)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, "/", val)
|
||||
|
||||
_, err = getCgroupProcess("testdata/cgroup.root", false)
|
||||
assert.NotNil(t, err)
|
||||
|
||||
val, err = getCgroupProcess("testdata/cgroup.other", true)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, "/other", val)
|
||||
|
||||
_, err = getCgroupProcess("testdata/cgroup.empty", true)
|
||||
assert.NotNil(t, err)
|
||||
}
|
Reference in New Issue
Block a user