Skip to content

Commit

Permalink
Add description to the test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Manu Gupta <manugupt1@gmail.com>
  • Loading branch information
manugupt1 committed Apr 6, 2022
1 parent 8c119c0 commit b8cddd9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mount/mount_unix_test.go
Expand Up @@ -267,10 +267,12 @@ func TestRecursiveUnmount_SubMountFailsToUnmount(t *testing.T) {
shadowedMounts := []string{child, grandchild}
for _, shadowedMount := range shadowedMounts {
// Unmount dir, make sure dir-other is still mounted.
if err := RecursiveUnmount(shadowedMount); err == nil {
t.Fatal("error cannot be nil")
} else if err != nil && !errors.Is(err, unix.ENOENT) {
t.Fatalf("expected error to be unix.ENOENT for shadow mount at path: %s", shadowedMount)
}
t.Run("RecursiveUnmount returns an error", func(t *testing.T) {
if err := RecursiveUnmount(shadowedMount); err == nil {
t.Fatalf("expected submount %s to return an error", shadowedMount)
} else if err != nil && !errors.Is(err, unix.ENOENT) {
t.Fatalf("expected submount(shadowed) %s to return unix.ENOENT", shadowedMount)
}
})
}
}

0 comments on commit b8cddd9

Please sign in to comment.