tests: correct test issues
This commit is contained in:
@@ -8,7 +8,7 @@ cmd-urls() {
|
|||||||
declare cmd="url"
|
declare cmd="url"
|
||||||
declare APP="$2"
|
declare APP="$2"
|
||||||
|
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
|
|
||||||
get_app_urls "$@"
|
get_app_urls "$@"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ cmd-docker-options-add() {
|
|||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1"
|
declare APP="$1"
|
||||||
|
|
||||||
verify_app_name "$2"
|
verify_app_name "$APP"
|
||||||
read -ra passed_phases <<<"$(get_phases "$2")"
|
read -ra passed_phases <<<"$(get_phases "$2")"
|
||||||
shift 2 # everything else passed is the docker option
|
shift 2 # everything else passed is the docker option
|
||||||
local passed_docker_option="$*"
|
local passed_docker_option="$*"
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -eo pipefail
|
|
||||||
[[ $DOKKU_TRACE ]] && set -x
|
|
||||||
|
|
||||||
cmd-ssh-keys-list() {
|
|
||||||
declare desc="List ssh key hashes"
|
|
||||||
declare cmd="ssh-keys:list"
|
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
|
||||||
|
|
||||||
verify_ssh_key_file
|
|
||||||
sshcommand list dokku
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,15 @@
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
[[ $DOKKU_TRACE ]] && set -x
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/internal-functions"
|
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/functions"
|
||||||
|
|
||||||
|
cmd-ssh-keys-list() {
|
||||||
|
declare desc="List ssh key hashes"
|
||||||
|
declare cmd="ssh-keys:list"
|
||||||
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
|
|
||||||
|
verify_ssh_key_file
|
||||||
|
sshcommand list dokku
|
||||||
|
}
|
||||||
|
|
||||||
cmd-ssh-keys-list "$@"
|
cmd-ssh-keys-list "$@"
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ cmd-storage-mount() {
|
|||||||
declare APP="$1" MOUNT_PATH="$2"
|
declare APP="$1" MOUNT_PATH="$2"
|
||||||
local passed_phases=(deploy run)
|
local passed_phases=(deploy run)
|
||||||
|
|
||||||
[[ -z "$APP" || "$MOUNT_PATH" ]] && dokku_log_fail "storage:mount requires an app and a two paths divided by colon."
|
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
|
[[ -z "$MOUNT_PATH" ]] && dokku_log_fail "Please specify two paths delimited by colon."
|
||||||
|
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
verify_paths "$MOUNT_PATH"
|
verify_paths "$MOUNT_PATH"
|
||||||
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" && dokku_log_fail "Mount path already exists."
|
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" && dokku_log_fail "Mount path already exists."
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ cmd-storage-unmount() {
|
|||||||
declare APP="$1" MOUNT_PATH="$2"
|
declare APP="$1" MOUNT_PATH="$2"
|
||||||
local passed_phases=(deploy run)
|
local passed_phases=(deploy run)
|
||||||
|
|
||||||
[[ -z "$APP" || "$MOUNT_PATH" ]] && dokku_log_fail "storage:unmount requires an app and a two paths divided by colon."
|
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
|
[[ -z "$MOUNT_PATH" ]] && dokku_log_fail "Please specify two paths delimited by colon."
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
verify_paths "$MOUNT_PATH"
|
verify_paths "$MOUNT_PATH"
|
||||||
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" || dokku_log_fail "Mount path does not exist."
|
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" || dokku_log_fail "Mount path does not exist."
|
||||||
|
|||||||
@@ -19,17 +19,10 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "(config) config:help" {
|
@test "(config) config:help" {
|
||||||
run /bin/bash -c "dokku config"
|
|
||||||
echo "output: $output"
|
|
||||||
echo "status: $status"
|
|
||||||
assert_output_contains "Manage global and app-specific config vars"
|
|
||||||
help_output="$output"
|
|
||||||
|
|
||||||
run /bin/bash -c "dokku config:help"
|
run /bin/bash -c "dokku config:help"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output_contains "Manage global and app-specific config vars"
|
assert_output_contains "Manage global and app-specific config vars"
|
||||||
assert_output "$help_output"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(config) config:set --global" {
|
@test "(config) config:set --global" {
|
||||||
|
|||||||
@@ -13,17 +13,10 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "(events) events:help" {
|
@test "(events) events:help" {
|
||||||
run /bin/bash -c "dokku events"
|
|
||||||
echo "output: $output"
|
|
||||||
echo "status: $status"
|
|
||||||
assert_output_contains "Manage event logging"
|
|
||||||
help_output="$output"
|
|
||||||
|
|
||||||
run /bin/bash -c "dokku events:help"
|
run /bin/bash -c "dokku events:help"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output_contains "Manage event logging"
|
assert_output_contains "Manage event logging"
|
||||||
assert_output "$help_output"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(events) check conffiles" {
|
@test "(events) check conffiles" {
|
||||||
|
|||||||
@@ -13,17 +13,10 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "(tags) tags:help" {
|
@test "(tags) tags:help" {
|
||||||
run /bin/bash -c "dokku tags"
|
|
||||||
echo "output: $output"
|
|
||||||
echo "status: $status"
|
|
||||||
assert_output_contains "Manage docker image tags"
|
|
||||||
help_output="$output"
|
|
||||||
|
|
||||||
run /bin/bash -c "dokku tags:help"
|
run /bin/bash -c "dokku tags:help"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_output_contains "Manage docker image tags"
|
assert_output_contains "Manage docker image tags"
|
||||||
assert_output "$help_output"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(tags) tags:create, tags, tags:destroy" {
|
@test "(tags) tags:create, tags, tags:destroy" {
|
||||||
|
|||||||
Reference in New Issue
Block a user