Merge pull request #2117 from halseth/integration-tests-backend-logs

Save integration tests backend logs
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-12-12 16:07:25 -08:00
commit 8c5d6842c2
3 files changed
+51 -26

No files matched your search

+23
View File
@@ -3,7 +3,9 @@ package lntest
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"strings"
"sync"
"time"
@@ -1289,3 +1291,24 @@ func (n *NetworkHarness) sendCoins(ctx context.Context, amt btcutil.Amount,
expectedBalance := initialBalance.ConfirmedBalance + int64(amt)
return target.WaitForBalance(expectedBalance, true)
}
// CopyFile copies the file src to dest.
func CopyFile(dest, src string) error {
s, err := os.Open(src)
if err != nil {
return err
}
defer s.Close()
d, err := os.Create(dest)
if err != nil {
return err
}
if _, err := io.Copy(d, s); err != nil {
d.Close()
return err
}
return d.Close()
}