mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-03 20:16:02 +02:00
server: use T.TempDir
to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@ -15,7 +15,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math/big"
|
"math/big"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -27,11 +26,7 @@ import (
|
|||||||
// new TLS certificate pair is regenerated when the old pair expires. This is
|
// new TLS certificate pair is regenerated when the old pair expires. This is
|
||||||
// necessary because the pair expires after a little over a year.
|
// necessary because the pair expires after a little over a year.
|
||||||
func TestTLSAutoRegeneration(t *testing.T) {
|
func TestTLSAutoRegeneration(t *testing.T) {
|
||||||
tempDirPath, err := ioutil.TempDir("", ".testLnd")
|
tempDirPath := t.TempDir()
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("couldn't create temporary cert directory")
|
|
||||||
}
|
|
||||||
defer os.RemoveAll(tempDirPath)
|
|
||||||
|
|
||||||
certPath := tempDirPath + "/tls.cert"
|
certPath := tempDirPath + "/tls.cert"
|
||||||
keyPath := tempDirPath + "/tls.key"
|
keyPath := tempDirPath + "/tls.key"
|
||||||
|
Reference in New Issue
Block a user