Download this file
| 1 | //go:build !linux |
| 2 | |
| 3 | package cgroup |
| 4 | |
| 5 | import ( |
| 6 | "context" |
| 7 | "errors" |
| 8 | "testing" |
| 9 | ) |
| 10 | |
| 11 | func TestCleanupUnsupported(t *testing.T) { |
| 12 | if _, err := (&Manager{root: t.TempDir()}).OpenCleanup("shop.example"); !errors.Is(err, ErrStrictUnsupported) { |
| 13 | t.Fatal(err) |
| 14 | } |
| 15 | var m *Manager |
| 16 | if _, err := m.OpenCleanup("shop.example"); !errors.Is(err, ErrNoDelegation) { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | c := &Cleanup{} |
| 20 | if _, err := c.Populated(); !errors.Is(err, ErrStrictUnsupported) { |
| 21 | t.Fatal(err) |
| 22 | } |
| 23 | if _, err := c.Members(); !errors.Is(err, ErrStrictUnsupported) { |
| 24 | t.Fatal(err) |
| 25 | } |
| 26 | if err := c.KillAndEmpty(context.Background()); !errors.Is(err, ErrStrictUnsupported) { |
| 27 | t.Fatal(err) |
| 28 | } |
| 29 | if err := c.Close(); !errors.Is(err, ErrStrictUnsupported) { |
| 30 | t.Fatal(err) |
| 31 | } |
| 32 | } |
| 33 | |