ezshare/store/bolt_test.go

49 lines
1.0 KiB
Go
Raw Permalink Normal View History

2021-12-05 11:39:28 +00:00
//nolint:staticcheck
2021-12-04 08:58:16 +00:00
package store_test
import (
"path/filepath"
"testing"
2022-01-13 17:40:15 +00:00
"git.t-juice.club/torjus/ezshare/store"
2021-12-04 08:58:16 +00:00
)
func TestBoltStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
2021-12-05 10:08:09 +00:00
defer s.Close()
2021-12-04 08:58:16 +00:00
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doFileStoreTest(s, t)
2021-12-05 00:00:32 +00:00
}
func TestBoltCertificateStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
2021-12-05 10:08:09 +00:00
defer s.Close()
2021-12-05 00:00:32 +00:00
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doCertificateStoreTest(s, t)
2021-12-05 10:08:09 +00:00
}
func TestBoltUserStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
defer s.Close()
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doUserStoreTests(s, t)
2021-12-04 08:58:16 +00:00
}
2021-12-08 04:55:30 +00:00
func TestBoltBinaryStore(t *testing.T) {
path := filepath.Join(t.TempDir(), "boltstore.db")
s, err := store.NewBoltStore(path)
defer s.Close()
if err != nil {
t.Fatalf("Error opening store: %s", err)
}
doBinaryStoreTests(s, t)
}