fix: app cmd parsing, usage & tests

Note: the integration tests don't work due to ValidateApp still
attempting to validate the host key for the test app which doesn't
exist. This will be fixed in a future commit.
This commit is contained in:
2022-08-12 01:59:08 +02:00
parent 8f709c05bf
commit 42a6818ff4
14 changed files with 155 additions and 42 deletions

1
tests/integration/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
logs

14
tests/integration/cmd.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
source ./testfunctions.sh
source ./common.sh
create_server_app_recipe
run_test '$ABRA app cmd foo.com test --local'
run_test '$ABRA app cmd foo.com test --local -- foo'
run_test '$ABRA app cmd foo.com test --local -- foo bar baz'
clean_server_app_recipe

View File

@ -2,6 +2,16 @@
set -e
create_server_app_recipe() {
ln -srf ../resources/testapp ~/.abra/servers/foo.com
ln -srf ../resources/testrecipe ~/.abra/recipes
}
clean_server_app_recipe() {
unlink ~/.abra/servers/foo.com
unlink ~/.abra/recipes/testrecipe
}
function init() {
ABRA="$(pwd)/../../abra"
INSTALLER_URL="https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer"

View File

@ -16,7 +16,7 @@ run_test () {
echo $logfile
}
testScripts=("app.sh" "autocomplete.sh" "catalogue.sh" "install.sh" "recipe.sh" "records.sh" "server.sh")
testScripts=("app.sh" "autocomplete.sh" "catalogue.sh" "install.sh" "recipe.sh" "records.sh" "server.sh", "cmd.sh")
for i in "${testScripts[@]}"; do
cmd="./$i $res_dir${i/sh/log}"