|
1 | 1 | package node |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "path/filepath" |
4 | 5 | "strings" |
5 | 6 | "time" |
6 | 7 |
|
@@ -104,3 +105,38 @@ var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager", |
104 | 105 | o.Expect(output).To(o.ContainSubstring("spec.cgroupMode: Unsupported value: \"v1\": supported values: \"v2\", \"\"")) |
105 | 106 | }) |
106 | 107 | }) |
| 108 | + |
| 109 | +var _ = g.Describe("[sig-node] [Jira:Node/CRI-O] CRI-O", func() { |
| 110 | + var ( |
| 111 | + oc = exutil.NewCLI("node-devfuse") |
| 112 | + nodeE2EBaseDir = exutil.FixturePath("testdata", "node", "node_e2e") |
| 113 | + podDevFuseYAML = filepath.Join(nodeE2EBaseDir, "pod-dev-fuse.yaml") |
| 114 | + ) |
| 115 | + |
| 116 | + //author: cmaurya@redhat.com |
| 117 | + g.It("[OTP] Allow dev fuse by default in CRI-O [OCP-70987]", func() { |
| 118 | + ns := oc.Namespace() |
| 119 | + podName := "pod-devfuse" |
| 120 | + |
| 121 | + g.By("Create a pod with dev fuse annotation") |
| 122 | + err := oc.AsAdmin().WithoutNamespace().Run("apply").Args("-f", podDevFuseYAML, "-n", ns).Execute() |
| 123 | + o.Expect(err).NotTo(o.HaveOccurred()) |
| 124 | + defer oc.AsAdmin().WithoutNamespace().Run("delete").Args("pod", podName, "-n", ns).Execute() |
| 125 | + |
| 126 | + g.By("Wait for pod to be ready") |
| 127 | + err = wait.Poll(5*time.Second, 1*time.Minute, func() (bool, error) { |
| 128 | + status, pollErr := oc.AsAdmin().WithoutNamespace().Run("get").Args("pod", podName, "-n", ns, "-o=jsonpath={.status.conditions[?(@.type=='Ready')].status}").Output() |
| 129 | + if pollErr != nil { |
| 130 | + return false, nil |
| 131 | + } |
| 132 | + return status == "True", nil |
| 133 | + }) |
| 134 | + o.Expect(err).NotTo(o.HaveOccurred(), "pod did not become ready") |
| 135 | + |
| 136 | + g.By("Check /dev/fuse is mounted inside the pod") |
| 137 | + output, err := oc.AsAdmin().WithoutNamespace().Run("exec").Args(podName, "-n", ns, "--", "stat", "/dev/fuse").Output() |
| 138 | + o.Expect(err).NotTo(o.HaveOccurred()) |
| 139 | + e2e.Logf("/dev/fuse mount output: %s", output) |
| 140 | + o.Expect(output).To(o.ContainSubstring("fuse"), "dev fuse is not mounted inside pod") |
| 141 | + }) |
| 142 | +}) |
0 commit comments