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
b0481297a1
commit
8e163af55e
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")
|
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