Tests: tmpfs automount.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user