mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
In this commit we add an extra config for enabling logging to an external file when using embedded etcd. This can be useful when running integration tests to see more details about etcd related issues.
21 lines
581 B
Go
21 lines
581 B
Go
// +build kvdb_etcd
|
|
|
|
package kvdb
|
|
|
|
import (
|
|
"github.com/lightningnetwork/lnd/kvdb/etcd"
|
|
)
|
|
|
|
// TestBackend is conditionally set to etcd when the kvdb_etcd build tag is
|
|
// defined, allowing testing our database code with etcd backend.
|
|
const TestBackend = EtcdBackendName
|
|
|
|
// GetEtcdTestBackend creates an embedded etcd backend for testing
|
|
// storig the database at the passed path.
|
|
func StartEtcdTestBackend(path string, clientPort, peerPort uint16,
|
|
logFile string) (*etcd.Config, func(), error) {
|
|
|
|
return etcd.NewEmbeddedEtcdInstance(
|
|
path, clientPort, peerPort, logFile,
|
|
)
|
|
}
|