-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #859 from nalind/recreate2
overlay.recreateSymlinks: handle missing "link" files, add a test
- Loading branch information
Showing
2 changed files
with
126 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
@test "overlay-recreate" { | ||
case "$STORAGE_DRIVER" in | ||
overlay) | ||
;; | ||
*) | ||
skip "not applicable to driver $STORAGE_DRIVER" | ||
;; | ||
esac | ||
populate | ||
# behold my destructive power! | ||
rm -v ${TESTDIR}/root/overlay/l/* | ||
# we should be able to recover from that. | ||
storage mount "$lowerlayer" | ||
storage unmount "$lowerlayer" | ||
storage mount "$midlayer" | ||
storage unmount "$midlayer" | ||
storage mount "$upperlayer" | ||
storage unmount "$upperlayer" | ||
# okay, but how about this? | ||
rm -v ${TESTDIR}/root/overlay/*/link | ||
# yeah, we can handle that, too. | ||
storage mount "$lowerlayer" | ||
storage unmount "$lowerlayer" | ||
storage mount "$midlayer" | ||
storage unmount "$midlayer" | ||
storage mount "$upperlayer" | ||
storage unmount "$upperlayer" | ||
# okay, not bad, kid. | ||
} |