11package node
22
33import (
4+ "path/filepath"
45 "strings"
56 "time"
67
@@ -14,7 +15,9 @@ import (
1415
1516var _ = g .Describe ("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager" , func () {
1617 var (
17- oc = exutil .NewCLIWithoutNamespace ("node" )
18+ oc = exutil .NewCLIWithoutNamespace ("node" )
19+ nodeE2EBaseDir = exutil .FixturePath ("testdata" , "node" , "node_e2e" )
20+ podDevFuseYAML = filepath .Join (nodeE2EBaseDir , "pod-dev-fuse.yaml" )
1821 )
1922
2023 // Skip all tests on MicroShift clusters as MachineConfig resources are not available
@@ -103,4 +106,40 @@ var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager",
103106 o .Expect (err ).Should (o .HaveOccurred ())
104107 o .Expect (output ).To (o .ContainSubstring ("spec.cgroupMode: Unsupported value: \" v1\" : supported values: \" v2\" , \" \" " ))
105108 })
109+
110+ //author: cmaurya@redhat.com
111+ g .It ("[OTP] Allow dev fuse by default in CRI-O [OCP-70987]" , func () {
112+ podName := "pod-devfuse"
113+ ns := "devfuse-test"
114+
115+ g .By ("Create a test namespace" )
116+ err := oc .AsAdmin ().WithoutNamespace ().Run ("create" ).Args ("namespace" , ns ).Execute ()
117+ o .Expect (err ).NotTo (o .HaveOccurred ())
118+ defer oc .AsAdmin ().WithoutNamespace ().Run ("delete" ).Args ("namespace" , ns , "--ignore-not-found" ).Execute ()
119+
120+ g .By ("Create a pod with dev fuse annotation" )
121+ err = oc .AsAdmin ().WithoutNamespace ().Run ("apply" ).Args ("-f" , podDevFuseYAML , "-n" , ns ).Execute ()
122+ o .Expect (err ).NotTo (o .HaveOccurred ())
123+
124+ g .By ("Wait for pod to be ready" )
125+ err = wait .Poll (5 * time .Second , 1 * time .Minute , func () (bool , error ) {
126+ status , pollErr := oc .AsAdmin ().WithoutNamespace ().Run ("get" ).Args ("pod" , podName , "-n" , ns , "-o=jsonpath={.status.conditions[?(@.type=='Ready')].status}" ).Output ()
127+ if pollErr != nil {
128+ e2e .Logf ("Error polling pod status: %v" , pollErr )
129+ return false , nil
130+ }
131+ return status == "True" , nil
132+ })
133+ if err != nil {
134+ podStatus , _ := oc .AsAdmin ().WithoutNamespace ().Run ("get" ).Args ("pod" , podName , "-n" , ns , "-o=jsonpath={.status}" ).Output ()
135+ e2e .Logf ("Pod status on timeout: %s" , podStatus )
136+ }
137+ o .Expect (err ).NotTo (o .HaveOccurred (), "pod did not become ready" )
138+
139+ g .By ("Check /dev/fuse is mounted inside the pod" )
140+ output , err := oc .AsAdmin ().WithoutNamespace ().Run ("exec" ).Args (podName , "-n" , ns , "--" , "stat" , "/dev/fuse" ).Output ()
141+ o .Expect (err ).NotTo (o .HaveOccurred ())
142+ e2e .Logf ("/dev/fuse mount output: %s" , output )
143+ o .Expect (output ).To (o .ContainSubstring ("fuse" ), "dev fuse is not mounted inside pod" )
144+ })
106145})
0 commit comments