rclone: Skip crash test when rclone is not found

This commit is contained in:
Michael Eischer 2020-07-26 12:06:18 +02:00
parent 01b9581453
commit ea97ff1ba4

View file

@ -2,8 +2,10 @@ package rclone
import ( import (
"context" "context"
"os/exec"
"testing" "testing"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/restic"
rtest "github.com/restic/restic/internal/test" rtest "github.com/restic/restic/internal/test"
) )
@ -16,6 +18,10 @@ func TestRcloneExit(t *testing.T) {
cfg := NewConfig() cfg := NewConfig()
cfg.Remote = dir cfg.Remote = dir
be, err := Open(cfg, nil) be, err := Open(cfg, nil)
if e, ok := errors.Cause(err).(*exec.Error); ok && e.Err == exec.ErrNotFound {
t.Skipf("program %q not found", e.Name)
return
}
rtest.OK(t, err) rtest.OK(t, err)
defer be.Close() defer be.Close()