zfs: parse GUID
This commit is contained in:
@@ -2,8 +2,12 @@ package zfs_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"git.gentoo.party/sam/thanks/internal/zfs"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type zfscmd struct {
|
||||
@@ -43,3 +47,14 @@ func Test_ZFSCommand(t *testing.T) {
|
||||
t.Errorf("SSH zrunner failed: %s \n\n%s", err.Error(), out)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Snapshots(t *testing.T) {
|
||||
f, err := os.Open("./zfs-list_snapshot.txt")
|
||||
assert.Nil(t, err, "failed to open test data")
|
||||
out, err := zfs.ParseSnapshots(f)
|
||||
assert.Nil(t, err, "ParseSnapshots returned non-nil error")
|
||||
|
||||
for _, snap := range out {
|
||||
assert.Contains(t, snap.SnapshotName, "thanks")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user