From e1daac32c5b7ca0d902c16135d361aa5303f5124 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 27 Jan 2013 15:00:27 +0100 Subject: o Creating an initial version of install-file. --- test/app-init.bats | 11 +++++++---- test/data/app-a/hooks/post-install | 5 +++++ test/data/app-a/scripts/postinstall | 21 --------------------- test/utils.bash | 1 + 4 files changed, 13 insertions(+), 25 deletions(-) create mode 100755 test/data/app-a/hooks/post-install delete mode 100644 test/data/app-a/scripts/postinstall (limited to 'test') diff --git a/test/app-init.bats b/test/app-init.bats index b62c42e..4e7c281 100755 --- a/test/app-init.bats +++ b/test/app-init.bats @@ -31,12 +31,15 @@ load utils fi app init -d my-app maven -r "file://$BATS_TMPDIR/repo" org.example:app-a:1.0-SNAPSHOT; echo_lines - eq '$status' 0 - eq '${lines[0]}' "Resolving version 1.0-SNAPSHOT..." + eq '$status' 0 + eq '${lines[0]}' "Resolving version 1.0-SNAPSHOT..." match '${lines[1]}' "Resolved version to 1.0-.*" match '${lines[2]}' "Downloading org.example:app-a:1.0-.*" - - eq '${#lines[*]}' 3 + eq '${lines[3]}' "Unpacking..." + match '${lines[4]}' "Creating current symlink for version 1.0-.*" + eq '${lines[5]}' "Running hook: post-install" + eq '${lines[6]}' "Post install" + eq '${#lines[*]}' 7 is_directory "my-app/.app" } diff --git a/test/data/app-a/hooks/post-install b/test/data/app-a/hooks/post-install new file mode 100755 index 0000000..99ad974 --- /dev/null +++ b/test/data/app-a/hooks/post-install @@ -0,0 +1,5 @@ +#!/bin/bash -e + +set -u + +echo "Post install" diff --git a/test/data/app-a/scripts/postinstall b/test/data/app-a/scripts/postinstall deleted file mode 100644 index dc176ff..0000000 --- a/test/data/app-a/scripts/postinstall +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -e - -echo "Hello World!" - -if [ -d etc/$APPSH_INSTANCE ] -then - find etc/$APPSH_INSTANCE -maxdepth 1 -type f | while read file - do - cp $file . - done -fi - -LOGS=$APPSH_APPS/$APPSH_NAME/$APPSH_INSTANCE/logs - -if [ ! -d $LOGS ] -then - echo "Creating logs directory" - mkdir $LOGS -fi - -ln -s $LOGS logs diff --git a/test/utils.bash b/test/utils.bash index fa2602e..3a9d425 100644 --- a/test/utils.bash +++ b/test/utils.bash @@ -7,6 +7,7 @@ exit_usage=1 exit_usage_wrong=0 setup() { + find test/data -name \*.zip | xargs rm -f PATH=/bin:/usr/bin PATH=$PATH:$APPSH_HOME APPSH_HOME=$(cd $BATS_TEST_DIRNAME/..; echo `pwd`) -- cgit v1.2.3