Skip to content

Commit

Permalink
Adapt unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <dcassany@suse.com>
  • Loading branch information
davidcassany committed Feb 14, 2024
1 parent f464c55 commit 4eb4eb0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ var _ = Describe("Config", Label("config"), func() {

err = fs.Mkdir("/proc", constants.DirPerm)
Expect(err).Should(BeNil())
err = fs.WriteFile("/proc/cmdline", []byte("root=LABEL=COS_STATE elemental.image=active elemental.overlay=tmpfs:30%"), 0444)
err = fs.WriteFile("/proc/cmdline", []byte("root=LABEL=COS_STATE elemental.mode=active elemental.overlay=tmpfs:30%"), 0444)
Expect(err).Should(BeNil())

cfg, err = ReadConfigRun("fixtures/config/", nil, mounter)
Expand Down
1 change: 0 additions & 1 deletion pkg/action/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ var _ = Describe("Build Actions", func() {
{"mkfs.vfat", "-n", "COS_GRUB"},
{"mkfs.ext4", "-L", "COS_OEM"},
{"mkfs.ext4", "-L", "COS_RECOVERY"},
{"mkfs.ext4", "-L", "COS_STATE"},
{"sgdisk", "-p", "/tmp/test/elemental.raw"},
{"partx", "-u", "/tmp/test/elemental.raw"},
})).To(Succeed())
Expand Down
4 changes: 2 additions & 2 deletions pkg/action/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var _ = Describe("Mount Action", func() {

fstab, err := cfg.Config.Fs.ReadFile(filepath.Join(spec.Sysroot, "/etc/fstab"))
Expect(err).To(BeNil())
expectedFstab := "/dev/loop0\t/\tauto\tro,relatime\t0\t0\n"
expectedFstab := "/dev/loop0\t/\text2\tro,relatime\t0\t0\n"
expectedFstab += "/dev/somedevice\t/run/elemental\tvfat\trw,defaults\t0\t0\n"
expectedFstab += "/dev/persistentdev\t/run/elemental/persistent\tauto\tdefaults\t0\t0\n"
expectedFstab += "/run/elemental/persistent/.state/some-path.bind\t/some/path\tnone\tdefaults,bind\t0\t0\n"
Expand Down Expand Up @@ -145,7 +145,7 @@ var _ = Describe("Mount Action", func() {

fstab, err := cfg.Config.Fs.ReadFile(filepath.Join(spec.Sysroot, "/etc/fstab"))
Expect(err).To(BeNil())
expectedFstab := "/dev/loop0\t/\tauto\tro,relatime\t0\t0\n"
expectedFstab := "/dev/loop0\t/\text2\tro,relatime\t0\t0\n"
expectedFstab += "/dev/somedevice\t/run/elemental/persistent/somedir\tvfat\trw,defaults\t0\t0\n"
expectedFstab += "/dev/persistentdev\t/run/elemental/persistent\tauto\tdefaults\t0\t0\n"
expectedFstab += "overlay\t/some/path\toverlay\t"
Expand Down
2 changes: 1 addition & 1 deletion pkg/action/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ var _ = Describe("Runtime Actions", func() {
// Writes filesystem labels to GRUB oem env file
grubOEMEnv := filepath.Join(spec.Partitions.EFI.MountPoint, constants.GrubOEMEnv)
Expect(runner.IncludesCmds(
[][]string{{"grub2-editenv", grubOEMEnv, "set", "passive_snaps=passive_2"}},
[][]string{{"grub2-editenv", grubOEMEnv, "set", "passive_snaps=2"}},
)).To(Succeed())

// Expect snapshot 2 and 3 to be there and 1 deleted
Expand Down

0 comments on commit 4eb4eb0

Please sign in to comment.