apiary/honeypot/ssh/store/memory_test.go

25 lines
503 B
Go
Raw Normal View History

2021-09-17 00:01:43 +00:00
package store_test
2021-04-10 05:58:01 +00:00
2021-09-17 00:01:43 +00:00
import (
"testing"
2021-04-10 05:58:01 +00:00
2021-10-21 10:36:01 +00:00
"github.uio.no/torjus/apiary/honeypot/ssh/store"
2021-09-17 00:01:43 +00:00
)
2021-04-10 05:58:01 +00:00
2021-09-17 00:01:43 +00:00
func TestMemoryStore(t *testing.T) {
s := &store.MemoryStore{}
testLoginAttemptStore(s, t)
2021-04-10 05:58:01 +00:00
}
2021-09-17 13:00:58 +00:00
func TestMemoryStoreWithCache(t *testing.T) {
backend := &store.MemoryStore{}
s := store.NewCachingStore(backend)
testLoginAttemptStore(s, t)
}
2021-11-03 20:24:23 +00:00
func BenchmarkMemoryStore(b *testing.B) {
setupFunc := func() store.LoginAttemptStore {
return &store.MemoryStore{}
}
benchmarkLoginAttemptStore(setupFunc, b)
}