+ print " ".join(cmd)
+ proc = subprocess.Popen(cmd, stdout = subprocess.PIPE)
+ self.output = proc.communicate()[0]
+
+ proc.wait()
+
+ if (self.expect_failure):
+ if (proc.returncode == 0):
+ fail("Command unexpectedly passed when expecting failure:\n " + " ".join(cmd))
+ else:
+ if (proc.returncode != 0):
+ fail("Command failed (returned non-zero):\n " + " ".join(cmd))