Skip to content

Commit

Permalink
test: TestGetMountablePartitions with unpartitioned device
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp committed Nov 19, 2024
1 parent ab3545c commit 924a671
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions providers/os/connection/snapshot/blockdevices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,21 @@ func TestGetMountablePartitions(t *testing.T) {
}
require.ElementsMatch(t, expected, parts)
})

t.Run("get all non-mounted partitions (unpartitioned)", func(t *testing.T) {
block := BlockDevice{
Name: "sda",
FsType: "xfs",
Label: "ROOT",
Uuid: "1234",
}
parts, err := block.GetMountablePartitions(true)
require.NoError(t, err)
expected := []*PartitionInfo{
{Name: "/dev/sda", FsType: "xfs", Uuid: "1234", Label: "ROOT"},
}
require.ElementsMatch(t, expected, parts)
})
}

func TestLongestMatchingSuffix(t *testing.T) {
Expand Down

0 comments on commit 924a671

Please sign in to comment.