Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fb220c
commit 88ecfec
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tests/robustness/snapmeta/kopia_snapshotter_upgrade_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.") | ||
} |