Skip to content

Commit c7dc96e

Browse files
committed
Automate OCP-70987: Allow dev fuse by default in CRI-O
1 parent b039d39 commit c7dc96e

3 files changed

Lines changed: 96 additions & 0 deletions

File tree

test/extended/node/node_e2e/node.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package node
22

33
import (
4+
"path/filepath"
45
"strings"
56
"time"
67

@@ -104,3 +105,38 @@ var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager",
104105
o.Expect(output).To(o.ContainSubstring("spec.cgroupMode: Unsupported value: \"v1\": supported values: \"v2\", \"\""))
105106
})
106107
})
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+
})

test/extended/testdata/bindata.go

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: pod-devfuse
5+
annotations:
6+
io.kubernetes.cri-o.Devices: "/dev/fuse"
7+
spec:
8+
securityContext:
9+
runAsNonRoot: true
10+
seccompProfile:
11+
type: RuntimeDefault
12+
containers:
13+
- name: pod-devfuse
14+
image: quay.io/openshifttest/hello-openshift@sha256:4200f438cf2e9446f6bcff9d67ceea1f69ed07a2f83363b7fb52529f7ddd8a83
15+
securityContext:
16+
allowPrivilegeEscalation: false
17+
capabilities:
18+
drop:
19+
- ALL

0 commit comments

Comments
 (0)