From 265b1d8b25945898e11801242dbff7639e1a4a60 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 17 Oct 2012 20:17:55 +0200 Subject: o Testing passing of environment variables. --- test/data/app-a/root/bin/app-a | 4 +++- test/it-install-remove.bats | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/data/app-a/root/bin/app-a b/test/data/app-a/root/bin/app-a index 1386f31..c8c4fc5 100644 --- a/test/data/app-a/root/bin/app-a +++ b/test/data/app-a/root/bin/app-a @@ -1,9 +1,11 @@ #!/bin/bash -me=`basename $0` +me=$APPSH_INSTANCE_HOME/`basename $0` echo "Starting" >> $me.log +env | grep TEST_PROPERTY > $me.env + for i in {1..10} do echo "#$i: `date`" >> $me.log diff --git a/test/it-install-remove.bats b/test/it-install-remove.bats index 3358118..736bf56 100755 --- a/test/it-install-remove.bats +++ b/test/it-install-remove.bats @@ -14,20 +14,30 @@ load utils -r file \ -u $BATS_TEST_DIRNAME/data/app-a.zip \ -n $name -i $instance + [ $status -eq 0 ] -# set -x can_not_read ".app/var/pid/$name-$instance.pid" + app -n $name -i $instance conf set env.TEST_PROPERTY awesome + [ $status -eq 0 ] + describe "Starting $name/$instance" app -n $name -i $instance operate start + [ $status -eq 0 ] echo_lines can_read .app/var/pid/$name-$instance.pid describe "Stopping $name/$instance" app -n $name -i $instance operate stop + [ $status -eq 0 ] echo_lines can_not_read .app/var/pid/$name-$instance.pid + can_read "$name/$instance/$name.log" + can_read "$name/$instance/$name.env" + + [ "`cat $name/$instance/$name.env`" = "TEST_PROPERTY=awesome" ] + # app instance install \ # -r file \ # -u $HOME/.m2/repository/io/trygvis/appsh/examples/jenkins/1.0-SNAPSHOT/jenkins-1.0-SNAPSHOT.zip \ -- cgit v1.2.3