зеркало из https://github.com/microsoft/docker.git
filesystem: Added IsMounted() unit tests
This commit is contained in:
Родитель
6513a1d94e
Коммит
d8bc912238
|
@ -27,21 +27,41 @@ func TestFilesystem(t *testing.T) {
|
||||||
t.Errorf("Umount succeeded even though the filesystem was not mounted")
|
t.Errorf("Umount succeeded even though the filesystem was not mounted")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if filesystem.IsMounted() {
|
||||||
|
t.Fatal("Filesystem should not be mounted")
|
||||||
|
}
|
||||||
|
|
||||||
if err := filesystem.Mount(); err != nil {
|
if err := filesystem.Mount(); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !filesystem.IsMounted() {
|
||||||
|
t.Fatal("Filesystem should be mounted")
|
||||||
|
}
|
||||||
|
|
||||||
if err := filesystem.Mount(); err == nil {
|
if err := filesystem.Mount(); err == nil {
|
||||||
t.Errorf("Double mount succeeded")
|
t.Errorf("Double mount succeeded")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !filesystem.IsMounted() {
|
||||||
|
t.Fatal("Filesystem should be mounted")
|
||||||
|
}
|
||||||
|
|
||||||
if err := filesystem.Umount(); err != nil {
|
if err := filesystem.Umount(); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if filesystem.IsMounted() {
|
||||||
|
t.Fatal("Filesystem should not be mounted")
|
||||||
|
}
|
||||||
|
|
||||||
if err := filesystem.Umount(); err == nil {
|
if err := filesystem.Umount(); err == nil {
|
||||||
t.Errorf("Umount succeeded even though the filesystem was already umounted")
|
t.Errorf("Umount succeeded even though the filesystem was already umounted")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if filesystem.IsMounted() {
|
||||||
|
t.Fatal("Filesystem should not be mounted")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilesystemMultiLayer(t *testing.T) {
|
func TestFilesystemMultiLayer(t *testing.T) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче