tordam

A library for peer discovery inside the Tor network
git clone https://git.parazyd.org/tordam
Log | Files | Refs | README | LICENSE

commit 4971808c9ab53995fa10a6af256dbb4ea18ad54b
parent 7af2d65892ef925279b8d5b41b44015995433915
Author: parazyd <parazyd@dyne.org>
Date:   Mon,  8 Mar 2021 01:26:33 +0100

announce_test: Set up Cfg.Datadir.

Diffstat:
Mannounce_test.go | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/announce_test.go b/announce_test.go @@ -22,6 +22,8 @@ import ( "crypto/ed25519" "crypto/rand" "encoding/base64" + "os" + "strings" "testing" ) @@ -31,6 +33,12 @@ func TestAnnounce(t *testing.T) { t.Fatal(err) } + Cfg.Datadir = os.Getenv("TMPDIR") + if Cfg.Datadir == "" { + Cfg.Datadir = "/tmp" + } + defer os.Remove(strings.Join([]string{Cfg.Datadir, dbFile}, "/")) + vals := []string{ "p7qaewjgnvnaeihhyybmoofd5avh665kr3awoxlh5rt6ox743kjdr6qd.onion:666", base64.StdEncoding.EncodeToString(pk),