mirror of
https://github.com/kopia/kopia.git
synced 2026-10-26 16:18:53 -04:00
test(general): parse stdout and stderr in robustness framework helper (#2779)
Parse stdout as well as stderr in `KopiaSnapshotter.CreateSnapshot`. This is contained to the Robustness Framework. Co-authored-by: Carl Braganza <carl@kasten.io>
This commit is contained in:
1 parent
fdb386154a
commit
5c901abc90
1 file changed
+5
-1
@@ -132,11 +132,15 @@ func (ks *KopiaSnapshotter) ConnectOrCreateFilesystem(repoPath string) error {
|
||||
// CreateSnapshot implements the Snapshotter interface, issues a kopia snapshot
|
||||
// create command on the provided source path.
|
||||
func (ks *KopiaSnapshotter) CreateSnapshot(source string) (snapID string, err error) {
|
||||
_, errOut, err := ks.Runner.Run("snapshot", "create", parallelFlag, strconv.Itoa(parallelSetting), noProgressFlag, source)
|
||||
stdOut, errOut, err := ks.Runner.Run("snapshot", "create", parallelFlag, strconv.Itoa(parallelSetting), noProgressFlag, source)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if stdOut != "" {
|
||||
return parseSnapID(strings.Split(stdOut, "\n"))
|
||||
}
|
||||
|
||||
return parseSnapID(strings.Split(errOut, "\n"))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user