Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/action/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ var _ = Describe("Init Action", func() {
var spec *types.InitSpec
var enabledUnits []string
var errCmd, initrdFile string
var mounter *mocks.FakeMounter

BeforeEach(func() {
mounter = mocks.NewFakeMounter()
runner = mocks.NewFakeRunner()
memLog = &bytes.Buffer{}
logger = types.NewBufferLogger(memLog)
Expand All @@ -56,6 +58,7 @@ var _ = Describe("Init Action", func() {
cfg = config.NewRunConfig(
config.WithFs(fs),
config.WithRunner(runner),
config.WithMounter(mounter),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not defined any specific mounter by default uses the the real mounter

config.WithLogger(logger),
)

Expand Down
3 changes: 3 additions & 0 deletions pkg/bootloader/grub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ var _ = Describe("Booloader", Label("bootloader", "grub"), func() {
var grubCfg, osRelease []byte
var efivars eleefi.Variables
var relativeTo string
var mounter *mocks.FakeMounter

BeforeEach(func() {
logger = types.NewNullLogger()
mounter = mocks.NewFakeMounter()
fs, cleanup, err = vfst.NewTestFS(map[string]interface{}{})
Expect(err).Should(BeNil())
runner = mocks.NewFakeRunner()
Expand Down Expand Up @@ -101,6 +103,7 @@ var _ = Describe("Booloader", Label("bootloader", "grub"), func() {
cfg = config.NewConfig(
config.WithLogger(logger),
config.WithRunner(runner),
config.WithMounter(mounter),
config.WithFs(fs),
config.WithPlatform("linux/amd64"),
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var _ = Describe("Types", Label("types", "config"), func() {
config.WithSyscall(sysc),
config.WithLogger(logger),
)
Expect(c.Mounter).To(Equal(types.NewMounter(constants.MountBinary)))
Expect(c.Mounter).ToNot(BeNil())
})
})
Describe("RunConfig", func() {
Expand Down Expand Up @@ -347,7 +347,7 @@ var _ = Describe("Types", Label("types", "config"), func() {
})
Describe("BuildConfig", Label("build"), func() {
It("initiates a new build config", func() {
build := config.NewBuildConfig()
build := config.NewBuildConfig(config.WithMounter(mounter))
Expect(build.Name).To(Equal(constants.BuildImgName))
})
})
Expand Down
1 change: 1 addition & 0 deletions pkg/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func PartitionAndFormatDevice(c types.Config, i *types.InstallSpec) error {
partitioner.WithRunner(c.Runner),
partitioner.WithFS(c.Fs),
partitioner.WithLogger(c.Logger),
partitioner.WithMounter(c.Mounter),
)

if !disk.Exists() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/partitioner/partitioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ var _ = Describe("Partitioner", Label("disk", "partition", "partitioner"), func(
})
AfterEach(func() { cleanup() })
It("Creates a default disk", func() {
dev = part.NewDisk("/dev/device")
dev = part.NewDisk("/dev/device", part.WithMounter(mounter))
})
Describe("Load data without changes", func() {
BeforeEach(func() {
Expand Down Expand Up @@ -471,7 +471,7 @@ var _ = Describe("Partitioner", Label("disk", "partition", "partitioner"), func(
Expect(runner.CmdsMatch(cmds)).To(BeNil())
})
It("Does not find device for a given partition number", func() {
dev := part.NewDisk("/dev/lp0")
dev := part.NewDisk("/dev/lp0", part.WithMounter(mounter))
_, err := dev.FindPartitionDevice(4)
Expect(err).NotTo(BeNil())
})
Expand Down