-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a boolean return form unmount to indicate when the layer is reall…
…y unmounted Signed-off-by: Daniel J Walsh <[email protected]>
- Loading branch information
Showing
5 changed files
with
146 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ type command struct { | |
var ( | ||
commands = []command{} | ||
jsonOutput = false | ||
force = false | ||
) | ||
|
||
func main() { | ||
|
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
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,81 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
@test "mount-layer" { | ||
# Create a layer. | ||
run storage --debug=false create-layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
layer="$output" | ||
|
||
# Mount the layer. | ||
run storage --debug=false mount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Unmount the layer. | ||
run storage --debug=false unmount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" == "" ] | ||
|
||
# Mount the layer twice. | ||
run storage --debug=false mount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
run storage --debug=false mount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Unmount the third layer. | ||
run storage --debug=false unmount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" == "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Unmount the third layer. | ||
run storage --debug=false unmount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" == "" ] | ||
|
||
|
||
# Mount the layer twice and force umount | ||
run storage --debug=false mount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
run storage --debug=false mount $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Unmount the third layer. | ||
run storage --debug=false unmount --force $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
# Check it layer is mounted | ||
run storage --debug=false mounted $layer | ||
[ "$status" -eq 0 ] | ||
[ "$output" == "" ] | ||
|
||
# Try to delete the first layer, which should fail because it has children. | ||
run storage delete-layer $layer | ||
[ "$status" -eq 0 ] | ||
} |