From 56616c43005f19252d5dd957fb4e4c9d5f3a9973 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 12 Sep 2021 04:19:18 -0400 Subject: [PATCH] tests: use a username longer than one character to workaround bug in upstream docker image Refs apache/couchdb-docker#206 --- tests/hook_pre_delete.bats | 12 ++++---- tests/service_clone.bats | 12 ++++---- tests/service_create.bats | 6 ++-- tests/service_destroy.bats | 18 +++++------ tests/service_export.bats | 8 ++--- tests/service_expose.bats | 8 ++--- tests/service_import.bats | 8 ++--- tests/service_info.bats | 40 ++++++++++++------------- tests/service_link.bats | 60 ++++++++++++++++++------------------- tests/service_list.bats | 8 ++--- tests/service_logs.bats | 8 ++--- tests/service_promote.bats | 36 +++++++++++----------- tests/service_restart.bats | 6 ++-- tests/service_start.bats | 6 ++-- tests/service_stop.bats | 6 ++-- tests/service_unexpose.bats | 10 +++---- tests/service_unlink.bats | 18 +++++------ 17 files changed, 135 insertions(+), 135 deletions(-) diff --git a/tests/hook_pre_delete.bats b/tests/hook_pre_delete.bats index 19809b1..e20737b 100755 --- a/tests/hook_pre_delete.bats +++ b/tests/hook_pre_delete.bats @@ -3,17 +3,17 @@ load test_helper setup() { dokku apps:create my-app - dokku "$PLUGIN_COMMAND_PREFIX:create" l - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2 + dokku "$PLUGIN_COMMAND_PREFIX:create" ls + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2 } teardown() { - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app >&2 - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app >&2 + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:hook:pre-delete) removes app from links file when destroying app" { - [[ -n $(< "$PLUGIN_DATA_ROOT/l/LINKS") ]] + [[ -n $(< "$PLUGIN_DATA_ROOT/ls/LINKS") ]] dokku --force apps:destroy my-app - [[ -z $(< "$PLUGIN_DATA_ROOT/l/LINKS") ]] + [[ -z $(< "$PLUGIN_DATA_ROOT/ls/LINKS") ]] } diff --git a/tests/service_clone.bats b/tests/service_clone.bats index 5ccd997..d145f6b 100755 --- a/tests/service_clone.bats +++ b/tests/service_clone.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:clone) error when there are no arguments" { @@ -22,14 +22,14 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:clone) error when new service isn't provided" { - run dokku "$PLUGIN_COMMAND_PREFIX:clone" l + run dokku "$PLUGIN_COMMAND_PREFIX:clone" ls assert_contains "${lines[*]}" "Please specify a name for the new service" assert_failure } @test "($PLUGIN_COMMAND_PREFIX:clone) error when new service already exists" { dokku "$PLUGIN_COMMAND_PREFIX:create" new_service - run dokku "$PLUGIN_COMMAND_PREFIX:clone" l new_service + run dokku "$PLUGIN_COMMAND_PREFIX:clone" ls new_service assert_contains "${lines[*]}" "service new_service already exists" assert_failure @@ -37,9 +37,9 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:clone) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:clone" l new_service + run dokku "$PLUGIN_COMMAND_PREFIX:clone" ls new_service [[ -f $PLUGIN_DATA_ROOT/new_service/ID ]] - assert_contains "${lines[*]}" "Copying data from l to new_service" + assert_contains "${lines[*]}" "Copying data from ls to new_service" assert_contains "${lines[*]}" "Done" assert_success diff --git a/tests/service_create.bats b/tests/service_create.bats index e9ac62d..791e5cc 100755 --- a/tests/service_create.bats +++ b/tests/service_create.bats @@ -2,9 +2,9 @@ load test_helper @test "($PLUGIN_COMMAND_PREFIX:create) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:create" l - assert_contains "${lines[*]}" "container created: l" - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + run dokku "$PLUGIN_COMMAND_PREFIX:create" ls + assert_contains "${lines[*]}" "container created: ls" + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:create) service with dashes" { diff --git a/tests/service_destroy.bats b/tests/service_destroy.bats index 98695ea..3a7bf0c 100755 --- a/tests/service_destroy.bats +++ b/tests/service_destroy.bats @@ -2,9 +2,9 @@ load test_helper @test "($PLUGIN_COMMAND_PREFIX:destroy) success with --force" { - dokku "$PLUGIN_COMMAND_PREFIX:create" l - run dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l - assert_contains "${lines[*]}" "container deleted: l" + dokku "$PLUGIN_COMMAND_PREFIX:create" ls + run dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls + assert_contains "${lines[*]}" "container deleted: ls" } @test "($PLUGIN_COMMAND_PREFIX:destroy) error when there are no arguments" { @@ -18,13 +18,13 @@ load test_helper } @test "($PLUGIN_COMMAND_PREFIX:destroy) error when container is linked to an app" { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls dokku apps:create app - dokku "$PLUGIN_COMMAND_PREFIX:link" l app - run dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku "$PLUGIN_COMMAND_PREFIX:link" ls app + run dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls assert_contains "${lines[*]}" "Cannot delete linked service" - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l app - run dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l - assert_contains "${lines[*]}" "container deleted: l" + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls app + run dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls + assert_contains "${lines[*]}" "container deleted: ls" } diff --git a/tests/service_export.bats b/tests/service_export.bats index 4d70d6e..b5ab9eb 100755 --- a/tests/service_export.bats +++ b/tests/service_export.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:export) error when there are no arguments" { @@ -24,7 +24,7 @@ teardown() { skip "No tty is available on Github Actions" fi export SSH_TTY=`tty` - run dokku "$PLUGIN_COMMAND_PREFIX:export" l + run dokku "$PLUGIN_COMMAND_PREFIX:export" ls echo "output: $output" echo "status: $status" assert_exit_status 0 @@ -32,7 +32,7 @@ teardown() { @test "($PLUGIN_COMMAND_PREFIX:export) success without SSH_TTY" { unset SSH_TTY - run dokku "$PLUGIN_COMMAND_PREFIX:export" l + run dokku "$PLUGIN_COMMAND_PREFIX:export" ls echo "output: $output" echo "status: $status" assert_exit_status 0 diff --git a/tests/service_expose.bats b/tests/service_expose.bats index 626ccfa..1c3be33 100755 --- a/tests/service_expose.bats +++ b/tests/service_expose.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:expose) error when there are no arguments" { @@ -20,11 +20,11 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:expose) success when not providing custom ports" { - run dokku "$PLUGIN_COMMAND_PREFIX:expose" l + run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls [[ "${lines[*]}" =~ exposed\ on\ port\(s\)\ \[container\-\>host\]\:\ [[:digit:]]+ ]] } @test "($PLUGIN_COMMAND_PREFIX:expose) success when providing custom ports" { - run dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242 + run dokku "$PLUGIN_COMMAND_PREFIX:expose" ls 4242 assert_contains "${lines[*]}" "exposed on port(s) [container->host]: 5984->4242" } diff --git a/tests/service_import.bats b/tests/service_import.bats index b1f99f0..940cd35 100755 --- a/tests/service_import.bats +++ b/tests/service_import.bats @@ -2,12 +2,12 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls echo '{"new_edits":false,"docs":[]}' | tee "/tmp/fake.json" } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls rm -f "/tmp/fake.json" } @@ -27,13 +27,13 @@ teardown() { if [[ -n "$GITHUB_WORKFLOW" ]]; then skip "No tty is available on Github Actions" fi - run dokku "$PLUGIN_COMMAND_PREFIX:import" l + run dokku "$PLUGIN_COMMAND_PREFIX:import" ls assert_contains "${lines[*]}" "No data provided on stdin" assert_failure } @test "($PLUGIN_COMMAND_PREFIX:import) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:import" l < "/tmp/fake.json" + run dokku "$PLUGIN_COMMAND_PREFIX:import" ls < "/tmp/fake.json" echo "output: $output" echo "status: $status" assert_success diff --git a/tests/service_info.bats b/tests/service_info.bats index 893e026..55a97ca 100755 --- a/tests/service_info.bats +++ b/tests/service_info.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:info) error when there are no arguments" { @@ -20,9 +20,9 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:info) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:info" l - local password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - assert_contains "${lines[*]}" "http://l:$password@dokku-couchdb-l:5984/l" + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls + local password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + assert_contains "${lines[*]}" "http://ls:$password@dokku-couchdb-ls:5984/ls" } @test "($PLUGIN_COMMAND_PREFIX:info) replaces underscores by dash in hostname" { @@ -34,45 +34,45 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:info) success with flag" { - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --dsn - local password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - assert_output "http://l:$password@dokku-couchdb-l:5984/l" + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --dsn + local password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + assert_output "http://ls:$password@dokku-couchdb-ls:5984/ls" - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --config-dir + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --config-dir assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --data-dir + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --data-dir assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --dsn + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --dsn assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --exposed-ports + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --exposed-ports assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --id + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --id assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --internal-ip + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --internal-ip assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --links + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --links assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --service-root + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --service-root assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --service-root + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --service-root assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --status + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --status assert_success - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --version + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --version assert_success } @test "($PLUGIN_COMMAND_PREFIX:info) error when invalid flag" { - run dokku "$PLUGIN_COMMAND_PREFIX:info" l --invalid-flag + run dokku "$PLUGIN_COMMAND_PREFIX:info" ls --invalid-flag assert_failure } diff --git a/tests/service_link.bats b/tests/service_link.bats index e2e47bb..c9085e1 100755 --- a/tests/service_link.bats +++ b/tests/service_link.bats @@ -2,14 +2,14 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l - dokku "$PLUGIN_COMMAND_PREFIX:create" m + dokku "$PLUGIN_COMMAND_PREFIX:create" ls + dokku "$PLUGIN_COMMAND_PREFIX:create" ms dokku apps:create my-app } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" m - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ms + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls dokku --force apps:destroy my-app } @@ -22,7 +22,7 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:link) error when the app argument is missing" { - run dokku "$PLUGIN_COMMAND_PREFIX:link" l + run dokku "$PLUGIN_COMMAND_PREFIX:link" ls echo "output: $output" echo "status: $status" assert_contains "${lines[*]}" "Please specify an app to run the command on" @@ -30,7 +30,7 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:link) error when the app does not exist" { - run dokku "$PLUGIN_COMMAND_PREFIX:link" l not_existing_app + run dokku "$PLUGIN_COMMAND_PREFIX:link" ls not_existing_app echo "output: $output" echo "status: $status" assert_contains "${lines[*]}" "App not_existing_app does not exist" @@ -46,73 +46,73 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:link) error when the service is already linked to app" { - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app - run dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app + run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app echo "output: $output" echo "status: $status" assert_contains "${lines[*]}" "Already linked as COUCHDB_URL" assert_failure - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } @test "($PLUGIN_COMMAND_PREFIX:link) exports COUCHDB_URL to app" { - run dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app + run dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app echo "output: $output" echo "status: $status" url=$(dokku config:get my-app COUCHDB_URL) - password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - assert_contains "$url" "http://l:$password@dokku-couchdb-l:5984/l" + password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + assert_contains "$url" "http://ls:$password@dokku-couchdb-ls:5984/ls" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } @test "($PLUGIN_COMMAND_PREFIX:link) generates an alternate config url when COUCHDB_URL already in use" { dokku config:set my-app COUCHDB_URL=http://user:pass@host:5984/db - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app run dokku config my-app assert_contains "${lines[*]}" "DOKKU_COUCHDB_AQUA_URL" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:link" m my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ms my-app run dokku config my-app assert_contains "${lines[*]}" "DOKKU_COUCHDB_BLACK_URL" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:unlink" m my-app - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ms my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } @test "($PLUGIN_COMMAND_PREFIX:link) links to app with docker-options" { - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app run dokku docker-options:report my-app - assert_contains "${lines[*]}" "--link dokku.couchdb.l:dokku-couchdb-l" + assert_contains "${lines[*]}" "--link dokku.couchdb.ls:dokku-couchdb-ls" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } @test "($PLUGIN_COMMAND_PREFIX:link) uses apps COUCHDB_DATABASE_SCHEME variable" { dokku config:set my-app COUCHDB_DATABASE_SCHEME=couchdb2 - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app url=$(dokku config:get my-app COUCHDB_URL) - password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - assert_contains "$url" "couchdb2://l:$password@dokku-couchdb-l:5984/l" + password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + assert_contains "$url" "couchdb2://ls:$password@dokku-couchdb-ls:5984/ls" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } @test "($PLUGIN_COMMAND_PREFIX:link) adds a querystring" { - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app --querystring "pool=5" + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --querystring "pool=5" url=$(dokku config:get my-app COUCHDB_URL) assert_contains "$url" "?pool=5" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } @test "($PLUGIN_COMMAND_PREFIX:link) uses a specified config url when alias is specified" { - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app --alias "ALIAS" + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app --alias "ALIAS" url=$(dokku config:get my-app ALIAS_URL) - password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - assert_contains "$url" "http://l:$password@dokku-couchdb-l:5984/l" + password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + assert_contains "$url" "http://ls:$password@dokku-couchdb-ls:5984/ls" assert_success - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app } diff --git a/tests/service_list.bats b/tests/service_list.bats index 8ace131..30cbff5 100755 --- a/tests/service_list.bats +++ b/tests/service_list.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" { @@ -15,8 +15,8 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:list) when there are no services" { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls run dokku "$PLUGIN_COMMAND_PREFIX:list" assert_output "${lines[*]}" "There are no $PLUGIN_SERVICE services" - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } diff --git a/tests/service_logs.bats b/tests/service_logs.bats index d12585c..272be43 100755 --- a/tests/service_logs.bats +++ b/tests/service_logs.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:logs) error when there are no arguments" { @@ -27,7 +27,7 @@ teardown() { @test "($PLUGIN_COMMAND_PREFIX:logs) success when not tailing" { skip "This may fail if there is no log output" - run dokku "$PLUGIN_COMMAND_PREFIX:logs" l + run dokku "$PLUGIN_COMMAND_PREFIX:logs" ls echo "output: $output" echo "status: $status" assert_success @@ -35,7 +35,7 @@ teardown() { @test "($PLUGIN_COMMAND_PREFIX:logs) success when tailing" { skip "This will hang as it waits for log output" - run dokku "$PLUGIN_COMMAND_PREFIX:logs" l -t + run dokku "$PLUGIN_COMMAND_PREFIX:logs" ls -t echo "output: $output" echo "status: $status" assert_success diff --git a/tests/service_promote.bats b/tests/service_promote.bats index 7bfda19..3dc6786 100755 --- a/tests/service_promote.bats +++ b/tests/service_promote.bats @@ -2,14 +2,14 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls dokku apps:create my-app - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app } teardown() { - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls dokku --force apps:destroy my-app } @@ -19,12 +19,12 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:promote) error when the app argument is missing" { - run dokku "$PLUGIN_COMMAND_PREFIX:promote" l + run dokku "$PLUGIN_COMMAND_PREFIX:promote" ls assert_contains "${lines[*]}" "Please specify an app to run the command on" } @test "($PLUGIN_COMMAND_PREFIX:promote) error when the app does not exist" { - run dokku "$PLUGIN_COMMAND_PREFIX:promote" l not_existing_app + run dokku "$PLUGIN_COMMAND_PREFIX:promote" ls not_existing_app assert_contains "${lines[*]}" "App not_existing_app does not exist" } @@ -34,30 +34,30 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:promote) error when the service is already promoted" { - run dokku "$PLUGIN_COMMAND_PREFIX:promote" l my-app + run dokku "$PLUGIN_COMMAND_PREFIX:promote" ls my-app assert_contains "${lines[*]}" "already promoted as COUCHDB_URL" } @test "($PLUGIN_COMMAND_PREFIX:promote) changes COUCHDB_URL" { - password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - dokku config:set my-app "COUCHDB_URL=http://u:p@host:5984/db" "DOKKU_COUCHDB_BLUE_URL=http://l:$password@dokku-couchdb-l:5984/l" - dokku "$PLUGIN_COMMAND_PREFIX:promote" l my-app + password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + dokku config:set my-app "COUCHDB_URL=http://u:p@host:5984/db" "DOKKU_COUCHDB_BLUE_URL=http://ls:$password@dokku-couchdb-ls:5984/ls" + dokku "$PLUGIN_COMMAND_PREFIX:promote" ls my-app url=$(dokku config:get my-app COUCHDB_URL) - assert_equal "$url" "http://l:$password@dokku-couchdb-l:5984/l" + assert_equal "$url" "http://ls:$password@dokku-couchdb-ls:5984/ls" } @test "($PLUGIN_COMMAND_PREFIX:promote) creates new config url when needed" { - password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - dokku config:set my-app "COUCHDB_URL=http://u:p@host:5984/db" "DOKKU_COUCHDB_BLUE_URL=http://l:$password@dokku-couchdb-l:5984/l" - dokku "$PLUGIN_COMMAND_PREFIX:promote" l my-app + password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + dokku config:set my-app "COUCHDB_URL=http://u:p@host:5984/db" "DOKKU_COUCHDB_BLUE_URL=http://ls:$password@dokku-couchdb-ls:5984/ls" + dokku "$PLUGIN_COMMAND_PREFIX:promote" ls my-app run dokku config my-app assert_contains "${lines[*]}" "DOKKU_COUCHDB_" } @test "($PLUGIN_COMMAND_PREFIX:promote) uses COUCHDB_DATABASE_SCHEME variable" { - password="$(sudo cat "$PLUGIN_DATA_ROOT/l/PASSWORD")" - dokku config:set my-app "COUCHDB_DATABASE_SCHEME=couchdb2" "COUCHDB_URL=http://u:p@host:5984/db" "DOKKU_COUCHDB_BLUE_URL=couchdb2://l:$password@dokku-couchdb-l:5984/l" - dokku "$PLUGIN_COMMAND_PREFIX:promote" l my-app + password="$(sudo cat "$PLUGIN_DATA_ROOT/ls/PASSWORD")" + dokku config:set my-app "COUCHDB_DATABASE_SCHEME=couchdb2" "COUCHDB_URL=http://u:p@host:5984/db" "DOKKU_COUCHDB_BLUE_URL=couchdb2://ls:$password@dokku-couchdb-ls:5984/ls" + dokku "$PLUGIN_COMMAND_PREFIX:promote" ls my-app url=$(dokku config:get my-app COUCHDB_URL) - assert_contains "$url" "couchdb2://l:$password@dokku-couchdb-l:5984/l" + assert_contains "$url" "couchdb2://ls:$password@dokku-couchdb-ls:5984/ls" } diff --git a/tests/service_restart.bats b/tests/service_restart.bats index a1b7ef9..7e56e96 100755 --- a/tests/service_restart.bats +++ b/tests/service_restart.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:restart) error when there are no arguments" { @@ -20,7 +20,7 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:restart) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:restart" l + run dokku "$PLUGIN_COMMAND_PREFIX:restart" ls assert_success } diff --git a/tests/service_start.bats b/tests/service_start.bats index af65496..f8dde8f 100755 --- a/tests/service_start.bats +++ b/tests/service_start.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:start) error when there are no arguments" { @@ -20,7 +20,7 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:start) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:start" l + run dokku "$PLUGIN_COMMAND_PREFIX:start" ls assert_success } diff --git a/tests/service_stop.bats b/tests/service_stop.bats index 02b573b..8810dac 100755 --- a/tests/service_stop.bats +++ b/tests/service_stop.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:stop) error when there are no arguments" { @@ -20,7 +20,7 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:stop) success" { - run dokku "$PLUGIN_COMMAND_PREFIX:stop" l + run dokku "$PLUGIN_COMMAND_PREFIX:stop" ls assert_success } diff --git a/tests/service_unexpose.bats b/tests/service_unexpose.bats index c236604..2fc9e44 100755 --- a/tests/service_unexpose.bats +++ b/tests/service_unexpose.bats @@ -2,11 +2,11 @@ load test_helper setup() { - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls } @test "($PLUGIN_COMMAND_PREFIX:unexpose) error when there are no arguments" { @@ -20,9 +20,9 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:unexpose) success" { - dokku "$PLUGIN_COMMAND_PREFIX:expose" l - run dokku "$PLUGIN_COMMAND_PREFIX:unexpose" l + dokku "$PLUGIN_COMMAND_PREFIX:expose" ls + run dokku "$PLUGIN_COMMAND_PREFIX:unexpose" ls [[ ! -f $PLUGIN_DATA_ROOT/PORT ]] - assert_contains "${lines[*]}" "Service l unexposed" + assert_contains "${lines[*]}" "Service ls unexposed" } diff --git a/tests/service_unlink.bats b/tests/service_unlink.bats index 6c14163..417c02e 100755 --- a/tests/service_unlink.bats +++ b/tests/service_unlink.bats @@ -3,11 +3,11 @@ load test_helper setup() { dokku apps:create my-app - dokku "$PLUGIN_COMMAND_PREFIX:create" l + dokku "$PLUGIN_COMMAND_PREFIX:create" ls } teardown() { - dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l + dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" ls dokku --force apps:destroy my-app } @@ -17,12 +17,12 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:unlink) error when the app argument is missing" { - run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l + run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls assert_contains "${lines[*]}" "Please specify an app to run the command on" } @test "($PLUGIN_COMMAND_PREFIX:unlink) error when the app does not exist" { - run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l not_existing_app + run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls not_existing_app assert_contains "${lines[*]}" "App not_existing_app does not exist" } @@ -32,13 +32,13 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:unlink) error when service not linked to app" { - run dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + run dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app assert_contains "${lines[*]}" "Not linked to app my-app" } @test "($PLUGIN_COMMAND_PREFIX:unlink) removes link from docker-options" { - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2 - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2 + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app check_value="Docker options build: Docker options deploy: --restart=on-failure:10 Docker options run:" options=$(dokku --quiet docker-options:report my-app | xargs) @@ -46,8 +46,8 @@ teardown() { } @test "($PLUGIN_COMMAND_PREFIX:unlink) unsets config url from app" { - dokku "$PLUGIN_COMMAND_PREFIX:link" l my-app >&2 - dokku "$PLUGIN_COMMAND_PREFIX:unlink" l my-app + dokku "$PLUGIN_COMMAND_PREFIX:link" ls my-app >&2 + dokku "$PLUGIN_COMMAND_PREFIX:unlink" ls my-app config=$(dokku config:get my-app COUCHDB_URL || true) assert_equal "$config" "" }