Jonathan Turner 8 лет назад
Родитель
Сommit
611d470e56
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      credentials/ccache_integration_test.go

+ 8 - 1
credentials/ccache_integration_test.go

@@ -4,6 +4,7 @@
 package credentials
 package credentials
 
 
 import (
 import (
+	"bytes"
 	"fmt"
 	"fmt"
 	"io"
 	"io"
 	"os"
 	"os"
@@ -41,9 +42,15 @@ func login() error {
 		defer stdin.Close()
 		defer stdin.Close()
 		io.WriteString(stdin, "passwordvalue")
 		io.WriteString(stdin, "passwordvalue")
 	}()
 	}()
+	stderr, _ := cmd.StderrPipe()
+	errBuf := new(bytes.Buffer)
+	go func() {
+		defer stderr.Close()
+		io.Copy(errBuf, stderr)
+	}()
 	err = cmd.Wait()
 	err = cmd.Wait()
 	if err != nil {
 	if err != nil {
-		return fmt.Errorf("%s did not run successfully: %v", kinitCmd, err)
+		return fmt.Errorf("%s did not run successfully: %v stderr: %s", kinitCmd, err, string(errBuf.Bytes()))
 	}
 	}
 	return nil
 	return nil
 }
 }