Skip to content

Commit

Permalink
Test custom msdos partitioning
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 17, 2022
1 parent 33f4b9a commit 6eaf253
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/cos/collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packages:
- &cos
name: "cos"
category: "system"
version: 0.8.2
version: 0.8.2-1
description: "cOS base image, used to build cOS live ISOs"
brand_name: "cOS"
labels:
Expand Down
4 changes: 2 additions & 2 deletions packages/toolchain/elemental-cli/collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ packages:
name: "elemental-cli"
bin_name: "elemental"
category: "toolchain"
version: "0.20220217"
version: "0.20220217-1"
fips: false
labels:
github.repo: "elemental"
github.owner: "rancher-sandbox"
autobump.revdeps: "true"
autobump.strategy: "git_hash"
autobump.git.branch: "main"
git.hash: "a95088a5347f8f8f35ea2a2afdd40d3fc1bb451b"
git.hash: "adea0565b69d9eaa5874acb6e56736d10c964763"
# - !!merge <<: *elemental
# category: "toolchain-fips"
# fips: true
8 changes: 4 additions & 4 deletions tests/assets/layout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ stages:
size: 10
pLabel: oem
- fsLabel: COS_RECOVERY
# default filesystem is ext2 if omitted
filesystem: ext4
# default filesystem is ext4 if omitted
filesystem: ext2
size: 4000
pLabel: recovery
- fsLabel: COS_PERSISTENT
pLabel: persistent
# default filesystem is ext2 if omitted
filesystem: ext4
# default filesystem is ext4 if omitted
filesystem: ext2
size: 100
50 changes: 44 additions & 6 deletions tests/installer/installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,47 @@ var _ = Describe("cOS Installer tests", func() {
By("Running the cos-installer with a layout file")
Expect(err).To(BeNil())
out, err := s.Command("cos-installer --partition-layout /usr/local/layout.yaml /dev/sda")
Expect(err).ToNot(BeNil())
Expect(err).To(BeNil())
Expect(out).To(ContainSubstring("Copying COS_ACTIVE image..."))
Expect(out).To(ContainSubstring("Installing GRUB.."))
Expect(out).To(ContainSubstring("Copying Passive image..."))
Expect(out).To(ContainSubstring("Copying Recovery image..."))
Expect(out).To(ContainSubstring("Mounting disk partitions"))
Expect(out).To(ContainSubstring("Partitioning device..."))
Expect(err.Error()).To(ContainSubstring("Custom partitioning is only supported for GPT disks"))
Expect(out).To(ContainSubstring("Unmounting disk partitions"))
s.Reboot()
By("Checking we booted from the installed cOS")
ExpectWithOffset(1, s.BootFrom()).To(Equal(sut.Active))

// check partition values
// Values have to match the yaml under ../assets/layout.yaml
// That is the file that the installer uses so partitions should match those values
disk := s.GetDiskLayout("/dev/sda")

for _, part := range []sut.PartitionEntry{
{
Label: "COS_STATE",
Size: 8192,
FsType: sut.Ext2,
},
{
Label: "COS_OEM",
Size: 10,
FsType: sut.Ext2,
},
{
Label: "COS_RECOVERY",
Size: 4000,
FsType: sut.Ext4,
},
{
Label: "COS_PERSISTENT",
Size: 100,
FsType: sut.Ext4,
},
} {
CheckPartitionValues(disk, part)
}
})
})
})
Expand Down Expand Up @@ -268,22 +306,22 @@ var _ = Describe("cOS Installer tests", func() {
{
Label: "COS_STATE",
Size: 8192,
FsType: sut.Ext2,
FsType: sut.Ext4,
},
{
Label: "COS_OEM",
Size: 10,
FsType: sut.Ext2,
FsType: sut.Ext4,
},
{
Label: "COS_RECOVERY",
Size: 4000,
FsType: sut.Ext4,
FsType: sut.Ext2,
},
{
Label: "COS_PERSISTENT",
Size: 100,
FsType: sut.Ext4,
FsType: sut.Ext2,
},
} {
CheckPartitionValues(disk, part)
Expand Down

0 comments on commit 6eaf253

Please sign in to comment.