Lines Matching full:pwd

23         @param _client: Test script pwd + name
54 pwd = mkdtemp(prefix='cgroup-', dir=root) + '/'
56 pwd = mkdtemp(prefix='cgroup-', dir=self.root) + '/'
60 return pwd
63 def rm_cgroup(self, pwd, supress=False): argument
67 @param pwd: cgroup directory.
72 os.rmdir(pwd)
95 def is_cgroup(self, pid, pwd): argument
97 Checks if the 'pid' process is in 'pwd' cgroup
99 @param pwd: cgroup directory
100 @return: 0 when is 'pwd' member
102 if open(pwd + '/tasks').readlines().count("%d\n" % pid) > 0:
117 def set_cgroup(self, pid, pwd): argument
121 @param pwd: cgroup directory
125 open(pwd+'/tasks', 'w').write(str(pid))
129 if self.is_cgroup(pid, pwd):
131 "failed", pid, pwd)
145 def get_prop(self, prop, pwd=None, supress=False): argument
149 @param pwd: cgroup directory
153 tmp = self.get_property(prop, pwd, supress)
162 def get_property(self, prop, pwd=None, supress=False): argument
166 @param pwd: cgroup directory
170 if pwd == None:
171 pwd = self.root
173 ret = open(pwd+prop, 'r').readlines()
181 def set_prop(self, prop, value, pwd=None, check=True): argument
186 @param pwd: cgroup directory
204 return self.set_property(prop, value, pwd, check)
207 def set_property(self, prop, value, pwd=None, check=True): argument
212 @param pwd: cgroup directory
217 if pwd == None:
218 pwd = self.root
220 open(pwd+prop, 'w').write(value)
226 _value = self.get_property(prop, pwd)[0][:-1]
240 pwd = self.mk_cgroup()
241 if pwd == None:
265 if self.set_cgroup(ps.pid, pwd):
271 if self.rm_cgroup(pwd, supress=True) == 0:
285 if self.rm_cgroup(pwd):