mirror of
https://github.com/containers/podman.git
synced 2025-05-18 15:47:51 +08:00

This probably makes sense when using podman-remote and it lets the unit tests pass which makes 'make localunit' happy. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
27 lines
572 B
Go
27 lines
572 B
Go
//go:build linux || darwin || freebsd
|
|
// +build linux darwin freebsd
|
|
|
|
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)
|
|
}
|