Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unflaky ci - 2 #1206

Merged
merged 2 commits into from
Mar 25, 2022
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
1 change: 1 addition & 0 deletions scripts/get_luet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if [[ "$DOCKER_INSTALL" == "true" ]]; then
echo "Using luet bootstrap version from docker image: ${_DOCKER_IMAGE}"
docker run --entrypoint /usr/bin/luet --name luet ${_DOCKER_IMAGE} --version
docker cp luet:/usr/bin/luet ./
docker rm luet
else
_LUET="luet-${LUET_VERSION}-linux-${LUET_ARCH}"
_LUET_URL="https://github.com/mudler/luet/releases/download/${LUET_VERSION}/${_LUET}"
Expand Down
89 changes: 51 additions & 38 deletions tests/installer/installer_efi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,25 @@ var _ = Describe("cOS Installer EFI tests", func() {
By("Reboot to make sure we boot from CD")
s.Reboot()
})*/

Context("partition layout tests", func() {
Context("with partition layout", func() {
It("Forcing GPT", func() {
It("performs a standard install", func() {
err := s.SendFile("../assets/layout.yaml", "/usr/local/layout.yaml", "0770")
By("Running the elemental install with a layout file")
Expect(err).To(BeNil())
out, err := s.Command("elemental install --force-gpt --partition-layout /usr/local/layout.yaml /dev/sda")
fmt.Printf(out)
Expect(err).To(BeNil())
Expect(out).To(ContainSubstring("Copying COS_ACTIVE image..."))
Expect(out).To(ContainSubstring("Installing GRUB.."))
Expect(out).To(ContainSubstring("Copying COS_PASSIVE image..."))
Expect(out).To(ContainSubstring("Mounting disk partitions"))
Expect(out).To(ContainSubstring("Partitioning device..."))
})

// This section of the test is flaky in our CI w/EFI. Commenting it out for the time being
PIt("Forcing GPT", func() {
err := s.SendFile("../assets/layout.yaml", "/usr/local/layout.yaml", "0770")
By("Running the elemental install with a layout file")
Expect(err).To(BeNil())
Expand All @@ -65,44 +81,41 @@ var _ = Describe("cOS Installer EFI tests", func() {
Expect(out).To(ContainSubstring("Mounting disk partitions"))
Expect(out).To(ContainSubstring("Partitioning device..."))

// This section of the test is flaky in our CI w/EFI. Commenting it out for the time being
PContext("reboots successfully into installed system", func() {
// Remove iso so we boot directly from the disk
s.EjectCOSCD()
// Reboot so we boot into the just installed cos
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")
// Remove iso so we boot directly from the disk
s.EjectCOSCD()
// Reboot so we boot into the just installed cos
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.Ext4,
},
{
Label: "COS_OEM",
Size: 10,
FsType: sut.Ext4,
},
{
Label: "COS_RECOVERY",
Size: 4000,
FsType: sut.Ext2,
},
{
Label: "COS_PERSISTENT",
Size: 100,
FsType: sut.Ext2,
},
} {
CheckPartitionValues(disk, part)
}
})
for _, part := range []sut.PartitionEntry{
{
Label: "COS_STATE",
Size: 8192,
FsType: sut.Ext4,
},
{
Label: "COS_OEM",
Size: 10,
FsType: sut.Ext4,
},
{
Label: "COS_RECOVERY",
Size: 4000,
FsType: sut.Ext2,
},
{
Label: "COS_PERSISTENT",
Size: 100,
FsType: sut.Ext2,
},
} {
CheckPartitionValues(disk, part)
}
})
// Marked as pending to reduce the number of efi tests. VBox efi support is
// not good enough to run extensive tests
Expand Down