summaryrefslogtreecommitdiffhomepage
path: root/runsc/cgroup/cgroup_test.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2018-10-25 11:45:37 -0700
committerShentubot <shentubot@google.com>2018-10-25 11:46:35 -0700
commit479cd52a6075066e93ce0c1bd0f183bb5df4fcc7 (patch)
tree60914b9e18cc61c3fa35b33655a3ec3dd4304bbb /runsc/cgroup/cgroup_test.go
parenta5fe397cf806cbc488757dbd73a3d83eb5da11cd (diff)
Uninstall() should not fail if a cgroup directory doesn't exist
It can be occurred if two controllers are mounted together or if Uninstall() is called on a error path. PiperOrigin-RevId: 218723886 Change-Id: I69d7a3c0685a7da38527ea8b7b301dbe96268285
Diffstat (limited to 'runsc/cgroup/cgroup_test.go')
-rw-r--r--runsc/cgroup/cgroup_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/runsc/cgroup/cgroup_test.go b/runsc/cgroup/cgroup_test.go
index 4a4713d4f..ecc184f74 100644
--- a/runsc/cgroup/cgroup_test.go
+++ b/runsc/cgroup/cgroup_test.go
@@ -18,6 +18,17 @@ import (
"testing"
)
+func TestUninstallEnoent(t *testing.T) {
+ c := Cgroup{
+ // set a non-existent name
+ Name: "runsc-test-uninstall-656e6f656e740a",
+ Own: true,
+ }
+ if err := c.Uninstall(); err != nil {
+ t.Errorf("Uninstall() failed: %v", err)
+ }
+}
+
func TestCountCpuset(t *testing.T) {
for _, tc := range []struct {
str string