2015-03-14 18:15:47 +01:00
|
|
|
package restic_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/restic/restic"
|
2015-04-09 21:15:48 +02:00
|
|
|
. "github.com/restic/restic/test"
|
2015-03-14 18:15:47 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCache(t *testing.T) {
|
2015-04-26 14:46:15 +02:00
|
|
|
server := SetupBackend(t)
|
|
|
|
defer TeardownBackend(t, server)
|
|
|
|
key := SetupKey(t, server, "geheim")
|
2015-03-28 15:07:08 +01:00
|
|
|
server.SetKey(key)
|
2015-03-14 18:15:47 +01:00
|
|
|
|
2015-04-26 17:44:38 +02:00
|
|
|
_, err := restic.NewCache(server)
|
2015-04-09 21:15:48 +02:00
|
|
|
OK(t, err)
|
2015-03-14 18:15:47 +01:00
|
|
|
|
2015-04-29 21:41:51 -04:00
|
|
|
arch := restic.NewArchiver(server)
|
2015-03-14 18:15:47 +01:00
|
|
|
|
|
|
|
// archive some files, this should automatically cache all blobs from the snapshot
|
2015-04-26 17:44:38 +02:00
|
|
|
_, _, err = arch.Snapshot(nil, []string{*benchArchiveDirectory}, nil)
|
2015-03-14 18:15:47 +01:00
|
|
|
|
2015-04-26 17:44:38 +02:00
|
|
|
// TODO: test caching index
|
2015-03-14 18:15:47 +01:00
|
|
|
}
|