Skip to content

Commit

Permalink
(feat): Add test coverage for layer.MountDeviceLayer()
Browse files Browse the repository at this point in the history
  • Loading branch information
lasith-kg committed Jan 3, 2024
1 parent 39adc79 commit fda9263
Show file tree
Hide file tree
Showing 3 changed files with 559 additions and 57 deletions.
4 changes: 2 additions & 2 deletions internal/layer/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func (fdl *MountDeviceLayer) Validate(c *config.Config) error {
}
d, err := fdl.fileBackend.GetDirectory(cd.MountPoint)
if err != nil {
return err
return fmt.Errorf("🔴 %s: Failed ownership validation checks. %s is either not a directory or does not exist", name, cd.MountPoint)
}
if bd.MountPoint != d.Path {
return fmt.Errorf("🔴 %s: Failed mountpoint validation checks. Device not mounted to %s", name, bd.MountPoint)
return fmt.Errorf("🔴 %s: Failed mountpoint validation checks. Device not mounted to %s", name, cd.MountPoint)
}
}
return nil
Expand Down
Loading

0 comments on commit fda9263

Please sign in to comment.