зеркало из https://github.com/microsoft/docker.git
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:
Родитель
e5ad715e59
Коммит
a7e181c857
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче