summaryrefslogtreecommitdiffhomepage
path: root/test/go/ns_inspect
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2020-11-16 17:22:10 +0000
committerTiago Natel de Moura <t.nateldemoura@f5.com>2020-11-16 17:22:10 +0000
commitbbc29df8fe4400e881829741c969f2fb77487423 (patch)
tree713195a9db5ebf4228e03eb5a344f62af35fb94d /test/go/ns_inspect
parent567f0a7b3049f4532524ac35cb232cbeedb868bf (diff)
downloadunit-bbc29df8fe4400e881829741c969f2fb77487423.tar.gz
unit-bbc29df8fe4400e881829741c969f2fb77487423.tar.bz2
Tests: tmpfs automount.
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)