Skip to content

Commit

Permalink
Improved pod name
Browse files Browse the repository at this point in the history
  • Loading branch information
SargunNarula committed Aug 16, 2024
1 parent 26db519 commit 83fa93a
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,34 +771,34 @@ var _ = Describe("[rfe_id:27363][performance] CPU Management", Ordered, func() {
})

Context("Runc cpus isolation", func() {
var guaranteedPod, secondPod *corev1.Pod
var guaranteedPod, bestEffortPod *corev1.Pod

AfterEach(func() {
cmd := []string{"rm", "-f", "/rootfs/var/roothome/create"}
nodes.ExecCommand(ctx, workerRTNode, cmd)
deleteTestPod(ctx, guaranteedPod)
deleteTestPod(ctx, secondPod)
deleteTestPod(ctx, bestEffortPod)
})

It("[test_id: 74461] Verify that runc excludes the cpus used by guaranteed pod", func() {
guaranteedPod, err := getGuaranteedPod(ctx, workerRTNode)
guaranteedPod, err = getGuaranteedPod(ctx, workerRTNode)
err = testclient.Client.Create(ctx, guaranteedPod)
Expect(err).ToNot(HaveOccurred())
_, err = pods.WaitForCondition(ctx, client.ObjectKeyFromObject(guaranteedPod), corev1.PodReady, corev1.ConditionTrue, 5*time.Minute)
Expect(err).ToNot(HaveOccurred())
Expect(guaranteedPod.Status.QOSClass).To(Equal(corev1.PodQOSGuaranteed))

secondPod, err := getNonGuaranteedPod(ctx, workerRTNode)
err = testclient.Client.Create(ctx, secondPod)
bestEffortPod, err = getNonGuaranteedPod(ctx, workerRTNode)
err = testclient.Client.Create(ctx, bestEffortPod)
Expect(err).ToNot(HaveOccurred())
_, err = pods.WaitForCondition(ctx, client.ObjectKeyFromObject(secondPod), corev1.PodReady, corev1.ConditionTrue, 5*time.Minute)
_, err = pods.WaitForCondition(ctx, client.ObjectKeyFromObject(bestEffortPod), corev1.PodReady, corev1.ConditionTrue, 5*time.Minute)
Expect(err).ToNot(HaveOccurred())

containerIDs := make([]string, 2)

containerIDs[0], err = pods.GetContainerIDByName(guaranteedPod, "test")
Expect(err).ToNot(HaveOccurred())
containerIDs[1], err = pods.GetContainerIDByName(secondPod, "test")
containerIDs[1], err = pods.GetContainerIDByName(bestEffortPod, "test")
Expect(err).ToNot(HaveOccurred())
for _, containerID := range containerIDs {
path := fmt.Sprintf("/rootfs/var/run/containers/storage/overlay-containers/%s/userdata/config.json", containerID)
Expand Down Expand Up @@ -834,7 +834,7 @@ var _ = Describe("[rfe_id:27363][performance] CPU Management", Ordered, func() {
runcCpus, err := cpuset.Parse(zippedMatches[1]["cpus"])
Expect(err).ToNot(HaveOccurred())
overlapFound := !guaranteedPodCpus.Intersection(runcCpus).IsEmpty()
Expect(overlapFound).ToNot(BeTrue(), "Overlap found between guaranteedPod cpus and runtime Cpus, not expected behaviour")
Expect(overlapFound).ToNot(BeTrue(), fmt.Sprintf("Overlap found between guaranteedPod cpus (%s) and runtime Cpus (%s), not expected behaviour", guaranteedPodCpus, runcCpus))
})
})

Expand Down

0 comments on commit 83fa93a

Please sign in to comment.