Tests: tmpfs automount.

This commit is contained in:
Tiago Natel de Moura
2020-11-16 17:22:10 +00:00
parent 567f0a7b30
commit bbc29df8fe
2 changed files with 29 additions and 3 deletions

View File

@@ -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)