File: named_test.go

package info (click to toggle)
golang-github-containerd-cgroups 0.0~git20180223.d578e4e-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 352 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 455 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package cgroups

import "testing"

func TestNamedNameValue(t *testing.T) {
	n := NewNamed("/sys/fs/cgroup", "systemd")
	if n.name != "systemd" {
		t.Fatalf("expected name %q to be systemd", n.name)
	}
}

func TestNamedPath(t *testing.T) {
	n := NewNamed("/sys/fs/cgroup", "systemd")
	path := n.Path("/test")
	if expected := "/sys/fs/cgroup/systemd/test"; path != expected {
		t.Fatalf("expected %q but received %q from named cgroup", expected, path)
	}
}