mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add a test for mount.GetMounts
Because mount.parseInfoFile is only available on Linux Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
This commit is contained in:
parent
e5ad715e59
commit
a7e181c857
1 changed files with 18 additions and 0 deletions
|
@ -108,3 +108,21 @@ func TestMountReadonly(t *testing.T) {
|
|||
t.Fatal("Should not be able to open a ro file as rw")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetMounts(t *testing.T) {
|
||||
mounts, err := GetMounts()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
root := false
|
||||
for _, entry := range mounts {
|
||||
if entry.Mountpoint == "/" {
|
||||
root = true
|
||||
}
|
||||
}
|
||||
|
||||
if !root {
|
||||
t.Fatal("/ should be mounted at least")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue