From bbc29df8fe4400e881829741c969f2fb77487423 Mon Sep 17 00:00:00 2001 From: Tiago Natel de Moura Date: Mon, 16 Nov 2020 17:22:10 +0000 Subject: Tests: tmpfs automount. --- test/go/ns_inspect/app.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/go') diff --git a/test/go/ns_inspect/app.go b/test/go/ns_inspect/app.go index 4d19a796..570580e6 100644 --- a/test/go/ns_inspect/app.go +++ b/test/go/ns_inspect/app.go @@ -7,6 +7,7 @@ import ( "unit.nginx.org/go" "os" "strconv" + "io/ioutil" ) type ( @@ -26,6 +27,7 @@ type ( GID int NS NS FileExists bool + Mounts string } ) @@ -77,6 +79,11 @@ func handler(w http.ResponseWriter, r *http.Request) { out.FileExists = err == nil } + if mounts := r.Form.Get("mounts"); mounts != "" { + data, _ := ioutil.ReadFile("/proc/self/mountinfo") + out.Mounts = string(data) + } + data, err := json.Marshal(out) if err != nil { w.WriteHeader(http.StatusInternalServerError) -- cgit