From ebf574023b2a0b35a6af71376d95609e069847e4 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 17 Dec 2013 17:09:17 -0500 Subject: [PATCH] adding a 'main' test file. --- main.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 main.go diff --git a/main.go b/main.go new file mode 100644 index 0000000..4296378 --- /dev/null +++ b/main.go @@ -0,0 +1,34 @@ +// cmpout + +// +build ignore + +package main + +import ( + "." + "fmt" +) + +func main() { + cgroup.Init() + fmt.Println(cgroup.DeleteIgnoreMigration) + fmt.Println(cgroup.DeleteIgnoreMigration|cgroup.DeleteEmptyOnly) + + g := cgroup.NewCgroup("foo") + c := g.AddController("bar") + fmt.Printf("%#v\n", c) + c = g.GetController("bar") + fmt.Printf("%#v\n", c) + + g.SetPermissions(cgroup.Mode(0777), cgroup.Mode(0777), cgroup.Mode(0777)) + + //fmt.Println(cgroup.GetSubSysMountPoint("cpu")) + ctls, err := cgroup.GetAllControllers() + if err != nil { + fmt.Println(err) + return + } + for i := range ctls { + fmt.Println(ctls[i]) + } +}