diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/X-app-help.bats | 38 | ||||
-rwxr-xr-x | test/X-app-install.bats | 50 | ||||
-rwxr-xr-x | test/X-app-list-versions.bats | 28 | ||||
-rwxr-xr-x | test/X-app-list.bats | 102 | ||||
-rwxr-xr-x | test/X-help.bats | 17 | ||||
-rwxr-xr-x | test/app-upgrade.bats | 8 |
6 files changed, 4 insertions, 239 deletions
diff --git a/test/X-app-help.bats b/test/X-app-help.bats deleted file mode 100755 index 4b94f23..0000000 --- a/test/X-app-help.bats +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bats -# vim: set filetype=sh: - -load utils - -@test "./app instance" { - app instance; echo_lines - [ $status -eq $exit_usage_wrong ] - [ $(expr "${lines[0]}" : "usage: ./app instance .*") -ne 0 ] - [ ${#lines[*]} == 6 ] -} - -@test "./app instance install" { - app instance install; echo_lines - [ $status -eq $exit_usage ] - [ $(expr "${lines[0]}" : "usage: install .*") -ne 0 ] - [ ${#lines[*]} == 6 ] -} - -@test "./app instance list" { - app instance list; echo_lines - [ $status -eq 0 ] - [ ${#lines[*]} == 0 ] -} - -@test "./app instance list-versions" { - app instance list-versions; echo_lines - [ $status -eq $exit_usage ] - [ $(expr "${lines[0]}" : "usage: list-versions .*") -ne 0 ] - [ ${#lines[*]} == 1 ] -} - -@test "./app instance set-current" { - app instance "set-current"; echo_lines - [ $status -eq $exit_usage ] - [ $(expr "${lines[0]}" : "usage: set-current .*") -ne 0 ] - [ ${#lines[*]} == 1 ] -} diff --git a/test/X-app-install.bats b/test/X-app-install.bats deleted file mode 100755 index 18a84bc..0000000 --- a/test/X-app-install.bats +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bats -# vim: set filetype=sh: - -load utils - -# TODO: Add test for installing duplicate version - -@test "./app install app-a" { - mkzip "app-a" - app install \ - -r file \ - -u $BATS_TEST_DIRNAME/data/app-a.zip - - echo_lines - [ $status -eq 0 ] - [ "$output" = "Creating instance 'prod' for 'app-a' -Unpacking... -Changing current symlink -Running postinstall... -Hello World! -Creating logs directory -Postinstall completed successfully" ] - [ ${#lines[*]} == 7 ] -} - -@test "./app instance install install-test-env" { - mkzip "install-test-env" - app instance install \ - -r file \ - -u $BATS_TEST_DIRNAME/data/install-test-env.zip \ - -v 1.0 - echo_lines - [ $status -eq 0 ] - [ "$output" = "Creating instance 'prod' for 'install-test-env' -Unpacking... -Changing current symlink -Running postinstall... -APPSH_APPS=$APPSH_APPS -APPSH_HOME=$APPSH_HOME -APPSH_INSTANCE=prod -APPSH_NAME=install-test-env -APPSH_VERSION=1.0 -PATH=/bin:/usr/bin -PWD=$APPSH_APPS_CANONICAL/install-test-env/prod/versions/1.0/root -SHLVL=1 -_=/usr/bin/env -Postinstall completed successfully" ] - [ ${#lines[*]} == 14 ] -# PWD=$APPSH_APPS_CANONICAL/install-test-env/prod/versions/1.0 -} diff --git a/test/X-app-list-versions.bats b/test/X-app-list-versions.bats deleted file mode 100755 index de543eb..0000000 --- a/test/X-app-list-versions.bats +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bats -# vim: set filetype=sh: - -load utils - -@test "./app instance list-versions" { - mkzip "app-a" - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.1 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-b -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-b -v 1.0 - [ $status -eq 0 ] - - app instance list-versions -n app-a -i env-a; echo_lines - [ $status -eq 0 ] - [ "$output" = "Available versions for app-a/env-a: -1.0 -1.1" ] - - expected="1.0 -1.1" - -set -x - app -n app-a instance -i env-a list-versions -P; [ "$output" = "$expected" ]; echo_lines; - app -n app-a instance list-versions -i env-a -P; [ "$output" = "$expected" ]; echo_lines; - app instance list-versions -n app-a -i env-a -P; [ "$output" = "$expected" ]; echo_lines; -} diff --git a/test/X-app-list.bats b/test/X-app-list.bats deleted file mode 100755 index 3092837..0000000 --- a/test/X-app-list.bats +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bats -# vim: set filetype=sh: - -load utils - -@test "./app instance list - all apps" { - mkzip "app-a" - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.1 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-b -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-b -v 1.0 - [ $status -eq 0 ] - - app instance list; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version -app-a env-a 1.1 -app-a env-b 1.0 -app-b env-a 1.0 -app-b env-b 1.0 " ] - - app instance list -P name -P instance -P version; echo_lines - [ $status -eq 0 ] - [ "$output" = "app-a:env-a:1.1 -app-a:env-b:1.0 -app-b:env-a:1.0 -app-b:env-b:1.0" ] -} - -@test "./app instance list - -n filter" { - mkzip "app-a" - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.1 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-b -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-b -v 1.0 - [ $status -eq 0 ] - - app instance list -n foo; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version " ] - - app instance list -n app-a; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version -app-a env-a 1.1 -app-a env-b 1.0 " ] - - app instance list -n app-a -P name -P instance -P version; echo_lines - [ $status -eq 0 ] - [ "$output" = "app-a:env-a:1.1 -app-a:env-b:1.0" ] -} - -@test "./app instance list - -i filter" { - mkzip "app-a" - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.1 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-b -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-b -v 1.0 - [ $status -eq 0 ] - - app instance list -i foo; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version " ] - - app instance list -i env-a; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version -app-a env-a 1.1 -app-b env-a 1.0 " ] - - app instance list -i env-a -P name -P instance -P version; echo_lines - [ $status -eq 0 ] - [ "$output" = "app-a:env-a:1.1 -app-b:env-a:1.0" ] -} - -@test "./app instance list - -n + -i filter" { - mkzip "app-a" - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-a -v 1.1 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-a -i env-b -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-a -v 1.0 && - app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n app-b -i env-b -v 1.0 - [ $status -eq 0 ] - - app instance list -n foo -i bar; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version " ] - - app instance list -n app-a -i env-a; echo_lines - [ $status -eq 0 ] - [ "$output" = "Name Instance Version -app-a env-a 1.1 " ] - - app instance list -n app-a -i env-a -P name -P instance -P version; echo_lines - [ $status -eq 0 ] - [ "$output" = "app-a:env-a:1.1" ] -} diff --git a/test/X-help.bats b/test/X-help.bats deleted file mode 100755 index eba4eeb..0000000 --- a/test/X-help.bats +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bats -# vim: set filetype=sh: - -load utils - -@test "./app" { - app; echo_lines - [ $status -eq $exit_usage_wrong ] - [ $(expr "${lines[0]}" : "usage: ./app .*") -ne 0 ] -} - -@test "./app foo" { - app foo; echo_lines - [ $status -eq $exit_usage_wrong ] - [ "${lines[0]}" = "Error: No such method group: foo" ] - [ $(expr "${lines[1]}" : "usage: ./app .*") -ne 0 ] -} diff --git a/test/app-upgrade.bats b/test/app-upgrade.bats index 4eef351..d27c6e7 100755 --- a/test/app-upgrade.bats +++ b/test/app-upgrade.bats @@ -13,17 +13,17 @@ load utils app conf get app.version eq '${lines[0]}' "1.0-SNAPSHOT" - app_version="${lines[0]}" + app_version="${lines[0]}" describe app_version = $app_version app conf get app.resolved_version match '${lines[0]}' "1.0-.*" - resolved_version="${lines[0]}" + resolved_version="${lines[0]}" describe resolved_version = $resolved_version app conf get app.installed_version match '${lines[0]}' "1.0-.*" - installed_version="${lines[0]}" + installed_version="${lines[0]}" describe installed_version = $installed_version eq '$installed_version' "$resolved_version" @@ -34,7 +34,7 @@ load utils app conf get app.resolved_version match '${lines[0]}' "1.0-.*" - new_resolved_version="${lines[0]}" + new_resolved_version="${lines[0]}" describe new_resolved_version = $new_resolved_version neq $new_resolved_version $resolved_version } |