summaryrefslogtreecommitdiffhomepage
path: root/test/go/ns_inspect
diff options
context:
space:
mode:
Diffstat (limited to 'test/go/ns_inspect')
-rw-r--r--test/go/ns_inspect/app.go7
1 files changed, 7 insertions, 0 deletions
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)