Skip to content

Commit

Permalink
node_labeller.go: Fix test_id: 6247
Browse files Browse the repository at this point in the history
If ObsoleteCPUModels is not nil, the test fails.
The tests assume that ObsoleteCPUModels is not set.

Signed-off-by: bmordeha <bmordeha@redhat.com>
  • Loading branch information
Barakmor1 committed May 5, 2024
1 parent 95435d0 commit 35a87de
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/infrastructure/node-labeller.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,22 @@ var _ = DescribeInfra("Node-labeller", func() {
})

It("[test_id:6247] should set default obsolete cpu models filter when obsolete-cpus-models is not set in kubevirt config", func() {
kvConfig := v1.KubeVirtConfiguration{ObsoleteCPUModels: nil}
tests.UpdateKubeVirtConfigValueAndWait(kvConfig)
node := nodesWithKVM[0]

for key := range node.Labels {
if strings.Contains(key, v1.CPUModelLabel) {
model := strings.TrimPrefix(key, v1.CPUModelLabel)
Expect(nodelabellerutil.DefaultObsoleteCPUModels).ToNot(HaveKey(model),
"Node can't contain label with cpu model, which is in default obsolete filter")
Eventually(func() error {
node, err = virtClient.CoreV1().Nodes().Get(context.Background(), node.Name, metav1.GetOptions{})
Expect(err).ToNot(HaveOccurred())
for key := range node.Labels {
if strings.Contains(key, v1.CPUModelLabel) {
model := strings.TrimPrefix(key, v1.CPUModelLabel)
if _, ok := nodelabellerutil.DefaultObsoleteCPUModels[model]; ok {
return fmt.Errorf("node can't contain label with cpu model, which is in default obsolete filter")
}
}
}
}
return nil
}).WithTimeout(30 * time.Second).WithPolling(1 * time.Second).ShouldNot(HaveOccurred())
})

It("[test_id:6995]should expose tsc frequency and tsc scalability", func() {
Expand Down

0 comments on commit 35a87de

Please sign in to comment.