Skip to content

Commit

Permalink
s/i/dmverity: add clarifying comments for test data generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sespiros committed Jan 9, 2025
1 parent 61e72fc commit c01745b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions snap/integrity/dmverity/veritysetup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ func (s *VerityTestSuite) TestVerityVersionDetect(c *C) {
}

func (s *VerityTestSuite) TestReadSuperBlockSuccess(c *C) {
// testdisk.verity is generated by:
// - dd if=/dev/zero of=testdisk bs=8M count=1
// - veritysetup format testdisk testdisk.verity
sb, err := dmverity.ReadSuperBlock("testdata/testdisk.verity")
c.Check(err, IsNil)

Expand All @@ -223,6 +226,9 @@ func (s *VerityTestSuite) TestReadSuperBlockSuccess(c *C) {

func (s *VerityTestSuite) TestReadSuperBlockError(c *C) {
// Attempt to read an empty disk

// testdisk is generated by:
// - dd if=/dev/zero of=testdisk bs=8M count=1
_, err := dmverity.ReadSuperBlock("testdata/testdisk")
c.Check(err, ErrorMatches, "invalid dm-verity superblock header")
}

0 comments on commit c01745b

Please sign in to comment.