mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-03 10:31:59 +00:00
ipn/store: [TestNewStore] do not use an empty file
Otherwise it would log warnings about an empty file.
```
stores.go:138: store.NewFileStore("/tmp/3777352782"): file empty; treating it like a missing file [warning]
```
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
@@ -63,18 +62,8 @@ func TestNewStore(t *testing.T) {
|
||||
} else if _, ok := s.(*store2); !ok {
|
||||
t.Fatalf("%q: got: %T, want: %T", path, s, new(store2))
|
||||
}
|
||||
f, err := os.CreateTemp("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() {
|
||||
os.Remove(f.Name())
|
||||
})
|
||||
|
||||
path = f.Name()
|
||||
path = filepath.Join(t.TempDir(), "state")
|
||||
if s, err := New(t.Logf, path); err != nil {
|
||||
t.Fatalf("%q: %v", path, err)
|
||||
} else if _, ok := s.(*FileStore); !ok {
|
||||
|
||||
Reference in New Issue
Block a user