cpu_manager_test.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /*
  2. Copyright 2017 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package e2e_node
  14. import (
  15. "fmt"
  16. "os/exec"
  17. "strconv"
  18. "strings"
  19. "time"
  20. "k8s.io/api/core/v1"
  21. "k8s.io/apimachinery/pkg/api/resource"
  22. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  23. runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
  24. kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
  25. "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
  26. cpumanagerstate "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state"
  27. "k8s.io/kubernetes/pkg/kubelet/cm/cpuset"
  28. "k8s.io/kubernetes/pkg/kubelet/types"
  29. "k8s.io/kubernetes/test/e2e/framework"
  30. . "github.com/onsi/ginkgo"
  31. . "github.com/onsi/gomega"
  32. )
  33. // Helper for makeCPUManagerPod().
  34. type ctnAttribute struct {
  35. ctnName string
  36. cpuRequest string
  37. cpuLimit string
  38. }
  39. // makeCPUMangerPod returns a pod with the provided ctnAttributes.
  40. func makeCPUManagerPod(podName string, ctnAttributes []ctnAttribute) *v1.Pod {
  41. var containers []v1.Container
  42. for _, ctnAttr := range ctnAttributes {
  43. cpusetCmd := fmt.Sprintf("grep Cpus_allowed_list /proc/self/status | cut -f2 && sleep 1d")
  44. ctn := v1.Container{
  45. Name: ctnAttr.ctnName,
  46. Image: busyboxImage,
  47. Resources: v1.ResourceRequirements{
  48. Requests: v1.ResourceList{
  49. v1.ResourceName(v1.ResourceCPU): resource.MustParse(ctnAttr.cpuRequest),
  50. v1.ResourceName(v1.ResourceMemory): resource.MustParse("100Mi"),
  51. },
  52. Limits: v1.ResourceList{
  53. v1.ResourceName(v1.ResourceCPU): resource.MustParse(ctnAttr.cpuLimit),
  54. v1.ResourceName(v1.ResourceMemory): resource.MustParse("100Mi"),
  55. },
  56. },
  57. Command: []string{"sh", "-c", cpusetCmd},
  58. }
  59. containers = append(containers, ctn)
  60. }
  61. return &v1.Pod{
  62. ObjectMeta: metav1.ObjectMeta{
  63. Name: podName,
  64. },
  65. Spec: v1.PodSpec{
  66. RestartPolicy: v1.RestartPolicyNever,
  67. Containers: containers,
  68. },
  69. }
  70. }
  71. func deletePods(f *framework.Framework, podNames []string) {
  72. for _, podName := range podNames {
  73. gp := int64(0)
  74. delOpts := metav1.DeleteOptions{
  75. GracePeriodSeconds: &gp,
  76. }
  77. f.PodClient().DeleteSync(podName, &delOpts, framework.DefaultPodDeletionTimeout)
  78. }
  79. }
  80. func getLocalNodeCPUDetails(f *framework.Framework) (cpuCapVal int64, cpuAllocVal int64, cpuResVal int64) {
  81. localNodeCap := getLocalNode(f).Status.Capacity
  82. cpuCap := localNodeCap[v1.ResourceCPU]
  83. localNodeAlloc := getLocalNode(f).Status.Allocatable
  84. cpuAlloc := localNodeAlloc[v1.ResourceCPU]
  85. cpuRes := cpuCap.Copy()
  86. cpuRes.Sub(cpuAlloc)
  87. // RoundUp reserved CPUs to get only integer cores.
  88. cpuRes.RoundUp(0)
  89. return cpuCap.Value(), (cpuCap.Value() - cpuRes.Value()), cpuRes.Value()
  90. }
  91. func waitForContainerRemoval(containerName, podName, podNS string) {
  92. rs, _, err := getCRIClient()
  93. Expect(err).NotTo(HaveOccurred())
  94. Eventually(func() bool {
  95. containers, err := rs.ListContainers(&runtimeapi.ContainerFilter{
  96. LabelSelector: map[string]string{
  97. types.KubernetesPodNameLabel: podName,
  98. types.KubernetesPodNamespaceLabel: podNS,
  99. types.KubernetesContainerNameLabel: containerName,
  100. },
  101. })
  102. if err != nil {
  103. return false
  104. }
  105. return len(containers) == 0
  106. }, 2*time.Minute, 1*time.Second).Should(BeTrue())
  107. }
  108. func waitForStateFileCleanedUp() {
  109. Eventually(func() bool {
  110. restoredState, err := cpumanagerstate.NewCheckpointState("/var/lib/kubelet", "cpu_manager_state", "static")
  111. framework.ExpectNoError(err, "failed to create testing cpumanager state instance")
  112. assignments := restoredState.GetCPUAssignments()
  113. if len(assignments) == 0 {
  114. return true
  115. }
  116. return false
  117. }, 2*time.Minute, 1*time.Second).Should(BeTrue())
  118. }
  119. func isHTEnabled() bool {
  120. outData, err := exec.Command("/bin/sh", "-c", "lscpu | grep \"Thread(s) per core:\" | cut -d \":\" -f 2").Output()
  121. framework.ExpectNoError(err)
  122. threadsPerCore, err := strconv.Atoi(strings.TrimSpace(string(outData)))
  123. framework.ExpectNoError(err)
  124. return threadsPerCore > 1
  125. }
  126. func getCPUSiblingList(cpuRes int64) string {
  127. out, err := exec.Command("/bin/sh", "-c", fmt.Sprintf("cat /sys/devices/system/cpu/cpu%d/topology/thread_siblings_list | tr -d \"\n\r\"", cpuRes)).Output()
  128. framework.ExpectNoError(err)
  129. return string(out)
  130. }
  131. func deleteStateFile() {
  132. err := exec.Command("/bin/sh", "-c", "rm -f /var/lib/kubelet/cpu_manager_state").Run()
  133. framework.ExpectNoError(err, "error deleting state file")
  134. }
  135. func setOldKubeletConfig(f *framework.Framework, oldCfg *kubeletconfig.KubeletConfiguration) {
  136. // Delete the CPU Manager state file so that the old Kubelet configuration
  137. // can take effect.i
  138. deleteStateFile()
  139. if oldCfg != nil {
  140. framework.ExpectNoError(setKubeletConfiguration(f, oldCfg))
  141. }
  142. }
  143. func disableCPUManagerInKubelet(f *framework.Framework) (oldCfg *kubeletconfig.KubeletConfiguration) {
  144. // Disable CPU Manager in Kubelet.
  145. oldCfg, err := getCurrentKubeletConfig()
  146. framework.ExpectNoError(err)
  147. newCfg := oldCfg.DeepCopy()
  148. if newCfg.FeatureGates == nil {
  149. newCfg.FeatureGates = make(map[string]bool)
  150. }
  151. newCfg.FeatureGates["CPUManager"] = false
  152. // Update the Kubelet configuration.
  153. framework.ExpectNoError(setKubeletConfiguration(f, newCfg))
  154. // Wait for the Kubelet to be ready.
  155. Eventually(func() bool {
  156. nodeList := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
  157. return len(nodeList.Items) == 1
  158. }, time.Minute, time.Second).Should(BeTrue())
  159. return oldCfg
  160. }
  161. func enableCPUManagerInKubelet(f *framework.Framework, cleanStateFile bool) (oldCfg *kubeletconfig.KubeletConfiguration) {
  162. // Enable CPU Manager in Kubelet with static policy.
  163. oldCfg, err := getCurrentKubeletConfig()
  164. framework.ExpectNoError(err)
  165. newCfg := oldCfg.DeepCopy()
  166. if newCfg.FeatureGates == nil {
  167. newCfg.FeatureGates = make(map[string]bool)
  168. } else {
  169. newCfg.FeatureGates["CPUManager"] = true
  170. }
  171. // After graduation of the CPU Manager feature to Beta, the CPU Manager
  172. // "none" policy is ON by default. But when we set the CPU Manager policy to
  173. // "static" in this test and the Kubelet is restarted so that "static"
  174. // policy can take effect, there will always be a conflict with the state
  175. // checkpointed in the disk (i.e., the policy checkpointed in the disk will
  176. // be "none" whereas we are trying to restart Kubelet with "static"
  177. // policy). Therefore, we delete the state file so that we can proceed
  178. // with the tests.
  179. // Only delete the state file at the begin of the tests.
  180. if cleanStateFile {
  181. deleteStateFile()
  182. }
  183. // Set the CPU Manager policy to static.
  184. newCfg.CPUManagerPolicy = string(cpumanager.PolicyStatic)
  185. // Set the CPU Manager reconcile period to 1 second.
  186. newCfg.CPUManagerReconcilePeriod = metav1.Duration{Duration: 1 * time.Second}
  187. // The Kubelet panics if either kube-reserved or system-reserved is not set
  188. // when CPU Manager is enabled. Set cpu in kube-reserved > 0 so that
  189. // kubelet doesn't panic.
  190. if newCfg.KubeReserved == nil {
  191. newCfg.KubeReserved = map[string]string{}
  192. }
  193. if _, ok := newCfg.KubeReserved["cpu"]; !ok {
  194. newCfg.KubeReserved["cpu"] = "200m"
  195. }
  196. // Update the Kubelet configuration.
  197. framework.ExpectNoError(setKubeletConfiguration(f, newCfg))
  198. // Wait for the Kubelet to be ready.
  199. Eventually(func() bool {
  200. nodeList := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
  201. return len(nodeList.Items) == 1
  202. }, time.Minute, time.Second).Should(BeTrue())
  203. return oldCfg
  204. }
  205. func runCPUManagerTests(f *framework.Framework) {
  206. var cpuCap, cpuAlloc int64
  207. var oldCfg *kubeletconfig.KubeletConfiguration
  208. var cpuListString, expAllowedCPUsListRegex string
  209. var cpuList []int
  210. var cpu1, cpu2 int
  211. var cset cpuset.CPUSet
  212. var err error
  213. var ctnAttrs []ctnAttribute
  214. var pod, pod1, pod2 *v1.Pod
  215. It("should assign CPUs as expected based on the Pod spec", func() {
  216. cpuCap, cpuAlloc, _ = getLocalNodeCPUDetails(f)
  217. // Skip CPU Manager tests altogether if the CPU capacity < 2.
  218. if cpuCap < 2 {
  219. framework.Skipf("Skipping CPU Manager tests since the CPU capacity < 2")
  220. }
  221. // Enable CPU Manager in the kubelet.
  222. oldCfg = enableCPUManagerInKubelet(f, true)
  223. By("running a non-Gu pod")
  224. ctnAttrs = []ctnAttribute{
  225. {
  226. ctnName: "non-gu-container",
  227. cpuRequest: "100m",
  228. cpuLimit: "200m",
  229. },
  230. }
  231. pod = makeCPUManagerPod("non-gu-pod", ctnAttrs)
  232. pod = f.PodClient().CreateSync(pod)
  233. By("checking if the expected cpuset was assigned")
  234. expAllowedCPUsListRegex = fmt.Sprintf("^0-%d\n$", cpuCap-1)
  235. err = f.PodClient().MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  236. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  237. pod.Spec.Containers[0].Name, pod.Name)
  238. By("by deleting the pods and waiting for container removal")
  239. deletePods(f, []string{pod.Name})
  240. waitForContainerRemoval(pod.Spec.Containers[0].Name, pod.Name, pod.Namespace)
  241. By("running a Gu pod")
  242. ctnAttrs = []ctnAttribute{
  243. {
  244. ctnName: "gu-container",
  245. cpuRequest: "1000m",
  246. cpuLimit: "1000m",
  247. },
  248. }
  249. pod = makeCPUManagerPod("gu-pod", ctnAttrs)
  250. pod = f.PodClient().CreateSync(pod)
  251. By("checking if the expected cpuset was assigned")
  252. cpu1 = 1
  253. if isHTEnabled() {
  254. cpuList = cpuset.MustParse(getCPUSiblingList(0)).ToSlice()
  255. cpu1 = cpuList[1]
  256. }
  257. expAllowedCPUsListRegex = fmt.Sprintf("^%d\n$", cpu1)
  258. err = f.PodClient().MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  259. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  260. pod.Spec.Containers[0].Name, pod.Name)
  261. By("by deleting the pods and waiting for container removal")
  262. deletePods(f, []string{pod.Name})
  263. waitForContainerRemoval(pod.Spec.Containers[0].Name, pod.Name, pod.Namespace)
  264. By("running multiple Gu and non-Gu pods")
  265. ctnAttrs = []ctnAttribute{
  266. {
  267. ctnName: "gu-container",
  268. cpuRequest: "1000m",
  269. cpuLimit: "1000m",
  270. },
  271. }
  272. pod1 = makeCPUManagerPod("gu-pod", ctnAttrs)
  273. pod1 = f.PodClient().CreateSync(pod1)
  274. ctnAttrs = []ctnAttribute{
  275. {
  276. ctnName: "non-gu-container",
  277. cpuRequest: "200m",
  278. cpuLimit: "300m",
  279. },
  280. }
  281. pod2 = makeCPUManagerPod("non-gu-pod", ctnAttrs)
  282. pod2 = f.PodClient().CreateSync(pod2)
  283. By("checking if the expected cpuset was assigned")
  284. cpu1 = 1
  285. if isHTEnabled() {
  286. cpuList = cpuset.MustParse(getCPUSiblingList(0)).ToSlice()
  287. cpu1 = cpuList[1]
  288. }
  289. expAllowedCPUsListRegex = fmt.Sprintf("^%d\n$", cpu1)
  290. err = f.PodClient().MatchContainerOutput(pod1.Name, pod1.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  291. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  292. pod1.Spec.Containers[0].Name, pod1.Name)
  293. cpuListString = "0"
  294. if cpuAlloc > 2 {
  295. cset = cpuset.MustParse(fmt.Sprintf("0-%d", cpuCap-1))
  296. cpuListString = fmt.Sprintf("%s", cset.Difference(cpuset.NewCPUSet(cpu1)))
  297. }
  298. expAllowedCPUsListRegex = fmt.Sprintf("^%s\n$", cpuListString)
  299. err = f.PodClient().MatchContainerOutput(pod2.Name, pod2.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  300. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  301. pod2.Spec.Containers[0].Name, pod2.Name)
  302. By("by deleting the pods and waiting for container removal")
  303. deletePods(f, []string{pod1.Name, pod2.Name})
  304. waitForContainerRemoval(pod1.Spec.Containers[0].Name, pod1.Name, pod1.Namespace)
  305. waitForContainerRemoval(pod2.Spec.Containers[0].Name, pod2.Name, pod2.Namespace)
  306. // Skip rest of the tests if CPU capacity < 3.
  307. if cpuCap < 3 {
  308. framework.Skipf("Skipping rest of the CPU Manager tests since CPU capacity < 3")
  309. }
  310. By("running a Gu pod requesting multiple CPUs")
  311. ctnAttrs = []ctnAttribute{
  312. {
  313. ctnName: "gu-container",
  314. cpuRequest: "2000m",
  315. cpuLimit: "2000m",
  316. },
  317. }
  318. pod = makeCPUManagerPod("gu-pod", ctnAttrs)
  319. pod = f.PodClient().CreateSync(pod)
  320. By("checking if the expected cpuset was assigned")
  321. cpuListString = "1-2"
  322. if isHTEnabled() {
  323. cpuListString = "2-3"
  324. cpuList = cpuset.MustParse(getCPUSiblingList(0)).ToSlice()
  325. if cpuList[1] != 1 {
  326. cset = cpuset.MustParse(getCPUSiblingList(1))
  327. cpuListString = fmt.Sprintf("%s", cset)
  328. }
  329. }
  330. expAllowedCPUsListRegex = fmt.Sprintf("^%s\n$", cpuListString)
  331. err = f.PodClient().MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  332. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  333. pod.Spec.Containers[0].Name, pod.Name)
  334. By("by deleting the pods and waiting for container removal")
  335. deletePods(f, []string{pod.Name})
  336. waitForContainerRemoval(pod.Spec.Containers[0].Name, pod.Name, pod.Namespace)
  337. By("running a Gu pod with multiple containers requesting integer CPUs")
  338. ctnAttrs = []ctnAttribute{
  339. {
  340. ctnName: "gu-container1",
  341. cpuRequest: "1000m",
  342. cpuLimit: "1000m",
  343. },
  344. {
  345. ctnName: "gu-container2",
  346. cpuRequest: "1000m",
  347. cpuLimit: "1000m",
  348. },
  349. }
  350. pod = makeCPUManagerPod("gu-pod", ctnAttrs)
  351. pod = f.PodClient().CreateSync(pod)
  352. By("checking if the expected cpuset was assigned")
  353. cpu1, cpu2 = 1, 2
  354. if isHTEnabled() {
  355. cpuList = cpuset.MustParse(getCPUSiblingList(0)).ToSlice()
  356. if cpuList[1] != 1 {
  357. cpu1, cpu2 = cpuList[1], 1
  358. }
  359. }
  360. expAllowedCPUsListRegex = fmt.Sprintf("^%d|%d\n$", cpu1, cpu2)
  361. err = f.PodClient().MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  362. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  363. pod.Spec.Containers[0].Name, pod.Name)
  364. err = f.PodClient().MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  365. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  366. pod.Spec.Containers[1].Name, pod.Name)
  367. By("by deleting the pods and waiting for container removal")
  368. deletePods(f, []string{pod.Name})
  369. waitForContainerRemoval(pod.Spec.Containers[0].Name, pod.Name, pod.Namespace)
  370. waitForContainerRemoval(pod.Spec.Containers[1].Name, pod.Name, pod.Namespace)
  371. By("running multiple Gu pods")
  372. ctnAttrs = []ctnAttribute{
  373. {
  374. ctnName: "gu-container1",
  375. cpuRequest: "1000m",
  376. cpuLimit: "1000m",
  377. },
  378. }
  379. pod1 = makeCPUManagerPod("gu-pod1", ctnAttrs)
  380. pod1 = f.PodClient().CreateSync(pod1)
  381. ctnAttrs = []ctnAttribute{
  382. {
  383. ctnName: "gu-container2",
  384. cpuRequest: "1000m",
  385. cpuLimit: "1000m",
  386. },
  387. }
  388. pod2 = makeCPUManagerPod("gu-pod2", ctnAttrs)
  389. pod2 = f.PodClient().CreateSync(pod2)
  390. By("checking if the expected cpuset was assigned")
  391. cpu1, cpu2 = 1, 2
  392. if isHTEnabled() {
  393. cpuList = cpuset.MustParse(getCPUSiblingList(0)).ToSlice()
  394. if cpuList[1] != 1 {
  395. cpu1, cpu2 = cpuList[1], 1
  396. }
  397. }
  398. expAllowedCPUsListRegex = fmt.Sprintf("^%d\n$", cpu1)
  399. err = f.PodClient().MatchContainerOutput(pod1.Name, pod1.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  400. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  401. pod1.Spec.Containers[0].Name, pod1.Name)
  402. expAllowedCPUsListRegex = fmt.Sprintf("^%d\n$", cpu2)
  403. err = f.PodClient().MatchContainerOutput(pod2.Name, pod2.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  404. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  405. pod2.Spec.Containers[0].Name, pod2.Name)
  406. By("by deleting the pods and waiting for container removal")
  407. deletePods(f, []string{pod1.Name, pod2.Name})
  408. waitForContainerRemoval(pod1.Spec.Containers[0].Name, pod1.Name, pod1.Namespace)
  409. waitForContainerRemoval(pod2.Spec.Containers[0].Name, pod2.Name, pod2.Namespace)
  410. By("test for automatically remove inactive pods from cpumanager state file.")
  411. // First running a Gu Pod,
  412. // second disable cpu manager in kubelet,
  413. // then delete the Gu Pod,
  414. // then enable cpu manager in kubelet,
  415. // at last wait for the reconcile process cleaned up the state file, if the assignments map is empty,
  416. // it proves that the automatic cleanup in the reconcile process is in effect.
  417. By("running a Gu pod for test remove")
  418. ctnAttrs = []ctnAttribute{
  419. {
  420. ctnName: "gu-container-testremove",
  421. cpuRequest: "1000m",
  422. cpuLimit: "1000m",
  423. },
  424. }
  425. pod = makeCPUManagerPod("gu-pod-testremove", ctnAttrs)
  426. pod = f.PodClient().CreateSync(pod)
  427. By("checking if the expected cpuset was assigned")
  428. cpu1 = 1
  429. if isHTEnabled() {
  430. cpuList = cpuset.MustParse(getCPUSiblingList(0)).ToSlice()
  431. cpu1 = cpuList[1]
  432. }
  433. expAllowedCPUsListRegex = fmt.Sprintf("^%d\n$", cpu1)
  434. err = f.PodClient().MatchContainerOutput(pod.Name, pod.Spec.Containers[0].Name, expAllowedCPUsListRegex)
  435. framework.ExpectNoError(err, "expected log not found in container [%s] of pod [%s]",
  436. pod.Spec.Containers[0].Name, pod.Name)
  437. By("disable cpu manager in kubelet")
  438. disableCPUManagerInKubelet(f)
  439. By("by deleting the pod and waiting for container removal")
  440. deletePods(f, []string{pod.Name})
  441. waitForContainerRemoval(pod.Spec.Containers[0].Name, pod.Name, pod.Namespace)
  442. By("enable cpu manager in kubelet without delete state file")
  443. enableCPUManagerInKubelet(f, false)
  444. By("wait for the deleted pod to be cleaned up from the state file")
  445. waitForStateFileCleanedUp()
  446. By("the deleted pod has already been deleted from the state file")
  447. setOldKubeletConfig(f, oldCfg)
  448. })
  449. }
  450. // Serial because the test updates kubelet configuration.
  451. var _ = SIGDescribe("CPU Manager [Serial] [Feature:CPUManager][NodeAlphaFeature:CPUManager]", func() {
  452. f := framework.NewDefaultFramework("cpu-manager-test")
  453. Context("With kubeconfig updated with static CPU Manager policy run the CPU Manager tests", func() {
  454. runCPUManagerTests(f)
  455. })
  456. })