Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitalisg committed Aug 25, 2022
1 parent 4fb220c commit 88ecfec
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/robustness/snapmeta/kopia_snapshotter_upgrade_test.go
@@ -0,0 +1,32 @@
//go:build darwin || (linux && amd64)
// +build darwin linux,amd64

package snapmeta

import (
"errors"
"testing"

"github.com/stretchr/testify/require"

"github.com/kopia/kopia/repo/format"
"github.com/kopia/kopia/tests/tools/kopiarunner"
)

func TestGetRepositoryStatus(t *testing.T) {
repoDir := t.TempDir()

ks, err := NewSnapshotter(repoDir)
if errors.Is(err, kopiarunner.ErrExeVariableNotSet) {
t.Skip("KOPIA_EXE not set, skipping test")
}

err = ks.ConnectOrCreateRepo(repoDir)
require.NoError(t, err)

rs, err := ks.GetRepositoryStatus()
require.NoError(t, err)

prev := rs.ContentFormat.MutableParameters.Version
require.Equal(t, prev, format.Version(3), "The format version should be 3.")
}

0 comments on commit 88ecfec

Please sign in to comment.