forked from rancher-sandbox/rancher-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rancher-sandbox#5424 from rancher-sandbox/5423-tes…
…t-factory-reset-with-snapshots Test presence/absence of apphome/snapshots.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 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 |
---|---|---|
|
@@ -684,6 +684,7 @@ sharkanodo | |
shasta | ||
shazbat | ||
shortkey | ||
shortlived | ||
showmuted | ||
sigch | ||
sigevent | ||
|
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,29 @@ | ||
load '../helpers/load' | ||
|
||
@test 'factory reset' { | ||
delete_all_snapshots | ||
factory_reset | ||
} | ||
|
||
@test 'Start up Rancher Desktop with a snapshots subdirectory' { | ||
start_container_engine | ||
wait_for_container_engine | ||
wait_for_backend | ||
} | ||
|
||
@test "Verify the snapshot dir isn't deleted on factory-reset" { | ||
rdctl shutdown | ||
rdctl snapshot create shortlived-snapshot | ||
rdctl factory-reset | ||
assert_not_exists "$PATH_APP_HOME/rd-engine.json" | ||
assert_exists "$PATH_SNAPSHOTS" | ||
run ls -A "$PATH_SNAPSHOTS" | ||
assert_output | ||
test -n "$output" | ||
} | ||
|
||
@test 'Verify factory-reset deletes an empty snapshots directory' { | ||
rdctl snapshot delete shortlived-snapshot | ||
rdctl factory-reset | ||
assert_not_exists "$PATH_APP_HOME" | ||
} |