Skip to content

Commit

Permalink
Merge pull request kubevirt#2719 from petrkotas/fix-q35
Browse files Browse the repository at this point in the history
Change emulated types in tests to pc
  • Loading branch information
rmohr authored Sep 24, 2019
2 parents 5cc20fd + 0f255ff commit bc2d9de
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/vmi_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1281,19 +1281,24 @@ var _ = Describe("Configurations", func() {

Context("with machine type settings", func() {
defaultMachineTypeKey := "machine-type"
defaultEmulatedMachineType := "emulated-machines"

BeforeEach(func() {
tests.UpdateClusterConfigValueAndWait(defaultEmulatedMachineType, "q35*,pc-q35*,pc*")
})

AfterEach(func() {
tests.UpdateClusterConfigValueAndWait(defaultMachineTypeKey, "")
})

It("should set machine type from VMI spec", func() {
vmi := tests.NewRandomVMI()
vmi.Spec.Domain.Machine.Type = "pc-q35-3.0"
vmi.Spec.Domain.Machine.Type = "pc"
tests.RunVMIAndExpectLaunch(vmi, 30)
runningVMISpec, err := tests.GetRunningVMISpec(vmi)

Expect(err).ToNot(HaveOccurred())
Expect(runningVMISpec.OS.Type.Machine).To(Equal("pc-q35-3.0"))
Expect(runningVMISpec.OS.Type.Machine).To(ContainSubstring("pc-i440"))
})

It("should set default machine type when it is not provided", func() {
Expand All @@ -1307,15 +1312,15 @@ var _ = Describe("Configurations", func() {
})

It("should set machine type from kubevirt-config", func() {
tests.UpdateClusterConfigValueAndWait(defaultMachineTypeKey, "pc-q35-3.0")
tests.UpdateClusterConfigValueAndWait(defaultMachineTypeKey, "pc")

vmi := tests.NewRandomVMI()
vmi.Spec.Domain.Machine.Type = ""
tests.RunVMIAndExpectLaunch(vmi, 30)
runningVMISpec, err := tests.GetRunningVMISpec(vmi)

Expect(err).ToNot(HaveOccurred())
Expect(runningVMISpec.OS.Type.Machine).To(Equal("pc-q35-3.0"))
Expect(runningVMISpec.OS.Type.Machine).To(ContainSubstring("pc-i440"))
})
})

Expand Down

0 comments on commit bc2d9de

Please sign in to comment.