Skip to content

Commit

Permalink
fix in another place where node name is hardcoded
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqalayan committed Mar 3, 2019
1 parent 0ec984c commit 9773d89
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/vmi_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,12 +1132,12 @@ var _ = Describe("Configurations", func() {
}

nodesWithCPUManager, err := virtClient.CoreV1().Nodes().List(metav1.ListOptions{LabelSelector: v1.CPUManager + "=" + "true"})
Expect(err).ToNot(HaveOccurred())
Expect(nodesWithCPUManager.Items).NotTo(Equal(0))
Expect(err).ToNot(HaveOccurred())
Expect(nodesWithCPUManager.Items).NotTo(Equal(0))

nodesWithoutCPUManager, err = virtClient.CoreV1().Nodes().List(metav1.ListOptions{LabelSelector: v1.CPUManager + "=" + "false"})
Expect(err).ToNot(HaveOccurred())
Expect(nodesWithoutCPUManager.Items).NotTo(Equal(0))
nodesWithoutCPUManager, err = virtClient.CoreV1().Nodes().List(metav1.ListOptions{LabelSelector: v1.CPUManager + "=" + "false"})
Expect(err).ToNot(HaveOccurred())
Expect(nodesWithoutCPUManager.Items).NotTo(Equal(0))
})
Context("with cpu pinning enabled", func() {
It("[test_id:1684]should set the cpumanager label to false when it's not running", func() {
Expand Down Expand Up @@ -1348,9 +1348,13 @@ var _ = Describe("Configurations", func() {
By("Starting a VirtualMachineInstance without dedicated cpus")
_, err = virtClient.VirtualMachineInstance(tests.NamespaceTestDefault).Create(Vmi)
Expect(err).ToNot(HaveOccurred())
node1 := tests.WaitForSuccessfulVMIStart(Vmi)
// what should i do here it will always fail for us
Expect(node1).To(ContainSubstring("node02"))
node = tests.WaitForSuccessfulVMIStart(Vmi)
for _, n := range nodesWithCPUManager.Items {
if strings.Contains(node, n.Name) {
Expect(node).To(ContainSubstring(n.Name))
break
}
}
})
})
})
Expand Down

0 comments on commit 9773d89

Please sign in to comment.