Add integration test for key command
This commit is contained in:
parent
e2563b3eca
commit
1216ded14b
1 changed files with 21 additions and 0 deletions
|
@ -86,6 +86,11 @@ func cmdFsck(t testing.TB) {
|
||||||
OK(t, cmd.Execute(nil))
|
OK(t, cmd.Execute(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func cmdKey(t testing.TB, args ...string) {
|
||||||
|
cmd := &CmdKey{}
|
||||||
|
OK(t, cmd.Execute(args))
|
||||||
|
}
|
||||||
|
|
||||||
func TestBackup(t *testing.T) {
|
func TestBackup(t *testing.T) {
|
||||||
withTestEnvironment(t, func(env *testEnvironment) {
|
withTestEnvironment(t, func(env *testEnvironment) {
|
||||||
datafile := filepath.Join("testdata", "backup-data.tar.gz")
|
datafile := filepath.Join("testdata", "backup-data.tar.gz")
|
||||||
|
@ -220,3 +225,19 @@ func TestIncrementalBackup(t *testing.T) {
|
||||||
t.Logf("repository grown by %d bytes", stat3.size-stat2.size)
|
t.Logf("repository grown by %d bytes", stat3.size-stat2.size)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestKeyAddRemove(t *testing.T) {
|
||||||
|
withTestEnvironment(t, func(env *testEnvironment) {
|
||||||
|
datafile := filepath.Join("testdata", "backup-data.tar.gz")
|
||||||
|
fd, err := os.Open(datafile)
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
t.Skipf("unable to find data file %q, skipping", datafile)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
OK(t, err)
|
||||||
|
OK(t, fd.Close())
|
||||||
|
|
||||||
|
cmdInit(t)
|
||||||
|
cmdKey(t, "list")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue