-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfuse_fs_test.go
40 lines (33 loc) · 1.09 KB
/
fuse_fs_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package vizzini_test
import (
"io"
"net/http"
"code.cloudfoundry.org/bbs/models"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("FuseFS", func() {
var lrp *models.DesiredLRP
var url string
BeforeEach(func() {
if !config.EnablePrivilegedContainerTests {
Skip("privileged container tests are disabled")
}
lrp = DesiredLRPWithGuid(guid)
lrp.Privileged = true
url = "http://" + RouteForGuid(guid) + "/env"
Expect(bbsClient.DesireLRP(logger, traceID, lrp)).To(Succeed())
Eventually(EndpointCurler(url)).Should(Equal(http.StatusOK))
})
It("should support FuseFS", func() {
resp, err := http.Post("http://"+RouteForGuid(guid)+"/fuse-fs/mount", "application/json", nil)
Expect(err).NotTo(HaveOccurred())
Expect(resp.StatusCode).To(Equal(http.StatusOK))
resp, err = http.Get("http://" + RouteForGuid(guid) + "/fuse-fs/ls")
Expect(err).NotTo(HaveOccurred())
Expect(resp.StatusCode).To(Equal(http.StatusOK))
contents, err := io.ReadAll(resp.Body)
Expect(err).NotTo(HaveOccurred())
Expect(contents).To(ContainSubstring("fuse-fs-works.txt"))
})
})