Skip to content

Commit

Permalink
overlord/fdestate: mock calls to cause a panic in unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
  • Loading branch information
bboozzoo authored and pedronis committed Oct 18, 2024
1 parent e0c44cf commit c943da6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions overlord/fdestate/fdemgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ func (s *fdeMgrSuite) SetUpTest(c *C) {
func(updateState backend.StateUpdater, method device.SealingMethod, rootdir string, params *boot.ResealKeyForBootChainsParams, expectReseal bool) error {
panic("BackendResealKeyForBootChains not mocked")
}))
s.AddCleanup(fdestate.MockDMCryptUUIDFromMountPoint(func(mountpoint string) (string, error) {
panic("MockDMCryptUUIDFromMountPoint is not mocked")
}))
s.AddCleanup(fdestate.MockGetPrimaryKeyHMAC(func(devicePath string, alg crypto.Hash) ([]byte, []byte, error) {
panic("GetPrimaryKeyHMAC is not mocked")
}))
s.AddCleanup(fdestate.MockVerifyPrimaryKeyHMAC(func(devicePath string, alg crypto.Hash, salt, digest []byte) (bool, error) {
panic("VerifyPrimaryKeyHMAC is not mocked")
}))
}

type instrumentedUnlocker struct {
Expand Down

0 comments on commit c943da6

Please sign in to comment.