-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for picking RD_LOCATION for BATS
Choose from system/user/dist/npm or pick first available. dist and npm only work when running from inside a git clone. npm is not yet supported on Windows. Also move "load ../helpers/load" from setup() to top level, so we can abort on fatal errors. Predefine teardown_file() with `rdctl shutdown` so it doesn't have to be repeated in every test file. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
- Loading branch information
Showing
20 changed files
with
181 additions
and
123 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
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
setup() { | ||
load '../helpers/load' | ||
} | ||
load '../helpers/load' | ||
|
||
@test 'factory reset' { | ||
factory_reset | ||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
setup() { | ||
load '../helpers/load' | ||
} | ||
load '../helpers/load' | ||
|
||
@test 'factory reset' { | ||
factory_reset | ||
|
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 |
---|---|---|
@@ -1,14 +1,42 @@ | ||
validate_enum() { | ||
local var=$1 | ||
shift | ||
for value in "$@"; do | ||
if [ "${!var}" = "$value" ]; then | ||
return | ||
fi | ||
done | ||
fatal "$var=${!var} is not a valid setting; select from [$*]" | ||
} | ||
|
||
: "${RD_CONTAINER_ENGINE:=containerd}" | ||
validate_enum RD_CONTAINER_ENGINE containerd moby | ||
|
||
: "${RD_KUBERNETES_VERSION:=1.23.6}" | ||
: "${RD_KUBERNETES_PREV_VERSION:=1.22.7}" | ||
: "${RD_RANCHER_IMAGE_TAG:=v2.7.0}" | ||
|
||
: "${RD_USE_IMAGE_ALLOW_LIST:=false}" | ||
: "${RD_USE_WINDOWS_EXE:=false}" | ||
|
||
# RD_LOCATION specifies the location where Rancher Desktop is installed | ||
# system: default system-wide install location shared for all users | ||
# user: per-user install location | ||
# dist: use the result of `npm run package` in ../dist | ||
# npm: dev mode; start app with `cd ..; npm run dev` | ||
# "": use first location from the list above that contains the app | ||
|
||
: "${RD_LOCATION:=}" | ||
validate_enum RD_LOCATION system user dist npm "" | ||
|
||
using_npm_run_dev() { | ||
[ "$RD_LOCATION" = "npm" ] | ||
} | ||
|
||
using_image_allow_list() { | ||
is_true "$RD_USE_IMAGE_ALLOW_LIST" | ||
} | ||
|
||
using_windows_exe() { | ||
is_true "$RD_USE_WINDOWS_EXE" | ||
} |
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
Oops, something went wrong.