Skip to content

Commit

Permalink
cmd/snap-bootstrap: add extra test for the wrong fsOpts type case
Browse files Browse the repository at this point in the history
  • Loading branch information
sespiros committed Jan 16, 2025
1 parent 142a624 commit f96ae03
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/snap-bootstrap/initramfs_systemd_mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,3 +670,20 @@ Wants=%[1]s
}
}
}

type dummyOpts struct{}

func (d dummyOpts) AppendOptions(strings []string) ([]string, error) {
return []string{"dummy options"}, nil
}

func (s *doSystemdMountSuite) TestDoSystemdMountWrongFsOpts(c *C) {

opts := &main.SystemdMountOptions{
FsOpts: dummyOpts{},
}

err := main.DoSystemdMount("what", "where", opts)
c.Check(err, ErrorMatches, "cannot mount \"what\" at \"where\": invalid options")

}

0 comments on commit f96ae03

Please sign in to comment.