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