mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
lntest/itest: use T.TempDir
to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
parent
0edc16aa01
commit
ca5c695526
@ -569,11 +569,7 @@ func testChannelBackupUpdates(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
|
|
||||||
// First, we'll make a temp directory that we'll use to store our
|
// First, we'll make a temp directory that we'll use to store our
|
||||||
// backup file, so we can check in on it during the test easily.
|
// backup file, so we can check in on it during the test easily.
|
||||||
backupDir, err := ioutil.TempDir("", "")
|
backupDir := t.t.TempDir()
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unable to create backup dir: %v", err)
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(backupDir)
|
|
||||||
|
|
||||||
// First, we'll create a new node, Carol. We'll also create a temporary
|
// First, we'll create a new node, Carol. We'll also create a temporary
|
||||||
// file that Carol will use to store her channel backups.
|
// file that Carol will use to store her channel backups.
|
||||||
|
@ -5,7 +5,6 @@ package itest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -68,12 +67,8 @@ func testEtcdFailoverCase(net *lntest.NetworkHarness, ht *harnessTest,
|
|||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
tmpDir, err := ioutil.TempDir("", "etcd")
|
|
||||||
if err != nil {
|
|
||||||
ht.Fatalf("Failed to create temp dir: %v", err)
|
|
||||||
}
|
|
||||||
etcdCfg, cleanup, err := kvdb.StartEtcdTestBackend(
|
etcdCfg, cleanup, err := kvdb.StartEtcdTestBackend(
|
||||||
tmpDir, uint16(lntest.NextAvailablePort()),
|
ht.t.TempDir(), uint16(lntest.NextAvailablePort()),
|
||||||
uint16(lntest.NextAvailablePort()), "",
|
uint16(lntest.NextAvailablePort()), "",
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user