aboutsummaryrefslogtreecommitdiff
path: root/internal/state/single_test.go
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-07-19 17:11:47 +0200
committerLinus Nordberg <linus@nordberg.se>2022-07-19 17:11:47 +0200
commit387914dfcfda0f84f13b4d49f5b2371867cace46 (patch)
tree28ff7eeff748cf24b04ed967e93f6c2cc6b752bb /internal/state/single_test.go
parentc8180107a6c281320fff2675abd7943cf5acafe2 (diff)
store and restore of latest published STH
Diffstat (limited to 'internal/state/single_test.go')
-rw-r--r--internal/state/single_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/state/single_test.go b/internal/state/single_test.go
index 9442fdc..a60795c 100644
--- a/internal/state/single_test.go
+++ b/internal/state/single_test.go
@@ -8,6 +8,7 @@ import (
"crypto/rand"
"fmt"
"io"
+ "os"
"reflect"
"testing"
"time"
@@ -65,7 +66,12 @@ func TestNewStateManagerSingle(t *testing.T) {
secondary.EXPECT().Initiated().Return(false)
}
- sm, err := NewStateManagerSingle(trillianClient, table.signer, time.Duration(0), time.Duration(0), secondary)
+ tmpFile, err := os.CreateTemp("", "sigsum-log-test-sth")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer os.Remove(tmpFile.Name())
+ sm, err := NewStateManagerSingle(trillianClient, table.signer, time.Duration(0), time.Duration(0), secondary, tmpFile)
if got, want := err != nil, table.description != "valid"; got != want {
t.Errorf("got error %v but wanted %v in test %q: %v", got, want, table.description, err)
}