+ # take a snapshot of the system if user is root
+ # to ensure that cleanProcess will not kill
+ # pre-existent processes
+ if self.node.get("username") == 'root':
+ import pickle
+ procs = dict()
+ ps_aux = "ps aux |awk '{print $2,$11}'"
+ (out, err), proc = self.node.execute(ps_aux)
+ if len(out) != 0:
+ for line in out.strip().split("\n"):
+ parts = line.strip().split(" ")
+ procs[parts[0]] = parts[1]
+ pickle.dump(procs, open("/tmp/save.proc", "wb"))
+