-
Notifications
You must be signed in to change notification settings - Fork 333
/
ovspinning.go
31 lines (20 loc) · 1.16 KB
/
ovspinning.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package e2e
import (
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
)
var _ = ginkgo.Describe("OVS CPU affinity pinning", func() {
f := wrappedTestFramework("ovspinning")
ginkgo.It("can be enabled on specific nodes by creating enable_dynamic_cpu_affinity file", func() {
nodeWithEnabledOvsAffinityPinning := "ovn-worker2"
_, err := runCommand(containerRuntime, "exec", nodeWithEnabledOvsAffinityPinning, "bash", "-c", "echo 1 > /etc/openvswitch/enable_dynamic_cpu_affinity")
gomega.Expect(err).ToNot(gomega.HaveOccurred())
restartOVNKubeNodePodsInParallel(f.ClientSet, ovnNamespace, "ovn-worker", "ovn-worker2")
enabledNodeLogs, err := getOVNKubePodLogsFiltered(f.ClientSet, ovnNamespace, "ovn-worker2", ".*ovspinning_linux.go.*$")
gomega.Expect(err).ToNot(gomega.HaveOccurred())
gomega.Expect(enabledNodeLogs).To(gomega.ContainSubstring("Starting OVS daemon CPU pinning"))
disabledNodeLogs, err := getOVNKubePodLogsFiltered(f.ClientSet, ovnNamespace, "ovn-worker", ".*ovspinning_linux.go.*$")
gomega.Expect(err).ToNot(gomega.HaveOccurred())
gomega.Expect(disabledNodeLogs).To(gomega.ContainSubstring("OVS CPU affinity pinning disabled"))
})
})