Files
podman/utils/utils_test.go
Doug Rabson a9852aa8ff utils: Enable cgroup utils for FreeBSD
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>
2022-11-14 14:22:36 +00:00

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)
}