Browse code

Add dockerCmdWithStdoutStderr function

Signed-off-by: Lei Jitang <leijitang@huawei.com>

Lei authored on 2015/07/18 11:48:28
Showing 1 changed files
... ...
@@ -554,6 +554,12 @@ func dockerCmdWithError(c *check.C, args ...string) (string, int, error) {
554 554
 	return runCommandWithOutput(exec.Command(dockerBinary, args...))
555 555
 }
556 556
 
557
+func dockerCmdWithStdoutStderr(c *check.C, args ...string) (string, string, int) {
558
+	stdout, stderr, status, err := runCommandWithStdoutStderr(exec.Command(dockerBinary, args...))
559
+	c.Assert(err, check.IsNil, check.Commentf("%q failed with errors: %s, %v", strings.Join(args, " "), stderr, err))
560
+	return stdout, stderr, status
561
+}
562
+
557 563
 func dockerCmd(c *check.C, args ...string) (string, int) {
558 564
 	out, status, err := runCommandWithOutput(exec.Command(dockerBinary, args...))
559 565
 	c.Assert(err, check.IsNil, check.Commentf("%q failed with errors: %s, %v", strings.Join(args, " "), out, err))